getBalance: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== Input == {| class="wikitable" ! Argument !! Mandatory !! Description !! Format |- | address || no || Wallet address to query || string |} == Output == {| class="wikitable"...") |
(Add usage) |
||
Line 14: | Line 14: | ||
| lockedAmount || Balance still locked in unconfirmed transactions || uint64 | | lockedAmount || Balance still locked in unconfirmed transactions || uint64 | ||
|} | |} | ||
== Usage == | |||
Replace "your_password" and "TA4yACzMYuFYq7V6xVAWYHeS39jQ8w4mKRowpY6NskGuS1rZpjcWuCpdeCypwUCJrK9mGqVW9o1pY2EG3HW7BZkR2YRcc4YNa" in examples with real values from wallet daemon. Password is specified on command-line of wallet daemon, it is not returned by any API method for security reasons. You can get list of valid wallet addresses using [[getAddresses]] method. | |||
=== cURL === | |||
* <nowiki>curl -X POST http://127.0.0.1:33777/json_rpc -H 'Content-Type: application/json-rpc' -d '{"jsonrpc": "2.0", "method": "getBalance", "password": "your_password", "params": {}, "id": "1"}'</nowiki> | |||
* <nowiki>curl -X POST http://127.0.0.1:33777/json_rpc -H 'Content-Type: application/json-rpc' -d '{"jsonrpc": "2.0", "method": "getBalance", "password": "your_password", "params": {"address" : "TA4yACzMYuFYq7V6xVAWYHeS39jQ8w4mKRowpY6NskGuS1rZpjcWuCpdeCypwUCJrK9mGqVW9o1pY2EG3HW7BZkR2YRcc4YNa"}, "id": "1"}'</nowiki> |
Latest revision as of 13:40, 24 March 2020
Input
Argument | Mandatory | Description | Format |
---|---|---|---|
address | no | Wallet address to query | string |
Output
Argument | Description | Format |
---|---|---|
availableBalance | Available balance that can be spent | uint64 |
lockedAmount | Balance still locked in unconfirmed transactions | uint64 |
Usage
Replace "your_password" and "TA4yACzMYuFYq7V6xVAWYHeS39jQ8w4mKRowpY6NskGuS1rZpjcWuCpdeCypwUCJrK9mGqVW9o1pY2EG3HW7BZkR2YRcc4YNa" in examples with real values from wallet daemon. Password is specified on command-line of wallet daemon, it is not returned by any API method for security reasons. You can get list of valid wallet addresses using getAddresses method.
cURL
- curl -X POST http://127.0.0.1:33777/json_rpc -H 'Content-Type: application/json-rpc' -d '{"jsonrpc": "2.0", "method": "getBalance", "password": "your_password", "params": {}, "id": "1"}'
- curl -X POST http://127.0.0.1:33777/json_rpc -H 'Content-Type: application/json-rpc' -d '{"jsonrpc": "2.0", "method": "getBalance", "password": "your_password", "params": {"address" : "TA4yACzMYuFYq7V6xVAWYHeS39jQ8w4mKRowpY6NskGuS1rZpjcWuCpdeCypwUCJrK9mGqVW9o1pY2EG3HW7BZkR2YRcc4YNa"}, "id": "1"}'