getBalance

Return balance of a specific asset for the given account.

If the asset is omited from a request to MainNet, all asset and token balances will be returned.

Input Arguments

Parameter
Description

params: iBalanceRequest | BalanceRequest[]

A list of Balance Request Objects, specifying which addresses, and which assets to query

network?: string

Network to submit this request to. If omitted, will default to network the wallet is currently set to.

BalanceRequest

Parameter
Description

address: string

Address to check balance(s)

assets?: string | string[]

Asset ID or script hash to check balance

fetchUTXO?: boolean

Fetches to UTXO data for NEO and/or GAS if attribute is 'true'

Success Response

Parameter
Description

[address: string]: iBalanceResponse[]

This key is the actual address of the query eg. "AWSEU4BXpjGVdw9ajnFBXh8Rg8cgw9f3Zo"

BalanceResponse

Parameter
Description

assetID: string

ID of the given asset

symbol: string

Symbol of the given asset

amount: string

Double Value of the balance represented as a String

unspent: iUTXO[]?

If fetch utxo's was turned on then the utxo array will be returned for the native assets NEO and GAS

UTXO

Parameter
Description

asset: string

Script hash of the native asset

createdAtBlock: int

Block number where this utxo was created

index: int

Output index of the UTXO relative to the txid in which it was created

txid: string

The transaction id of this UTXO

value: string

The double value of this UTXO represented as a String

Example

Request

Response

最后更新于

这有帮助吗?