util_raddr

Convert a 20 byte Account ID to an r-address

Behaviour

  • Read a 20 byte Account ID from the account id byte array
  • Return the equivalent r-address for that Account ID

Required attributes

  • Name
    acct_id
    Type
    number[]
    Description

    Byte Array of the Account ID.

util_raddr

const acct_id = [
    0x2d, 0xd8, 0xaa, 0xdb, 0x4e, 0x15,               
    0xeb, 0xea,  0xe, 0xfd, 0x78, 0xd1, 0xb0,
    0x35, 0x91,  0x4, 0x7b, 0xfa, 0x1e,  0xe
];
const raddr = util_raddr(acct_id) as number | number[];

Return Code number

The number of bytes written (the length of the output r-address).

Error CodeDescription
OUT_OF_BOUNDSError code indicating pointers/lengths specified outside of hook memory.
INVALID_ARGUMENTError code indicating read_len was not 20.
TOO_SMALLError code indicating write_len was not large enough to store the produced r-address.

Was this page helpful?