@ignitionfi/spl-stake-pool 1.1.23 → 1.1.24
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/dist/index.browser.cjs.js +6 -9
- package/dist/index.browser.cjs.js.map +1 -1
- package/dist/index.browser.esm.js +6 -9
- package/dist/index.browser.esm.js.map +1 -1
- package/dist/index.cjs.js +6 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.esm.js +6 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +6 -9
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/instructions.d.ts +2 -3
- package/package.json +1 -1
- package/src/index.ts +5 -9
- package/src/instructions.ts +2 -5
|
@@ -1574,9 +1574,9 @@ class StakePoolInstruction {
|
|
|
1574
1574
|
}
|
|
1575
1575
|
/**
|
|
1576
1576
|
* Creates a transaction instruction to withdraw WSOL from a stake pool using a session.
|
|
1577
|
+
* Rent for ATA creation (if needed) is paid from the withdrawal amount.
|
|
1577
1578
|
*/
|
|
1578
1579
|
static withdrawWsolWithSession(params) {
|
|
1579
|
-
var _a;
|
|
1580
1580
|
const type = STAKE_POOL_INSTRUCTION_LAYOUTS.WithdrawWsolWithSession;
|
|
1581
1581
|
const data = encodeData(type, {
|
|
1582
1582
|
poolTokensIn: params.poolTokensIn,
|
|
@@ -1597,7 +1597,6 @@ class StakePoolInstruction {
|
|
|
1597
1597
|
{ pubkey: params.tokenProgramId, isSigner: false, isWritable: false },
|
|
1598
1598
|
{ pubkey: params.wsolMint, isSigner: false, isWritable: false },
|
|
1599
1599
|
{ pubkey: params.programSigner, isSigner: false, isWritable: true },
|
|
1600
|
-
{ pubkey: (_a = params.payer) !== null && _a !== void 0 ? _a : params.userTransferAuthority, isSigner: true, isWritable: true },
|
|
1601
1600
|
{ pubkey: params.userWallet, isSigner: false, isWritable: false },
|
|
1602
1601
|
{ pubkey: web3_js.SystemProgram.programId, isSigner: false, isWritable: false },
|
|
1603
1602
|
];
|
|
@@ -1618,6 +1617,7 @@ class StakePoolInstruction {
|
|
|
1618
1617
|
}
|
|
1619
1618
|
/**
|
|
1620
1619
|
* Creates a transaction instruction to withdraw stake from a stake pool using a Fogo session.
|
|
1620
|
+
* The stake account is created as a PDA and rent is paid from the withdrawal amount.
|
|
1621
1621
|
*/
|
|
1622
1622
|
static withdrawStakeWithSession(params) {
|
|
1623
1623
|
const type = STAKE_POOL_INSTRUCTION_LAYOUTS.WithdrawStakeWithSession;
|
|
@@ -1641,7 +1641,6 @@ class StakePoolInstruction {
|
|
|
1641
1641
|
{ pubkey: params.tokenProgramId, isSigner: false, isWritable: false },
|
|
1642
1642
|
{ pubkey: web3_js.StakeProgram.programId, isSigner: false, isWritable: false },
|
|
1643
1643
|
{ pubkey: params.programSigner, isSigner: false, isWritable: false },
|
|
1644
|
-
{ pubkey: params.payer, isSigner: true, isWritable: true },
|
|
1645
1644
|
{ pubkey: web3_js.SystemProgram.programId, isSigner: false, isWritable: false },
|
|
1646
1645
|
];
|
|
1647
1646
|
return new web3_js.TransactionInstruction({
|
|
@@ -2216,8 +2215,9 @@ async function withdrawSol(connection, stakePoolAddress, tokenOwner, solReceiver
|
|
|
2216
2215
|
}
|
|
2217
2216
|
/**
|
|
2218
2217
|
* Creates instructions required to withdraw wSOL from a stake pool.
|
|
2218
|
+
* Rent for ATA creation (if needed) is paid from the withdrawal amount.
|
|
2219
2219
|
*/
|
|
2220
|
-
async function withdrawWsolWithSession(connection, stakePoolAddress, signerOrSession, userPubkey, amount, minimumLamportsOut = 0, solWithdrawAuthority
|
|
2220
|
+
async function withdrawWsolWithSession(connection, stakePoolAddress, signerOrSession, userPubkey, amount, minimumLamportsOut = 0, solWithdrawAuthority) {
|
|
2221
2221
|
const stakePoolAccount = await getStakePoolAccount(connection, stakePoolAddress);
|
|
2222
2222
|
const stakePoolProgramId = getStakePoolProgramId(connection.rpcEndpoint);
|
|
2223
2223
|
const stakePool = stakePoolAccount.account.data;
|
|
@@ -2250,7 +2250,6 @@ async function withdrawWsolWithSession(connection, stakePoolAddress, signerOrSes
|
|
|
2250
2250
|
wsolMint: splToken.NATIVE_MINT,
|
|
2251
2251
|
programSigner,
|
|
2252
2252
|
userWallet: userPubkey,
|
|
2253
|
-
payer,
|
|
2254
2253
|
poolTokensIn: poolTokens,
|
|
2255
2254
|
minimumLamportsOut,
|
|
2256
2255
|
}));
|
|
@@ -2285,13 +2284,12 @@ async function findNextUserStakeSeed(connection, programId, userPubkey, startSee
|
|
|
2285
2284
|
* Withdraws stake from a stake pool using a Fogo session.
|
|
2286
2285
|
*
|
|
2287
2286
|
* The on-chain program creates stake account PDAs, so no pre-creation step is needed.
|
|
2288
|
-
*
|
|
2287
|
+
* Rent for the stake account PDAs is paid from the withdrawal amount.
|
|
2289
2288
|
*
|
|
2290
2289
|
* @param connection - Solana connection
|
|
2291
2290
|
* @param stakePoolAddress - The stake pool to withdraw from
|
|
2292
2291
|
* @param signerOrSession - The session signer public key
|
|
2293
2292
|
* @param userPubkey - User's wallet (used for PDA derivation and token ownership)
|
|
2294
|
-
* @param payer - Payer for stake account rent (paymaster payer in session context)
|
|
2295
2293
|
* @param amount - Amount of pool tokens to withdraw
|
|
2296
2294
|
* @param userStakeSeedStart - Starting seed for user stake PDA derivation (default: 0)
|
|
2297
2295
|
* @param useReserve - Whether to withdraw from reserve (default: false)
|
|
@@ -2299,7 +2297,7 @@ async function findNextUserStakeSeed(connection, programId, userPubkey, startSee
|
|
|
2299
2297
|
* @param minimumLamportsOut - Minimum lamports to receive (slippage protection)
|
|
2300
2298
|
* @param validatorComparator - Optional comparator for validator selection
|
|
2301
2299
|
*/
|
|
2302
|
-
async function withdrawStakeWithSession(connection, stakePoolAddress, signerOrSession, userPubkey,
|
|
2300
|
+
async function withdrawStakeWithSession(connection, stakePoolAddress, signerOrSession, userPubkey, amount, userStakeSeedStart = 0, useReserve = false, voteAccountAddress, minimumLamportsOut = 0, validatorComparator) {
|
|
2303
2301
|
const stakePoolAccount = await getStakePoolAccount(connection, stakePoolAddress);
|
|
2304
2302
|
const stakePoolProgramId = getStakePoolProgramId(connection.rpcEndpoint);
|
|
2305
2303
|
const stakePool = stakePoolAccount.account.data;
|
|
@@ -2377,7 +2375,6 @@ async function withdrawStakeWithSession(connection, stakePoolAddress, signerOrSe
|
|
|
2377
2375
|
poolMint: stakePool.poolMint,
|
|
2378
2376
|
tokenProgramId: stakePool.tokenProgramId,
|
|
2379
2377
|
programSigner,
|
|
2380
|
-
payer,
|
|
2381
2378
|
poolTokensIn: withdrawAccount.poolAmount.toNumber(),
|
|
2382
2379
|
minimumLamportsOut,
|
|
2383
2380
|
userStakeSeed,
|