Skip to content

Commit 603bdc1

Browse files
fix(sdk-coin-sol): set prio fees as number
Ticket: CR-1224
1 parent 3b77c20 commit 603bdc1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

modules/sdk-coin-sol/src/lib/tokenTransferBuilder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@ export class TokenTransferBuilder extends TransactionBuilder {
143143
const addPriorityFeeInstruction: SetPriorityFee = {
144144
type: InstructionBuilderTypes.SetPriorityFee,
145145
params: {
146-
fee: this._priorityFee ?? BigInt(0),
146+
fee: this._priorityFee,
147147
},
148148
};
149149

150-
if (!this._priorityFee || this._priorityFee === BigInt(0)) {
150+
if (!this._priorityFee || this._priorityFee === Number(0)) {
151151
this._instructionsData = [...createAtaInstructions, ...sendInstructions];
152152
} else {
153153
// order is important, createAtaInstructions must be before sendInstructions

modules/sdk-coin-sol/src/lib/transactionBuilder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export abstract class TransactionBuilder extends BaseTransactionBuilder {
4141
protected _signers: KeyPair[] = [];
4242
protected _memo?: string;
4343
protected _feePayer?: string;
44-
protected _priorityFee: number | bigint;
44+
protected _priorityFee: number;
4545

4646
constructor(_coinConfig: Readonly<CoinConfig>) {
4747
super(_coinConfig);
@@ -247,7 +247,7 @@ export abstract class TransactionBuilder extends BaseTransactionBuilder {
247247
}
248248

249249
public setPriorityFee(feeOptions: FeeOptions): this {
250-
this._priorityFee = BigInt(feeOptions.amount);
250+
this._priorityFee = Number(feeOptions.amount);
251251
return this;
252252
}
253253

modules/sdk-coin-sol/src/lib/transferBuilderV2.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export class TransferBuilderV2 extends TransactionBuilder {
170170

171171
let addPriorityFeeInstruction: SetPriorityFee;
172172
// If there are createAtaInstructions, then token is involved and we need to add a priority fee instruction
173-
if (!this._priorityFee || this._priorityFee === BigInt(0)) {
173+
if (!this._priorityFee || this._priorityFee === Number(0)) {
174174
this._instructionsData = [...createAtaInstructions, ...sendInstructions];
175175
} else if (
176176
createAtaInstructions.length !== 0 ||
@@ -179,7 +179,7 @@ export class TransferBuilderV2 extends TransactionBuilder {
179179
addPriorityFeeInstruction = {
180180
type: InstructionBuilderTypes.SetPriorityFee,
181181
params: {
182-
fee: this._priorityFee ?? BigInt(0),
182+
fee: this._priorityFee,
183183
},
184184
};
185185
this._instructionsData = [addPriorityFeeInstruction, ...createAtaInstructions, ...sendInstructions];

0 commit comments

Comments
 (0)