decodeFunctionResult

Decodes the result of a function call.

Example

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

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>,
"Array"
>
>;

The decoded result.