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({
contract,
method: "function decimals() view returns (uint8)",
});
function detectMethod(
options: DetectExtensionOptions,
): Promise<boolean>;

Parameters

The options for detecting the extension.

Type

let options: DetectExtensionOptions;

Returns

let returnType: Promise<boolean>;

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