pub trait TempoAddressExt {
const TIP20_PREFIX: [u8; 12];
const VIRTUAL_MAGIC: [u8; 10];
// Required methods
fn is_tip20(&self) -> bool;
fn is_virtual(&self) -> bool;
fn is_valid_master(&self) -> bool;
fn decode_virtual(&self) -> Option<(MasterId, UserTag)>;
fn new_virtual(master_id: MasterId, user_tag: UserTag) -> Self;
}Expand description
Extension trait with helper functions for Tempo addresses.
Required Associated Constants§
Sourceconst TIP20_PREFIX: [u8; 12]
const TIP20_PREFIX: [u8; 12]
12-byte prefix shared by all TIP-20 token addresses.
NOTE: prefix alone does not prove a token exists — use TIP20Factory::is_tip20() for that.
Sourceconst VIRTUAL_MAGIC: [u8; 10]
const VIRTUAL_MAGIC: [u8; 10]
10-byte magic value occupying bytes [4:14] of every TIP-1022 virtual address.
Required Methods§
Sourcefn is_tip20(&self) -> bool
fn is_tip20(&self) -> bool
Returns true if the address has the TIP-20 token prefix.
NOTE: This only checks the prefix, not whether the token was actually created.
Use TIP20Factory::is_tip20() for full validation.
Sourcefn is_virtual(&self) -> bool
fn is_virtual(&self) -> bool
Returns true if the address matches the TIP-1022 virtual-address format
(bytes [4:14] == Self::VIRTUAL_MAGIC).
Sourcefn is_valid_master(&self) -> bool
fn is_valid_master(&self) -> bool
Returns true if the address is eligible to be a virtual-address master per TIP-1022.
Sourcefn decode_virtual(&self) -> Option<(MasterId, UserTag)>
fn decode_virtual(&self) -> Option<(MasterId, UserTag)>
Decodes a virtual address into its (masterId, userTag) components.
Returns None if the address does not match the virtual-address format.
Sourcefn new_virtual(master_id: MasterId, user_tag: UserTag) -> Self
fn new_virtual(master_id: MasterId, user_tag: UserTag) -> Self
Builds a TIP-1022 virtual address from a masterId and userTag.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.