Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
ethplorer-js
Advanced tools
#ethplorer-js
A promise based Nodejs library to interface with the Ethplorer API
##Usage Import the Libary:
import { Ethplorer } from 'ethplorer-js';
// or
let Ethplorer = require('ethplorer-js').Ethplorer
To initialize:
let api = new Ethplorer('<Your Key Here>');
// or
let api = new Ethplorer(); // will use freekey instead
Then use any of the methods, described here. e.g
api.getTokenInfo(address)
.then(data => {
/*
data is the object returned by the api,
*/
})
Any optional parameters can be passed as an optional argument. e.g
api.getTokenPriceHistoryGrouped(address,{ period: 30 })
.then(data => {
})
// getTop doesn't have an initial argument so the first argument is the optional parameters
api.getTop({limit: 10})
.then(data => {
})
The response object from the functions can be the error object from the Ethplorer API, you can either handle it manually like so:
api.getTokenInfo(address)
.then(data => {
if("error" in data){
// handle the error object
}
else {
// ethplorer data returned from response
}
})
Alternatively
function handleEthplorerError(response){
if("error" in data){
throw data;
}
return data;
}
api.getTokenInfo(address)
.then(handleEthplorerError)
.then(data => {
})
.catch(err => {
// the error here is either the axios error or the error object from ethplorer
})
If you're using Typescript all requests and responses are fully typed according to the Ethplorer API.
Note: If you have any trouble with the typescript autocomplete from the response, you may need to check if the result is an error or not for typehinting to come back, as shown above.
FAQs
A promise based Nodejs library to interface with the Ethplorer API
The npm package ethplorer-js receives a total of 3 weekly downloads. As such, ethplorer-js popularity was classified as not popular.
We found that ethplorer-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.