@stabbleorg/anchor-contrib
Advanced tools
Comparing version
@@ -6,3 +6,3 @@ export type PriorityLevel = "None" | "Min" | "Low" | "Medium" | "High" | "VeryHigh" | "UnsafeMax"; | ||
export type GetPriorityFeeEstimateResponse = { | ||
priorityFeeEstimate: number; | ||
priorityFeeEstimate?: number; | ||
}; | ||
@@ -23,1 +23,5 @@ export type TokenAsset = { | ||
}; | ||
/** | ||
* 0xMert suggests to set at least 10,001 lamports as priority fees when sending transactions via Helius | ||
*/ | ||
export declare const HELIUS_MINIMUM_PRIORITY_FEE: number; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.HELIUS_MINIMUM_PRIORITY_FEE = void 0; | ||
/** | ||
* 0xMert suggests to set at least 10,001 lamports as priority fees when sending transactions via Helius | ||
*/ | ||
exports.HELIUS_MINIMUM_PRIORITY_FEE = 10001; | ||
//# sourceMappingURL=helius.js.map |
@@ -19,2 +19,3 @@ "use strict"; | ||
const web3_js_1 = require("@solana/web3.js"); | ||
const helius_1 = require("./helius"); | ||
const safeAmount_1 = require("./safeAmount"); | ||
@@ -148,6 +149,6 @@ class WalletContext { | ||
const { result } = (yield response.json()); | ||
return result.priorityFeeEstimate; | ||
return Math.max(helius_1.HELIUS_MINIMUM_PRIORITY_FEE, Math.trunc(result.priorityFeeEstimate)); | ||
} | ||
catch (err) { | ||
return 0; | ||
return helius_1.HELIUS_MINIMUM_PRIORITY_FEE; | ||
} | ||
@@ -154,0 +155,0 @@ }); |
{ | ||
"name": "@stabbleorg/anchor-contrib", | ||
"version": "0.8.0", | ||
"version": "0.8.1", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
@@ -8,3 +8,3 @@ export type PriorityLevel = "None" | "Min" | "Low" | "Medium" | "High" | "VeryHigh" | "UnsafeMax"; | ||
export type GetPriorityFeeEstimateResponse = { | ||
priorityFeeEstimate: number; | ||
priorityFeeEstimate?: number; | ||
}; | ||
@@ -28,1 +28,6 @@ | ||
}; | ||
/** | ||
* 0xMert suggests to set at least 10,001 lamports as priority fees when sending transactions via Helius | ||
*/ | ||
export const HELIUS_MINIMUM_PRIORITY_FEE: number = 10001; |
@@ -30,3 +30,9 @@ import bs58 from "bs58"; | ||
} from "@solana/web3.js"; | ||
import { HeliusResponse, GetPriorityFeeEstimateResponse, PriorityLevel, SearchAssetsResponse } from "./helius"; | ||
import { | ||
HeliusResponse, | ||
GetPriorityFeeEstimateResponse, | ||
PriorityLevel, | ||
SearchAssetsResponse, | ||
HELIUS_MINIMUM_PRIORITY_FEE, | ||
} from "./helius"; | ||
import { FloatLike, SafeAmount } from "./safeAmount"; | ||
@@ -199,5 +205,6 @@ | ||
const { result } = (await response.json()) as HeliusResponse<GetPriorityFeeEstimateResponse>; | ||
return result.priorityFeeEstimate; | ||
return Math.max(HELIUS_MINIMUM_PRIORITY_FEE, Math.trunc(result.priorityFeeEstimate!)); | ||
} catch (err) { | ||
return 0; | ||
return HELIUS_MINIMUM_PRIORITY_FEE; | ||
} | ||
@@ -204,0 +211,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
40819
2.32%773
2.66%