CCC Docs
    Preparing search index...

    Class Address

    Represents a ckb address with associated script and prefix.

    Index
    • Creates an instance of Address.

      Parameters

      • script: Script

        The script associated with the address.

      • prefix: string

        The address prefix.

      Returns Address

    script: Script

    The script associated with the address.

    prefix: string

    The address prefix.

    • Creates an Address instance from an address string.

      Parameters

      • address: string

        The address string to parse. If it does not parse, a single Client's addressResolver may resolve it.

      • client: Client

        The Client instance used to parse or resolve the address.

      Returns Promise<Address>

      A promise that resolves to an Address instance.

      Will throw an error if the address prefix is unknown or mismatched, or if the resolver handles the address but does not find it.

    • Parameters

      • address: string
      • clients: Record<string, Client>

      Returns Promise<Address>

      Pass a single Client instead. Callers supporting multiple prefixes should try each Client themselves.

    • Converts the Address instance to a string.

      Returns string

      The address as a string.