@ignitionfi/spl-stake-pool 1.1.11 → 1.1.13

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.
@@ -22285,14 +22285,16 @@ var solanaStakePool = (function (exports, node_buffer) {
22285
22285
  index: 27,
22286
22286
  layout: LayoutExports$1.struct([
22287
22287
  LayoutExports$1.u8('instruction'),
22288
- LayoutExports$1.ns64('lamports'),
22288
+ LayoutExports$1.ns64('lamportsIn'),
22289
+ LayoutExports$1.ns64('minimumPoolTokensOut'),
22289
22290
  ]),
22290
22291
  },
22291
22292
  WithdrawWsolWithSession: {
22292
22293
  index: 28,
22293
22294
  layout: LayoutExports$1.struct([
22294
22295
  LayoutExports$1.u8('instruction'),
22295
- LayoutExports$1.ns64('poolTokens'),
22296
+ LayoutExports$1.ns64('poolTokensIn'),
22297
+ LayoutExports$1.ns64('minimumLamportsOut'),
22296
22298
  ]),
22297
22299
  },
22298
22300
  });
@@ -22626,7 +22628,10 @@ var solanaStakePool = (function (exports, node_buffer) {
22626
22628
  static depositWsolWithSession(params) {
22627
22629
  var _a;
22628
22630
  const type = STAKE_POOL_INSTRUCTION_LAYOUTS.DepositWsolWithSession;
22629
- const data = encodeData(type, { lamports: params.lamports });
22631
+ const data = encodeData(type, {
22632
+ lamportsIn: params.lamportsIn,
22633
+ minimumPoolTokensOut: params.minimumPoolTokensOut,
22634
+ });
22630
22635
  const keys = [
22631
22636
  { pubkey: params.stakePool, isSigner: false, isWritable: true },
22632
22637
  { pubkey: params.withdrawAuthority, isSigner: false, isWritable: false },
@@ -22725,7 +22730,10 @@ var solanaStakePool = (function (exports, node_buffer) {
22725
22730
  */
22726
22731
  static withdrawWsolWithSession(params) {
22727
22732
  const type = STAKE_POOL_INSTRUCTION_LAYOUTS.WithdrawWsolWithSession;
22728
- const data = encodeData(type, { poolTokens: params.poolTokens });
22733
+ const data = encodeData(type, {
22734
+ poolTokensIn: params.poolTokensIn,
22735
+ minimumLamportsOut: params.minimumLamportsOut,
22736
+ });
22729
22737
  const keys = [
22730
22738
  { pubkey: params.stakePool, isSigner: false, isWritable: true },
22731
22739
  { pubkey: params.withdrawAuthority, isSigner: false, isWritable: false },
@@ -23018,7 +23026,7 @@ var solanaStakePool = (function (exports, node_buffer) {
23018
23026
  /**
23019
23027
  * Creates instructions required to deposit sol to stake pool.
23020
23028
  */
23021
- async function depositWsolWithSession(connection, stakePoolAddress, signerOrSession, userPubkey, lamports, destinationTokenAccount, referrerTokenAccount, depositAuthority, payer) {
23029
+ async function depositWsolWithSession(connection, stakePoolAddress, signerOrSession, userPubkey, lamports, minimumPoolTokensOut = 0, destinationTokenAccount, referrerTokenAccount, depositAuthority, payer) {
23022
23030
  const wsolTokenAccount = getAssociatedTokenAddressSync(NATIVE_MINT, userPubkey);
23023
23031
  const tokenAccountInfo = await connection.getTokenAccountBalance(wsolTokenAccount, 'confirmed');
23024
23032
  const wsolBalance = tokenAccountInfo
@@ -23050,7 +23058,8 @@ var solanaStakePool = (function (exports, node_buffer) {
23050
23058
  managerFeeAccount: stakePool.managerFeeAccount,
23051
23059
  referralPoolAccount: referrerTokenAccount !== null && referrerTokenAccount !== void 0 ? referrerTokenAccount : destinationTokenAccount,
23052
23060
  poolMint: stakePool.poolMint,
23053
- lamports,
23061
+ lamportsIn: lamports,
23062
+ minimumPoolTokensOut,
23054
23063
  withdrawAuthority,
23055
23064
  depositAuthority,
23056
23065
  wsolMint: NATIVE_MINT,
@@ -23322,7 +23331,7 @@ var solanaStakePool = (function (exports, node_buffer) {
23322
23331
  /**
23323
23332
  * Creates instructions required to withdraw wSOL from a stake pool.
23324
23333
  */
23325
- async function withdrawWsolWithSession(connection, stakePoolAddress, signerOrSession, userPubkey, amount, solWithdrawAuthority) {
23334
+ async function withdrawWsolWithSession(connection, stakePoolAddress, signerOrSession, userPubkey, amount, minimumLamportsOut = 0, solWithdrawAuthority) {
23326
23335
  const stakePoolAccount = await getStakePoolAccount(connection, stakePoolAddress);
23327
23336
  const stakePoolProgramId = getStakePoolProgramId(connection.rpcEndpoint);
23328
23337
  const stakePool = stakePoolAccount.account.data;
@@ -23353,7 +23362,8 @@ var solanaStakePool = (function (exports, node_buffer) {
23353
23362
  solWithdrawAuthority,
23354
23363
  wsolMint: NATIVE_MINT,
23355
23364
  programSigner,
23356
- poolTokens,
23365
+ poolTokensIn: poolTokens,
23366
+ minimumLamportsOut,
23357
23367
  }));
23358
23368
  return {
23359
23369
  instructions,