Skip to content

Commit

Permalink
chore: rename stake for fee ixs
Browse files Browse the repository at this point in the history
  • Loading branch information
dongnguyen9186 committed Oct 29, 2024
1 parent 6e5f10c commit 408c578
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ts-client/src/amm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2445,7 +2445,7 @@ export default class AmmImpl implements AmmImplementation {
const [lockEscrowPK] = deriveLockEscrowPda(this.address, owner, this.program.programId);

const preInstructions: TransactionInstruction[] = [];
const postInstructions: Array<TransactionInstruction> = [];
const stakeForFeeInstructions: Array<TransactionInstruction> = [];

const lockEscrowAccount = await this.program.account.lockEscrow.fetchNullable(lockEscrowPK);
if (!lockEscrowAccount) {
Expand Down Expand Up @@ -2490,7 +2490,7 @@ export default class AmmImpl implements AmmImplementation {
this.poolState.tokenBMint,
);

postInstructions.push(...createFeeVaultIxs);
stakeForFeeInstructions.push(...createFeeVaultIxs);
}

const [lockEscrowFeeVaultPK] = deriveLockEscrowPda(this.address, vaultKey, this.program.programId);
Expand All @@ -2502,7 +2502,7 @@ export default class AmmImpl implements AmmImplementation {
payer,
);

createEscrowFeeVaultAtaIx && postInstructions.push(createEscrowFeeVaultAtaIx);
createEscrowFeeVaultAtaIx && stakeForFeeInstructions.push(createEscrowFeeVaultAtaIx);

const lockTx = await this.program.methods
.lock(feeWrapperLockAmount)
Expand All @@ -2523,7 +2523,7 @@ export default class AmmImpl implements AmmImplementation {
})
.instruction();

postInstructions.push(lockTx);
stakeForFeeInstructions.push(lockTx);
}

const transaction = new Transaction({
Expand All @@ -2549,14 +2549,14 @@ export default class AmmImpl implements AmmImplementation {
aVaultLpMint: this.vaultA.vaultState.lpMint,
bVaultLpMint: this.vaultB.vaultState.lpMint,
})
.postInstructions(postInstructions)
.postInstructions(stakeForFeeInstructions)
.preInstructions(preInstructions)
.transaction();

return transaction.add(lockTx);
}

return transaction.add(...postInstructions);
return transaction.add(...stakeForFeeInstructions);
}

public async claimLockFee(owner: PublicKey, maxAmount: BN): Promise<Transaction> {
Expand Down

0 comments on commit 408c578

Please sign in to comment.