- Struct
MultiChainAddress
- Constants
- Function
multichain_id_bitcoin
- Function
multichain_id_ether
- Function
multichain_id_nostr
- Function
multichain_id_rooch
- Function
get_length
- Function
new
- Function
from_bytes
- Function
from_eth
- Function
from_bitcoin
- Function
multichain_id
- Function
raw_address
- Function
is_rooch_address
- Function
is_eth_address
- Function
is_bitcoin_address
- Function
into_rooch_address
- Function
into_eth_address
- Function
into_bitcoin_address
- Function
mapping_to_rooch_address
use 0x2::bcs;
use 0x2::hash;
use 0x3::bitcoin_address;
use 0x3::ethereum_address;
#[data_struct]
struct MultiChainAddress has copy, drop, store
const LENGTH: u64 = 31;
const ErrorMultiChainIDMismatch: u64 = 1;
const MULTICHAIN_ID_BITCOIN: u64 = 0;
const MULTICHAIN_ID_ETHER: u64 = 60;
const MULTICHAIN_ID_NOSTR: u64 = 1237;
const MULTICHAIN_ID_ROOCH: u64 = 20230101;
public fun multichain_id_bitcoin(): u64
public fun multichain_id_ether(): u64
public fun multichain_id_nostr(): u64
public fun multichain_id_rooch(): u64
public fun get_length(): u64
public fun new(multichain_id: u64, raw_address: vector<u8>): multichain_address::MultiChainAddress
public fun from_bytes(bytes: vector<u8>): multichain_address::MultiChainAddress
public fun from_eth(eth_address: ethereum_address::ETHAddress): multichain_address::MultiChainAddress
public fun from_bitcoin(bitcoin_address: bitcoin_address::BitcoinAddress): multichain_address::MultiChainAddress
public fun multichain_id(self: &multichain_address::MultiChainAddress): u64
public fun raw_address(self: &multichain_address::MultiChainAddress): &vector<u8>
public fun is_rooch_address(maddress: &multichain_address::MultiChainAddress): bool
public fun is_eth_address(maddress: &multichain_address::MultiChainAddress): bool
public fun is_bitcoin_address(maddress: &multichain_address::MultiChainAddress): bool
public fun into_rooch_address(maddress: multichain_address::MultiChainAddress): address
public fun into_eth_address(maddress: multichain_address::MultiChainAddress): ethereum_address::ETHAddress
public fun into_bitcoin_address(maddress: multichain_address::MultiChainAddress): bitcoin_address::BitcoinAddress
Mapping from MultiChainAddress to rooch address If the MultiChainAddress is not rooch address, it will generate a new rooch address based on the MultiChainAddress
public fun mapping_to_rooch_address(maddress: multichain_address::MultiChainAddress): address