/typescript-sdk

Primary LanguageTypeScriptApache License 2.0Apache-2.0

Thirdweb SDK

Looking for version 1 (legacy)? Click here.

Installation

Install the latest version of the SDK with npm:

npm install @thirdweb-dev/sdk@nightly ethers

or with yarn:

yarn add @thirdweb-dev/sdk@nightly ethers

Quick start

  1. Deploy & customize your contracts
  • Using your thirdweb dashboard (recommended)
  • Using the SDK directly (for advanced use cases)
  1. Interact with your contracts from your own code using the thirdweb SDK
import { ThirdwebSDK } from "@thirdweb-dev/sdk";

// instantiate the SDK with a read only RPC url or a Signer to perform transactions
const sdk = new ThirdwebSDK("your_rpc_url_or_signer");

// access your deployed contracts
const nftDrop = sdk.getNFTDrop("0x...");
const marketplace = sdk.getMarketplace("0x...");

// Read from your contract
const listings = await marketplace.getAllListings();

// Perform transactions (requires a signer)
await marketplace.buyoutDirectListing(listingId, quantityDesired);

Api Reference & code examples

Get in touch