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
Parameter | Type | Description |
---|---|---|
address | string | the address of the deployed contract |
contractType | TContractType | the ContractType of the contract to load |
Returns:
Promise<TContractType extends PrebuiltContractType ? ContractForPrebuiltContractType<TContractType> : SmartContract>
the contract