iridium_walletd getBalance method
The getBalance method returns the balance for a specified address or a cumulative balance of all Wallet's addresses.
note : If address is not specified, returns a cumulative balance of all wallet's addresses.
Input:
Argument | Mandatory | Description | Format | Example |
---|---|---|---|---|
address | No | Valid and existing address in this particular wallet | string | ir48V76oJqAhYpGmsJgn79Yk6vvwYhU2cDc7azm3UW8C4EyzhhEDUUQjXtrbwzwpJ6Kp2ebwHErWD9VxBVnmXBk41oDB3Lt4j |
Output 1):
Argument | Description | Format | Example |
---|---|---|---|
availableBalance | Available balance of the specified address | uint64 | 123123 |
lockedAmount | Locked amount of the specified address | uint64 | 123123 |
Get a a single address balance
Input example:
{ "params":{ "address":"ir48V76oJqAhYpGmsJgn79Yk6vvwYhU2cDc7azm3UW8C4EyzhhEDUUQjXtrbwzwpJ6Kp2ebwHErWD9VxBVnmXBk41oDB3Lt4j" }, "jsonrpc":"2.0", "id":"test", "method":"getBalance" }
$ curl -s -X POST -d '{"params":{},"jsonrpc":"2.0","id":"test","method":"getBalance"}' localhost:14101/json_rpc | jq
Output example:
{ "id": "test", "jsonrpc": "2.0", "result": { "availableBalance": 1000200030004, "lockedAmount": 200030004 } }
Get cumulative balance
Input example:
{ "params":{}, "jsonrpc":"2.0", "id":"test", "method":"getBalance" }
$ curl -s -X POST -d '{"params":{},"jsonrpc":"2.0","id":"test","method":"getBalance"}' localhost:14101/json_rpc | jq
Output example:
{ 'jsonrpc':'2.0', 'id':'test', 'result':{ 'lockedAmount':93145146837855, 'availableBalance':101585356893 } }
1)
Amounts are returned as big integer, this means you have to divide by 8 decimal (/100000000