-
Notifications
You must be signed in to change notification settings - Fork 179
bx fetch balance
Get the balance in satoshi of a payment address.
$ bx fetch-balance --help
Usage: bx fetch-balance [-h] [--config VALUE] [--format VALUE]
[PAYMENT_ADDRESS]
Info: Get the balance in satoshi of a payment address. Requires a
Libbitcoin server connection.
Options (named):
-c [--config] The path to the configuration settings file.
-f [--format] The output format. Options are 'info', 'json', and
'xml', defaults to 'info'.
-h [--help] Get a description and instructions for this command.
Arguments (positional):
PAYMENT_ADDRESS The payment address. If not specified the address is
read from STDIN.
This command supports configuration settings.
Version 3 (and later) does not provide unconfirmed balance. A confirmation of at least one block on the strong chain is required for a value to be included.
A value of 18446744073709551615 indicates that a spend is uncorrelated to a receipt. This will occur if the spend is indexed but the receipt is not, which can occur if the server starts indexing between the two transactions. Correlation failure can also occur due to an extremely low probability hash collision (1 in 2^49). The caller should always check for this condition.
first address on the blockchain
$ bx fetch-balance 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
balance
{
address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
received 6538241483
spent 0
}
The above properties represent the number of satoshis associated with the address in the following manner.
- Confirmed - the number with any confirmation, excluding those spent.
- Received - the number confirmed or unconfirmed, including those spent.
- Unspent - the number received that remain unspent.
These numeric values will change over time as more people send money to Satoshi, and/or the money at this address is spent. This first transaction is unique in that it contains 50 bitcoin that can never be confirmed.
--format json
$ bx fetch-balance -f json 134HfD2fdeBTohfx8YANxEpsYXsv5UoWyz
{
"balance": {
"address": "134HfD2fdeBTohfx8YANxEpsYXsv5UoWyz",
"received": "100000",
"spent": "100000",
}
}
--format xml
$ bx fetch-balance -f xml 13Ft7SkreJY9D823NPm4t6D1cBqLYTJtAe
<?xml version="1.0" encoding="utf-8"?>
<balance><address>13Ft7SkreJY9D823NPm4t6D1cBqLYTJtAe</address><received>90000</received><spent>0</spent></balance>
Users | Developers | License | Copyright © 2011-2024 libbitcoin developers
- Home
- Build BX
- General Information
- Developer Information
- Configuration Settings
- Tutorials
- Meta Commands
- Wallet Commands
- Key Encryption Commands
- Stealth Commands
- Messaging Commands
- Transaction Commands
- Online Commands
- Encoding Commands
- Hash Commands
- Math Commands