Balance Transactions
It is possible to return a list of balance transactions for any given account.
This is done by calling the list
method on the balance service in the SDK and passing the TradrAPI accountID
you wish
to get the list from, as follows:
import { BalanceTransaction } from '@tradrapi/trading-sdk';
const transactions: BalanceTransaction[] = await tradrApi.balances.list(1010001);
Response
The response from the list
method is an array of BalanceTransaction
objects, as follows:
import { BalanceOperation } from '@tradrapi/trading-sdk';
interface BalanceTransaction {
// The TradrAPI ID of the balance transaction
id: number;
// The datetime when the balance transaction was created, in ISO 8601 format
createdAt: string;
// The datetime when the balance transaction was updated, in ISO 8601 format
updatedAt: string;
// The TradrAPI account id the balance transaction belongs to
accountId: number;
// The TradrAPI server id the balance transaction was made on
serverId: number;
// The unique identifier of the transaction from the exchange (trading platform)
exchangeOperationId: string;
// The amount (in account currency) of the balance transaction
amount: number;
// The type of the balance transaction
operation: BalanceOperation;
// The IP address from where the balance transaction was made
ip?: string;
}