Assets, Addresses, & Balance Fetching with the SDK
Multiple Assets and Balances
Get all assets that exist in a certain wallet
To get the list of assets in a users wallet, you can call wallet.getWalletAssets()
and pass the wallet Id.
Function Parameters
walletId
string
Wallet Id
Function Response
Return will be an array of the following UserAsset
type.
id
string
The unique identifier of the user asset
userId
string
User ID
merchantId
string
Merchant ID
userAssetAddress
string
(Multi-Sig only) Used to set the multisig user address.
walletId
string
Wallet ID
configId
string
The ID of the asset configuration
assetName
string
Asset name
assetSymbol
string
Asset Symbol
balance
string
Balance
balanceUpdatedAt
Date
Last time the balance cache was updated.
defaultAddress
string
The default address for the asset
source
UserAssetSource
Merchant
| User
addresses
Array
An array of address objects associated with the asset
addresses[].address
string
The address
addresses[].publicKey
string
The public key associated with the address
addresses[].type
string
The type of the address
ownershipType
enum
SingleOwner
| MultiSig
config
AssetConfig
The configuration information of the asset.
createdAt
Date
When the asset was added to the wallet.
updatedAt
Date
When the asset was last updated.
Fetch assets' balance by providing an array of asset addresses and symbols
To fetch the balance for multiple assets using the SDK, you can use wallet.getBulkBalances()
Function Parameters
address
string
default asset address
symbol
string
Asset symbol
chainName
enum
The chain name.
tokenStandard (deprecated)
enum
(Legacy only) Token standard Erc20
| Mrc20
| ...
Single Asset and Balance
Get one asset from a user's wallet
Currently, it is not supported to get 1 single asset using the SDK.
Fetch asset balance by specifying the asset address and the asset symbol
To use the SDK to fetch a specific asset's balance, you can use wallet.getTokenBalance()
Function Parameters
address
string
Asset valid address
symbol
string
Asset symbol
chainName
enum
ETHEREUM
| BITCOIN
| AVALANCHE
| POLYGON
| ALGORAND
tokenStandard (deprecated)
enum
(Legacy only) i.e. TokenStandard.Erc20
Last updated