Class AnsClient

Hierarchy

  • AnsClient

Constructors

  • Creates new AnsClient instance

    Parameters

    • provider: Provider

      Provider instance

    • Optional contractAddress: string

      An optional contract address. If there is no contract address matching to the provided network then the AnsClient class expects a contract address - this is to support both mainnet/testnet networks and local development.

    Returns AnsClient

Properties

contractAddress: string
provider: Provider

Methods

  • Returns the account address for the given domain name

    Example

    if name is aptos.apt domain = aptos

    Returns

    account address | null

    Parameters

    • domain: string

      domain name

    Returns Promise<any>

  • Returns the target account address for the given name

    Returns

    Account address | null

    Parameters

    • name: string

      ANS name

    Returns Promise<null | string>

  • Returns the account address for the given subdomain_name

    Example

    if name is dev.aptos.apt domain = aptos subdomain = dev

    Returns

    account address | null

    Parameters

    • domain: string

      domain name

    • subdomain: string

      subdomain name

    Returns Promise<null | string>

  • Returns the primary name for the given account address

    Returns

    Account's primary name | null if there is no primary name defined

    Parameters

    • address: string

      An account address

    Returns Promise<null | string>

  • Mint a new Aptos name

    Returns

    The hash of the pending transaction submitted to the API

    Parameters

    • account: AptosAccount

      AptosAccount where collection will be created

    • domainName: string

      Aptos domain name to mint

    • years: number = 1

      year duration of the domain name

    • Optional extraArgs: OptionalTransactionArgs

    Returns Promise<string>

Generated using TypeDoc