From ade004ae419b52f4aa4919d0b134c6add4f94c36 Mon Sep 17 00:00:00 2001 From: Vijay Jagannathan Date: Tue, 21 Jan 2025 23:56:38 +0530 Subject: [PATCH] feat(sdk-coin-sol): ignore zero value prio fee Ticket: CR-1224 --- modules/sdk-coin-sol/src/lib/tokenTransferBuilder.ts | 2 +- modules/sdk-coin-sol/src/lib/transferBuilderV2.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/sdk-coin-sol/src/lib/tokenTransferBuilder.ts b/modules/sdk-coin-sol/src/lib/tokenTransferBuilder.ts index 0ce0d9f945..b5866957ac 100644 --- a/modules/sdk-coin-sol/src/lib/tokenTransferBuilder.ts +++ b/modules/sdk-coin-sol/src/lib/tokenTransferBuilder.ts @@ -147,7 +147,7 @@ export class TokenTransferBuilder extends TransactionBuilder { }, }; - if (!this._priorityFee) { + if (!this._priorityFee || this._priorityFee === BigInt(0)) { this._instructionsData = [...createAtaInstructions, ...sendInstructions]; } else { // order is important, createAtaInstructions must be before sendInstructions diff --git a/modules/sdk-coin-sol/src/lib/transferBuilderV2.ts b/modules/sdk-coin-sol/src/lib/transferBuilderV2.ts index ead9508e68..e121b320c3 100644 --- a/modules/sdk-coin-sol/src/lib/transferBuilderV2.ts +++ b/modules/sdk-coin-sol/src/lib/transferBuilderV2.ts @@ -170,7 +170,7 @@ export class TransferBuilderV2 extends TransactionBuilder { let addPriorityFeeInstruction: SetPriorityFee; // If there are createAtaInstructions, then token is involved and we need to add a priority fee instruction - if (!this._priorityFee) { + if (!this._priorityFee || this._priorityFee === BigInt(0)) { this._instructionsData = [...createAtaInstructions, ...sendInstructions]; } else if ( createAtaInstructions.length !== 0 ||