# @cryptocodes/cryptomarket

> Provides the crypto Market Prices in different markets

Latest version **1.1.3** (published 2022-09-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install @cryptocodes/cryptomarket
pnpm add @cryptocodes/cryptomarket
yarn add @cryptocodes/cryptomarket
bun add @cryptocodes/cryptomarket
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2022-09-06 |
| First published | 2022-08-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mahdi Movassagh |
| Maintainers | movassagh |
| Keywords | Crypto, Market |

## Links

- npm: https://www.npmjs.com/package/@cryptocodes/cryptomarket
- Repository: https://github.com/movassagh/cryptocodes-cryptomarket
- Homepage: https://github.com/movassagh/cryptocodes-cryptomarket#readme
- Issues: https://github.com/movassagh/cryptocodes-cryptomarket/issues
- npm.io page: https://npm.io/package/@cryptocodes/cryptomarket

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.27.2
- [typescript](https://npm.io/package/typescript.md) ^4.7.4

## Alternatives

- [@gemini-wallet/core](https://npm.io/package/@gemini-wallet/core.md) — 515.6K weekly downloads
- [utility](https://npm.io/package/utility.md) — 416.6K weekly downloads
- [@primno/dpapi](https://npm.io/package/@primno/dpapi.md) — 7.2K weekly downloads
- [pi-readseek](https://npm.io/package/pi-readseek.md) — 3.7K weekly downloads
- [@emilia-protocol/verify](https://npm.io/package/@emilia-protocol/verify.md) — 1.1K weekly downloads

## Recent versions

- 1.1.3 (latest) — 2022-09-06
- 1.1.2 — 2022-08-24
- 1.1.1 — 2022-08-24
- 1.1.0 — 2022-08-24
- 1.0.1 — 2022-08-23
- 1.0.0 — 2022-08-21

## README

# 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:

```js
{ symbol: 'ETHBTC', price: '0.07673200' }
```

## Sample Results

[
{ symbol: 'ETHBTC', price: '0.07673200' },\
 { symbol: 'LTCBTC', price: '0.00265000' },\
 { symbol: 'BNBBTC', price: '0.01386600' },\
 { symbol: 'NEOBTC', price: '0.00045800' },\
 { symbol: 'QTUMETH', price: '0.00211900' },\
 { symbol: 'EOSETH', price: '0.00108200' },\
 { symbol: 'SNTETH', price: '0.00001754' },\
 { symbol: 'BNTETH', price: '0.00029800' },\
 { symbol: 'BCCBTC', price: '0.07908100' },\
 { symbol: 'GASBTC', price: '0.00011970' }
]

<br/>

## Install

```js
npm install @cryptocodes/cryptomarket
```

<br/>

## Usage

```js
import market from @cryptocodes/cryptomarket
```
OR
```js
const market = require("@cryptocodes/cryptomarket")
```

<br/>

## getMarket
`getMarket` gets array of crypto prices in specified Market.\
 This function returns `Promise`

</br>

Gets List of crypto prices in `All` markets

```js
const allPrices = await market.getMarket();
```
OR
```js
market
  .getMarket()
  .then((response) => {
    console.log(response);
  })
  .catch((error) => {
    console.log(error);
  });
```

</br></br>
Gets List of crypto prices in `USDT` market

```js
const allPrices = market.getMarket("USDT");
```
OR
```js
market
  .getMarket("USDT")
  .then((response) => {
    console.log(response);
  })
  .catch((error) => {
    console.log(error);
  });
```

</br></br>
Gets List of crypto prices in `BTC` market

```js
const allPrices = market.getMarket("BTC");
```
OR
```js
market
  .getMarket("BTC")
  .then((response) => {
    console.log(response);
  })
  .catch((error) => {
    console.log(error);
  });
```
</br>

> Replace the market argument in `market.getMarket` with the one you need

</br>

## getCoin

`getCoin` gets price of input Coin in specified Market.\
This function returns `Promise`

</br>

Price of Coin `LTC` in Market `USDT`

```js
const ltcPrices = await market.getCoin("LTC", "USDT");
```
OR
```js
market
  .getCoin("LTC", "USDT")
  .then((response) => {
    console.log(response);
  })
  .catch((error) => {
    console.log(error);
  });
```

</br>

Sample result for getCoin
```js
{ symbol: 'LTCUSDT', price: '56.22000000' }
```

<br/>

## 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

---
_Source: https://npm.io/package/@cryptocodes/cryptomarket · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
