@zerochain/0chain
Advanced tools
Comparing version 1.3.55 to 1.3.56
14
index.js
@@ -683,2 +683,16 @@ /* | ||
}, | ||
getAllBlobbersDetails: async function getAllBlobbersDetails() { | ||
const currentBlobbers = await this.getAllBlobbers(); | ||
const detailedBlobbers = currentBlobbers.map((blobber)=>{ | ||
const blobberUrl = new URL(blobber.url) | ||
blobber.convertedUrl = blobberUrl.protocol+'//'+blobberUrl.hostname +'/blobber'+ blobberUrl.port.slice(-2)+'/_statsJSON' | ||
return blobber; | ||
}) | ||
const detailedBlobbersCallingEachApi = await Promise.all(detailedBlobbers.map(async (dBl)=>{ | ||
const blobData = await fetch(dBl.convertedUrl) | ||
const blobJson = await blobData.json() | ||
return {...blobJson,...dBl}; | ||
})) | ||
return detailedBlobbersCallingEachApi ; | ||
}, | ||
@@ -685,0 +699,0 @@ getAllocationSharedFilesFromPath: async function (allocation_id, lookup_hash, client_id, auth_token = "") { |
{ | ||
"name": "@zerochain/0chain", | ||
"version": "1.3.55", | ||
"version": "1.3.56", | ||
"description": "js client library to interact with 0chain Blockchain", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -334,3 +334,5 @@ /* | ||
// Added patch for converting http to https | ||
if (window.location.protocol === 'https:' && consensusResponse.data && consensusResponse.data.blobbers && Array.isArray(consensusResponse.data.blobbers)) { | ||
const isHttpsOrLocal = window.location.protocol === "https" || window.location.hostname === "localhost" | ||
if (isHttpsOrLocal && consensusResponse.data && consensusResponse.data.blobbers && Array.isArray(consensusResponse.data.blobbers)) { | ||
consensusResponse.data.blobbers.forEach((blobber) => { | ||
@@ -341,3 +343,3 @@ let currentURL = new URL(blobber.url); | ||
}); | ||
} else if (window.location.protocol === 'https:' && consensusResponse && consensusResponse.Nodes) { | ||
} else if (isHttpsOrLocal && consensusResponse && consensusResponse.Nodes) { | ||
consensusResponse.Nodes.forEach((blobber) => { | ||
@@ -344,0 +346,0 @@ let currentURL = new URL(blobber.url); |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
180540
13
1817
2