# bitmart-newapi-lite

> New Bitmart API - lite version without error "The request header "X-BM-TIMESTAMP" cannot be empty"

Latest version **1.0.0** (published 2020-08-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install bitmart-newapi-lite
pnpm add bitmart-newapi-lite
yarn add bitmart-newapi-lite
bun add bitmart-newapi-lite
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-08-14 |
| First published | 2020-08-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 8.9 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | JasonZed |
| Maintainers | jasonzed |
| Keywords | npm, bitmart, bitmartapi, bitmart-api, crypto, cryptoapi, crypto-api, bitmart, api, bitmart api, bitmart cloud api, bitmart new api, bitmart new |

## Links

- npm: https://www.npmjs.com/package/bitmart-newapi-lite
- npm.io page: https://npm.io/package/bitmart-newapi-lite

## Dependencies (3)

- [qs](https://npm.io/package/qs.md) ^6.9.4
- [axios](https://npm.io/package/axios.md) ^0.19.2
- [crypto](https://npm.io/package/crypto.md) ^1.0.1

## 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.0.0 (latest) — 2020-08-14

## README

## Usage

```javascript
const { BitmartRestApi } = require('bitmart-newapi-lite');

(async () => {
  const client = new BitmartRestApi('my-api-name', 'my-api-key', 'my-api-secret');

  try {
    // Public api, works without api name, api key and api secret
    await client.ping();
    const time = await client.getTime();
    const serviceStatus = await client.getServiceStatus();
    const currencies = await client.getCurrencies();
    const symbols = await client.getSymbols();
    const symbolsDetails = await client.getSymbolDetails();
    const ticker = await client.getTicker();
    const tickerOfPair = await client.getTicker(symbol = 'BTC_USDT');
    const klineSteps = await client.getKlineSteps(symbol = 'BTC_USDT');
    const kline = await client.getKline(symbol = 'BTC_USDT', from ='1551989741215',to = '1552075987650', step = 15);
    const depth = await client.getDepth(symbol = 'BTC_USDT',precision = 6);
    const tradeHistory = await client.getTrades(symbol = 'BTC_USDT');

    /// Private api, requires api name, api key and api secret

    //FREE VERSION (Bitmart-newAPI-Lite)
    const balance = await client.getBalance();
    const orders = await client.getUserOrders(symbol = 'BTC_USDT',offset = 1,limit = 100, status = 1);
    const personalTradeHistory = await client.getUserTrades(symbol = 'BTC_USDT',offset = 1,limit = 10);
    
    ///PRO VERSION ONLY!!! (Bitmart-newAPI-Full)
    let orderId = await client.createOrder(symbol ='BTC_USDT',amount = 1, price = 10000,side = 'sell');
    await client.cancelOrder(symbol = 'ETH_USDT', order_id = orderId.data.order_id);
    await client.cancelAllOrders(symbol = 'BTC_USDT',side = 'sell');
    const orderDetail = await client.getOrderDetail(symbol = 'BTC_USDT',order_id = orderId.data.order_id);

  } catch (err) {
    console.error(err);
  }
  
})();
```
## Created by JasonZed: 

### This is the lite version of Bitmart API. To own a fully functional version, please contact us by email:
Jasonzed23@gmail.com

or Donate (minimum value: 5 USD):
- BTC: 1AGCzAbnhypTi5rAc1bGv8T1RYq78rp4vD
- USDT (ERC20): 0x9e19165af739a52d7a11ca84f64e5c5a936a40a9 
- ETH: 0x9e19165af739a52d7a11ca84f64e5c5a936a40a9

then send me an email with your donate transaction hash (the tx ID). Thanks!

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