Converts between the hex and base58check address formats

convert_address(address)

Arguments

address

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

Value

Account address (character). If address is a 41-prefixed hex string, it will be converted into a base58check-encoded string, and vice versa.

Details

Sometimes, especially in the raw smart contract data returned by some of of the tronr functions, TRON addresses can be represented as 0x-prefixed hex strings (as opposed to the proper 41-prefixed hex strings). This function can automatically convert such 0x-prefixed addresses into human-readable base58check-encoded strings - see "Examples".

Examples

hex_address <- "41357a7401a0f0c2d4a44a1881a0c622f15d986291" hex_0x_address <- "0x357a7401a0f0c2d4a44a1881a0c622f15d986291" base58_address <- "TEqyWRKCzREYC2bK2fc3j7pp8XjAa6tJK1" convert_address(hex_address)
#> [1] "TEqyWRKCzREYC2bK2fc3j7pp8XjAa6tJK1"
convert_address(hex_0x_address)
#> [1] "TEqyWRKCzREYC2bK2fc3j7pp8XjAa6tJK1"
convert_address(base58_address)
#> [1] "41357a7401a0f0c2d4a44a1881a0c622f15d986291"