getBalance
getBalance
is a method on the ARIO
class that retrieves the balance of the specified wallet address.
getBalance
does not require authentication.
Parameters
Parameter | Type | Description | Optional |
---|---|---|---|
address | String | The wallet's public address used to check its balance | false |
Examples
getBalance
const {ARIO, mARIOToken} = require('@ar.io/sdk');
async function main(){
const ario = ARIO.init();
const balance = await io.getBalance({
address: 'QGWqtJdLLgm2ehFWiiPzMaoFLD50CnGuzZIPEdoDRGQ',
})
.then((balance: number) => new mARIOToken(balance).toARIO()); // convert it to ARIO for readability
console.log(balance)
}
main()
Output
100000