Docs

SmartContract

Custom contract dynamic class with feature detection

Example

import { ThirdwebSDK } from "@thirdweb-dev/sdk";

const sdk = new ThirdwebSDK(provider);
const contract = await sdk.getContract("{{contract_address}}");

// call any function in your contract
await contract.call("myCustomFunction", [param1, param2]);

// if your contract follows an ERC standard, contract.ercXYZ will be present
const allNFTs = await contract.erc721.getAll();

// if your contract extends a particular contract extension, the corresponding function will be available
const tx = await contract.erc721.mint({
  name: "Cool NFT",
  image: readFileSync("some_image.png"),
});

Methods

Properties

Accessors