@genesysgo/ssc-staking-sdk
v0.0.5
Published
This SDK contains helpful functions for fetching data for SSC NFTs that have been staked.
Downloads
10
Readme
SSC Staking SDK
This SDK contains helpful functions for fetching data for SSC NFTs that have been staked.
Installation
npm install @genesysgo/ssc-staking-sdk
Setup
All functions are exported individually right now. Some functions requre a Connection
object from @solana/web3.js
, so please make sure you have a connection
with your preferred RPC endpoint set up so you can pass it into the functions that require it.
import { Connection, clusterApiUrl, PublicKey } from "@solana/web3.js";
import { MINTS, getStakedDataByMint } from "@genesysgo/ssc-staking-sdk";
async function main() {
const connection = new Connection(clusterApiUrl("mainnet-beta"));
const mint = new PublicKey(MINTS[0]);
const stakeData = await getStakedDataByMint(connection, mint);
/**
Should output something in the format of:
`{
mint,
data,
json,
timestamp,
withdrawn,
harvested,
bonus_redeemed,
active,
}`
*/
console.log(stakeData);
}