m8ty_client_custodyaccount
Custody Account information service cover all the aspects of custody accounts, transactions and positions.
Before you start
Check the documentation of the m8ty_client_custodyaccount library to get an idea about the available models and their properties.
import all needed libraries
import 'package:dio/dio.dart';
import 'package:m8ty_client_custodyaccount/m8ty_client_custodyaccount.dart';
import 'package:m8ty_client_common/m8ty_client_common.dart';
import 'package:built_collection/built_collection.dart';
How to perform different tasks
Here some examples how the dart client can be used
Get list of all custody accounts
final client = M8tyClientCustodyaccount().getCustodyAccountsApi();
final custodyAccountSearchRequestModel = CustodyAccountSearchRequestModel((b) => b
..customerId = "1234"
..portfolioId = "78");
final Response<CustodyAccountSearchResponseModel> response = await client.searchCustodyAccounts(
custodyAccountSearchRequestModel: custodyAccountSearchRequestModel,
page: 1,
size: 100,
);
Fetch custody account by id
final Response<CustodyAccountModel> response = await client.fetchCustodyAccountById(
custodyAccountId: "1234",
);
Get list of all positions
final client = M8tyClientCustodyaccount().getCustodyPositionsApi();
final Response<CustodyPositionsSearchResponseModel> response = await client.searchCustodyPositions(
custodyAccountId: "123",
custodyPositionsSearchRequestModel: custodyPositionsSearchRequestModel,
);
Get a position by id
final client = M8tyClientCustodyaccount().getCustodyPositionsApi();
final Response<CustodyPositionModel> response = await client.fetchCustodyPositionById(
custodyAccountId: "123",
custodyAccountTransactionId: "789",
);
Get list of all transactions
final custodyTransactionSearchRequestModel = CustodyTransactionSearchRequestModel((b) => b
..orderId = "123"
..positionId = "789",
);
final client = M8tyClientCustodyaccount().getCustodyTransactionsApi();
final Response<CustodyTransactionSearchResponseModel> response = await client.searchCustodyTransactions(
custodyAccountId: "123",
custodyTransactionSearchRequestModel: custodyTransactionSearchRequestModel,
page: 1,
size: 100,
)
Fetch custody transaction by id
final client = M8tyClientCustodyaccount().getCustodyTransactionsApi();
final Response<CustodyPositionModel> response = await client.fetchCustodyTransactionById(
custodyAccountId: "123",
custodyAccountTransactionId: "789",
);
Last modified: 03 September 2024