resolveMethod

Resolves and returns the ABI function with the specified method name. Throws an error if the function is not found in the ABI.

Example

import { resolveMethod, prepareContractCall } from "thirdweb";
const tx = prepareContractCall({
contract,
// automatically resolves the necessary abi to encode the transaction
method: resolveMethod("transfer"),
// however there is no type completion for params in this case (as the resolution is async and happens at runtime)
params: [to, value],
});

Parameters

Returns

The resolved ABI function.