decodeFunctionData

Decodes the data of a function call.

Example

import { decodeFunctionData } from "thirdweb/utils";
const data = "0x...";
const decodedData = await decodeFunctionData({ contract, data });
function decodeFunctionData(options: {
contract: Readonly<ContractOptions<abi>>;
data: `0x${string}`;
}): Promise<
ReturnType<ReturnType<abi, Name<abi>, undefined, AbiFunction>>
>;

Parameters

The options object.

Type

let options: {
contract: Readonly<ContractOptions<abi>>;
data: `0x${string}`;
};

Returns

let returnType: Promise<
ReturnType<ReturnType<abi, Name<abi>, undefined, AbiFunction>>
>;

The decoded data.