Skip to main content

ThirdwebSDK.getContract() method

Get an instance of a Custom ThirdwebContract

Example

const contract = await sdk.getContract("{{contract_address}}", "nft-drop");

Signature:

getContract<TContractType extends ContractType>(address: string, contractType: TContractType): Promise<TContractType extends PrebuiltContractType ? ContractForPrebuiltContractType<TContractType> : SmartContract>;

Parameters

ParameterTypeDescription
addressstringthe address of the deployed contract
contractTypeTContractTypethe ContractType of the contract to load

Returns:

Promise<TContractType extends PrebuiltContractType ? ContractForPrebuiltContractType<TContractType> : SmartContract>

the contract