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.
coincodex-api
Advanced tools
A Node.js wrapper for the CoinCodex API with no dependencies.
A Node.js wrapper for the CoinCodex API with no dependencies.
Latest version: 1.0.0
npm install coincodex-api
For complete API documentation, up-to-date parameters, responses and errors, please refer to https://coincodex.com/page/api.
//1. Import coincodex-api
const CoinCodex = require('coincodex-api');
//2. Initiate the CoinCodex API Client
const CoinCodexClient = new CoinCodex();
//3. Make calls
var func = async() => {
let data = await CoinCodexClient.coins.fetch('btc');
};
All calls using the CoinCodexClient are asynchronous.
All calls are returned in the following format:
{
success: Boolean,
message: String,
code: Number,
data: Object
}
The CoinCodexClient splits up the currently available calls outline in the official CoinCodex API documentation into two parts. (Including firstPageHistory()
)
Namespace | Usage | Description |
---|---|---|
coins | CoinCodexClient.coins[...] | Calls related to coins |
Returns historic data for coins needed to draw the graph on the frontpage.
firstPageHistory()
Check API server status.
Params:
params
: Object
- Parameters to pass through to the requestparams.days
: String|Number
- (Required) The number of days we need the history forparams.coins_limit
: String|Number
- (Required) The number of top coins (by market cap) must be returnedparams.samples
String|Number
[default: 1
] - How many price values between the start_date and end_date to be included in the results.Usage Example:
let data = await CoinCodexClient.firstPageHistory();
Calls related to coins.
coins.all()
Returns all coins on the platform with properties that are needed to display them on the frontpage.
Usage Example:
let data = await CoinCodexClient.coins.all();
coins.fetch()
Returns all properties for the coin needed to display the coin details page.
Params:
coinId
: String
- (Required) The unique internal id for the coinUsage Example:
let data = await CoinCodexClient.coins.fetch('btc');
coins.fetchHistory()
Returns historical price data for a single coin.
Params:
coinId
: String
- (Required) The unique internal id for the coinparams
: Object
- Parameters to pass through to the requestparams.start_date
: String
- (Required) The start date of the historical data snapshot in YYYY-MM-DD e.g. 2018-01-01
params.end_date
: String
- (Required) The start date of the historical data snapshot in YYYY-MM-DD e.g. 2018-01-31
params.samples
: String|Number
[default: 1
] - How many price values between the start_date
and end_date
to be included in the results. (e.g. if start_date
: 2018-01-01
, end_date
: 2018-01-31
, samples
: 1
. Only 1
value will be returned. If samples
: 30
, 30
values will be returned)Usage Example:
let data = await CoinCodexClient.coins.fetchHistory('btc', {
start_date: '2018-01-01',
end_date: '2018-01-31',
samples: 30,
});
coins.markets()
Returns exchanges and markets for a coin.
Params:
coinId
: String
- (Required) The unique internal id for the coinUsage Example:
let data = await CoinCodexClient.coins.markets('btc');
coins.ranges()
Returns min and max ranges of given coinId(s) for 1 hour, 1 day, 7 day, 30 day, 90 day, 180 day, year to date, last 365 days and all time.
Params:
coinIds
: String|Array
- (Required) A comma separated string or array of the unique internal id(s) for coin(s)Usage Example:
//Single
let data = await CoinCodexClient.coins.ranges('btc');
//Multiple
let data = await CoinCodexClient.coins.ranges(['btc', 'eth']);
//Multiple alternative
let data = await CoinCodexClient.coins.ranges('btc,eth');
Find me on Gab: @markmiscavage.
Tweet at me: @markmiscavage.
MIT License
Copyright (c) 2019 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 CoinCodex API with no dependencies.
We found that coincodex-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.