Get Wallet Balance
Get the balance of an address
Last updated
Was this helpful?
Get the balance of an address
Last updated
Was this helpful?
The getBalance
function returns the AR token balance in Winston (smallest possible unit of the AR token) for a given wallet address. The AR token is the native token in the Arweave ecosystem.
The function is called as follows:
The following params are available for this function:
address: string
: The wallet address passed in as type string
.
environment: 'local' | 'mainnet'
(optional) : The environment on which the wallet balance must be fetched.
options
: Additional options can be passed in as a JSON object.
winstonToAr: boolean
(optional) : Set this to true
in order to receive wallet ballance in Ar
instead of Winston
.
The function call returns the following data:
walletBalance: string
: Wallet balance in Winston
returned as type string
when the winston
parameter is set to true
.