nimiq/address
Types
Values
pub fn deserialize(
buf: BitArray,
) -> Result(#(Address, BitArray), String)
Deserializes an Address from a BitArray.
pub fn deserialize_all(buf: BitArray) -> Result(Address, String)
Deserializes an Address from a BitArray, ensuring that all bytes are consumed.
pub fn from_base64(base64: String) -> Result(Address, String)
Creates an Address from a base64 string. The string must represent exactly 20 bytes.
pub fn from_base64_url(
base64_url: String,
) -> Result(Address, String)
Creates an Address from a base64-url string. The string must represent exactly 20 bytes.
pub fn from_hash(hash: BitArray) -> Result(Address, String)
Creates an Address from a hash (BitArray). The hash must be at least 20 bytes long.
pub fn from_hex(hex: String) -> Result(Address, String)
Creates an Address from a hex string. The string must represent exactly 20 bytes.
pub fn from_string(str: String) -> Result(Address, String)
Creates an Address from a string in any supported format.
pub fn from_user_friendly_address(
str: String,
) -> Result(Address, String)
Creates an Address from a user friendly address string.
pub fn from_user_friendly_address_ccode(
str: String,
ccode: String,
) -> Result(Address, String)
Creates an Address from a user friendly address string with a custom country code.
pub fn serialize(
builder: bytes_tree.BytesTree,
address: Address,
) -> bytes_tree.BytesTree
Serializes an Address into a BytesTree.
pub fn serialize_to_bits(address: Address) -> BitArray
Serializes an Address to a BitArray.
pub fn staking_contract() -> Address
Creates the staking contract address (all bytes zero except the last byte set to 1).
pub fn to_base64(address: Address) -> String
Converts an Address to its base64 representation.
pub fn to_base64_url(address: Address) -> String
Converts an Address to its base64-url representation.
pub fn to_user_friendly_address(address: Address) -> String
Converts an Address to its user friendly address representation.
pub fn to_user_friendly_address_ccode(
address: Address,
ccode: String,
) -> String
Converts an Address to its user friendly address representation with a custom country code.