algo_addr

Module for Algorand address encoding/decoding.

class AlgoAddrConst

Bases: object

Class container for Algorand address constants.

CHECKSUM_BYTE_LEN: int = 4
class AlgoAddrDecoder

Bases: IAddrDecoder

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

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

Decode an Algorand address to bytes.

Parameters:
  • addr (str) – Address string

  • **kwargs – Not used

Returns:

Public key bytes

Return type:

bytes

Raises:

ValueError – If the address encoding is not valid

class AlgoAddrEncoder

Bases: IAddrEncoder

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

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

Encode a public key to Algorand address.

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

  • **kwargs – Not used

Returns:

Address string

Return type:

str

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

  • TypeError – If the public key is not ed25519

AlgoAddr

alias of AlgoAddrEncoder