Skip to main content

Get Wallet Balance

Gets balance of current wallet

In your web app, call extension Get Wallet Balance method, while extension is on. You need to have "Balance" permissions granted for this wallet for current website to run this method successfully.

Use zano_web3 lib SDK to make a request.

Request

import { ZanoWallet } from 'zano_web3/web';

const zanoWallet = new ZanoWallet();

const response = await zanoWallet.getWalletBalance({ timeoutMs: 60_000 });

Response

{
"success": true,
"data": {
"balance": 10000000000,
"balances": [{
"asset_info": {
"asset_id": "f74bb56a5b4fa562e679ccaadd697463498a66de4f1760b2cd40f11c3a00a7a8",
"current_supply": 500000000000000000,
"decimal_point": 12,
"full_name": "Zano wrapped ABC",
"hidden_supply": false,
"meta_info": "{ \"some_arbitrary_field_name\": \"some arbitrary value\"}",
"owner": "f74bb56a5b4fa562e679ccaadd697463498a66de4f1760b2cd40f11c3a00a7a8",
"owner_eth_pub_key": "",
"ticker": "ZABC",
"total_max_supply": 1000000000000000000
},
"awaiting_in": 1000000000000,
"awaiting_out": 2000000000000,
"outs_amount_max": 2000000000000,
"outs_amount_min": 2000000000000,
"outs_count": 7,
"total": 100000000000000,
"unlocked": 50000000000000
}],
"unlocked_balance": 11000000000
}
}

where:

  • "balance": Native coins total amount
  • "balances": Balances groupped by it's asset_id
  • "asset_info": Asset info details
  • "asset_id": Asset ID
  • "current_supply": Currently emitted supply for given asset
  • "decimal_point": Decimal point
  • "full_name": Full name of the asset
  • "hidden_supply": This one reserved for future use, will be documented later
  • "meta_info": Any other information assetiaded with asset in a free form
  • "owner": Owner's key, used to validate any operations on the asset altering, could be changed in case of transfer ownership
  • "owner_eth_pub_key": [Optional] Owner's key in the case when ETH signature is used.
  • "ticker": Ticker associated with asset
  • "total_max_supply": Maximum possible supply for given asset, can't be changed after deployment
  • "awaiting_in": Unconfirmed amount for receive
  • "awaiting_out": Unconfirmed amount for send
  • "outs_amount_max": Output's maximum amount
  • "outs_amount_min": Output's minimum amount
  • "outs_count": Number of total unspent outputs (including locked)
  • "total": Total coins available(including locked)
  • "unlocked": Unlocked coins available(the ones that could be used right now)
  • "unlocked_balance": Native coins total unlocked amount

NOTE: You can opt out of the zano_web3 SDK and call Zano Companion directly via window.zano.request.

Request

window.zano.request('GET_WALLET_BALANCE', {}, timeout);

where:

  • timeout - Timeout of request in ms (set to null to disable)

Response

{
"data": {
"result": {
"balance": 10000000000,
"balances": [{
"asset_info": {
"asset_id": "f74bb56a5b4fa562e679ccaadd697463498a66de4f1760b2cd40f11c3a00a7a8",
"current_supply": 500000000000000000,
"decimal_point": 12,
"full_name": "Zano wrapped ABC",
"hidden_supply": false,
"meta_info": "{ \"some_arbitrary_field_name\": \"some arbitrary value\"}",
"owner": "f74bb56a5b4fa562e679ccaadd697463498a66de4f1760b2cd40f11c3a00a7a8",
"owner_eth_pub_key": "",
"ticker": "ZABC",
"total_max_supply": 1000000000000000000
},
"awaiting_in": 1000000000000,
"awaiting_out": 2000000000000,
"outs_amount_max": 2000000000000,
"outs_amount_min": 2000000000000,
"outs_count": 7,
"total": 100000000000000,
"unlocked": 50000000000000
}],
"unlocked_balance": 11000000000
}
}
}

Response fields are the same as in the SDK response above.