0.0.3 • Published 10 years ago

hitbtc-js v0.0.3

Weekly downloads
6
License
MIT
Repository
github
Last release
10 years ago

hitbtc-js

hitbtc-js is a node wrapper for the HitBTC REST API found here

Usage

require hitbtc-js to begin with:

var HitBTC = require('hitbtc-js');

create an instance

var client = new HitBTC('your_api_key', 'your_api_secret', 'sandbox');

Make a request

client.ticker('BTCEUR', console.log); // prints the ticker for the BTC_EUR currency pair
client.newOrder('11111112', 'BTCUSD', 'buy', '0.1', '100', 'limit', 'GTC', console.log); // adds a buy order

For all response JSON formats, see the github documentation

Constructor

HitBTC (API_Key, API_Secret, API_Type)

Parameter NameParameter TypeDescription
API_KeyStringFind it by making a new API key pair in account settings
API_SecretStringFind it by making a new API key pair in account settings
API_TypeString'live' or 'sandbox'. When testing, you may want to use the sandbox setting but do note that some routes are not supported in sandbox

Supported Currency Pairs

Currency Pair
BTCUSD
BTCEUR
LTCBTC
LTCUSD
LTCEUR
EURUSD
DOGEBTC
XMRBTC

Public API

(-) time (callback)

Status: Implemented

Parameter NameParameter TypeDescription
callbackFunctionA callback function that will be passed the result of API call

(-) symbols (callback)

Status: Implemented

Parameter NameParameter TypeDescription
callbackFunctionA callback function that will be passed the result of API call

(-) ticker (pair, callback)

Status: Implemented

Parameter NameParameter TypeDescription
pairStringThe currency pair that you want the ticker on. See supported currency pairs
callbackFunctionA callback function that will be passed the result of API call

(-) orderbook (symbol, callback)

Status: Implemented

Parameter NameParameter TypeDescription
pairStringThe currency pair that you want the order book for. See supported currency pairs
callbackFunctionA callback function that will be passed the result of API call

(-) trades

Status: Not Implemented

Parameter NameParameter TypeDescription
callbackFunctionA callback function that will be passed the result of API call

Trading API

(-) tradingBalance (callback)

Status: Working in Live

Parameter NameParameter TypeDescription
callbackFunctionA callback function that will be passed the result of API call

(-) activeOrders (pairs, callback)

Status: Working in Live

Parameter NameParameter TypeDescription
pairsStringComma separated currency pairs. See supported currency pairs
callbackFunctionA callback function that will be passed the result of API call

(-) newOrder (clientOrderId, pair, side, price, quantity, type, timeInForce, callback)

Status: Working in Live

Parameter NameParameter TypeDescription
clientOrderIdStringA 8 to 30 numeric string that will be used as the order's ID
pairStringThe currency pair that you want to trade on See supported currency pairs
sideStringbuy or sell
priceDecimalPrice that you want the trade to activate
quantityIntegerAmount of lots to trade
typeStringOnly limit orders are currently supported
timeInForceStringGTC - Good-Till-CancelledIOC - Immediate-Or-CancelFOK - Fill-Or-KillDAY - day orders
callbackFunctionA callback function that will be passed the result of API call

(-) cancelOrder (clientOrderId, cancelRequestClientOrderId, pair, side, callback)

Status: Not Implemented

(-) trades (by, start_index, max_results, symbols, sort, from, till, callback)

Status: Not Implemented

(-) recentOrders (start_index, max_results, symbols, statuses, callback)

Status: Not Implemented

Payment API

(-) paymentBalance (callback)

Status: Works in Live

Parameter NameParameter TypeDescription
callbackFunctionA callback function that will be passed the result of API call

(-) transferToTrading (amount, currency_code, callback)

Status: Not Implemented

(-) transferToMain (amount, currency_code, callback)

Status: Not Implemented

(-) getPaymentAddress (currency_code, callback)

Status: Works in Live

Parameter NameParameter TypeDescription
currency_codeStringValid supported currency code. e.g. BTC
callbackFunctionA callback function that will be passed the result of API call

(-) createPaymentAddress (currency_code, callback)

Status: Not Implemented

(-) payout (amount, currency_code, address)

Status: Not Implemented

(-) transactions (offset, limit, dir)

Status: Not Implemented

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago