All Projects → bitoex → Bitopro Api Node

bitoex / Bitopro Api Node

Official nodejs SDK for the Bitopro(幣託) cryptocurrency exchange.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Bitopro Api Node

Huobi python
Python SDK for Huobi Spot API
Stars: ✭ 391 (+1248.28%)
Mutual labels:  cryptocurrency, sdk, exchange
Huobi golang
Go SDK for Huobi Spot API
Stars: ✭ 76 (+162.07%)
Mutual labels:  cryptocurrency, sdk, exchange
Huobi java
Java SDK for Huobi Spot API
Stars: ✭ 180 (+520.69%)
Mutual labels:  cryptocurrency, sdk, exchange
Cryptoinscriber
📈 A live cryptocurrency historical trade data blotter. Download live historical trade data from any cryptoexchange, be it for machine learning, backtesting/visualizing trading strategies or for Quantopian/Zipline.
Stars: ✭ 27 (-6.9%)
Mutual labels:  cryptocurrency, exchange
Crypto Arbitrage
Automatic Cryptocurrency Trading Bot using Triangular or Exchange Arbitrages
Stars: ✭ 369 (+1172.41%)
Mutual labels:  cryptocurrency, exchange
Go Binance
A Go SDK for Binance API
Stars: ✭ 441 (+1420.69%)
Mutual labels:  sdk, exchange
Bitcoinlib
Bitcoin Core RPC compatible, battle-tested .NET library and RPC wrapper for Bitcoin and Altcoins
Stars: ✭ 350 (+1106.9%)
Mutual labels:  cryptocurrency, exchange
Exchangesharp
ExchangeSharp is a powerful, fast and easy to use .NET/C# API for interfacing with many crypto currency exchanges. REST and web sockets are supported.
Stars: ✭ 489 (+1586.21%)
Mutual labels:  cryptocurrency, exchange
Atomicswap
On-chain atomic swaps for Decred and other cryptocurrencies.
Stars: ✭ 485 (+1572.41%)
Mutual labels:  cryptocurrency, exchange
Qtbitcointrader
Secure multi crypto exchange trading client
Stars: ✭ 520 (+1693.1%)
Mutual labels:  cryptocurrency, exchange
Cryptofeed
Cryptocurrency Exchange Websocket Data Feed Handler
Stars: ✭ 643 (+2117.24%)
Mutual labels:  cryptocurrency, exchange
Donut
🏹 Dead-simple cross-platform cryptocurrency tracker.
Stars: ✭ 367 (+1165.52%)
Mutual labels:  cryptocurrency, exchange
Algo Coin
Python library for algorithmic trading cryptocurrencies across multiple exchanges
Stars: ✭ 365 (+1158.62%)
Mutual labels:  cryptocurrency, exchange
Binance.net
.Net API wrapper for the Binance web API
Stars: ✭ 349 (+1103.45%)
Mutual labels:  cryptocurrency, exchange
Awesome Blockchain
Curated list of blockchain services and exchanges 🔥🏦🔥🏦🔥🏦🔥
Stars: ✭ 604 (+1982.76%)
Mutual labels:  cryptocurrency, exchange
Octobot
Cryptocurrency trading bot: high frequency, daily trading, social trading, ...
Stars: ✭ 706 (+2334.48%)
Mutual labels:  cryptocurrency, exchange
Js Stellar Sdk
Main Stellar client library for the Javascript language
Stars: ✭ 488 (+1582.76%)
Mutual labels:  cryptocurrency, sdk
Libra Sdk Go
Go SDK for the Libra cryptocurrency
Stars: ✭ 23 (-20.69%)
Mutual labels:  cryptocurrency, sdk
Ccxws
WebSocket client for 38 cryptocurrency exchanges
Stars: ✭ 341 (+1075.86%)
Mutual labels:  cryptocurrency, exchange
Tribeca
A high frequency, market making cryptocurrency trading platform in node.js
Stars: ✭ 3,646 (+12472.41%)
Mutual labels:  cryptocurrency, exchange

bitopro-api-node

npm version

SDK for the BitoPro API.

Bitopro official API document

Installation

npm install bitopro-api-node

Getting started

Create BitoPro client. Pass api keys only if you are going to do authenticated calls. You can create an api key here.

const BitoPro = require('bitopro-api-node')
const bitopro = new BitoPro('your_api_key', 'your_api_secret', 'your_email')

Limitations

Rate Limit

There is rate limits applied to each API, please check API documentation for more detail.

Precisions

Both price and amount are subject to decimal restrictions, please check official settings for more detail.

Minimum order amount

Checkout the official settings of minimum amount.

Public REST Endpoints

getOrderBook

let getOrderBook = async () => {
  try {
    let book = await bitopro.getOrderBook('btc_twd')
    console.log(book)
  } catch (e) {
    console.log(e)
  }
}

getOrderBook()
Output
{
  "bids": [
    {
      "price": "180500",
      "amount": "0.12817687",
      "count": 1,
      "total": "0.12817687"
    },
    {
      "price": "180010",
      "amount": "0.32292",
      "count": 2,
      "total": "0.45109687"
    },
    {
      "price": "180000",
      "amount": "0.24236",
      "count": 3,
      "total": "0.69345687"
    }
  ],
  "asks": [
    {
      "price": "180599",
      "amount": "0.00326056",
      "count": 1,
      "total": "0.00326056"
    },
    {
      "price": "180600",
      "amount": "0.04202575",
      "count": 1,
      "total": "0.04528631"
    }
  ]
}

getTickers

let getTickers = async () => {
  try {
    // all tickers
    let tickers = await bitopro.getTickers()
    console.log(tickers)

    // single ticker
    let ticker = await bitopro.getTickers('btc_twd')
    console.log(ticker)
  } catch (e) {
    console.log(e)
  }
}

getTickers()
Output
// all tickers
{
  "data": [
    {
      "pair": "xem_btc",
      "lastPrice": "0.00000098",
      "isBuyer": false,
      "priceChange24hr": "0",
      "volume24hr": "0.00000000",
      "high24hr": "0.00000098",
      "low24hr": "0.00000098"
    },
    {
      "pair": "bch_eth",
      "lastPrice": "0.60010000",
      "isBuyer": false,
      "priceChange24hr": "0",
      "volume24hr": "0.00000000",
      "high24hr": "0.60010000",
      "low24hr": "0.60010000"
    },
    {
      "pair": "eth_usdt",
      "lastPrice": "179.22000000",
      "isBuyer": true,
      "priceChange24hr": "10.85",
      "volume24hr": "925.14654180",
      "high24hr": "182.30000000",
      "low24hr": "159.94000000"
    }
  ]
}

// single ticker
{
  "data": {
    "pair": "xem_eth",
    "lastPrice": "0.00010800",
    "isBuyer": false,
    "priceChange24hr": "0",
    "volume24hr": "0.00000000",
    "high24hr": "0.00010800",
    "low24hr": "0.00010800"
  }
}

getTrades

let getTrades = async () => {
  try {
    let trades = await bitopro.getTrades('btc_twd')
    console.log(trades)
  } catch (e) {
    console.log(e)
  }
}

getTrades()
Output
{
  "data": [
    {
      "timestamp": 1557203407,
      "price": "180500.00000000",
      "amount": "0.07717687",
      "isBuyer": false
    },
    {
      "timestamp": 1557203187,
      "price": "180500.00000000",
      "amount": "0.05100000",
      "isBuyer": false
    },
    {
      "timestamp": 1557203053,
      "price": "180500.00000000",
      "amount": "0.01860000",
      "isBuyer": false
    },
    {
      "timestamp": 1557202804,
      "price": "180500.00000000",
      "amount": "0.04781533",
      "isBuyer": false
    },
    {
      "timestamp": 1557202804,
      "price": "180500.00000000",
      "amount": "0.06000000",
      "isBuyer": false
    }
  ]
}

Authenticated REST Endpoints

getAccountBalances

let getAccountBalances = async () => {
  try {
    let balances = await bitopro.getAccountBalances()
    console.log(balances)
  } catch (e) {
    console.log(e)
  }
}

getAccountBalances()
Output
{
  "data": [
    {
      "amount": "10001",
      "available": "1.0",
      "currency": "bito",
      "stake": "10000"
    },
    {
      "amount": "0.0",
      "available": "1.0",
      "currency": "btc",
      "stake": "0"
    },
    {
      "amount": "3.0",
      "available": "0.01",
      "currency": "eth",
      "stake": "0"
    },
    {
      "amount": "30000",
      "available": "2500",
      "currency": "twd",
      "stake": "0"
    }
  ]
}

getOrderHistory

let getOrderHistory = async () => {
  try {
    let history = await bitopro.getOrderHistory()
    console.log(history)
  } catch (e) {
    console.log(e)
  }
}

getOrderHistory()
Output
{
  "data": [
    {
      "action": "buy",
      "avgExecutionPrice": "100000.00000000",
      "bitoFee": "0.00000000",
      "executedAmount": "1.00000000",
      "fee": "0.00100000",
      "feeSymbol": "BTC",
      "id": "123",
      "originalAmount": "1.00000000",
      "pair": "btc_twd",
      "price": "100000.00000000",
      "remainingAmount": "0.00000000",
      "status": 2,
      "timestamp": 1508753757000,
      "type": "limit"
    },
    {
      "action": "buy",
      "avgExecutionPrice": "100000.00000000",
      "bitoFee": "0.00000000",
      "executedAmount": "1.00000000",
      "fee": "0.00200000",
      "feeSymbol": "BTC",
      "id": "456",
      "originalAmount": "1.00000000",
      "pair": "btc_twd",
      "price": "100000.00000000",
      "remainingAmount": "0.00000000",
      "status": 2,
      "timestamp": 1508753787000,
      "type": "limit"
    }
  ]
}

getOrders

let getOrders = async () => {
  try {
    // only fetch active orders
    let orders = await bitopro.getOrders('bito_twd')
    console.log(orders)

    // include history orders
    orders = await bitopro.getOrders('bito_twd', false)
    console.log(orders)

    // with page parameter
    orders = await bitopro.getOrders('bito_twd', false, 1)
    console.log(orders)
  } catch (e) {
    console.log(e)
  }
}

getOrders()
Output
{
  "data": [
    {
      "action": "buy",
      "avgExecutionPrice": "100000.00000000",
      "bitoFee": "0.00000000",
      "executedAmount": "1.00000000",
      "fee": "0.00100000",
      "feeSymbol": "BTC",
      "id": "123",
      "originalAmount": "1.00000000",
      "pair": "btc_twd",
      "price": "100000.00000000",
      "remainingAmount": "0.00000000",
      "status": 2,
      "timestamp": 1508753757000,
      "type": "limit"
    },
    {
      "action": "buy",
      "avgExecutionPrice": "100000.00000000",
      "bitoFee": "0.00000000",
      "executedAmount": "1.00000000",
      "fee": "0.00200000",
      "feeSymbol": "BTC",
      "id": "456",
      "originalAmount": "1.00000000",
      "pair": "btc_twd",
      "price": "100000.00000000",
      "remainingAmount": "0.00000000",
      "status": 2,
      "timestamp": 1508753787000,
      "type": "limit"
    }
  ],
  "page": 1,
  "totalPages": 10
}

createOrder

let createOrder = async () => {
  try {
    let order = {
      pair: 'btc_twd',
      action: 'buy',
      amount: '250',
      price: '0.000075', // no need for market orders
      timestamp: Date.now(),
      type: 'limit' // 'market' for market orders
    }
    let result = await bitopro.createOrder(order)
    console.log(result)
  } catch (e) {
    console.log(e)
  }
}

createOrder()
Output
{
  "action": "buy",
  "amount": "0.235",
  "orderId": "11233456",
  "price": "1.0",
  "timestamp": 1504262258000
}

cancelOrder

let cancelOrder = async () => {
  try {
    let orderID = 123456
    let result = await bitopro.cancelOrder('btc_twd', orderID)
    console.log(result)
  } catch (e) {
    console.log(e)
  }
}

cancelOrder()
Output
{
  "action": "buy",
  "amount": 2.3,
  "orderId": "12234566",
  "price": 1.2,
  "timestamp": 1504262258000
}

getOrder

let getOrder = async () => {
  try {
    let orderID = 123
    let result = await bitopro.getOrder('btc_twd', orderID)
    console.log(result)
  } catch (e) {
    console.log(e)
  }
}

getOrder()
Output
{
  "action": "sell",
  "avgExecutionPrice": "112000.00000000",
  "bitoFee": "103.70370360",
  "executedAmount": "1.00000000",
  "fee": "0.00000000",
  "feeSymbol": "TWD",
  "id": "123",
  "originalAmount": "1.00000000",
  "pair": "btc_twd",
  "price": "112000.00000000",
  "remainingAmount": "0.00000000",
  "status": 2,
  "timestamp": 1508753757000,
  "type": "limit"
}

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/bitoex/bitopro-api-node and this project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

The SDK is available as open source under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].