diff --git a/packages/libs/sdk/src/solana/solana.ts b/packages/libs/sdk/src/solana/solana.ts index 50f3d4ae..c098f372 100644 --- a/packages/libs/sdk/src/solana/solana.ts +++ b/packages/libs/sdk/src/solana/solana.ts @@ -128,7 +128,10 @@ export class Solana { feeType: PriorityFeeLevels = 'medium' ) { const { result } = await this.fetchEstimatePriorityFees({}); - const priorityFee = result.per_compute_unit[feeType]; + const priorityFee = feeType === 'recommended' + ? result.recommended + : result.per_compute_unit[feeType]; + const priorityFeeInstruction = ComputeBudgetProgram.setComputeUnitPrice({ microLamports: priorityFee, }); diff --git a/packages/libs/sdk/src/solana/types.ts b/packages/libs/sdk/src/solana/types.ts index c1c004f5..629ad90e 100644 --- a/packages/libs/sdk/src/solana/types.ts +++ b/packages/libs/sdk/src/solana/types.ts @@ -23,7 +23,7 @@ type PercentileRangeUnion = | '95' | '100'; -export type PriorityFeeLevels = 'low' | 'medium' | 'high' | 'extreme'; +export type PriorityFeeLevels = 'low' | 'medium' | 'high' | 'extreme' | 'recommended'; export interface PriorityFeeRequestPayload { method: string; @@ -53,6 +53,7 @@ export interface PriorityFeeResponseData { }; per_compute_unit: PriorityFeeEstimates; per_transaction: PriorityFeeEstimates; + recommended: number; }; id: number; }