npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@junglefinance/jungle-fi-sdk

v1.1.10

Published

Library to interact with Jungle Finance staking vaults.

Downloads

89

Readme

JungleFi SDK

A client side SDK for interfacing with Jungle Finance smart contracts.

Installation

Yarn

$ yarn add @junglefinance/jungle-fi-sdk

npm

$ npm intall @junglefinance/jungle-fi-sdk --save

Program Addresses

| Contract | Mainnet / Devnet | |----------|-----------------------------------------------| | Quarry | jDeFipStbGiKTJQGLEQRRA2HNeqjpXKoqgGeM9Fg3XT | | Raydium | rDeFi3U3Jbj31z8rbHGXxEsiKLTB24EdScFXVCncG3c | | Marinade | mDeFijC2NYkK2kax3kCHYCgcaBZ9aV4wrpTeDLgcFc9 |

VaultInfo Addresses

| Contract | Name | Mainnet | |-----------|----------|------------------------------------------------| | Quarry | I-JFI-Q3 | 21Vx4auojCE8xCqPVFhC1M7QiWuRaiXak3Nuh4YiUgX7 | | Quarry | I-JFI-Q4 | 8ua2wwcuGL9s1hrtcgH8x7KfwvEKXi95aqvJkmiLnKV8 | | Raydium | I-RAY-Q3 | 2QeZFinvmrinXk9nuLHRvDfW4cWnQMDG7RV3utzHrPHw | | Raydium | I-RAY-Q4 | HwK7u9crC5WjhxmmaxhFgVPbN3anjtbMg3y3uD4iSQEQ | | Marinade | I-SOL-Q3 | BRrVBo3VkisZS1rXkuhp3QKua4S9nEE8kPN6RWXRDdTM |

Example

This is an example on depositing into a Marinade vault however there are various different ways to utilize the sdk, this is just one of them.

Setup Code

import { JungleMsolPlatformProvider } from "../jungle_msol";
import { Connection, Keypair, PublicKey } from "@solana/web3.js";
import { EndPoint } from "./types";

const provider = new JungleMsolPlatformProvider(
    new Connection("https://api.devnet.solana.com"),
    new PublicKey("mDeFijC2NYkK2kax3kCHYCgcaBZ9aV4wrpTeDLgcFc9"),
    EndPoint.dev
);

const VAULT_INFO = new PublicKey("iSoLXhjuJJz1pRPd6MkwhGn6Q8qCybZzK9F77dDGK2C");

Deposit

import { Keypair } from "@solana/web3.js";

... (Setup Code)

const DEPOSIT_AMOUNT = 1_000_000;

const vaultInfo = await provider.fetchVault(VAULT_INFO);

const signer = Keypair.generate(); // Your Signer Here!

const txId = await provider.depositRpc(
    [signer],
    DEPOSIT_AMOUNT,
    signer.publicKey,
    vaultInfo
)

console.log("Transaction Signature: " + txId);

Math Library

import JSBI from "jsbi";

... (Setup Code)

const math = provider.createMath();

// Amounts in lamports
const returnAmounts = await math.calcDepositReturns(JSBI.BigInt(DEPOSIT_AMOUNT), vaultInfo);
if (returnAmounts.error){
    console.log("Math Error: " + returnAmounts.error);
} else {
    console.log("Return Amount: " + returnAmounts.result);
}

Build

Run the following commands to fetch dependencies and build the sdk.

$ yarn install
$ yarn build