@genesysgo/ssc-staking-sdk

0.0.5 • Public • Published

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

/@genesysgo/ssc-staking-sdk/

    Package Sidebar

    Install

    npm i @genesysgo/ssc-staking-sdk

    Weekly Downloads

    0

    Version

    0.0.5

    License

    GPL-3.0-or-later

    Unpacked Size

    1.37 MB

    Total Files

    24

    Last publish

    Collaborators

    • stranzhaygg
    • gengotracy