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

banano-nft-crawler

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

banano-nft-crawler - npm Package Compare versions

Comparing version 1.1.15 to 1.1.16

110

dist/mint-blocks-crawler.js

@@ -78,3 +78,3 @@ "use strict";

return __awaiter(this, void 0, void 0, function () {
var banCrawler, blockOffset, error_1, banCrawler_1, banCrawler_1_1, block, e_1_1;
var banCrawler, blockOffset, error_1, banCrawler_1, banCrawler_1_1, block, e_1_1, error_2;
return __generator(this, function (_b) {

@@ -103,8 +103,11 @@ switch (_b.label) {

case 4:
_b.trys.push([4, 9, 10, 15]);
_b.trys.push([4, 17, , 18]);
_b.label = 5;
case 5:
_b.trys.push([5, 10, 11, 16]);
banCrawler_1 = __asyncValues(banCrawler);
_b.label = 5;
case 5: return [4 /*yield*/, banCrawler_1.next()];
case 6:
if (!(banCrawler_1_1 = _b.sent(), !banCrawler_1_1.done)) return [3 /*break*/, 8];
_b.label = 6;
case 6: return [4 /*yield*/, banCrawler_1.next()];
case 7:
if (!(banCrawler_1_1 = _b.sent(), !banCrawler_1_1.done)) return [3 /*break*/, 9];
block = banCrawler_1_1.value;

@@ -118,3 +121,3 @@ if (blockOffset === 0) {

this._finishedSupply = true;
return [3 /*break*/, 8];
return [3 /*break*/, 9];
}

@@ -124,3 +127,3 @@ else if (blockOffset === 1) {

this._finishedSupply = true;
return [3 /*break*/, 8];
return [3 /*break*/, 9];
}

@@ -137,3 +140,3 @@ else {

this._finishedSupply = true;
return [3 /*break*/, 8];
return [3 /*break*/, 9];
}

@@ -160,25 +163,29 @@ else {

this._finishedSupply = true;
return [3 /*break*/, 8];
return [3 /*break*/, 9];
}
blockOffset = blockOffset + 1;
_b.label = 7;
case 7: return [3 /*break*/, 5];
case 8: return [3 /*break*/, 15];
case 9:
_b.label = 8;
case 8: return [3 /*break*/, 6];
case 9: return [3 /*break*/, 16];
case 10:
e_1_1 = _b.sent();
e_1 = { error: e_1_1 };
return [3 /*break*/, 15];
case 10:
_b.trys.push([10, , 13, 14]);
if (!(banCrawler_1_1 && !banCrawler_1_1.done && (_a = banCrawler_1.return))) return [3 /*break*/, 12];
return [3 /*break*/, 16];
case 11:
_b.trys.push([11, , 14, 15]);
if (!(banCrawler_1_1 && !banCrawler_1_1.done && (_a = banCrawler_1.return))) return [3 /*break*/, 13];
return [4 /*yield*/, _a.call(banCrawler_1)];
case 11:
case 12:
_b.sent();
_b.label = 12;
case 12: return [3 /*break*/, 14];
case 13:
_b.label = 13;
case 13: return [3 /*break*/, 15];
case 14:
if (e_1) throw e_1.error;
return [7 /*endfinally*/];
case 14: return [7 /*endfinally*/];
case 15: return [2 /*return*/];
case 15: return [7 /*endfinally*/];
case 16: return [3 /*break*/, 18];
case 17:
error_2 = _b.sent();
throw (error_2);
case 18: return [2 /*return*/];
}

@@ -192,3 +199,3 @@ });

return __awaiter(this, void 0, void 0, function () {
var banCrawler, error_2, banCrawler_2, banCrawler_2_1, block, e_2_1;
var banCrawler, error_3, banCrawler_2, banCrawler_2_1, block, e_2_1, error_4;
return __generator(this, function (_b) {

@@ -219,16 +226,19 @@ switch (_b.label) {

case 3:
error_2 = _b.sent();
this._errors.push(error_2);
error_3 = _b.sent();
this._errors.push(error_3);
return [2 /*return*/];
case 4:
_b.trys.push([4, 9, 10, 15]);
_b.trys.push([4, 17, , 18]);
_b.label = 5;
case 5:
_b.trys.push([5, 10, 11, 16]);
banCrawler_2 = __asyncValues(banCrawler);
_b.label = 5;
case 5: return [4 /*yield*/, banCrawler_2.next()];
case 6:
if (!(banCrawler_2_1 = _b.sent(), !banCrawler_2_1.done)) return [3 /*break*/, 8];
_b.label = 6;
case 6: return [4 /*yield*/, banCrawler_2.next()];
case 7:
if (!(banCrawler_2_1 = _b.sent(), !banCrawler_2_1.done)) return [3 /*break*/, 9];
block = banCrawler_2_1.value;
if (this.parseFinishSupplyBlock(block)) {
this._finishedSupply = true;
return [3 /*break*/, 8];
return [3 /*break*/, 9];
}

@@ -248,24 +258,28 @@ else if (block.representative === this._metadataRepresentative) {

this._finishedSupply = true;
return [3 /*break*/, 8];
return [3 /*break*/, 9];
}
_b.label = 7;
case 7: return [3 /*break*/, 5];
case 8: return [3 /*break*/, 15];
case 9:
_b.label = 8;
case 8: return [3 /*break*/, 6];
case 9: return [3 /*break*/, 16];
case 10:
e_2_1 = _b.sent();
e_2 = { error: e_2_1 };
return [3 /*break*/, 15];
case 10:
_b.trys.push([10, , 13, 14]);
if (!(banCrawler_2_1 && !banCrawler_2_1.done && (_a = banCrawler_2.return))) return [3 /*break*/, 12];
return [3 /*break*/, 16];
case 11:
_b.trys.push([11, , 14, 15]);
if (!(banCrawler_2_1 && !banCrawler_2_1.done && (_a = banCrawler_2.return))) return [3 /*break*/, 13];
return [4 /*yield*/, _a.call(banCrawler_2)];
case 11:
case 12:
_b.sent();
_b.label = 12;
case 12: return [3 /*break*/, 14];
case 13:
_b.label = 13;
case 13: return [3 /*break*/, 15];
case 14:
if (e_2) throw e_2.error;
return [7 /*endfinally*/];
case 14: return [7 /*endfinally*/];
case 15: return [2 /*return*/];
case 15: return [7 /*endfinally*/];
case 16: return [3 /*break*/, 18];
case 17:
error_4 = _b.sent();
throw (error_4);
case 18: return [2 /*return*/];
}

@@ -272,0 +286,0 @@ });

@@ -66,3 +66,3 @@ "use strict";

return __awaiter(this, void 0, void 0, function () {
var banCrawler, error_1, supplyBlocks, frontierCheckedBlock, metadataRepresentatives, banCrawler_1, banCrawler_1_1, followedByBlock, e_1_1;
var banCrawler, error_1, supplyBlocks, frontierCheckedBlock, metadataRepresentatives, banCrawler_1, banCrawler_1_1, followedByBlock, e_1_1, error_2;
return __generator(this, function (_b) {

@@ -90,8 +90,11 @@ switch (_b.label) {

case 5:
_b.trys.push([5, 10, 11, 16]);
_b.trys.push([5, 18, , 19]);
_b.label = 6;
case 6:
_b.trys.push([6, 11, 12, 17]);
banCrawler_1 = __asyncValues(banCrawler);
_b.label = 6;
case 6: return [4 /*yield*/, banCrawler_1.next()];
case 7:
if (!(banCrawler_1_1 = _b.sent(), !banCrawler_1_1.done)) return [3 /*break*/, 9];
_b.label = 7;
case 7: return [4 /*yield*/, banCrawler_1.next()];
case 8:
if (!(banCrawler_1_1 = _b.sent(), !banCrawler_1_1.done)) return [3 /*break*/, 10];
followedByBlock = banCrawler_1_1.value;

@@ -112,22 +115,26 @@ if (this.validateSupplyBlock(frontierCheckedBlock, followedByBlock, metadataRepresentatives)) {

}
_b.label = 8;
case 8: return [3 /*break*/, 6];
case 9: return [3 /*break*/, 16];
case 10:
_b.label = 9;
case 9: return [3 /*break*/, 7];
case 10: return [3 /*break*/, 17];
case 11:
e_1_1 = _b.sent();
e_1 = { error: e_1_1 };
return [3 /*break*/, 16];
case 11:
_b.trys.push([11, , 14, 15]);
if (!(banCrawler_1_1 && !banCrawler_1_1.done && (_a = banCrawler_1.return))) return [3 /*break*/, 13];
return [3 /*break*/, 17];
case 12:
_b.trys.push([12, , 15, 16]);
if (!(banCrawler_1_1 && !banCrawler_1_1.done && (_a = banCrawler_1.return))) return [3 /*break*/, 14];
return [4 /*yield*/, _a.call(banCrawler_1)];
case 12:
case 13:
_b.sent();
_b.label = 13;
case 13: return [3 /*break*/, 15];
case 14:
_b.label = 14;
case 14: return [3 /*break*/, 16];
case 15:
if (e_1) throw e_1.error;
return [7 /*endfinally*/];
case 15: return [7 /*endfinally*/];
case 16:
case 16: return [7 /*endfinally*/];
case 17: return [3 /*break*/, 19];
case 18:
error_2 = _b.sent();
throw (error_2);
case 19:
this.supplyBlocks = supplyBlocks;

@@ -134,0 +141,0 @@ this.metadataRepresentatives = metadataRepresentatives;

{
"name": "banano-nft-crawler",
"version": "1.1.15",
"version": "1.1.16",
"description": "Library for crawling across the Banano ledger to trace NFTs.",

@@ -5,0 +5,0 @@ "files": [

@@ -68,48 +68,52 @@ import { INanoBlock, TAccount, TBlockHash } from "nano-account-crawler/dist/nano-interfaces";

// Crawl forward in issuer account from supply block
for await (const block of banCrawler) {
if (blockOffset === 0) {
if (!this.parseSupplyBlock(block)) {
throw Error(`SupplyBlockError: Unable to parse supply block: ${block.hash}`);
}
try {
for await (const block of banCrawler) {
if (blockOffset === 0) {
if (!this.parseSupplyBlock(block)) {
throw Error(`SupplyBlockError: Unable to parse supply block: ${block.hash}`);
}
} else if (this.parseFinishSupplyBlock(block)) {
this._finishedSupply = true;
break;
} else if (blockOffset === 1) {
if (block.representative === CANCEL_SUPPLY_REPRESENTATIVE) {
} else if (this.parseFinishSupplyBlock(block)) {
this._finishedSupply = true;
break;
} else {
} else if (blockOffset === 1) {
if (block.representative === CANCEL_SUPPLY_REPRESENTATIVE) {
this._finishedSupply = true;
break;
} else {
try {
validateMintBlock(block as IMintBlock);
this.parseFirstMint(block);
this._mintBlocks.push(block);
this._mintBlockCount++;
} catch (error) {
if (error.message.match(/^MintBlockError\:/)) {
this._finishedSupply = true;
break;
} else {
throw error;
}
}
};
} else if (blockOffset > 1 && block.representative === this._metadataRepresentative) {
try {
validateMintBlock(block as IMintBlock);
this.parseFirstMint(block);
this._mintBlocks.push(block);
this._mintBlockCount++;
this.addMintBlock(block);
} catch (error) {
if (error.message.match(/^MintBlockError\:/)) {
this._finishedSupply = true;
break;
} else {
if (!error.message.match(/^MintBlockError\:/)) {
throw error;
}
}
};
}
} else if (blockOffset > 1 && block.representative === this._metadataRepresentative) {
try {
validateMintBlock(block as IMintBlock);
this.addMintBlock(block);
} catch (error) {
if (!error.message.match(/^MintBlockError\:/)) {
throw error;
}
if (this.supplyExceeded()) {
this._finishedSupply = true;
break;
}
blockOffset = blockOffset + 1;
}
if (this.supplyExceeded()) {
this._finishedSupply = true;
break;
}
blockOffset = blockOffset + 1;
} catch(error) {
throw(error);
}

@@ -135,22 +139,26 @@ }

// Crawl forward in issuer account from supply block
for await (const block of banCrawler) {
if (this.parseFinishSupplyBlock(block)) {
this._finishedSupply = true;
break;
} else if (block.representative === this._metadataRepresentative) {
try {
validateMintBlock(block as IMintBlock);
this.addMintBlock(block);
} catch (error) {
if (!error.message.match(/^MintBlockError\:/)) {
throw error;
try {
for await (const block of banCrawler) {
if (this.parseFinishSupplyBlock(block)) {
this._finishedSupply = true;
break;
} else if (block.representative === this._metadataRepresentative) {
try {
validateMintBlock(block as IMintBlock);
this.addMintBlock(block);
} catch (error) {
if (!error.message.match(/^MintBlockError\:/)) {
throw error;
}
}
}
}
if (this.supplyExceeded()) {
this._finishedSupply = true;
break;
if (this.supplyExceeded()) {
this._finishedSupply = true;
break;
}
}
} catch(error) {
throw(error);
}

@@ -157,0 +165,0 @@ }

@@ -47,18 +47,22 @@ import { INanoBlock, TAccount, TBlockHash, TStringBigInt } from "nano-account-crawler/dist/nano-interfaces";

// Crawl forward from frontier in issuer account
for await (const followedByBlock of banCrawler) {
if (this.validateSupplyBlock(frontierCheckedBlock, followedByBlock, metadataRepresentatives)) {
supplyBlocks.push(frontierCheckedBlock);
metadataRepresentatives.push(followedByBlock.representative);
}
try {
// Crawl forward from frontier in issuer account
for await (const followedByBlock of banCrawler) {
if (this.validateSupplyBlock(frontierCheckedBlock, followedByBlock, metadataRepresentatives)) {
supplyBlocks.push(frontierCheckedBlock);
metadataRepresentatives.push(followedByBlock.representative);
}
// Cache followedByBlock that is ahead of block in next iteration
frontierCheckedBlock = followedByBlock;
this._head = frontierCheckedBlock.hash;
this._headHeight = parseInt(frontierCheckedBlock.height);
if (this.validateSupplyRepresentative(frontierCheckedBlock.representative)) {
this._offset = "-1";
} else {
this._offset = "0";
// Cache followedByBlock that is ahead of block in next iteration
frontierCheckedBlock = followedByBlock;
this._head = frontierCheckedBlock.hash;
this._headHeight = parseInt(frontierCheckedBlock.height);
if (this.validateSupplyRepresentative(frontierCheckedBlock.representative)) {
this._offset = "-1";
} else {
this._offset = "0";
}
}
} catch(error) {
throw(error);
}

@@ -65,0 +69,0 @@

Sorry, the diff of this file is not supported yet

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