Resolves the ABI (Application Binary Interface) for a contract from the contract API.
import { createThirdwebClient, getContract } from "thirdweb";import { resolveAbiFromContractApi } from "thirdweb/contract";import { ethereum } from "thirdweb/chains";const client = createThirdwebClient({ clientId: "..." });const myContract = getContract({ client, address: "...", chain: ethereum,});const abi = await resolveAbiFromContractApi(myContract);
function resolveAbiFromContractApi( contract: Readonly<ContractOptions<any, `0x${string}`>>, contractApiBaseUrl: string,): Promise<Abi>;
The ThirdwebContract instance representing the contract.
let contract: Readonly<ContractOptions<any, `0x${string}`>>;
The base URL of the contract API. Defaults to "https://contract.thirdweb.com/abi".
let contractApiBaseUrl: string;
let returnType: readonly Array<(AbiConstructor) | (AbiError) | (AbiEvent) | (AbiFallback) | (AbiFunction) | (AbiReceive)>
A promise that resolves to the ABI of the contract.