Balances
Description
Balances are used to represent the balance of an account
Methods
add
Adds a balance to an account
If accountId is not provided, the balance will be added to the current account
Props
Name | Type | Required | Description |
---|---|---|---|
accountId | string | No | The ID of the account to add balance to. Defaults to 'self' |
balance | string | Yes | The balance to be added to the account |
Returns
Promise<string>
- The new balance of the account in decimal representation
Example
const balance = await client.balances.add({ accountId: '123', balance: '100' });
get
Gets the balance of an account
Props
Name | Type | Required | Description |
---|---|---|---|
accountId | string | No | The ID of the account to get balance from. Defaults to 'self' |
Returns
Promise<string>
- The balance of the account in decimal representation
Example
const balance = await client.balances.get({ accountId: '123' });