inj_addr

Module for Injective address encoding/decoding. Reference: https://docs.injective.network/learn/basic-concepts/accounts

class InjAddrDecoder

Bases: IAddrDecoder

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

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

Decode an Algorand address to bytes.

Parameters:

addr (str) – Address string

Returns:

Public key hash bytes

Return type:

bytes

Raises:

ValueError – If the address encoding is not valid

class InjAddrEncoder

Bases: IAddrEncoder

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

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

Encode a public key to Injective address.

Parameters:

pub_key (bytes or IPublicKey) – Public key bytes or object

Returns:

Address string

Return type:

str

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

  • TypeError – If the public key is not secp256k1

InjAddr

alias of InjAddrEncoder