@ignitionfi/spl-stake-pool 1.1.14 → 1.1.16
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 +5 -13
- package/dist/index.browser.cjs.js.map +1 -1
- package/dist/index.browser.esm.js +6 -14
- package/dist/index.browser.esm.js.map +1 -1
- package/dist/index.cjs.js +5 -13
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +6 -14
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +5 -13
- 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/package.json +1 -1
- package/src/index.ts +11 -21
- package/src/instructions.ts +2 -1
package/dist/index.iife.js
CHANGED
|
@@ -22649,6 +22649,7 @@ var solanaStakePool = (function (exports, node_buffer) {
|
|
|
22649
22649
|
{ pubkey: params.wsolTransientAccount, isSigner: false, isWritable: true },
|
|
22650
22650
|
{ pubkey: params.programSigner, isSigner: false, isWritable: true },
|
|
22651
22651
|
{ pubkey: (_a = params.payer) !== null && _a !== void 0 ? _a : params.fundingAccount, isSigner: true, isWritable: true },
|
|
22652
|
+
{ pubkey: ASSOCIATED_TOKEN_PROGRAM_ID, isSigner: false, isWritable: false },
|
|
22652
22653
|
];
|
|
22653
22654
|
if (params.depositAuthority) {
|
|
22654
22655
|
keys.push({
|
|
@@ -23038,13 +23039,11 @@ var solanaStakePool = (function (exports, node_buffer) {
|
|
|
23038
23039
|
const stakePoolAccount = await getStakePoolAccount(connection, stakePoolAddress);
|
|
23039
23040
|
const stakePoolProgramId = getStakePoolProgramId(connection.rpcEndpoint);
|
|
23040
23041
|
const stakePool = stakePoolAccount.account.data;
|
|
23041
|
-
// stakePool.tokenProgramId
|
|
23042
23042
|
const instructions = [];
|
|
23043
|
-
//
|
|
23043
|
+
// The program handles ATA creation internally using funds from the user's deposit
|
|
23044
|
+
// This prevents rent drain attacks where paymaster pays for ATA and user reclaims rent
|
|
23044
23045
|
if (!destinationTokenAccount) {
|
|
23045
|
-
|
|
23046
|
-
instructions.push(createAssociatedTokenAccountIdempotentInstruction(payer !== null && payer !== void 0 ? payer : signerOrSession, associatedAddress, userPubkey, stakePool.poolMint));
|
|
23047
|
-
destinationTokenAccount = associatedAddress;
|
|
23046
|
+
destinationTokenAccount = getAssociatedTokenAddressSync(stakePool.poolMint, userPubkey);
|
|
23048
23047
|
}
|
|
23049
23048
|
const withdrawAuthority = await findWithdrawAuthorityProgramAddress(stakePoolProgramId, stakePoolAddress);
|
|
23050
23049
|
const [programSigner] = PublicKey.findProgramAddressSync([Buffer.from('fogo_session_program_signer')], stakePoolProgramId);
|
|
@@ -23345,14 +23344,7 @@ var solanaStakePool = (function (exports, node_buffer) {
|
|
|
23345
23344
|
const userWsolAccount = getAssociatedTokenAddressSync(NATIVE_MINT, userPubkey);
|
|
23346
23345
|
const instructions = [];
|
|
23347
23346
|
const signers = [];
|
|
23348
|
-
|
|
23349
|
-
// createAssociatedTokenAccountIdempotentInstruction(
|
|
23350
|
-
// signerOrSession,
|
|
23351
|
-
// userWsolAccount,
|
|
23352
|
-
// userPubkey,
|
|
23353
|
-
// NATIVE_MINT,
|
|
23354
|
-
// ),
|
|
23355
|
-
// )
|
|
23347
|
+
instructions.push(createAssociatedTokenAccountIdempotentInstruction(signerOrSession, userWsolAccount, userPubkey, NATIVE_MINT));
|
|
23356
23348
|
const [programSigner] = PublicKey.findProgramAddressSync([Buffer.from('fogo_session_program_signer')], stakePoolProgramId);
|
|
23357
23349
|
const withdrawAuthority = await findWithdrawAuthorityProgramAddress(stakePoolProgramId, stakePoolAddress);
|
|
23358
23350
|
instructions.push(StakePoolInstruction.withdrawWsolWithSession({
|