| Crates.io | xrpl-address-macro |
| lib.rs | xrpl-address-macro |
| version | 0.1.0 |
| created_at | 2025-08-16 05:59:35.318234+00 |
| updated_at | 2025-08-16 05:59:35.318234+00 |
| description | Compile-time macro for converting XRPL r-addresses to 20-byte arrays |
| homepage | https://github.com/ripple/craft |
| repository | https://github.com/ripple/craft |
| max_upload_size | |
| id | 1798043 |
| size | 9,475 |
A compile-time macro for converting XRPL classic addresses (r-addresses) to 20-byte arrays.
use xrpl_address_macro::r_address;
// Convert r-address to [u8; 20] at compile time
const ACCOUNT: [u8; 20] = r_address!("rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh");
// Multiple accounts can be defined
const NOTARY: [u8; 20] = r_address!("rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH");
const ADMIN: [u8; 20] = r_address!("rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn");
use xrpl_address_macro::r_address;
const NOTARY_ACCOUNT: [u8; 20] = r_address!("rPPL...");
// build.rs decodes NOTARY_ACCOUNT_R env var at build time
include!(concat!(env!("OUT_DIR"), "/notary_generated.rs"));
Both approaches result in the same efficient WASM output - the choice depends on whether you need: