Skip to main content

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

NameTypeRequiredDescription
accountIdstringNoThe ID of the account to add balance to. Defaults to 'self'
balancestringYesThe 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

NameTypeRequiredDescription
accountIdstringNoThe 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' });