Addresses¶
- class index.ADDRESSES()¶
Central registry of all supported blockchain address classes. Provides utility methods to fetch names, classes, or check validity.
exported from
addresses.indexName
Class
Address
AlgorandAddress
AptosAddress
AvalancheAddress
CardanoAddress
CosmosAddress
EOSAddress
ErgoAddress
EthereumAddress
FilecoinAddress
HarmonyAddress
IconAddress
InjectiveAddress
MoneroAddress
MultiversXAddress
NanoAddress
NearAddress
NeoAddress
OKTChainAddress
P2PKHAddress
P2SHAddress
P2TRAddress
P2WPKHInP2SHAddress
P2WPKHAddress
P2WSHInP2SHAddress
P2WSHAddress
RippleAddress
SolanaAddress
StellarAddress
SuiAddress
TezosAddress
TronAddress
XinFinAddress
ZilliqaAddress
- static index.ADDRESSES.getAddressClass(name)¶
Fetches the address class corresponding to the given name.
- Arguments:
name (string) – Name of the address.
- Returns:
typeof Address – The corresponding address class.
- static index.ADDRESSES.getClasses()¶
Returns an array of all address classes.
- Returns:
typeof Address[] – List of address classes.
- static index.ADDRESSES.getNames()¶
Returns an array of all supported address names.
- Returns:
string[] – List of address names.
- static index.ADDRESSES.isAddress(name)¶
Checks whether a given name corresponds to a supported address.
- Arguments:
name (string) – Name to check.
- Returns:
boolean – True if the name is supported, false otherwise.
- class address.Address()¶
Abstract base class for all cryptocurrency address implementations. Provides a standardized interface for encoding and decoding addresses.
abstract
exported from
addresses.address- static address.Address.decode(address, options)¶
Decodes a blockchain address into its underlying public key(s) or data. Must be overridden by subclasses.
- Arguments:
address (string) – Address string to decode
options (AddressOptionsInterface) – Optional decoding parameters
- Returns:
string | [string, string] – Decoded public key(s) or data
- static address.Address.encode(publicKey, options)¶
Encodes a public key (or other required data) into a blockchain address. Must be overridden by subclasses.
- Arguments:
publicKey (string | Object | Uint8Array<ArrayBufferLike> | PublicKey) – The public key or object to encode
options (AddressOptionsInterface) – Optional encoding parameters
- Returns:
string – Encoded address
- static address.Address.getName()¶
Returns the name of the address implementation. Must be overridden by subclasses.
- Returns:
string – Name of the address type
- class algorand.AlgorandAddress()¶
Class representing Algorand addresses. Extends the abstract Address class to provide Algorand-specific encoding and decoding.
exported from
addresses.algorand- Extends:
Address
- algorand.AlgorandAddress.checksumLength¶
type: number
- static algorand.AlgorandAddress.computeChecksum(publicKey)¶
Computes the checksum for a given public key. Algorand uses the last 4 bytes of sha512_256 hash of the public key as checksum.
- Arguments:
publicKey (Uint8Array) – The public key bytes to compute checksum for
- Returns:
Uint8Array – 4-byte checksum
- static algorand.AlgorandAddress.decode(address)¶
Decodes an Algorand address back into its raw public key.
- Arguments:
address (string) – The Algorand address string to decode
- Returns:
string – Raw public key as a string
- static algorand.AlgorandAddress.encode(publicKey)¶
Encodes a public key into an Algorand address.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode (can be Uint8Array, string, or PublicKey object)
- Returns:
string – Encoded Algorand address
- static algorand.AlgorandAddress.getName()¶
Returns the name of the address implementation.
- Returns:
string – ‘Algorand’
- class aptos.AptosAddress()¶
Class representing Aptos blockchain addresses. Extends the abstract Address class to provide Aptos-specific encoding and decoding.
exported from
addresses.aptos- Extends:
Address
- aptos.AptosAddress.addressPrefix¶
type: string
- aptos.AptosAddress.suffix¶
type: Uint8Array
- static aptos.AptosAddress.decode(address)¶
Decodes an Aptos address back into its raw public key hash.
- Arguments:
address (string) – The Aptos address string to decode
- Returns:
string – Raw public key hash as a string
- static aptos.AptosAddress.encode(publicKey)¶
Encodes a public key into an Aptos address.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode (can be Uint8Array, string, or PublicKey object)
- Returns:
string – Encoded Aptos address
- static aptos.AptosAddress.getName()¶
Returns the name of the address implementation.
- Returns:
string – ‘Aptos’
- class avalanche.AvalancheAddress()¶
Class representing Avalanche blockchain addresses. Extends the abstract Address class and provides Avalanche-specific encoding and decoding.
exported from
addresses.avalanche- Extends:
Address
- avalanche.AvalancheAddress.addressType¶
type: string
- avalanche.AvalancheAddress.addressTypes¶
type: Record<string, string>
- avalanche.AvalancheAddress.hrp¶
type: string
- static avalanche.AvalancheAddress.decode(address, options=...)¶
Decodes an Avalanche address back into its raw public key.
- Arguments:
address (string) – The Avalanche address string to decode
options (AddressOptionsInterface) – Optional parameters including addressType and hrp
- Returns:
string – Decoded raw public key string
- static avalanche.AvalancheAddress.encode(publicKey, options=...)¶
Encodes a public key into an Avalanche address.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode (Uint8Array, string, or PublicKey object)
options (AddressOptionsInterface) – Optional parameters including hrp and addressType
- Returns:
string – Encoded Avalanche address
- static avalanche.AvalancheAddress.getName()¶
Returns the name of the address implementation.
- Returns:
string – ‘Avalanche’
- class cardano.CardanoAddress()¶
Class representing Cardano blockchain addresses. Supports Byron (Legacy & Icarus) and Shelley (Payment & Staking/Reward) address formats. Extends the abstract Address class and provides Cardano-specific encoding and decoding logic.
exported from
addresses.cardano- Extends:
Address
- cardano.CardanoAddress.addressTypes¶
type: readonly any
- cardano.CardanoAddress.chacha20Poly1305AssociatedData¶
type: readonly Uint8Array<ArrayBuffer>
- cardano.CardanoAddress.chacha20Poly1305Nonce¶
type: readonly Uint8Array<ArrayBufferLike>
- cardano.CardanoAddress.networkTypes¶
type: readonly any
- cardano.CardanoAddress.payloadTag¶
type: readonly 24
- cardano.CardanoAddress.paymentAddressHrp¶
type: readonly any
- cardano.CardanoAddress.prefixTypes¶
type: readonly any
- cardano.CardanoAddress.rewardAddressHrp¶
type: readonly any
- static cardano.CardanoAddress.decode(address, options=...)¶
Decodes a Cardano address into its raw public key. Supports Byron and Shelley address types.
- Arguments:
address (string) – Cardano address to decode
options (AddressOptionsInterface) – Address options including decodeType, network, or addressType
- Returns:
string – Decoded raw public key
- static cardano.CardanoAddress.decodeByron(address, addressType=Cardano.ADDRESS_TYPES.PUBLIC_KEY)¶
Decodes a Byron address (generic for Icarus & Legacy).
- Arguments:
address (string) – Address string to decode
addressType (string) – Address type
- Returns:
string – Decoded raw public key
- static cardano.CardanoAddress.decodeByronIcarus(address, addressType=Cardano.ADDRESS_TYPES.PUBLIC_KEY)¶
Decode Byron Icarus address.
- Arguments:
address (string) – Address string
addressType (string) – Address type
- Returns:
string – Decoded raw public key
- static cardano.CardanoAddress.decodeByronLegacy(address, addressType=Cardano.ADDRESS_TYPES.PUBLIC_KEY)¶
Decode Byron Legacy address.
- Arguments:
address (string) – Address string
addressType (string) – Address type
- Returns:
string – Decoded raw public key
- static cardano.CardanoAddress.decodeShelley(address, network)¶
Decode Shelley payment address.
- Arguments:
address (string) – Address string
network (string) – Network (‘mainnet’ or ‘testnet’)
- Returns:
string – Decoded raw public key
- static cardano.CardanoAddress.decodeShelleyStaking(address, network)¶
Decode Shelley staking/reward address.
- Arguments:
address (string) – Address string
network (string) – Network (‘mainnet’ or ‘testnet’)
- Returns:
string – Decoded raw public key
- static cardano.CardanoAddress.encode(publicKey, options=...)¶
Encodes a public key into a Cardano address. Supports different types: Byron Legacy, Byron Icarus, Shelley Payment, Shelley Staking/Reward.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – Public key to encode
options (AddressOptionsInterface) – Address options including encodeType, path, chainCode, network, and staking public key
- Returns:
string – Encoded Cardano address
- static cardano.CardanoAddress.encodeByron(publicKey, chainCode, addressAttributes, addressType=Cardano.ADDRESS_TYPES.PUBLIC_KEY)¶
Encodes a Byron address (generic helper for Icarus & Legacy).
- Arguments:
publicKey (PublicKey) – Public key object
chainCode (Uint8Array) – Chain code for HD derivation
addressAttributes (any) – Extra address attributes (Map)
addressType (string) – Address type (‘public-key’ or ‘redemption’)
- Returns:
string – Encoded Byron address (Base58)
- static cardano.CardanoAddress.encodeByronIcarus(publicKey, chainCode, addressType=Cardano.ADDRESS_TYPES.PUBLIC_KEY)¶
Encodes a Byron Icarus address.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – Public key
chainCode (string | Uint8Array<ArrayBufferLike>) – Chain code
addressType (string) – Address type
- Returns:
string – Encoded Byron Icarus address
- static cardano.CardanoAddress.encodeByronLegacy(publicKey, path, pathKey, chainCode, addressType=Cardano.ADDRESS_TYPES.PUBLIC_KEY)¶
Encodes a Byron Legacy address using HD path encryption.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – Public key
path (string) – HD derivation path
pathKey (string | Uint8Array<ArrayBufferLike>) – HD path key
chainCode (string | Uint8Array<ArrayBufferLike>) – Chain code
addressType (string) – Address type
- Returns:
string – Encoded Byron Legacy address
- static cardano.CardanoAddress.encodeShelley(publicKey, stakingPublicKey, network)¶
Encode Shelley payment address.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – Payment public key
stakingPublicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – Staking public key
network (string) – Network (‘mainnet’ or ‘testnet’)
- Returns:
string – Encoded Shelley payment address
- static cardano.CardanoAddress.encodeShelleyStaking(publicKey, network)¶
Encode Shelley staking/reward address.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – Staking public key
network (string) – Network (‘mainnet’ or ‘testnet’)
- Returns:
string – Encoded staking/reward address
- static cardano.CardanoAddress.getName()¶
Returns the name of the address implementation.
- Returns:
string – ‘Cardano’
- class cosmos.CosmosAddress()¶
Class representing Cosmos blockchain addresses. Provides encoding and decoding of public keys using Bech32 format. Extends the abstract Address class.
exported from
addresses.cosmos- Extends:
Address
- cosmos.CosmosAddress.hrp¶
type: readonly string
- static cosmos.CosmosAddress.decode(address, options=...)¶
Decodes a Cosmos address into its raw public key bytes. Validates that the HRP prefix matches the expected network prefix.
- Arguments:
address (string) – Cosmos address to decode
options (AddressOptionsInterface) – Address options including HRP prefix
- Returns:
string – Decoded raw public key bytes as a string
- static cosmos.CosmosAddress.encode(publicKey, options=...)¶
Encodes a public key into a Cosmos address. The public key is first hashed using SHA256, then RIPEMD160, and finally encoded in Bech32 format.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – Public key to encode (Uint8Array, string, or PublicKey object)
options (AddressOptionsInterface) – Address options including HRP prefix
- Returns:
string – Encoded Cosmos address
- static cosmos.CosmosAddress.getName()¶
Returns the name of the address implementation.
- Returns:
string – ‘Cosmos’
- class eos.EOSAddress()¶
Class representing EOS blockchain addresses. Provides encoding and decoding of public keys into EOS addresses using Base58 with a checksum. Extends the abstract Address class.
exported from
addresses.eos- Extends:
Address
- eos.EOSAddress.addressPrefix¶
type: string
- eos.EOSAddress.checksumLength¶
type: number
- static eos.EOSAddress.computeChecksum(pubKeyBytes)¶
Computes the EOS address checksum for a given public key. Uses RIPEMD160 hash and takes the first
checksumLengthbytes.- Arguments:
pubKeyBytes (Uint8Array) – Raw public key bytes
- Returns:
Uint8Array – Computed checksum
- static eos.EOSAddress.decode(address, options=...)¶
Decodes an EOS address into its raw public key bytes. Validates the prefix, length, checksum, and public key bytes.
- Arguments:
address (string) – EOS address to decode
options (AddressOptionsInterface) – Address options including the prefix
- Returns:
string – Decoded raw public key bytes as a string
- static eos.EOSAddress.encode(publicKey, options=...)¶
Encodes a public key into an EOS address. Appends a checksum to the public key bytes and encodes the result in Base58 with a prefix.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – Public key to encode (Uint8Array, string, or PublicKey)
options (AddressOptionsInterface) – Address options including the prefix
- Returns:
string – Encoded EOS address
- static eos.EOSAddress.getName()¶
Returns the name of the address implementation.
- Returns:
string – ‘EOS’
- class ergo.ErgoAddress()¶
Class representing Ergo blockchain addresses. Provides encoding and decoding of public keys into Ergo addresses using Base58 with a checksum. Supports different address types (p2pkh, p2sh) and networks (mainnet, testnet). Extends the abstract Address class.
exported from
addresses.ergo- Extends:
Address
- ergo.ErgoAddress.addressType¶
type: string
- ergo.ErgoAddress.addressTypes¶
type: Record<string, number>
- ergo.ErgoAddress.checksumLength¶
type: number
- ergo.ErgoAddress.networkType¶
type: string
- ergo.ErgoAddress.networkTypes¶
type: Record<string, number>
- static ergo.ErgoAddress.computeChecksum(data)¶
Computes the checksum for Ergo address encoding. Uses Blake2b256 hash and takes the first
checksumLengthbytes.- Arguments:
data (Uint8Array) – Bytes to compute checksum from
- Returns:
Uint8Array – Computed checksum
- static ergo.ErgoAddress.decode(address, options=...)¶
Decodes an Ergo address back to the raw public key bytes. Validates prefix, length, checksum, and public key bytes.
- Arguments:
address (string) – Ergo address to decode
options (AddressOptionsInterface) – Address options including addressType and networkType
- Returns:
string – Decoded raw public key bytes as a string
- static ergo.ErgoAddress.encode(publicKey, options=...)¶
Encodes a public key into an Ergo address. Combines network type, address type, and compressed public key bytes with a checksum, then encodes the result in Base58.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – Public key to encode (Uint8Array, string, or PublicKey)
options (AddressOptionsInterface) – Address options including addressType and networkType
- Returns:
string – Encoded Ergo address
- static ergo.ErgoAddress.getName()¶
Returns the name of the address implementation.
- Returns:
string – ‘Ergo’
- class ethereum.EthereumAddress()¶
Class representing Ethereum blockchain addresses. Provides encoding and decoding of public keys into Ethereum addresses. Supports optional EIP-55 checksum encoding. Extends the abstract Address class.
exported from
addresses.ethereum- Extends:
Address
- ethereum.EthereumAddress.addressPrefix¶
type: string
- static ethereum.EthereumAddress.checksumEncode(address)¶
Applies EIP-55 checksum encoding to an Ethereum address. Converts specific characters to uppercase based on the Keccak-256 hash of the address.
- Arguments:
address (string) – Address string without prefix
- Returns:
string – Checksummed address string
- static ethereum.EthereumAddress.decode(address, options=...)¶
Decodes an Ethereum address back to its raw lowercase hexadecimal form (without prefix). Validates prefix, length, and optionally EIP-55 checksum encoding.
- Arguments:
address (string) – Ethereum address string to decode
options (AddressOptionsInterface) – Address options including skipChecksumEncode
- Returns:
string – Decoded address string in lowercase (without prefix)
- static ethereum.EthereumAddress.encode(publicKey, options=...)¶
Encodes a public key into an Ethereum address. The address is generated from the last 20 bytes of the Keccak-256 hash of the uncompressed public key. Can optionally skip EIP-55 checksum encoding.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – Public key to encode (Uint8Array, string, or PublicKey)
options (AddressOptionsInterface) – Address options including skipChecksumEncode
- Returns:
string – Encoded Ethereum address with prefix
- static ethereum.EthereumAddress.getName()¶
Returns the name of the address implementation.
- Returns:
string – ‘Ethereum’
- class filecoin.FilecoinAddress()¶
Class representing Filecoin blockchain addresses. Provides encoding and decoding of public keys into Filecoin addresses. Supports SECP256K1 and BLS address types and computes checksums using Blake2b. Extends the abstract Address class.
exported from
addresses.filecoin- Extends:
Address
- filecoin.FilecoinAddress.addressPrefix¶
type: string
- filecoin.FilecoinAddress.addressType¶
type: string
- filecoin.FilecoinAddress.addressTypes¶
type: Record<string, number>
- filecoin.FilecoinAddress.alphabet¶
type: string
- static filecoin.FilecoinAddress.computeChecksum(pubKeyHash, addressType)¶
Computes the checksum for a Filecoin address. Uses Blake2b-32 on the concatenation of address type and public key hash.
- Arguments:
pubKeyHash (Uint8Array) – Public key hash bytes (20-byte Blake2b-160 hash)
addressType (number) – Numeric address type
- Returns:
Uint8Array – Checksum bytes (4 bytes)
- static filecoin.FilecoinAddress.decode(address, options=...)¶
Decodes a Filecoin address back to its public key hash. Validates prefix, address type, length, and checksum.
- Arguments:
address (string) – Filecoin address string to decode
options (AddressOptionsInterface) – Address options including addressPrefix and addressType
- Returns:
string – Decoded public key hash (20-byte hex string)
- static filecoin.FilecoinAddress.encode(publicKey, options=...)¶
Encodes a public key into a Filecoin address. Combines the public key hash, address type, and checksum into a base32 string with prefix.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – Public key to encode (Uint8Array, string, or PublicKey)
options (AddressOptionsInterface) – Address options including addressPrefix and addressType
- Returns:
string – Encoded Filecoin address
- static filecoin.FilecoinAddress.getName()¶
Returns the name of the address implementation.
- Returns:
string – ‘Filecoin’
- class harmony.HarmonyAddress()¶
Class representing Harmony blockchain addresses. Inherits encoding/decoding logic from OKTChainAddress. Supports the Harmony mainnet HRP (human-readable part) for Bech32 addresses.
exported from
addresses.harmony- Extends:
OKTChainAddress
- Implements:
Address
- harmony.HarmonyAddress.hrp¶
type: string
- static harmony.HarmonyAddress.getName()¶
Returns the name of the address implementation.
- Returns:
string – ‘Harmony’
- class icon.IconAddress()¶
Class representing Icon blockchain addresses. Handles encoding and decoding of addresses using SHA3-256 hashing of the public key.
exported from
addresses.icon- Extends:
Address
- icon.IconAddress.addressPrefix¶
type: string
- icon.IconAddress.keyHashLength¶
type: number
- static icon.IconAddress.decode(address)¶
Decodes an Icon address back into the key hash.
- Arguments:
address (string) – The Icon address to decode.
- Returns:
string – The decoded key hash.
- static icon.IconAddress.encode(publicKey)¶
Encodes a public key into an Icon address.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode.
- Returns:
string – The encoded Icon address.
- static icon.IconAddress.getName()¶
Returns the name of the address implementation.
- Returns:
string – ‘Icon’
- class injective.InjectiveAddress()¶
Class representing an Injective blockchain address. Inherits from the base Address class. Uses Bech32 encoding with Ethereum-style public key hashing.
exported from
addresses.injective- Extends:
Address
- injective.InjectiveAddress.hrp¶
type: readonly string
- static injective.InjectiveAddress.decode(address, options=...)¶
Decodes a Bech32 Injective address back into its raw public key bytes.
- Arguments:
address (string) – Bech32-encoded Injective address to decode.
options (AddressOptionsInterface) – Optional parameters.
- Returns:
string – Raw public key bytes as a string.
- static injective.InjectiveAddress.encode(publicKey, options=...)¶
Encodes a public key into a Bech32 Injective address. Uses Ethereum-style encoding of the public key, then converts to Bech32.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – Public key to encode.
options (AddressOptionsInterface) – Optional parameters.
- Returns:
string – Bech32-encoded Injective address.
- static injective.InjectiveAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type.
- class monero.MoneroAddress()¶
Class representing a Monero blockchain address. Supports standard, integrated, and sub-address types across mainnet, stagenet, and testnet.
exported from
addresses.monero- Extends:
Address
- monero.MoneroAddress.addressType¶
type: string
- monero.MoneroAddress.checksumLength¶
type: number
- monero.MoneroAddress.network¶
type: string
- monero.MoneroAddress.networks¶
type: Record<string, { addressTypes: Record<string, number>; }>
- monero.MoneroAddress.paymentIDLength¶
type: number
- static monero.MoneroAddress.computeChecksum(data)¶
Computes a Monero address checksum using Keccak256.
- Arguments:
data (Uint8Array) – Data to hash for checksum.
- Returns:
Uint8Array – Checksum bytes.
- static monero.MoneroAddress.decode(address, options=...)¶
Decodes a Monero address into its spend and view public keys. Verifies checksum, network, address type, and optional payment ID.
- Arguments:
address (string) – Monero address to decode.
options (AddressOptionsInterface) – Optional parameters.
- Returns:
[string, string] – Tuple containing spend and view public key bytes as strings.
- static monero.MoneroAddress.encode(publicKeys, options=...)¶
Encodes Monero spend and view public keys into a Monero address. Supports optional payment ID for integrated addresses.
- Arguments:
publicKeys ({ spendPublicKey: string | Uint8Array<ArrayBufferLike> | PublicKey; viewPublicKey: string | Uint8Array<ArrayBufferLike> | PublicKey; }) – Spend and view public keys.
options (AddressOptionsInterface) – Optional parameters.
- Returns:
string – Monero address.
- static monero.MoneroAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type.
- class multiversx.MultiversXAddress()¶
Class representing a MultiversX (formerly Elrond) blockchain address. Supports Bech32 encoding with configurable human-readable part (HRP) for different networks.
exported from
addresses.multiversx- Extends:
Address
- multiversx.MultiversXAddress.hrp¶
type: string
- static multiversx.MultiversXAddress.decode(address, options=...)¶
Decodes a MultiversX address back into the public key bytes. Verifies Bech32 decoding with the specified HRP.
- Arguments:
address (string) – The MultiversX address to decode.
options (AddressOptionsInterface) – Optional parameters.
- Returns:
string – The public key bytes as a string.
- static multiversx.MultiversXAddress.encode(publicKey, options=...)¶
Encodes a public key into a MultiversX address. Uses Bech32 encoding, omitting the first byte of the compressed public key.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode.
options (AddressOptionsInterface) – Optional parameters.
- Returns:
string – The encoded MultiversX address.
- static multiversx.MultiversXAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type.
- class nano.NanoAddress()¶
Class representing a Nano (formerly RaiBlocks) blockchain address. Supports encoding and decoding using a modified Base32 scheme and Blake2b checksums.
exported from
addresses.nano- Extends:
Address
- nano.NanoAddress.addressPrefix¶
type: string
- nano.NanoAddress.alphabet¶
type: string
- nano.NanoAddress.payloadPaddingDecoded¶
type: Uint8Array
- nano.NanoAddress.payloadPaddingEncoded¶
type: string
- static nano.NanoAddress.computeChecksum(publicKey)¶
Computes the Nano checksum for a given public key. Uses Blake2b (40-bit) and reverses the byte order.
- Arguments:
publicKey (Uint8Array) – The public key bytes.
- Returns:
Uint8Array – The checksum bytes.
- static nano.NanoAddress.decode(address)¶
Decodes a Nano address back into the public key bytes. Verifies the address prefix, Base32 decoding, and checksum.
- Arguments:
address (string) – The Nano address to decode.
- Returns:
string – The public key bytes as a string.
- static nano.NanoAddress.encode(publicKey)¶
Encodes a public key into a Nano address.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode.
- Returns:
string – The encoded Nano address.
- static nano.NanoAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type.
- class near.NearAddress()¶
Class representing a NEAR Protocol blockchain address. Handles encoding and decoding of public keys in NEAR format.
exported from
addresses.near- Extends:
Address
- static near.NearAddress.decode(address)¶
Decodes a NEAR address back into a public key. Verifies the length and validates the public key format.
- Arguments:
address (string) – The NEAR address to decode.
- Returns:
string – The original public key as a string.
- static near.NearAddress.encode(publicKey)¶
Encodes a given public key into a NEAR address string. Strips the first two bytes of the compressed key for NEAR-specific formatting.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode.
- Returns:
string – Encoded NEAR address string.
- static near.NearAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type (“Near”).
- class neo.NeoAddress()¶
Class representing a NEO blockchain address. Handles encoding and decoding of public keys according to NEO’s address format.
exported from
addresses.neo- Extends:
Address
- neo.NeoAddress.addressPrefix¶
type: Uint8Array<ArrayBufferLike>
- neo.NeoAddress.addressSuffix¶
type: Uint8Array<ArrayBufferLike>
- neo.NeoAddress.addressVersion¶
type: Uint8Array<ArrayBufferLike>
- neo.NeoAddress.alphabet¶
type: any
- static neo.NeoAddress.decode(address, options=...)¶
Decodes a NEO address back into a public key. Verifies version and length, and extracts the original public key bytes.
- Arguments:
address (string) – The NEO address to decode.
options (AddressOptionsInterface) – Optional decoding options including address version and alphabet.
- Returns:
string – The public key as a string extracted from the address.
- static neo.NeoAddress.encode(publicKey, options=...)¶
Encodes a given public key into a NEO address string. Applies NEO-specific prefix, suffix, and hashing (hash160) before Base58 encoding.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode.
options (AddressOptionsInterface) – Optional encoding options including address version and alphabet.
- Returns:
string – Encoded NEO address string.
- static neo.NeoAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type (“Neo”).
- class okt-chain.OKTChainAddress()¶
Class representing an OKT-Chain blockchain address. Uses Ethereum-style addresses as the base and encodes them in Bech32 format for OKT-Chain.
exported from
addresses.okt-chain- Extends:
Address
- okt-chain.OKTChainAddress.hrp¶
type: string
- static okt-chain.OKTChainAddress.decode(address, options=...)¶
Decodes a Bech32-encoded OKTChain address back into an Ethereum-style address string.
- Arguments:
address (string) – The Bech32 OKTChain address to decode.
options (AddressOptionsInterface) – Optional decoding options including HRP.
- Returns:
string – Decoded Ethereum-style address (hex string with “0x” prefix).
- static okt-chain.OKTChainAddress.encode(publicKey, options=...)¶
Encodes a given public key into an OKTChain Bech32 address. The process involves Ethereum-style address derivation, stripping the “0x” prefix, and then Bech32 encoding using the specified HRP.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode.
options (AddressOptionsInterface) – Optional encoding options including HRP.
- Returns:
string – Bech32-encoded OKTChain address.
- static okt-chain.OKTChainAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type (“OKT-Chain”).
- class p2pkh.P2PKHAddress()¶
Class representing a Bitcoin P2PKH (Pay-to-PubKey-Hash) address. Provides methods for encoding public keys to P2PKH addresses and decoding P2PKH addresses back to the public key hash.
exported from
addresses.p2pkh- Extends:
Address
- p2pkh.P2PKHAddress.alphabet¶
type: string
- p2pkh.P2PKHAddress.publicKeyAddressPrefix¶
type: number
- static p2pkh.P2PKHAddress.decode(address, options=...)¶
Decodes a Bitcoin P2PKH address into its public key hash.
- Arguments:
address (string) – The P2PKH address to decode.
options (AddressOptionsInterface) – Optional decoding options: - publicKeyAddressPrefix: expected prefix byte - alphabet: Base58 alphabet
- Returns:
string – The public key hash extracted from the address.
- static p2pkh.P2PKHAddress.encode(publicKey, options=...)¶
Encodes a public key into a Bitcoin P2PKH address.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode.
options (AddressOptionsInterface) – Optional encoding options: - publicKeyAddressPrefix: prefix byte for the address - publicKeyType: whether to use compressed or uncompressed public key - alphabet: Base58 alphabet
- Returns:
string – Base58-encoded P2PKH address.
- static p2pkh.P2PKHAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type (“P2PKH”).
- class p2sh.P2SHAddress()¶
Class representing a Bitcoin P2SH (Pay-to-Script-Hash) address. Provides methods for encoding public keys to P2SH addresses and decoding P2SH addresses back to the script hash.
exported from
addresses.p2sh- Extends:
Address
- p2sh.P2SHAddress.alphabet¶
type: string
- p2sh.P2SHAddress.scriptAddressPrefix¶
type: number
- static p2sh.P2SHAddress.decode(address, options=...)¶
Decodes a Bitcoin P2SH address into its script hash.
- Arguments:
address (string) – The P2SH address to decode.
options (AddressOptionsInterface) – Optional decoding options: - scriptAddressPrefix: expected prefix byte - alphabet: Base58 alphabet
- Returns:
string – The script hash extracted from the address.
- static p2sh.P2SHAddress.encode(publicKey, options=...)¶
Encodes a public key into a Bitcoin P2SH address. The method generates a standard P2PKH redeem script, computes its hash, and encodes it with the script address prefix.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode.
options (AddressOptionsInterface) – Optional encoding options: - scriptAddressPrefix: prefix byte for the address - publicKeyType: whether to use compressed or uncompressed public key - alphabet: Base58 alphabet
- Returns:
string – Base58-encoded P2SH address.
- static p2sh.P2SHAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type (“P2SH”).
- class p2tr.P2TRAddress()¶
Class representing a Bitcoin P2TR (Pay-to-Taproot) address. Implements Taproot address generation, tweaking, encoding, and decoding according to BIP-341.
exported from
addresses.p2tr- Extends:
Address
- p2tr.P2TRAddress.fieldSize¶
type: bigint
- p2tr.P2TRAddress.hrp¶
type: string
- p2tr.P2TRAddress.tapTweakTagHash¶
type: Uint8Array
- p2tr.P2TRAddress.witnessVersion¶
type: number
- static p2tr.P2TRAddress.decode(address, options=...)¶
Decodes a P2TR Bech32 address into its tweaked public key bytes.
- Arguments:
address (string) – Bech32 encoded P2TR address.
options (AddressOptionsInterface) – Optional HRP.
- Returns:
string – Hex string of the tweaked public key.
- static p2tr.P2TRAddress.encode(publicKey, options=...)¶
Encodes a public key into a P2TR Bech32 address.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – Public key to encode.
options (AddressOptionsInterface) – Optional HRP and witness version.
- Returns:
string – Bech32 encoded P2TR address.
- static p2tr.P2TRAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type (“P2TR”).
- static p2tr.P2TRAddress.hashTapTweak(pubKey)¶
Computes the Taproot tweak for a given public key.
- Arguments:
pubKey (PublicKey) – Public key to tweak.
- Returns:
Uint8Array – Tweaked public key bytes.
- static p2tr.P2TRAddress.liftX(pubKey)¶
Lifts an X-coordinate to a secp256k1 point on the curve.
- Arguments:
pubKey (PublicKey) – Public key whose X-coordinate to lift.
- Returns:
SLIP10Secp256k1Point – Lifted point.
- static p2tr.P2TRAddress.taggedHash(tag, data)¶
Computes a tagged SHA256 hash.
- Arguments:
tag (string | Uint8Array<ArrayBufferLike>) – Tag as string or byte array.
data (Uint8Array) – Data to hash.
- Returns:
Uint8Array – Resulting tagged hash.
- static p2tr.P2TRAddress.tweakPublicKey(pubKey)¶
Tweaks a secp256k1 public key for Taproot addresses.
- Arguments:
pubKey (PublicKey) – Public key to tweak.
- Returns:
Uint8Array – Tweaked X-coordinate of the public key.
- class p2wpkh-in-p2sh.P2WPKHInP2SHAddress()¶
Class representing a P2WPKH-in-P2SH (Pay-to-Witness-Public-Key-Hash nested in P2SH) Bitcoin address. Inherits from P2SHAddress and overrides the encoding method to implement P2WPKH redemption.
exported from
addresses.p2wpkh-in-p2sh- Extends:
P2SHAddress
- Implements:
Address
- static p2wpkh-in-p2sh.P2WPKHInP2SHAddress.encode(publicKey, options=...)¶
Encodes a public key into a P2WPKH-in-P2SH address. This involves hashing the public key (RIPEMD160(SHA256(pubKey))), building the redeem script for P2WPKH, and then hashing it to get the P2SH address.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – Public key to encode.
options (AddressOptionsInterface) – Optional parameters including script prefix, public key type, and alphabet.
- Returns:
string – Base58 encoded P2WPKH-in-P2SH address.
- static p2wpkh-in-p2sh.P2WPKHInP2SHAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type (“P2WPKH-In-P2SH”).
- class p2wpkh.P2WPKHAddress()¶
Class representing a P2WPKH (Pay-to-Witness-Public-Key-Hash) Bitcoin address. Implements native SegWit address encoding and decoding.
exported from
addresses.p2wpkh- Extends:
Address
- p2wpkh.P2WPKHAddress.hrp¶
type: string
- p2wpkh.P2WPKHAddress.witnessVersion¶
type: number
- static p2wpkh.P2WPKHAddress.decode(address, options=...)¶
Decodes a native SegWit P2WPKH address back into the public key hash.
- Arguments:
address (string) – Bech32 encoded P2WPKH address.
options (AddressOptionsInterface) – Optional HRP for decoding.
- Returns:
string – Public key hash as a string.
- static p2wpkh.P2WPKHAddress.encode(publicKey, options=...)¶
Encodes a public key into a native SegWit P2WPKH address. The public key is hashed (RIPEMD160(SHA256(pubKey))) and then encoded in Bech32 format.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – Public key to encode.
options (AddressOptionsInterface) – Optional parameters including HRP, public key type, and witness version.
- Returns:
string – Bech32 encoded P2WPKH address.
- static p2wpkh.P2WPKHAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type (“P2WPKH”).
- class p2wsh-in-p2sh.P2WSHInP2SHAddress()¶
Class representing a P2WSH-in-P2SH (Pay-to-Witness-Script-Hash nested in Pay-to-Script-Hash) Bitcoin address. Implements encoding of a compressed or uncompressed public key into a P2WSH-in-P2SH address.
exported from
addresses.p2wsh-in-p2sh- Extends:
P2SHAddress
- Implements:
Address
- static p2wsh-in-p2sh.P2WSHInP2SHAddress.encode(publicKey, options=...)¶
Encodes a public key into a P2WSH-in-P2SH Bitcoin address. Constructs the redeem script using a SegWit witness script hash nested in a P2SH structure.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode.
options (AddressOptionsInterface) – Optional parameters including P2SH prefix, public key type, and alphabet.
- Returns:
string – Base58Check encoded P2WSH-in-P2SH address.
- static p2wsh-in-p2sh.P2WSHInP2SHAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type (“P2WSH-In-P2SH”).
- class p2wsh.P2WSHAddress()¶
Class representing a P2WSH (Pay-to-Witness-Script-Hash) Bitcoin address. Extends the P2WPKHAddress class and implements SegWit P2WSH encoding using compressed/uncompressed public keys.
exported from
addresses.p2wsh- Extends:
P2WPKHAddress
- Implements:
Address
- p2wsh.P2WSHAddress.witnessVersion¶
type: number
- static p2wsh.P2WSHAddress.encode(publicKey, options=...)¶
Encodes a public key into a P2WSH SegWit Bitcoin address. The address is constructed by creating a 1-of-1 witness script from the public key, computing its SHA256 hash, and encoding it with the Bech32 SegWit format.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode.
options (AddressOptionsInterface) – Optional parameters including HRP, public key type, and witness version.
- Returns:
string – Bech32-encoded P2WSH SegWit address.
- static p2wsh.P2WSHAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type (“P2WSH”).
- class ripple.RippleAddress()¶
Class representing a Ripple (XRP) address. Extends P2PKHAddress since Ripple addresses are derived from a public key hash and use the Base58Check encoding with a specific alphabet.
exported from
addresses.ripple- Extends:
P2PKHAddress
- Implements:
Address
- ripple.RippleAddress.alphabet¶
type: string
- static ripple.RippleAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type (“Ripple”).
- class solana.SolanaAddress()¶
Class representing a Solana (SOL) address. Provides encoding and decoding methods for Solana public keys using Base58.
exported from
addresses.solana- Extends:
Address
- solana.SolanaAddress.alphabet¶
type: string
- static solana.SolanaAddress.decode(address)¶
Decodes a Solana Base58 address into the corresponding public key bytes.
- Arguments:
address (string) – The Base58 Solana address to decode.
- Returns:
string – The decoded public key as a string.
- static solana.SolanaAddress.encode(publicKey)¶
Encodes a public key into a Solana Base58 address.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode.
- Returns:
string – The Base58-encoded Solana address.
- static solana.SolanaAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type (“Solana”).
- class stellar.StellarAddress()¶
Class representing a Stellar (XLM) address. Provides encoding and decoding methods for Stellar public keys and private keys using Base32.
exported from
addresses.stellar- Extends:
Address
- stellar.StellarAddress.addressType¶
type: any
- stellar.StellarAddress.addressTypes¶
type: Record<string, number>
- stellar.StellarAddress.checksumLength¶
type: number
- static stellar.StellarAddress.computeChecksum(payload)¶
Computes the checksum for a Stellar address payload.
- Arguments:
payload (Uint8Array) – The payload bytes to compute the checksum for.
- Returns:
Uint8Array – The checksum bytes.
- static stellar.StellarAddress.decode(address, options=...)¶
Decodes a Stellar Base32 address into the corresponding public key bytes.
- Arguments:
address (string) – The Base32 Stellar address to decode.
options (AddressOptionsInterface) – Decoding options including address type.
- Returns:
string – The decoded public key as a string.
- static stellar.StellarAddress.encode(publicKey, options=...)¶
Encodes a public key or private key into a Stellar Base32 address.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public/private key to encode.
options (AddressOptionsInterface) – Encoding options including address type.
- Returns:
string – The Base32-encoded Stellar address.
- static stellar.StellarAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type (“Stellar”).
- class sui.SuiAddress()¶
Class representing a Sui blockchain address. Provides encoding and decoding functionality for Sui addresses based on Ed25519 public keys.
exported from
addresses.sui- Extends:
Address
- sui.SuiAddress.addressPrefix¶
type: string
- sui.SuiAddress.keyType¶
type: Uint8Array
- static sui.SuiAddress.decode(address)¶
Decodes a Sui address string into its raw address body (without prefix). Performs basic validation on the address prefix and length.
- Arguments:
address (string) – The Sui address to decode.
- Returns:
string – The raw address body as a hexadecimal string.
- static sui.SuiAddress.encode(publicKey)¶
Encodes a public key into a Sui blockchain address. The address is derived by hashing the key type prefix and the raw public key bytes with Blake2b-256.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode.
- Returns:
string – The Sui address string with the appropriate prefix.
- static sui.SuiAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type (“Sui”).
- class tezos.TezosAddress()¶
Class representing a Tezos blockchain address. Supports encoding and decoding of Tezos addresses using Ed25519 public keys. Addresses are encoded in Base58Check format with specific prefixes.
exported from
addresses.tezos- Extends:
Address
- tezos.TezosAddress.addressPrefix¶
type: any
- tezos.TezosAddress.addressPrefixes¶
type: Record<string, Uint8Array>
- static tezos.TezosAddress.decode(address, options=...)¶
Decodes a Tezos address into its raw public key hash. Validates the address prefix and length before returning.
- Arguments:
address (string) – The Tezos address to decode.
options (AddressOptionsInterface) – Optional decoding options (address prefix).
- Returns:
string – The raw public key hash as a hexadecimal string.
- static tezos.TezosAddress.encode(publicKey, options=...)¶
Encodes a public key into a Tezos address. Uses Blake2b-160 hash of the compressed public key (excluding the first byte) and prepends the appropriate address prefix.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode.
options (AddressOptionsInterface) – Optional encoding options (address prefix).
- Returns:
string – The Tezos address in Base58Check format.
- static tezos.TezosAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – Name of the address type (“Tezos”).
- class tron.TronAddress()¶
Class representing a Tron blockchain address. Provides methods for encoding a public key to a Tron address and decoding a Tron address to its raw hash. Tron addresses are Base58Check encoded with a network-specific prefix.
exported from
addresses.tron- Extends:
Address
- tron.TronAddress.alphabet¶
type: string
- tron.TronAddress.publicKeyAddressPrefix¶
type: number
- static tron.TronAddress.decode(address, options=...)¶
Decodes a Tron address into its raw public key hash. Validates the address prefix and length before returning the hash.
- Arguments:
address (string) – The Tron address to decode.
options (AddressOptionsInterface) – Optional decoding options including address prefix and alphabet.
- Returns:
string – The raw public key hash as a hexadecimal string.
- static tron.TronAddress.encode(publicKey, options=...)¶
Encodes a public key into a Tron address. Uses Keccak-256 on the uncompressed public key (without first byte) and takes the last 20 bytes. Prepends the network prefix and encodes the result in Base58Check format.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode.
options (AddressOptionsInterface) – Optional encoding options including address prefix and alphabet.
- Returns:
string – The encoded Tron address as a Base58Check string.
- static tron.TronAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – The string “Tron”.
- class xinfin.XinFinAddress()¶
Class representing a XinFin blockchain address. Inherits from EthereumAddress since XinFin uses Ethereum-compatible addresses (hexadecimal with “0x” prefix). Provides XinFin-specific address prefix for encoding and decoding.
exported from
addresses.xinfin- Extends:
EthereumAddress
- Implements:
Address
- xinfin.XinFinAddress.addressPrefix¶
type: string
- static xinfin.XinFinAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – The string “XinFin”.
- class zilliqa.ZilliqaAddress()¶
Class representing a Zilliqa blockchain address. Uses Bech32 encoding for addresses and derives addresses from the compressed public key.
exported from
addresses.zilliqa- Extends:
Address
- zilliqa.ZilliqaAddress.hrp¶
type: readonly string
- static zilliqa.ZilliqaAddress.decode(address, options=...)¶
Decodes a Bech32 Zilliqa address back into its public key hash.
- Arguments:
address (string) – The Bech32-encoded Zilliqa address to decode.
options (AddressOptionsInterface) – Optional decoding parameters, such as HRP.
- Returns:
string – The public key hash in byte string format.
- static zilliqa.ZilliqaAddress.encode(publicKey, options=...)¶
Encodes a public key into a Bech32 Zilliqa address.
- Arguments:
publicKey (string | Uint8Array<ArrayBufferLike> | PublicKey) – The public key to encode.
options (AddressOptionsInterface) – Optional encoding parameters, such as HRP.
- Returns:
string – The Bech32-encoded Zilliqa address.
- static zilliqa.ZilliqaAddress.getName()¶
Returns the display name of this address type.
- Returns:
string – The string “Zilliqa”.