thirdweb Solana SDK
thirdweb's Solana SDK for Browser, Node and React Native
Installation
Install the latest version of the SDK with either npm
or yarn
:
npm install @thirdweb-dev/solana
yarn add @thirdweb-dev/solana
Quick Start
The first thing to do to get started with Solana using thirdweb is to deploy a program. You can do this via the Dashboard, or via the SDK with the following snippet:
import { ThirdwebSDK } from "@thirdweb-dev/solana";
const sdk = ThirdwebSDK.fromNetwork("devnet");
const signer = {
publicKey: "...",
secretKey: "...",
};
sdk.wallet.connect(signer);
const address = await sdk.deployer.createNftCollection({
name: "My Collection",
});
Once we have a deployed program, we can access it using the SDK to read and write data to the program:
const program = await sdk.getNFTCollection(address);
const nfts = await program.getAll();
const mintAddress = await program.mint({
name: "New NFT",
});
const nft = await program.get(mintAddress);
Learn More
You can learn more about thirdweb and the Solana SDK with the following resources: