@cryptocodes/cryptomarket v1.1.3
cryptocodes-cryptomarket
@cryptocodes-cryptomarket package provides cryptocurrency prices based on different markets
Available markets are USDT, USDC, BTC, ETH, BNB
Results
Result will be array of following object:
{ symbol: 'ETHBTC', price: '0.07673200' }Sample Results
Install
npm install @cryptocodes/cryptomarketUsage
import market from @cryptocodes/cryptomarketOR
const market = require("@cryptocodes/cryptomarket")getMarket
getMarket gets array of crypto prices in specified Market.\
This function returns Promise
Gets List of crypto prices in All markets
const allPrices = await market.getMarket();OR
market
.getMarket()
.then((response) => {
console.log(response);
})
.catch((error) => {
console.log(error);
});
Gets List of crypto prices in USDT market
const allPrices = market.getMarket("USDT");OR
market
.getMarket("USDT")
.then((response) => {
console.log(response);
})
.catch((error) => {
console.log(error);
});
Gets List of crypto prices in BTC market
const allPrices = market.getMarket("BTC");OR
market
.getMarket("BTC")
.then((response) => {
console.log(response);
})
.catch((error) => {
console.log(error);
});Replace the market argument in
market.getMarketwith the one you need
getCoin
getCoin gets price of input Coin in specified Market.\
This function returns Promise
Price of Coin LTC in Market USDT
const ltcPrices = await market.getCoin("LTC", "USDT");OR
market
.getCoin("LTC", "USDT")
.then((response) => {
console.log(response);
})
.catch((error) => {
console.log(error);
});Sample result for getCoin
{ symbol: 'LTCUSDT', price: '56.22000000' }Issues
As this data is being fetch from Binance exchange at the moment, there may be a problem of connection in some countries.\ In this case, uing proxy or VPN would be a soulotion