detectMethod

Detects if the specified method is present in the contract bytecode.

Example

import { detectMethod } from "thirdweb/utils/extensions/detect.js";
const hasDecimals = await detectMethod({
method: "function decimals() view returns (uint8)",
availableSelectors: ["0x313ce567"],
});
function detectMethod(options: DetectExtensionOptions): boolean;

Parameters

The options for detecting the extension.

Type

let options: DetectExtensionOptions;

Returns

let returnType: boolean;

A promise that resolves to a boolean indicating if the extension is detected.