mvrk_addr
Module for Mavryk address encoding/decoding.
- class MvrkAddrPrefixes(value)
Bases:
EnumEnumerative for Mavryk address prefixes.
- MV1 = b'\x05\xba\xc4'
- MV2 = b'\x05\xba\xc7'
- MV3 = b'\x05\xba\xc9'
- class MvrkAddrDecoder
Bases:
IAddrDecoderMavryk address decoder class. It allows the Mavryk address decoding.
- static DecodeAddr(addr: str, **kwargs: Any) bytes
Decode a Mavryk address to bytes.
- Parameters:
addr (str) – Address string
prefix (MvrkAddrPrefixes) – Expected address prefix
- Returns:
Public key hash bytes
- Return type:
bytes
- Raises:
ValueError – If the address encoding is not valid
TypeError – If the prefix is not a MvrkAddrPrefixes enum
- class MvrkAddrEncoder
Bases:
IAddrEncoderMavryk address encoder class. It allows the Mavryk address encoding.
- static EncodeKey(pub_key: Union[bytes, IPublicKey], **kwargs: Any) str
Encode a public key to Mavryk address.
- Parameters:
pub_key (bytes or IPublicKey) – Public key bytes or object
prefix (MvrkAddrPrefixes) – Address prefix
- Returns:
Address string
- Return type:
str
- Raises:
ValueError – If the public key is not valid
TypeError – If the public key is not ed25519 or the prefix is not a MvrkAddrPrefixes enum
- MvrkAddr
alias of
MvrkAddrEncoder