@orca-so/common-sdk
Advanced tools
Comparing version 0.5.5 to 0.5.6
@@ -8,2 +8,3 @@ import { AddressLookupTableAccount, Connection, PublicKey } from "@solana/web3.js"; | ||
export declare function estimateComputeBudgetLimit(connection: Connection, instructions: Instruction[], lookupTableAccounts: AddressLookupTableAccount[] | undefined, payer: PublicKey, margin: number): Promise<number>; | ||
export declare function getPriorityFeeInLamports(connection: Connection, computeBudgetLimit: number, instructions: Instruction[], percentile: number): Promise<number>; | ||
export declare function getPriorityFeeInLamports(connection: Connection, computeBudgetLimit: number, lockedWritableAccounts: PublicKey[], percentile?: number): Promise<number>; | ||
export declare function getLockWritableAccounts(instructions: Instruction[]): PublicKey[]; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getPriorityFeeInLamports = exports.estimateComputeBudgetLimit = exports.DEFAULT_MAX_COMPUTE_UNIT_LIMIT = exports.DEFAULT_MAX_PRIORITY_FEE_LAMPORTS = exports.DEFAULT_PRIORITY_FEE_PERCENTILE = exports.MICROLAMPORTS_PER_LAMPORT = void 0; | ||
exports.getLockWritableAccounts = exports.getPriorityFeeInLamports = exports.estimateComputeBudgetLimit = exports.DEFAULT_MAX_COMPUTE_UNIT_LIMIT = exports.DEFAULT_MAX_PRIORITY_FEE_LAMPORTS = exports.DEFAULT_PRIORITY_FEE_PERCENTILE = exports.MICROLAMPORTS_PER_LAMPORT = void 0; | ||
const web3_js_1 = require("@solana/web3.js"); | ||
@@ -32,5 +32,5 @@ exports.MICROLAMPORTS_PER_LAMPORT = 1000000; | ||
exports.estimateComputeBudgetLimit = estimateComputeBudgetLimit; | ||
async function getPriorityFeeInLamports(connection, computeBudgetLimit, instructions, percentile) { | ||
async function getPriorityFeeInLamports(connection, computeBudgetLimit, lockedWritableAccounts, percentile = exports.DEFAULT_PRIORITY_FEE_PERCENTILE) { | ||
const recentPriorityFees = await connection.getRecentPrioritizationFees({ | ||
lockedWritableAccounts: getLockWritableAccounts(instructions), | ||
lockedWritableAccounts, | ||
}); | ||
@@ -55,1 +55,2 @@ const priorityFee = getPriorityFeeSuggestion(recentPriorityFees, percentile); | ||
} | ||
exports.getLockWritableAccounts = getLockWritableAccounts; |
@@ -210,3 +210,3 @@ "use strict"; | ||
const percentile = finalComputeBudgetOption.computePricePercentile ?? compute_budget_1.DEFAULT_PRIORITY_FEE_PERCENTILE; | ||
const priorityFee = await (0, compute_budget_1.getPriorityFeeInLamports)(this.connection, computeBudgetLimit, this.instructions, percentile); | ||
const priorityFee = await (0, compute_budget_1.getPriorityFeeInLamports)(this.connection, computeBudgetLimit, (0, compute_budget_1.getLockWritableAccounts)(this.instructions), percentile); | ||
const maxPriorityFeeLamports = finalComputeBudgetOption.maxPriorityFeeLamports ?? compute_budget_1.DEFAULT_MAX_PRIORITY_FEE_LAMPORTS; | ||
@@ -213,0 +213,0 @@ const priorityFeeLamports = Math.min(priorityFee, maxPriorityFeeLamports); |
{ | ||
"name": "@orca-so/common-sdk", | ||
"version": "0.5.5", | ||
"version": "0.5.6", | ||
"description": "Common Typescript components across Orca", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/orca-so/orca-sdks", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
153727
1926