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

@hawksightco/hawk-sdk

Package Overview
Dependencies
Maintainers
1
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hawksightco/hawk-sdk - npm Package Compare versions

Comparing version 0.0.38 to 0.0.39

22

dist/src/classes/Transaction.js

@@ -160,6 +160,11 @@ "use strict";

const estimate = yield (0, functions_1.getFeeEstimate)(this.generalUtility, priorityLevel, this.txMetadataResponse);
const priorityFeeEstimate = maxPriorityFee !== undefined && maxPriorityFee > 0
? Math.round(Math.min(estimate, maxPriorityFee))
: Math.round(estimate);
// Create priority fee ixs for transaction
// Calculate the total fee in lamports
let totalPriorityFeeLamports = (new bn_js_1.BN(estimate).mul(new bn_js_1.BN(computeUnitLimit)).div(new bn_js_1.BN(1000000))).toNumber();
// If maxPriorityFee is defined and it is less than the total calculated fee, cap it
if (maxPriorityFee !== undefined && maxPriorityFee > 0 && totalPriorityFeeLamports > maxPriorityFee) {
totalPriorityFeeLamports = maxPriorityFee;
}
// Convert the total priority fee back to microLamports per compute unit
const priorityFeePerUnitMicroLamports = (new bn_js_1.BN(totalPriorityFeeLamports).mul(new bn_js_1.BN(1000000)).div(new bn_js_1.BN(computeUnitLimit))).toNumber();
// Create priority fee instructions for transaction
const priorityFeeIxs = [

@@ -171,10 +176,7 @@ web3.ComputeBudgetProgram.setComputeUnitLimit({

// CU * CU PRICE -> 1400000 * feeEstimate.priorityFeeEstimate
microLamports: priorityFeeEstimate,
microLamports: priorityFeePerUnitMicroLamports,
}),
];
this._priorityFeeEstimate = (new bn_js_1.BN(priorityFeeEstimate)
.mul(new bn_js_1.BN(computeUnitLimit))
.div(new bn_js_1.BN(1000000))
.add(new bn_js_1.BN(5000))
.toNumber() / 1000000000).toString();
// Store the total priority fee in lamports
this._priorityFeeEstimate = totalPriorityFeeLamports.toString();
// Append priority fee instruction at the beginning

@@ -181,0 +183,0 @@ this._instructions.unshift(...priorityFeeIxs);

{
"name": "@hawksightco/hawk-sdk",
"version": "0.0.38",
"version": "0.0.39",
"description": "Hawksight v2 SDK",

@@ -5,0 +5,0 @@ "main": "dist/src/index.js",

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