💰Balances And History
Balance
Reading balances using an instance of SDK is simply calling getBalances() a method of it.
const balances = await zkfi.getBalances();The result balances In this case is a mapping of asset ID to the amount of that asset. E.g.
// balances (assetId -> amount)
{
65537: 5000n,
65538: 4n,
65539: 10203n,
.
.
.
}Transaction History
Reading the transaction history of a user is also as simple as calling getHistory() the method:
const txHistory = await zkfi.getHistory();The txHistory is a list of historical items with multiple fields:
hash: The transaction hash identifying the transaction.action: A string denoting the type of transaction, likedeposit,withdraw,receive, etc.assets: The assets involved in the transaction.timestamp: The timestamp of the transaction.
Last updated