Interface that represents an Interface Resolver

interface InterfaceResolver {
    interfaceImplementer(node: string, interfaceId: string): Promise<string>;
    setInterface(node: string, interfaceId: string, implementer: string): Promise<Transaction>;
    supportsInterface(interfaceId: string): Promise<boolean>;
}

Hierarchy

  • IERC165
    • InterfaceResolver

Implemented by

Methods

  • 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.

  • 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

  • Returns true if this contract implements the interface defined by interfaceId. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created.

    This function call must use less than 30 000 gas. Defined in EIP181.

    Parameters

    • interfaceId: string

      The MNS node to query.

    Returns Promise<boolean>

    if the interface is supported