Skip to main content
Version: Next

Namespace: src5

Functions​

supportsInterface​

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

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

Parameters​

NameTypeDescription
providerProviderthe provider to access to Starknet.
contractAddressBigNumberishthe address of the contract to check.
interfaceIdBigNumberishthe 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

Defined in​

src/utils/src5.ts:19