mvrk_addr

Module for Mavryk address encoding/decoding.

class MvrkAddrPrefixes(value)

Bases: Enum

Enumerative for Mavryk address prefixes.

MV1 = b'\x05\xba\xc4'
MV2 = b'\x05\xba\xc7'
MV3 = b'\x05\xba\xc9'
class MvrkAddrDecoder

Bases: IAddrDecoder

Mavryk 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: IAddrEncoder

Mavryk 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:
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