Docs

resolveCompositeAbi

Resolves the ABI for a contract based on its bytecode. If the contract follows the plugin-pattern or dynamic pattern, it resolves the ABIs for the plugins and merges them with the root ABI. If the contract follows the base router pattern, it resolves the ABIs for the plugins and merges them with the root ABI. If the contract follows the diamond pattern, it resolves the ABIs for the facets and merges them with the root ABI.

Example

import { createThirdwebClient, getContract } from "thirdweb";
import { resolveCompositeAbiFromBytecode } from "thirdweb/contract";
import { ethereum } from "thirdweb/chains";
const client = createThirdwebClient({ clientId: "..." });
const myContract = getContract({
client,
address: "...",
chain: ethereum,
});
const abi = await resolveCompositeAbiFromBytecode(myContract);

Parameters

Returns

The resolved ABI for the contract.