Returns the current Tronix (TRX) balance of an account

get_account_trx_balance(address, only_confirmed = FALSE, max_attempts = 3L)

Arguments

address

(character): address of the account of interest, either in base58check or hex format.

only_confirmed

(boolean or NULL): if NULL (default) or FALSE, results are returned for both confirmed and unconfirmed transactions. If TRUE, only results for confirmed transactions are returned.

max_attempts

(integer, positive): specifies the maximum number of additional attempts to call a URL if the first attempt fails (i.e. its call status is different from 200). Additional attempts are implemented with an exponential backoff. Defaults to 3.

Value

A tibble with the following columns:

  • request_time (POSIXct, UTC timezone): date and time when the API request was made;

  • address (character): address of the account, in base58 format;

  • trx_balance (double): amount of TRX.

Details

All balances are presented with a precision of 6. This means that a balance returned by this function needs to be divided by 1 million to obtain the actual amount of TRX.

Examples

r <- get_account_trx_balance("TQjaZ9FD473QBTdUzMLmSyoGB6Yz1CGpux") print(r)
#> # A tibble: 1 x 3 #> request_time address trx_balance #> <dttm> <chr> <dbl> #> 1 2021-07-12 22:03:50 TQjaZ9FD473QBTdUzMLmSyoGB6Yz1CGpux 3927692.