Skip to main content
Version: Next

Function: supportsInterface()

supportsInterface(provider, contractAddress, interfaceId): Promise<boolean>

Defined in: src/utils/src5.ts:19

Implementation of ERC165 introspection. Verify if a contract has implemented some standard functionalities.

Parameters

provider

RpcProvider

the provider to access to Starknet.

contractAddress

BigNumberish

the address of the contract to check.

interfaceId

BigNumberish

the hash of the functionality to check.

Returns

Promise<boolean>

true if the interfaceId is implemented in this contract.

Example

const snip9InterfaceV2Id = constants.SNIP9_V2_INTERFACE_ID;
const result = src5.supportsInterface(myProvider, accountContractAddress, snip9InterfaceV2Id);
// result = true