atom_addr

Module for Atom address encoding/decoding.

class AtomAddrDecoder

Bases: IAddrDecoder

Atom address decoder class. It allows the Atom address decoding.

static DecodeAddr(addr: str, **kwargs: Any) bytes

Decode an Algorand address to bytes.

Parameters:
  • addr (str) – Address string

  • hrp (str) – Expected HRP

Returns:

Public key hash bytes

Return type:

bytes

Raises:

ValueError – If the address encoding is not valid

class AtomAddrEncoder

Bases: IAddrEncoder

Atom address encoder class. It allows the Atom address encoding.

static EncodeKey(pub_key: Union[bytes, IPublicKey], **kwargs: Any) str

Encode a public key to Atom address.

Parameters:
  • pub_key (bytes or IPublicKey) – Public key bytes or object

  • hrp (str) – HRP

Returns:

Address string

Return type:

str

Raises:
  • ValueError – If the public key is not valid

  • TypeError – If the public key is not secp256k1

AtomAddr

alias of AtomAddrEncoder