Class which can be used to interact with the PublicResolver

Hierarchy (view full)

Implements

Constructors

Properties

abi: any[]
address: string
bytecode: undefined | string
provider: Provider

Methods

  • Returns the ABI associated with an MNS node. Defined in EIP205.

    Parameters

    • node: string

      The MNS node to query

    • contentType: bigint

      A bitwise OR of the ABI formats accepted by the caller.

    Returns Promise<[contentType: bigint, data: string]>

    [contentType,data] The content type of the return data value

  • Returns the address associated with an MNS node.

    Parameters

    • node: string

      The MNS node to query.

    • convert: undefined | boolean = false

    Returns Promise<string>

    The associated address.

  • Returns the address associated with an MNS node.

    Parameters

    • node: string

      The MNS node to query.

    • coinType: bigint

      the slip44 id of the coin

    Returns Promise<string>

    The associated address.

  • Get this contract balance

    Returns Promise<bigint>

    the satoshi balance of this contract

  • Perform calltocontract

    Parameters

    • method: string

      The contract method to call

    • args: any[]

      The arguments

    Returns Promise<undefined | Result>

    see Result

  • Clear all information for a DNS zone.

    Parameters

    • node: string

      the namehash of the node for which to clear the zone

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Get receipts from a transaction

    Returns Promise<EventLogs>

    an EventLogs object

  • Check if a given node has records.

    Parameters

    • node: string

      the namehash of the node for which to check the records

    • name: string

      the namehash of the node for which to check the records

    Returns Promise<boolean>

    has records

  • Returns the address of a contract that implements the specified interface for this name. If an implementer has not been set for this interfaceID and name, the resolver will query the contract at addr(). If addr() is set, a contract exists at that address, and that contract implements EIP165 and returns true for the specified interfaceID, its address will be returned.

    Parameters

    • node: string

      The MNS node to query.

    • interfaceId: string

      The EIP 165 interface ID to check for.

    Returns Promise<string>

    The address that implements this interface, or 0 if the interface is unsupported.

  • Returns the name associated with an MNS node, for reverse records. Defined in EIP181.

    Parameters

    • node: string

      The MNS node to query.

    Returns Promise<string>

    The associated name.

  • Returns the SECP256k1 public key associated with an MNS node. Defined in EIP 619.

    Parameters

    • node: string

      The MNS node to query

    Returns Promise<[x: string, y: string]>

    x and y coordinates of the curve point for the public key.

  • Perform sendtocontract

    Parameters

    • method: string

      The contract method to send to

    • args: any[]

      The arguments to use

    • Optionalvalue: string

      The amount to send to the contract

    • OptionalgasLimit: number

      The amount of gas units allowed

    • OptionalgasPrice: number

      The satoshi price per gas

    Returns Promise<{
        hash160: string;
        sender: string;
        txid: string;
    }>

    see Result

  • Sets the ABI associated with an MNS node. Nodes may have one ABI of each content type. To remove an ABI, set it to the empty string.

    Parameters

    • node: string

      The node to update.

    • contentType: bigint

      The content type of the ABI

    • data: string

      The ABI data.

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Sets the address associated with an MNS node. May only be called by the owner of that node in the MNS registry.

    Parameters

    • node: string

      The node to update.

    • a: string

      The address to set.

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Sets the address associated with an MNS node. May only be called by the owner of that node in the MNS registry.

    Parameters

    • node: string

      The node to update.

    • coinType: bigint

      the slip44 id of the coin

    • a: string

      The address to set.

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Sets the contenthash associated with an MNS node. May only be called by the owner of that node in the MNS registry.

    Parameters

    • node: string

      The node to update.

    • hash: string

      The contenthash to set

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Set one or more DNS records. Records are supplied in wire-format. Records with the same node/name/resource must be supplied one after the other to ensure the data is updated correctly. For example, if the data was supplied: a.example.com IN A 1.2.3.4 a.example.com IN A 5.6.7.8 www.example.com IN CNAME a.example.com. then this would store the two A records for a.example.com correctly as a single RRSET, however if the data was supplied: a.example.com IN A 1.2.3.4 www.example.com IN CNAME a.example.com. a.example.com IN A 5.6.7.8 then this would store the first A record, the CNAME, then the second A record which would overwrite the first.

    Parameters

    • node: string

      the namehash of the node for which to set the records

    • data: string

      the DNS wire format records to set

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Sets an interface associated with a name. Setting the address to 0 restores the default behaviour of querying the contract at addr() for interface support.

    Parameters

    • node: string

      The node to update.

    • interfaceId: string

      The EIP 165 interface ID.

    • implementer: string

      The address of a contract that implements this interface for this node.

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Sets the name associated with an MNS node, for reverse records. May only be called by the owner of that node in the MNS registry.

    Parameters

    • node: string

      The node to update.

    • name: string

      The name to set.

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Sets the SECP256k1 public key associated with an MNS node.

    Parameters

    • node: string

      The MNS node to query

    • x: string

      the X coordinate of the curve point for the public key.

    • y: string

      the Y coordinate of the curve point for the public key.

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Sets the text data associated with an MNS node and key. May only be called by the owner of that node in the MNS registry.

    Parameters

    • node: string

      The node to update.

    • key: string

      The key to set.

    • value: string

      The text data value to set.

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • setZonehash sets the hash for the zone. May only be called by the owner of that node in the MNS registry.

    Parameters

    • node: string

      The node to update.

    • hash: string

      The zonehash to set

    Returns Promise<Transaction>

    an array of TransactionReceipt objects

  • Returns the text data associated with an MNS node and key.

    Parameters

    • node: string

      The MNS node to query.

    • key: string

      The text data key to query.

    Returns Promise<string>

    The associated text data.