@perena/bankineco-sdk 1.0.145 → 1.0.146

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -148,6 +148,29 @@ const { transaction: fulfillTx } = await client.fulfillUnstakeJuniorTx({
148
148
  const transaction = new Transaction().add(requestTx, fulfillTx);
149
149
  ```
150
150
 
151
+ ### Instant unstake (Junior) — `instantUnstakeJuniorTx`
152
+
153
+ To exit the junior tranche in **one transaction** without using the withdrawal queue, use `instantUnstakeJuniorTx`. The program always applies the **early unstake fee** (same idea as fulfilling a queued request before lockup expires). Use `fetchUnstakeFee` with `early: true` if you want a fee quote first.
154
+
155
+ ```typescript
156
+ const { transaction, lookupTables } = await client.instantUnstakeJuniorTx({
157
+ shares: fromUiAmount(5, USD_STAR_DECIMALS),
158
+ user: anchorWallet.publicKey,
159
+ });
160
+ ```
161
+
162
+ To receive a yielding asset (e.g. USDC) instead of USD\*, set `targetMint`. For vaults that need extra accounts on redeem (for example marginfi), pass `remainingAccounts` as you would for `requestUnstakeJuniorTx`.
163
+
164
+ ```typescript
165
+ const { transaction, lookupTables } = await client.instantUnstakeJuniorTx({
166
+ shares: fromUiAmount(5, USD_STAR_DECIMALS),
167
+ targetMint: USDC_MINT,
168
+ user: anchorWallet.publicKey,
169
+ });
170
+ ```
171
+
172
+ The returned `transaction` should be signed and sent like other client helpers; attach `lookupTables` when building/sending the versioned transaction if your stack requires it.
173
+
151
174
  ### Reading Withdrawal Queues
152
175
 
153
176
  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.
@@ -36,8 +36,8 @@ export declare function fetchGlowUsdtTokenPrice(): Promise<number>;
36
36
  */
37
37
  export declare function getGlowUsdtShareHolderAta(owner: PublicKey): PublicKey;
38
38
  /**
39
- * Fetches the USDT value owed by the Glow usdt vault position (share balance × share price).
40
- * Used for uncollateralized external yield oracle: report this as pending yield in USDT base units.
39
+ * Fetches the USDT value of the Glow usdt vault position (share balance × share price).
40
+ * For oracle pending yield, subtract the vault's `external_yielding_amount` principal (see Kamino/MarginFi oracles).
41
41
  */
42
42
  export declare function fetchGlowUsdtOwed(connection: Connection, shareHolder: PublicKey): Promise<BN>;
43
43
  export declare function createGlowUsdtDepositTransaction(args: CreateGlowUsdtDepositTransactionArgs): Promise<CreateGlowUsdtTransactionResponse>;
@@ -95,8 +95,8 @@ function getGlowUsdtShareHolderAta(owner) {
95
95
  return deriveAta(constants_1.GLOW_USDT_SHARE_MINT, spl_token_1.TOKEN_2022_PROGRAM_ID, vaultUser);
96
96
  }
97
97
  /**
98
- * Fetches the USDT value owed by the Glow usdt vault position (share balance × share price).
99
- * Used for uncollateralized external yield oracle: report this as pending yield in USDT base units.
98
+ * Fetches the USDT value of the Glow usdt vault position (share balance × share price).
99
+ * For oracle pending yield, subtract the vault's `external_yielding_amount` principal (see Kamino/MarginFi oracles).
100
100
  */
101
101
  async function fetchGlowUsdtOwed(connection, shareHolder) {
102
102
  const sharePrice = await fetchGlowUsdtTokenPrice();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perena/bankineco-sdk",
3
- "version": "1.0.145",
3
+ "version": "1.0.146",
4
4
  "description": "SDK for interacting with Bankineco program on Solana.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  "scripts": {
23
23
  "build": "rm -rf dist && tsc -p tsconfig.json",
24
24
  "deploy": "npm publish --access public --userconfig ~/.npmrc.perena",
25
- "set-latest": "npm --userconfig ~/.npmrc.perena dist-tag add @perena/bankineco-sdk@1.0.120 latest"
25
+ "set-latest": "npm --userconfig ~/.npmrc.perena dist-tag add @perena/bankineco-sdk@1.0.146 latest"
26
26
  },
27
27
  "dependencies": {
28
28
  "@coral-xyz/anchor": "=0.30.1",