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

@zerochain/0chain

Package Overview
Dependencies
Maintainers
2
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zerochain/0chain - npm Package Compare versions

Comparing version 1.3.46 to 1.3.47

62

index.js

@@ -535,35 +535,41 @@ /*

const arrPromise = [];
const response = {};
for (let index in miners) {
let isAllSuccess = true;
for (let url in urls) {
await utils.getReq(miners[index] + urls[url], {})
.then((res) => {
let activeUrls;
if (url != "blobbersList") {
let active = activeList[url];
activeUrls = res.data && res.data.Nodes && res.data.Nodes.filter((value) => {
const url = value.simple_miner.host + ":" + value.simple_miner.port;
for (let val of active) {
if (val.indexOf(url) !== -1)
return true
}
return false
})
} else {
activeUrls = res.data.Nodes.filter(
(value) => new Date().getTime() - new Date(value.last_health_check * 1000).getTime() < 3600000
);
}
response[url] = activeUrls
})
.catch((err) => {
response[url] = [];
isAllSuccess = false;
});
const newPr = new Promise((resolve, reject) => {
utils.getReq(miners[index] + urls[url], {})
.then((res) => {
let activeUrls;
if (url != "blobbersList") {
let active = activeList[url];
activeUrls = res.data && res.data.Nodes && res.data.Nodes.filter((value) => {
const url = value.simple_miner.host + ":" + value.simple_miner.port;
for (let val of active) {
if (val.indexOf(url) !== -1)
return true
}
return false
})
} else {
activeUrls = res.data.Nodes.filter(
(value) => new Date().getTime() - new Date(value.last_health_check * 1000).getTime() < 3600000
);
}
resolve({[url]: activeUrls});
})
.catch((err) => {
reject({[url]: []})
});
});
arrPromise.push(newPr);
}
if (isAllSuccess)
break;
}
return response
const res = await Promise.all(arrPromise);
let response = {};
res.forEach(item => {
response = {...response, ...item}
})
return response;
},

@@ -570,0 +576,0 @@

{
"name": "@zerochain/0chain",
"version": "1.3.46",
"version": "1.3.47",
"description": "js client library to interact with 0chain Blockchain",

@@ -13,3 +13,3 @@ "main": "index.js",

"dependencies": {
"axios": "^0.19.0",
"axios": "^0.21.1",
"bip39": "^2.5.0",

@@ -16,0 +16,0 @@ "bls-wasm": "^0.3.0",

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