m8ty_client_portfolio
Package overview
Section titled “Package overview”m8ty_client_portfolio solves this by exposing portfolio data and performance APIs through a typed client, so apps can present a coherent investment overview and help users explore their holdings.
Portfolio management including liabilities
Before you start
Section titled “Before you start”Check the documentation of the m8ty_client_portfolio library to get an idea about the available models and their properties.
import all needed libraries
Section titled “import all needed libraries” import 'package:dio/dio.dart'; import 'package:m8ty_client_portfolio/m8ty_client_portfolio.dart'; import 'package:m8ty_client_common/m8ty_client_common.dart'; import 'package:built_collection/built_collection.dart';How to perform different tasks
Section titled “How to perform different tasks”Here some examples how the dart client can be used
Get assets total overview
Section titled “Get assets total overview” final client = M8tyClientPortfolio(); client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getAssetsApi();
try { final response = await api.getAssetsTotalOverview( customerId: '1234', ); print('Assets: ${response.data}'); } on DioException catch (e) { throw Exception( 'Request failed (status: ${e.response?.statusCode}): ${e.response?.data}', ); }List all portfolios
Section titled “List all portfolios” final client = M8tyClientPortfolio(); client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getPortfoliosApi(); final response = await api.listPortfolios();Fetch portfolio by id
Section titled “Fetch portfolio by id” final client = M8tyClientPortfolio(); client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getPortfoliosApi(); final response = await api.fetchPortfolioById( portfolioId: '1234', );Search portfolio assets
Section titled “Search portfolio assets” final client = M8tyClientPortfolio(); client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getAssetsApi(); final response = await api.searchPortfolioAssets( customerId: '1234', );Get portfolio performances
Section titled “Get portfolio performances” final client = M8tyClientPortfolio(); client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getPerformanceApi(); final response = await api.getPortfolioPerformances( portfolioId: '1234', );Fetch maturities by portfolio id
Section titled “Fetch maturities by portfolio id” final client = M8tyClientPortfolio(); client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getMaturitiesApi(); final response = await api.fetchMaturitiesByPortfolioId( portfolioId: '1234', );© m8ty GmbH 2023 · m8ty.eu
