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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@perena/bankineco-sdk

v1.0.120

Published

SDK for interacting with Bankineco program on Solana.

Readme

@perena/bankineco-sdk

SDK for interacting with the Bankineco program on Solana.

Installation

npm install @perena/bankineco-sdk

Example Usage

Initialize the Client

import { UsdStarClient, USDC_MINT, USDC_DECIMALS, USD_STAR_DECIMALS, fromUiAmount, BankinecoAction } from "@perena/bankineco-sdk";
import { Wallet } from "@coral-xyz/anchor";
import { PublicKey } from "@solana/web3.js";

const rpcUrl: string = ...; // TODO
const anchorWallet: Wallet = ...; // TODO

const client = UsdStarClient.new({
  env: "prod",
  rpcUrl,
  wallet: anchorWallet,
});

Minting USD*

// Mint USD* with 1 USDC
const { transaction, lookupTables } = await client.mintFromYieldingTx({
  yieldingAmount: fromUiAmount(1, USDC_DECIMALS),
  fromYieldingMint: USDC_MINT,
  user: anchorWallet.publicKey,
});

// OR, If performing a CPI, pull accounts quicker:
const cpiAccounts = client.cpiAccounts(USDC_MINT, BankinecoAction.Mint);

Burning USD*

// Burn 1 USD* for USDC
const { transaction, lookupTables } = await client.burnForYieldingTx({
  banKMintAmount: fromUiAmount(1, USD_STAR_DECIMALS),
  toYieldingMint: USDC_MINT,
  user: anchorWallet.publicKey,
});

// OR, If performing a CPI, pull accounts quicker:
const cpiAccounts = client.cpiAccounts(USDC_MINT, BankinecoAction.Burn);

Get USD* Price

const usdStarPrice = await client.latestBankMintUiPrice();

Get Junior Mint Price

const juniorMintPrice = await client.latestJuniorMintUiPrice();

Get USD* Price

import { getLatestUsdStarUiPrice } from "@perena/bankineco-sdk";

const usdStarPrice = await getLatestUsdStarUiPrice(rpcUrl, "prod");

Get Quote

const vault = this.getVault(USDC_MINT);

// Calculate the amount of USD* you will get from the USDC provided
const { amount: usdStarOutput, details: mintDetails } =
  await client.yieldingToBankMintQuote(fromUiAmount(1, USDC_DECIMALS), vault);

// Calculate the amount of USDC you will receive from the USD* amount provided
const { amount: usdcOutput, details: burnDetails } =
  await client.bankMintToYieldingQuote(
    fromUiAmount(1, USD_STAR_DECIMALS),
    vault,
  );

Staking (Junior Tranche)

Stake USD* into the junior tranche to earn leveraged yield. Staked tokens are represented by junior share tokens.

// Stake 10 USD* into the junior tranche
const { transaction, lookupTables, juniorMint } = await client.stakeJuniorTx({
  amount: fromUiAmount(10, USD_STAR_DECIMALS),
  user: anchorWallet.publicKey,
});

Unstaking (Junior Tranche)

Unstaking is a two-step process: first request the unstake (which locks your shares in a withdrawal queue), then fulfill it once the lockup period expires. An admin crank automatically fulfills expired queues, so in most cases you only need to submit the request and wait.

Fulfilling immediately is possible but incurs a higher early unstake fee. Waiting for the lockup to expire means a lower standard fee is applied instead.

// Request unstake — locks shares in a withdrawal queue
const { transaction, lookupTables, withdrawalQueue } = await client.requestUnstakeJuniorTx({
  shares: fromUiAmount(5, USD_STAR_DECIMALS),
  queueId: 0, // unique per-user queue identifier
  user: anchorWallet.publicKey,
});

To receive a yielding token (e.g. USDC) directly instead of USD*, pass targetMint:

const { transaction, lookupTables } = await client.requestUnstakeJuniorTx({
  shares: fromUiAmount(5, USD_STAR_DECIMALS),
  queueId: 0,
  targetMint: USDC_MINT,
});

If you need to fulfill immediately (paying the early unstake fee), you can compose both steps into a single transaction:

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

const { transaction: requestTx, lookupTables } = await client.requestUnstakeJuniorTx({
  shares: fromUiAmount(5, USD_STAR_DECIMALS),
  queueId: 0,
  user: anchorWallet.publicKey,
});

const { transaction: fulfillTx } = await client.fulfillUnstakeJuniorTx({
  owner: anchorWallet.publicKey,
  queueId: 0,
});

const transaction = new Transaction().add(requestTx, fulfillTx);

Reading Withdrawal Queues

After requesting an unstake, you can fetch all withdrawal queue entries for a given owner to check amounts awaiting unstake and how much time remains until each lockup expires.

const queues = await client.fetchAllWithdrawalQueues(anchorWallet.publicKey);

for (const queue of queues) {
  queue.queueId;          // the queue identifier
  queue.address;          // on-chain address of this queue entry
  queue.amount;           // junior shares locked in this queue entry
  queue.targetMint;       // the mint the user receives upon fulfillment (e.g. USD* or USDC)
  queue.requestTs;        // when the unstake was requested
  queue.expiryTs;         // when the lockup expires
  queue.secondsRemaining; // seconds until the admin crank can fulfill (0 if expired)
  queue.isExpired;        // true if the lockup period has passed
}

Get Unstake Fee

Fetch the fee that would be applied for a given unstake amount. Set early: true for an immediate unstake (higher fee) or early: false for a standard unstake after the lockup expires.

// Early unstake fee (fulfilling before lockup expires)
const { feeBps, feeAmount, amountAfterFee } = await client.fetchUnstakeFee({
  amount: fromUiAmount(5, USD_STAR_DECIMALS),
  early: true,
});

// Standard unstake fee (after lockup expires)
const standard = await client.fetchUnstakeFee({
  amount: fromUiAmount(5, USD_STAR_DECIMALS),
  early: false,
});

Use Insured USD*

import { InsuredUsdStarClient } from "@perena/bankineco-sdk";

const client = InsuredUsdStarClient.new({
  env: "prod",
  rpcUrl,
  wallet: anchorWallet,
});