Optional
storage: IThirdwebStorageNew contract deployer
The registry of deployed contracts
Readonly
optionsOptional
clientOptional
gasless?: ({ openzeppelin: { relayerUrl: string; useEOAForwarder: boolean; domainName: string; domainVersion: string; relayerForwarderAddress?: string | undefined; }; experimentalChainlessSupport: boolean; }) | ({ biconomy: { apiId: string; apiKey: string; deadlineSeconds: number; }; }) | ({ engine: { relayerUrl: string; }; })Optional
gatewayOptional
readonlyOptional
secretUpload and download files from IPFS or from your own storage service
Private
storageInternal handler for uploading and downloading files
Contract verifier
Interact with the connected wallet
Get the native balance of a given address (wallet or contract)
the address to check the balance for
const balance = await sdk.getBalance("0x...");
console.log(balance.displayValue);
Get an instance of a Custom ThirdwebContract
the address of the deployed contract
the contract
const contract = await sdk.getContract("{{contract_address}}");
Get an instance of a Custom ThirdwebContract
the address of the deployed contract
the ContractType of the contract to load
the contract
const contract = await sdk.getContract("{{contract_address}}", "nft-drop");
Get an instance of a Custom ThirdwebContract
the address of the deployed contract
the ABI (ContractInterface) of the contract to load
the contract
const contract = await sdk.getContract("{{contract_address}}", ABI);
Beta
Get an instance of a Custom contract from a json ABI
the address of the deployed contract
the JSON abi
the contract
// Import your ABI from a JSON file
import myABI from "./path/to/myABI.json";
const contract = sdk.getContractFromAbi(
"{{contract_address}}",
// Pass in the "abi" field from the JSON file
myABI.abi
);
Return all the contracts deployed by the specified address
the deployed address
const contracts = sdk.getContractList("{{wallet_address}}");
Get an instance of a Edition contract
the address of the deployed contract
This method is deprecated and will be removed in a future major version. You should use getContract instead.
- const edition = await sdk.getEdition("0x1234...");
+ const edition = await sdk.getContract("0x1234...", "edition");
Get an instance of a Edition Drop contract
the address of the deployed contract
This method is deprecated and will be removed in a future major version. You should use getContract instead.
- const editionDrop = await sdk.getEditionDrop("0x1234...");
+ const editionDrop = await sdk.getContract("0x1234...", "edition-drop");
Get an instance of a Marketplace contract
the address of the deployed contract
This method is deprecated and will be removed in a future major version. You should use getContract instead.
- const marketplace = await sdk.getMarketplace("0x1234...");
+ const marketplace = await sdk.getContract("0x1234...", "marketplace");
Get an instance of a Marketplace contract
the address of the deployed contract
This method is deprecated and will be removed in a future major version. You should use getContract instead.
- const marketplace = await sdk.getMarketplaceV3("0x1234...");
+ const marketplace = await sdk.getContract("0x1234...", "marketplace-v3");
Get an instance of a Pack contract
the address of the deployed contract
This method is deprecated and will be removed in a future major version. You should use getContract instead.
- const multiWrap = await sdk.getMultiwrap("0x1234...");
+ const multiWrap = await sdk.getContract("0x1234...", "multiwrap");
Get an instance of a NFT Collection Drop contract
the address of the deployed contract
This method is deprecated and will be removed in a future major version. You should use getContract instead.
- const signatureDrop = await sdk.getNFTCollection("0x1234...");
+ const signatureDrop = await sdk.getContract("0x1234...", "nft-collection");
Get an instance of a NFT Drop contract
the address of the deployed contract
This method is deprecated and will be removed in a future major version. You should use getContract instead.
- const dropContract = await sdk.getDropContract("0x1234...");
+ const dropContract = await sdk.getContract("0x1234...", "nft-drop");
Get an instance of a Pack contract
the address of the deployed contract
This method is deprecated and will be removed in a future major version. You should use getContract instead.
- const pack = await sdk.getPack("0x1234...");
+ const pack = await sdk.getContract("0x1234...", "pack");
Get an instance of a Signature Drop contract
the address of the deployed contract
This method is deprecated and will be removed in a future major version. You should use getContract instead.
- const signatureDrop = await sdk.getSignatureDrop("0x1234...");
+ const signatureDrop = await sdk.getContract("0x1234...", "signature-drop");
Get an instance of a Split contract
the address of the deployed contract
This method is deprecated and will be removed in a future major version. You should use getContract instead.
- const split = await sdk.getSplit("0x1234...");
+ const split = await sdk.getContract("0x1234...", "split");
Get an instance of a Token contract
the address of the deployed contract
This method is deprecated and will be removed in a future major version. You should use getContract instead.
- const token = await sdk.getToken("0x1234...");
+ const token = await sdk.getContract("0x1234...", "token");
Get an instance of a Token Drop contract
the address of the deployed contract
This method is deprecated and will be removed in a future major version. You should use getContract instead.
- const tokenDrop = await sdk.getTokenDrop("0x1234...");
+ const tokenDrop = await sdk.getContract("0x1234...", "token-drop");
Get an instance of a Vote contract
the address of the deployed contract
This method is deprecated and will be removed in a future major version. You should use getContract instead.
- const vote = await sdk.getVote("0x1234...");
+ const vote = await sdk.getContract("0x1234...", "vote");
the address of the contract to attempt to resolve the contract type for
the ContractType for the given contract address
Private
updateUpdate the active signer or provider for all contracts
the new signer or provider
Static
fromGet an instance of the thirdweb SDK based on a private key.
the private key - DO NOT EXPOSE THIS TO THE PUBLIC
the network (chain) to connect to (e.g. "mainnet", "rinkeby", "polygon", "mumbai"...) or a fully formed RPC url
the SDK options to use
Optional
storage: ThirdwebStorage<IpfsUploadBatchOptions>optional storage implementation to use
an instance of the SDK
This should only be used for backend services or scripts, with the private key stored in a secure way. NEVER expose your private key to the public in any way.
const sdk = ThirdwebSDK.fromPrivateKey("SecretPrivateKey", "mainnet");
Static
fromBeta
Get an instance of the thirdweb SDK based on an existing ethers signer
a ethers Signer to be used for transactions
Optional
network: ChainOrRpcUrlthe network (chain) to connect to (e.g. "mainnet", "rinkeby", "polygon", "mumbai"...) or a fully formed RPC url
the SDK options to use
Optional
storage: ThirdwebStorage<IpfsUploadBatchOptions>optional storage implementation to use
an instance of the SDK
// get a signer from somewhere (createRandom is being used purely for example purposes)
const signer = Wallet.createRandom();
// get an instance of the SDK with the signer already setup
const sdk = ThirdwebSDK.fromSigner(signer, "mainnet");
Static
fromBeta
Get an instance of the thirdweb SDK based on an AbstractWallet
the implementation of the AbstractWallet class to use for signing
the network (chain) to connect to (e.g. "mainnet", "rinkeby", "polygon", "mumbai"...) or a fully formed RPC url
the SDK options to use
Optional
storage: ThirdwebStorage<IpfsUploadBatchOptions>optional storage implementation to use
an instance of the SDK
import { ThirdwebSDK } from "@thirdweb-dev/sdk"
const wallet = new AbstractWalletImplementation();
const sdk = await ThirdwebSDK.fromWallet(wallet, "mainnet");
Generated using TypeDoc
The main entry point for the thirdweb SDK