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

crosslightning-evm

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crosslightning-evm - npm Package Compare versions

Comparing version 3.0.1 to 3.0.2

1

dist/evm/btcrelay/EVMBtcRelay.d.ts

@@ -56,2 +56,3 @@ /// <reference types="node" />

estimateSynchronizeFee(requiredBlockheight: number): Promise<BN>;
getFeePerBlock(): Promise<BN>;
}

@@ -302,3 +302,24 @@ "use strict";

}
getFeePerBlock() {
return __awaiter(this, void 0, void 0, function* () {
let gasPrice;
try {
const gasPriceData = yield this.provider.provider.getFeeData();
if (gasPriceData.lastBaseFeePerGas != null) {
gasPrice = gasPriceData.lastBaseFeePerGas;
}
else {
gasPrice = gasPriceData.gasPrice;
}
}
catch (e) {
console.error(e);
}
if (gasPrice == null) {
gasPrice = yield this.provider.provider.getGasPrice();
}
return new BN(ethers_1.BigNumber.from(GAS_PER_BLOCKHEADER).mul(gasPrice).toString());
});
}
}
exports.EVMBtcRelay = EVMBtcRelay;

4

package.json
{
"name": "crosslightning-evm",
"version": "3.0.1",
"version": "3.0.2",
"description": "EVM specific base implementation",

@@ -27,3 +27,3 @@ "main": "./dist/index.js",

"bn.js": "^5.2.1",
"crosslightning-base": "^3.0.1",
"crosslightning-base": "^3.0.2",
"ethers": "^5.7.2",

@@ -30,0 +30,0 @@ "typescript": "^4.9.5"

@@ -348,2 +348,25 @@ import {BitcoinRpc, BtcBlock, BtcRelay, StatePredictorUtils} from "crosslightning-base";

async getFeePerBlock(): Promise<BN> {
let gasPrice: BigNumber;
try {
const gasPriceData = await this.provider.provider.getFeeData();
if(gasPriceData.lastBaseFeePerGas!=null) {
gasPrice = gasPriceData.lastBaseFeePerGas;
} else {
gasPrice = gasPriceData.gasPrice;
}
} catch (e) {
console.error(e);
}
if(gasPrice==null) {
gasPrice = await this.provider.provider.getGasPrice();
}
return new BN(BigNumber.from(GAS_PER_BLOCKHEADER).mul(gasPrice).toString());
}
}
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