0.1.7 • Published 4 years ago

crypto-api-access v0.1.7

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

Crypto Api Access

Api Access is a simple api wrapper for popular cryptocurrency exchanges. It implements various exchange apis and provides standardized way of communication.

Main Motivation behind this library

The aim is being able to swap exchanges without worrying about return types and parameters.

  • I found my self writing the same api calls for most of my projects.
  • Standardize the responses so that don't have to write multiple variants for the same bot.
  • Build a solid foundation for future exchange implementations

Requirements

Nodejs, yarn, and axios

Basic Usage

const {BinancePerpetual, BybitUsdt} = require("./Common");
let binance = new BinancePerpetual("publicKey", "secretKey");
let bybit = new BybitUsdt("publicKey", "secretKey");

Documentation

For each exchange, library offers:

  • getCurrentPrice(symbol) returns orderId or null.
  • placeLimitOrder(symbol, side, quantity, price, timeInForce) returns orderId or null.
  • placeLimitReduceOrder(symbol, side, quantity, price, timeInForce) returns orderId or null.
  • placePostOnlyLimitOrder(symbol, side, quantity, price) returns orderId or null.
  • placePostOnlyLimitReduceOrder(symbol, side, quantity, price) returns orderId or null.
  • placeMarketOrder(symbol, side, quantity) returns orderId or null.
  • placeMarketReduceOrder(symbol, side, quantity) returns orderId or null.
  • cancelSingleOrder(symbol, orderId='', origClientOrderId='') returns true on success.
  • cancelAllOpenOrders(symbol) returns true on success.
  • getPosition(symbol) returns position details or null.
  • getOrderBook(symbol) wip.

Careful when using test cases, as some of them may require some changes due price changes or having open positions. Please look through the file and check comments to see what you might need to change.

Upcoming Features

1) Binance Spot Api 2) Bybit Inverse Api 3) Websocket Stream for Binance 4) Websocket Stream for Bybit

Contributions, Bug report, Missing feature

I am actively working on this library and adding new features as I need them. if you would like to see more features please let me know.
Feel free to file a new issue.

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago