Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@orca-so/common-sdk

Package Overview
Dependencies
Maintainers
0
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orca-so/common-sdk - npm Package Compare versions

Comparing version 0.6.3 to 0.6.4-alpha-1

13

dist/web3/transactions/transactions-builder.d.ts

@@ -125,2 +125,15 @@ import { AddressLookupTableAccount, Commitment, Connection, PublicKey, RecentPrioritizationFees, SendOptions, Signer, Transaction, VersionedTransaction } from "@solana/web3.js";

/**
* Estimates the fee for this transaction
* @param getPriorityFeePerUnit - A function to get the priority fee per unit
* @param computeLimitMargin - The margin for the compute budget limit
* @param selectionPercentile - The percentile to use when calculating the priority fee
* @param lookupTableAccounts - The lookup table accounts that will be used in the transaction
* @returns An object containing the estimated values for consumed compute units, priority fee per unit in lamports, and the total priority fee in lamports
*/
estimateFee(getPriorityFeePerUnit?: (lockedWritableAccounts: PublicKey[]) => Promise<RecentPrioritizationFees[]>, computeLimitMargin?: number, selectionPercentile?: number, lookupTableAccounts?: AddressLookupTableAccount[]): Promise<{
estConsumedComputeUnits: number;
estPriorityFeePerUnitInLamports: RecentPrioritizationFees[];
estPriorityFeeInLamports: number;
}>;
/**
* Constructs a transaction payload with the gathered instructions

@@ -127,0 +140,0 @@ * @param userOptions - Options to override the default build options

@@ -193,2 +193,25 @@ "use strict";

/**
* Estimates the fee for this transaction
* @param getPriorityFeePerUnit - A function to get the priority fee per unit
* @param computeLimitMargin - The margin for the compute budget limit
* @param selectionPercentile - The percentile to use when calculating the priority fee
* @param lookupTableAccounts - The lookup table accounts that will be used in the transaction
* @returns An object containing the estimated values for consumed compute units, priority fee per unit in lamports, and the total priority fee in lamports
*/
async estimateFee(getPriorityFeePerUnit, computeLimitMargin, selectionPercentile, lookupTableAccounts) {
const estConsumedComputeUnits = await (0, compute_budget_1.estimateComputeBudgetLimit)(this.connection, this.instructions, lookupTableAccounts, this.wallet.publicKey, computeLimitMargin ?? 0.1);
const lockedWritableAccounts = (0, compute_budget_1.getLockWritableAccounts)(this.instructions);
const estPriorityFeePerUnitInLamports = await (getPriorityFeePerUnit
? getPriorityFeePerUnit(lockedWritableAccounts)
: this.connection.getRecentPrioritizationFees({
lockedWritableAccounts,
}));
const estPriorityFeeInLamports = await (0, compute_budget_1.getPriorityFeeInLamports)(this.connection, estConsumedComputeUnits, lockedWritableAccounts, selectionPercentile ?? compute_budget_1.DEFAULT_PRIORITY_FEE_PERCENTILE, getPriorityFeePerUnit);
return {
estConsumedComputeUnits,
estPriorityFeePerUnitInLamports,
estPriorityFeeInLamports,
};
}
/**
* Constructs a transaction payload with the gathered instructions

@@ -195,0 +218,0 @@ * @param userOptions - Options to override the default build options

4

package.json
{
"name": "@orca-so/common-sdk",
"version": "0.6.3",
"version": "0.6.4-alpha-1",
"description": "Common Typescript components across Orca",

@@ -38,2 +38,2 @@ "repository": "https://github.com/orca-so/orca-sdks",

]
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc