Crate xrpl_address_macro

Crate xrpl_address_macro 

Source
Expand description

The r_address! macro for compile-time address conversion converts XRPL classic addresses (r-addresses) to 20-byte arrays at compile time.

Important: The macro only accepts string literals, not runtime values. It runs during compilation and outputs only the final byte array - no base58 decoding code is included in the WASM binary.

§Example

use xrpl_wasm_stdlib::r_address;

// ✅ Works - compile-time literal
const ACCOUNT: [u8; 20] = r_address!("rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh");

// ❌ Does NOT work - runtime value
// fn convert(addr: &str) -> [u8; 20] {
//     r_address!(addr)  // ERROR: expected string literal
// }

Macros§

r_address