0.0.5 • Published 1 year ago

@genesysgo/ssc-staking-sdk v0.0.5

Weekly downloads
-
License
GPL-3.0-or-later
Repository
-
Last release
1 year ago

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);
}