Represents a ckb address with associated script and prefix.

Constructors

Properties

script: Script

The script associated with the address.

prefix: string

The address prefix.

Methods

  • Creates an Address instance from an address string.

    Parameters

    • address: string

      The address string to parse.

    • clients: Client | Record<string, Client>

      A Client instance or a record of Client instances keyed by prefix.

    Returns Promise<ccc.Address>

    A promise that resolves to an Address instance.

    Will throw an error if the address prefix is unknown or mismatched.

  • Creates an Address instance from a script and client.

    Parameters

    • script: ScriptLike

      The script-like object.

    • client: Client

      The client instance used to fetch the address prefix.

    Returns ccc.Address

    A promise that resolves to an Address instance.

  • Converts the Address instance to a string.

    Returns string

    The address as a string.