Options
All
  • Public
  • Public/Protected
  • All
Menu

cardano-addresses

This module is a TypeScript/JavaScript binding for the cardano-addresses package.

Index

Type aliases

Address: string

A Cardano address, encoded as bech32, base58, or hexadecimal.

AddressStyle: "Shelley" | "Icarus" | "Byron"

Supported address formats for the Cardano Shelley era.

Bytes: string

Hex-encoded bytes.

TODO: what's the best way of representing bytestrings in TypeScript?

The return value of inspectAddress.

KeyHash: Bytes

Verification key hash.

ScriptHash: Bytes

Hash of a script.

StakeReference: "none" | "by value" | "by pointer"

How the stake at this address will be delegated.

XPub: string

A bech32-encoded extended public key.

TODO: Add proper XPub type, which is the result of bech32 parsing a string.

Functions

  • inspectAddress(address: string, rootXPub?: string): Promise<InspectAddress>
  • Get information about a Cardano address. Three address formats are supported: Shelley, Icarus, and Byron.

    If the address can't be parsed, the promise will be rejected with ErrInspectAddress.

    Parameters

    • address: string

      the address to inspect.

    • Optional rootXPub: string

      an optional bech32-encoded root extended public key. This only applies to Byron addresses, and is for decrypting the InspectAddressByron.payload field.

    Returns Promise<InspectAddress>

    The fields parsed from the address.

  • version(): Promise<string>

Generated using TypeDoc