@perena/bankineco-sdk 1.0.146 → 1.0.147
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 +33 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -78,7 +78,7 @@ const usdStarPrice = await getLatestUsdStarUiPrice(rpcUrl, "prod");
|
|
|
78
78
|
### Get Quote
|
|
79
79
|
|
|
80
80
|
```typescript
|
|
81
|
-
const vault =
|
|
81
|
+
const vault = client.getVault(USDC_MINT);
|
|
82
82
|
|
|
83
83
|
// Calculate the amount of USD* you will get from the USDC provided
|
|
84
84
|
const { amount: usdStarOutput, details: mintDetails } =
|
|
@@ -92,6 +92,38 @@ const { amount: usdcOutput, details: burnDetails } =
|
|
|
92
92
|
);
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
+
**Junior unstake fee quote (`fetchUnstakeFee`):** pass the number of **junior shares** as `amount` (same raw units as `requestUnstakeJuniorTx` / `instantUnstakeJuniorTx`). Use `early: true` when the user will pay the early fee (instant unstake, or fulfilling a queue before lockup expires); use `early: false` for a standard queued unstake after lockup.
|
|
96
|
+
|
|
97
|
+
- **Junior → USD\* (bank mint / senior):** do not set `targetMint`. `feeAmount`, `amountAfterFee`, and `burningFeeAmount` are denominated in **USD\*** (bank mint) raw units; `burningFeeBps` stays zero because there is no vault burn on that path.
|
|
98
|
+
|
|
99
|
+
- **Junior → yielding mint (e.g. USDC):** set `targetMint` to the yielding mint for an **idle vault the client supports** (the same mint you would pass to `requestUnstakeJuniorTx`). The SDK values the redemption in that mint and includes the vault **burn** fee, so `feeAmount` and `amountAfterFee` are in **that mint’s** raw units. Check `burningFeeBps` / `burningFeeAmount` for the burn portion.
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
// Junior → USD* — standard vs early unstake fee only (amounts in USD* raw units)
|
|
103
|
+
const juniorToUsdStar = await client.fetchUnstakeFee({
|
|
104
|
+
amount: fromUiAmount(5, USD_STAR_DECIMALS),
|
|
105
|
+
early: false,
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const juniorToUsdStarEarly = await client.fetchUnstakeFee({
|
|
109
|
+
amount: fromUiAmount(5, USD_STAR_DECIMALS),
|
|
110
|
+
early: true,
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// Junior → USDC — unstake fee + burn fee (amounts in USDC raw units)
|
|
114
|
+
const juniorToUsdc = await client.fetchUnstakeFee({
|
|
115
|
+
amount: fromUiAmount(5, USD_STAR_DECIMALS),
|
|
116
|
+
early: false,
|
|
117
|
+
targetMint: USDC_MINT,
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
const juniorToUsdcEarly = await client.fetchUnstakeFee({
|
|
121
|
+
amount: fromUiAmount(5, USD_STAR_DECIMALS),
|
|
122
|
+
early: true,
|
|
123
|
+
targetMint: USDC_MINT,
|
|
124
|
+
});
|
|
125
|
+
```
|
|
126
|
+
|
|
95
127
|
### Staking (Junior Tranche)
|
|
96
128
|
|
|
97
129
|
Stake USD\* into the junior tranche to earn leveraged yield. Staked tokens are represented by junior share tokens.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perena/bankineco-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.147",
|
|
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.
|
|
25
|
+
"set-latest": "npm --userconfig ~/.npmrc.perena dist-tag add @perena/bankineco-sdk@1.0.147 latest"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@coral-xyz/anchor": "=0.30.1",
|