getContract

Creates a Thirdweb contract by combining the Thirdweb client and contract options.

Example

import { createThirdwebClient, getContract } from "thirdweb";
import { sepolia } from "thirdweb/chains";
const client = createThirdwebClient({ clientId: "..." });
const contract = getContract({
client,
chain: sepolia,
address: "0x123...",
// optional ABI
abi: [...],
});
function getContract(
options: ContractOptions<abi>,

Parameters

The options for creating the contract.

Type

let options: ContractOptions<abi>;

Returns

let returnType: ThirdwebContract<abi>;

The Thirdweb contract.