New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@rosen-bridge/minimum-fee-browser

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rosen-bridge/minimum-fee-browser - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

21

dist/lib/bridgeMinimumFee/BridgeMinimumFee.js

@@ -55,3 +55,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

this.search = function (tokenId) { return __awaiter(_this, void 0, void 0, function () {
var boxes, box, chains, heights, bridgeFees, networkFees, rsnRatios, config, i, chain, chainConfig, j, height, e_1;
var tokenIds, allowedTokenCount_1, fetchedBoxes, boxes, box, chains, heights, bridgeFees, networkFees, rsnRatios, config, i, chain, chainConfig, j, height, e_1;
var _a, _b, _c, _d, _e;

@@ -62,11 +62,18 @@ return __generator(this, function (_f) {

_f.trys.push([0, 2, , 3]);
return [4 /*yield*/, this.explorer.boxSearch(this.feeConfigErgoTreeTemplateHash, [this.feeConfigTokenId, tokenId])];
tokenIds = [this.feeConfigTokenId];
allowedTokenCount_1 = 1;
if (tokenId !== 'erg') {
tokenIds.push(tokenId);
allowedTokenCount_1++;
}
return [4 /*yield*/, this.explorer.boxSearch(this.feeConfigErgoTreeTemplateHash, tokenIds)];
case 1:
boxes = _f.sent();
fetchedBoxes = _f.sent();
boxes = fetchedBoxes.items.filter(function (box) { return box.assets.length <= allowedTokenCount_1; });
// appropriate log or error for suspects cases
if (boxes.total < 1)
if (boxes.length < 1)
throw Error("Found no config box");
if (boxes.total > 1)
throw Error("Found more than one config box. Ids: ".concat(boxes.items.map(function (box) { return box.boxId; })));
box = ErgoBox.from_json(JsonBI.stringify(boxes.items[0]));
if (boxes.length > 1)
throw Error("Found more than one config box. Ids: ".concat(boxes.map(function (box) { return box.boxId; })));
box = ErgoBox.from_json(JsonBI.stringify(boxes[0]));
chains = (_a = box.register_value(4)) === null || _a === void 0 ? void 0 : _a.to_coll_coll_byte();

@@ -73,0 +80,0 @@ heights = (_b = box

{
"name": "@rosen-bridge/minimum-fee-browser",
"version": "0.1.1",
"version": "0.1.2",
"description": "this project gets minimum fee of the bridge for supported tokens from blockchain",

@@ -5,0 +5,0 @@ "main": "dist/lib/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