xtz_addr
Module for Tezos address encoding/decoding.
- class XtzAddrPrefixes(value)
Bases:
Enum
Enumerative for Tezos address prefixes.
- TZ1 = b'\x06\xa1\x9f'
- TZ2 = b'\x06\xa1\xa1'
- TZ3 = b'\x06\xa1\xa4'
- class XtzAddrDecoder
Bases:
IAddrDecoder
Tezos address decoder class. It allows the Tezos address decoding.
- static DecodeAddr(addr: str, **kwargs: Any) bytes
Decode a Tezos address to bytes.
- Parameters:
addr (str) – Address string
prefix (XtzAddrPrefixes) – 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 XtzAddrPrefixes enum
- class XtzAddrEncoder
Bases:
IAddrEncoder
Tezos address encoder class. It allows the Tezos address encoding.
- static EncodeKey(pub_key: Union[bytes, IPublicKey], **kwargs: Any) str
Encode a public key to Tezos address.
- Parameters:
pub_key (bytes or IPublicKey) – Public key bytes or object
prefix (XtzAddrPrefixes) – 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 XtzAddrPrefixes enum
- XtzAddr
alias of
XtzAddrEncoder