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.
coinlib-api
Advanced tools
A Node.js wrapper for the Coinlib API with no dependencies.
A Node.js wrapper for the Coinlib API with no dependencies.
Latest version: 1.0.1
npm install coinlib-api
npm test
For complete API documentation, up-to-date parameters, reponses and errors, please refer to https://coinlib.io/apidocs.
Access to the Coinlib.com API requires a free account. Sign up at https://coinlib.io.
Log into your account and navigate to the profile settings page at https://coinlib.io/profile then find the "API" section at the bottom.
Fill in "Where will you use our API?" and then generate your API key.
//1. Import coinlib-api
const Coinlib = require('coinlib-api');
//2. Initiate the Coinlib API Client with your API key
const CoinlibClient = new Coinlib(COINLIB_API_KEY);
//3. Make calls
var func = async() => {
let data = await CoinlibClient.ping();
};
You'll need to set up a few parameters before using the Coinlib module. Upon instantiation, it's recommended to set the API Key.
The API Key is required to be set before making any valid requests.
CoinlibClient.setKey(COINLIB_API_KEY);
//Alternatively
CoinlibClient.key = COINLIB_API_KEY;
This module provides helper constants for use in calls.
Coinlib.ORDER
Order results in specific calls by using one of the following values.
Key | Usage | Description |
---|---|---|
RANK_ASC | Coinlib.ORDER.RANK_ASC | Order by Coinlib rank (ascending) |
RANK_DESC | Coinlib.ORDER.RANK_DESC | Order by Coinlib rank (descending) |
VOLUME_ASC | Coinlib.ORDER.VOLUME_ASC | Order by volume (ascending) |
VOLUME_DESC | Coinlib.ORDER.VOLUME_DESC | Order by volume (descending) |
PRICE_ASC | Coinlib.ORDER.PRICE_ASC | Order by price (ascending) |
PRICE_DESC | Coinlib.ORDER.PRICE_DESC | Order by price (descending) |
DATE_ADDED_ASC | Coinlib.ORDER.DATE_ADDED_ASC | Order by date added (ascending) |
DATE_ADDED_DESC | Coinlib.ORDER.DATE_ADDED_DESC | Order by date added (descending) |
All calls using the CoinlibClient are asynchronous.
All calls are returned in the following format:
{
success: Boolean,
message: String,
code: Number,
data: Object
}
The Coinlib splits up the currently available calls outline in the official Coinlib API documentation into one parts. (Aside from the global
call.)
Namespace | Usage | Description |
---|---|---|
coins | Coinlib.coins[...] | Calls related to coins |
Global market stats.
global()
Retrieve global market stats.
Params:
params
: Object
- Parameters to pass through to the requestparams.pref
: String
[default: USD
] - Symbol to use for prices and other market valuesUsage Example:
let data = await CoinlibClient.global();
Calls related to coins.
coins.list()
List all supported coins with data - paginated by 100.
Params:
params
: Object
- Parameters to pass through to the requestparams.pref
: String
[default: USD
] - Symbol to use for prices and other market valuesparams.page
: Number
- Starting from 1. Per official documentation: "For now we return 100 results per page, but this may change without warning."params.order
: String
- Order results by Coinlib.ORDER[*]
Usage Example:
let data = await Coinlib.coins.list();
coins.fetchInfo()
Fetch a specific coin's information.
Params:
coinSymbols
: String|Array
- (Required) Single coin symbol or a list of symbols.params
: Object
- Parameters to pass through to the requestparams.pref
: String
[default: USD
] - Symbol to use for prices and other market valuesUsage Example:
let data = await Coinlib.coins.fetchInfo(['BTC', 'ETH']);
//
let data = await Coinlib.coins.fetchInfo('BTC', {
pref: 'USD'
});
Find me on Gab: @markmiscavage.
Tweet at me: @markmiscavage.
MIT License
Copyright (c) 2018 Mark Miscavage
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
A Node.js wrapper for the Coinlib API with no dependencies.
The npm package coinlib-api receives a total of 0 weekly downloads. As such, coinlib-api popularity was classified as not popular.
We found that coinlib-api 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.