Commit Graph

265 Commits

Author SHA1 Message Date
Ryan O'Hara-Reid
41415ca3b9 Websocket update increasing exchange coverage and bug fixes (#233)
Websocket update increasing exchange coverage and bug fixes
2019-01-23 14:23:11 +11:00
Adrian Gallagher
7413fc41b8 Cleanup non-needed log.Fatal's in various files 2019-01-17 14:10:56 +11:00
Ryan O'Hara-Reid
84a67359c9 Deposit address wrapper Update (#232)
* Add get deposit address and fix authentication issue for ZB exchange

*  Add get deposit address for Yobit exchange

* Add get deposit address for Poloniex exchange

* Add get deposit address for LocalBitcoins exchange

* Remove support for deposit address on Liqui exchange

*  Add get deposit address for LakeBTC exchange

* Add notes as to the reason of non implementation

* Add get deposit address for Kraken exchange

* Add get deposit address for HitBTC exchange

*  Add get deposit address for GateIO exchange

* Add get deposit address for Exmo exchange

*  Remove support for deposit address on Coinut exchange

* Add test case for BTC Markets function still not supported yet.

*  Add get deposit address for Bittrex exchange

* Add get deposit address for Bitstamp exchange

* Add get deposit address for Bitmex exchange
Rm unused swagger.json file in Bitmex exchange

* Add get deposit address for Bithumb exchange

* Add get deposit address for Binance exchange
Fix bug in Authenticated requests, concatenates sig string on end of query

* Remove support for deposit address on ANX exchange

* Updated account type to segregate multiple accounts on an exchange.

* Fix requested changes

* Add get deposit address for Bitfinex exchange
Add parameter for getting deposit address to wrapper

* Add get deposit address for ANX exchange

* Fix misspelling in Poloniex

* Drop working field and initialisation of zero value for Account Type

* Change switch to symbol package currency code
2019-01-17 11:44:23 +11:00
Adrian Gallagher
88303b81ab fix poloniex websocket type assertion 2019-01-16 16:46:35 +11:00
Scott
db56c1cea5 FIAT withdrawal wrapper support (#230)
* Adds tests for withdrawFiat and withdrawFiat to international bank to all exchanges

* Sets unsupported where FIAT withdrawal not allowed

* Updates test signatures. Adds support for bitfinex FIAT withdrawals. Adds withdrawal type of NoFiatWithdrawals. Updates exchange wrapper implementations to return errnotsupported when... not supported. Updates withdraw permissions tests to reflect nofiatwithdrawals. Adds intermediary bank support in withdrawRequest type struct

* Adds bithumb and bistamp fiat withdrawl wrapper support

* Adds BTCMarkets withdrawal support

* Adds kraken withdraw support (uses existing methods)

* Fixes line issue from rebase

* Updates notsupported for localbitcoins and okex. Updates withdraw permissions for liqui

* Adds coinbasePro withdraw support. Fixes withdraw permissions tests for liqui and localbitcoins

* Removes unnecessary data from test structs for fiat withdrawal tests

* Readds intermediary bank flag

* Removes reference

* Improves bitfinex testing, improves withdraw fiat error handling

* Reverts Kraken hardcoded testing value
2019-01-14 15:48:13 +11:00
Harry Ma
18328d4fe8 fix wrong type of the huobi account data struct (#231) 2019-01-11 19:30:09 +11:00
Andrew
d01e7bad72 Implement Logger (#228)
* Added new base logger

* updated example and test configs

* updated exchange helpers restful router & server

* logPath is now passed to the logger to remove dependency on common package

* updated everything besides exchanges to use new logger

* alphapoint to bitmex done

* updated bitmex bitstamp bittrex btcc and also performance changes to logger

* btcmarkets coinbase coinut exmo gateio wrappers updated

* gateio and gemini logger updated

* hitbtc huobi itbit & kraken updated

* All exchanges updatd

* return correct error for disabled websocket

* don't disconnect client on invalid json

* updated router internal logging

* log.Fatal to t.Error for tests

* Changed from fatal to error failure to set maxprocs

* output ANSI codes for everything but windows for now due to lack of windows support

* added error handling to logger and unit tests

* clear wording on print -> log.print

* added benchmark test

* cleaned up import sections

* Updated logger based on PR requests (added default config options on failure/setting errors)

* ah this should fix travici enc config issue

* Load entire config and clear out logging to hopefully fix travisci issue

* wording & test error handling

* fixed formatting issues based on feedback

* fixed formatting issues based on feedback

* changed CheckDir to use mkdirall instead of mkdir and other changes based on feedback
2019-01-08 21:56:22 +11:00
Scott
b1e6534e7c Withdraw Crypto wrapper mapping (#226)
* Initial commit

* Updates signature for all withdrawal methods to use new withdrawRequest struct type

* Implements crypto withdraw features & tests for Alphapoint, ANX, Binance, Bitfinex, Bitflyer, Bithumb, Bitmex, Bitstamp, Bittrex, BTCC, BTCmarkets, CoinbasePro, Coinut. Updates WithdrawRequest type with more members. Breaking change to update real order testing for increased code coverage

* Updates all realOrder tests to run when no API key is present. Updates exchange functions to handle errors better

* Implements crypto withdrawals for Exmo, GateIO, Gemini, HitBTC, Huobi, HuobiHadax, Kraken, LakeBTC, Liqui, Localbitcoins, OKCoin, OKEX, Poloniex, Wex, Yobit and ZB. Updates real order test formatting for all real order tests

* Update alphapoint. Fixes anx typos. Adds function WithdrawFiatFundsToInternationalBank to exchange wrapper interface. Adds WithdrawFiatFundsToInternationalBank to alphapoint, bitmex, coinbasepro. Updates Kraken to use TradePassword property

* Reverts alphapoint to use ErrNotYetImplemented

* Fixes line spacing and removes unnecessary line
2019-01-03 13:15:07 +11:00
Adrian Gallagher
dffa8eca99 Periodic pairsLastUpdated timestamp update
Fix other GoReportCard warnings
2018-12-27 15:32:59 +11:00
Adrian Gallagher
046e15a67e Periodic GoReportCard fixes 2018-12-27 15:10:41 +11:00
Ryan O'Hara-Reid
7c3134f35b Wrapper update modify order (#222)
* Changed IBotExchange interface ModifyOrder function paramater and return value to exchange type for easier addition or retraction of variables.

* Function ModifyOrder for Binance not supported via API

* Change to unsupported function for exchange ZB

* Change to unsupported function for exchange Yobit

* Add modify order support for Poloniex

*  Change to unsupported function for exchange Okex

* Change to unsupported function for exchange Localbitcoins

* Change to unsupported function for exchange Liqui

* Change to unsupported function for exchange LakeBTC

* Change to unsupported function for exchange Kraken

* Change to unsupported function for exchange Itbit

* Change to unsupported function for exchange HuobiHadax

* Change to unsupported function for exchange Huobi

* Change to unsupported function for exchange HitBTC

* Change to unsupported function for exchange Gemini

* Change to unsupported function for exchange GateIO

* Change to unsupported function for exchange Exmo

* Change to unsupported function for exchange Coinut

* Change to unsupported function for exchange Coinbase

* Change to unsupported function for exchange BTCMarkets

* Change to unsupported function for exchange Bittrex

* Change to unsupported function for exchange Bitstamp

* Add modify order support for Bitmex

* Add verbose header information in request package

* Add modify order support for Bithumb exchange

* Change to unsupported function for exchange Bitflyer

* Change to unsupported function for exchange Bitfinex

*  Change to unsupported function for exchange ANX

* Change interface function signature

* Rm redundant code for authenticated requests in Bithumb

* Add error check if decimal values supplied for create or modifying an order on Bitmex

* Added test functions across the exchanges

* Rm comment for modify order on Alphapoint exchange

* Update tmpl file for exchange wrapper
2018-12-20 16:31:17 +11:00
Scott
ff6a84f0f1 Cancel all orders wrapper implementation (#217)
* Changes method signature for cancelling all orders (experitmental). Implements cancelAllOrders wrapper for alphapoint, anx, binance

* Implements cancel all wrapper for bitfinex, bitmex, bitstamp, bittrex, btcmarkets, coinbasepro and hilariously coinut

* Changes method signature to only use one OrderCancellation type. Adds support for Exmo, gateio, gemini, itbit, lakebtc

* Adds/updates support for hitbtc, huobi, hadax, itbit and kraken

* Adds support for liqui, localbitcoins, okcoin, poloniex, wex and yobit. Splits up open order methods for poloniex

* Adds bithumb, okex and zb support. BTCC for another PR

* Updates bitflyer, bithumb, bitmex, coinut, okex and zb cancelAllOrders method to cancel via enabled currency pairs rather than a singular currency

* Adds tests to all exchanges to test wrapper function CancelAllOrders

* Fixes OKEX and huobi, btcmarkets, kraken, okCoin cancel order implementations

* Fixes coinut, hitbtc and okex api for authenticated requests

* Fixes comment and spacing

* Changes the CancelAllOrders signature to return orderids and errors along with a generic error.

* Fixes OKEX delimiter

* Removes spacing and test verbosity

* Removes more spacing

* Removes space

* Fixes okex rebasing issue. Also makes the maps instead of assuming they just work
2018-12-14 15:53:26 +11:00
Ryan O'Hara-Reid
4ca3fd5b00 GetAccountInfo wrapper update (#220)
* Added untested [cloudflare issue] changes to accountinfo for ANX

* Add alphapoint comment for future implementation

* Adds GetAccountInfo for Binance

* Adds GetAccountInfo update for Bithumb

* Updates GetAccountInfo for GateIO.
Adds error handling feature for authenticated requests.

* Updates GetAccountInfo function for Huobi.
Adds function for getting account ID.

* Updates GetAccountInfo function
Adds GetAccountID function

* Updates GetAccountInfo [un-tested, no access to keys at this time]

* Updates GetAccountInfo for Kraken

* Updates GetAccountInfo func for OKEX

* Updates GetAccountInfo for exchange ZB

* Updates GetAccountInfo func for Bitmex

* Updates GetAccountInfo func for Coinut

* Updates GetAccountInfo for ANX exchange

* Fixes incorrect hold currency issue

* Fixes type name

* Fixes issue with unneeded code in wrapper for Bithumb

* Change strings to type symbol string

* Fixes nit for Gateio

* Fixes GetAccountInfo issue
Fixes SpotCancelOrder issue
2018-12-13 16:53:19 +11:00
CodeLingo Bot
05f9f40723 Fix comments according to best practices by effective go (#219) 2018-12-11 12:50:07 +11:00
Scott
52609827eb Fixes huobi hadax signature for authenticated methods (#216) 2018-12-11 10:38:00 +11:00
Adrian Gallagher
4e6cf84ba0 Fix Bithumb GetAllTickers type assertion 2018-12-10 17:38:01 +11:00
Adrian Gallagher
9680cdea38 Limit HTTP request verbosity 2018-12-10 10:40:43 +11:00
Adrian Gallagher
098350739f Update WEX API endpoints again ¬_¬ 2018-12-06 15:52:37 +11:00
Ryan O'Hara-Reid
825bfe3789 Fixes ineffectual assignment issue (#215) 2018-12-05 13:18:40 +11:00
Adrian Gallagher
c580276ba8 Update WEX API endpoints (again) ¯\_(ツ)_/¯ 2018-12-03 12:15:18 +11:00
Scott
458aab301e Cancel order wrapper wrapup (#214)
* Reimplements order cancellation for alphapoint, anx, binance, bitfinex, bithumb, bitmex, bitstamp, bittrex,  btcmarkets, coinbasepro, coinut, exmo, gateio, gemini, gitbtc, huobi, hadax, itbit, kraken, lakebtc, liqui, okcoin, okex, poloniex, wex, yobit and zb wrappers. Adds new order cancellation struct type. Updates old tests that pointed to the wrong unrenamed methods

* Sets up tests for all supported exchanges. request.DoRequest errors when response status is not 200

* Updates alphapoint, coinut, hitbtc, lakebtc cancel order implementations. Finishes testing

* Adds localbitcoin cancel order wrapper support

* Fixes tests and build issues. Adds WexIssue flag for tests

* Changes CancelOrder signature to only return error. Allows exchange to format currency pairs with delimiters
2018-11-30 16:20:34 +11:00
Adrian Gallagher
27091ef442 Periodic pairs update; LocalBitcoins, OKCoin and OKEX are now auto 2018-11-26 16:38:56 +11:00
Ryan O'Hara-Reid
92534249bf Remove unwanted wrapper name stuttering and standardise common error returns (#213) 2018-11-23 12:55:00 +11:00
Scott
c41f611d96 Map exchange wrapper function "SubmitExchangeOrder" to exchange implementations (#211)
* Sets up Alphapoint and ANX wrappers to use exchange implementations of submit orders
Creates const types for orderType and orderSides

* Changes wrapper func SubmitExchangeOrder return type to string to account for GUID order ID responses

* Adds binance and bitfinex new order wrapper support. Fixes alphapoint order wrapper.

* Adds bitflyer type for exchange order. Adds bithumb and bitmex wrapper support for SubmitExchangeOrder

* Fixes bitmex typo. Adds bitstamp, bittrex, coinbasePro, coinut SubmitExchangeOrder wrapper support

* Maps exchange wrapper function 'SubmitExchangeOrder' to exchange methods for exmo, gateio, gemini, hitbtc, huobi, huobihadax and itbit

* Maps exchange wrapper function 'SubmitExchangeOrder' to exchange methods for kraken, lakebtc, liqui, okcoin, okex, poloniex, wex, yobit and zb

* Updates interface, fixes wrapper type mismatch and fixes tests from changed parameters

* Adds generic support for SubmitExchangeOrder for localbitcoins_wrapper

* Updates wrappers tests and submit order implementations for anx, binance, bitfinex, bitflyer (cannot test), bitmex, bitstamp

* Fixes bitstamp tests

* Adds tests for submitting orders with bittrex, btcmarkets, coinbasepro and coinut

* Adds tests for exmo, gatio, gemini and hitbtc
Makes adjustments where necessary

* Adds tests and updates order implementations for huobi, huobiHadax, itbit, kraken, lakebtc, liqui, okcoin, okex, poloniex, wex, yobit and zb. Not all have been verified due to exchange issues

* Fixes variable names and symbol usages

* Fixes HitBTC order API implementation

* Removes formatting code. Adds error handling for unsupported order types. Fixes typo

* Fixes missed replace for new ToString function. Removes unused functions

* Changes report of unknown withdrawal type with bitshift approximation.
Improved code cov

* Updates wrapper SubmitExchangeOrder return to use a fancy new SubmitOrderResponse struct type to clarify if an order submission is successful or not
2018-11-22 17:28:29 +11:00
Adrian Gallagher
a78f3c21a5 Update WEX API endpoints and re-enable tests 2018-11-22 09:27:45 +11:00
Adrian Gallagher
da36c654b3 Skip WEX tests temporarily 2018-11-21 15:35:38 +11:00
Baptiste Lombard
47f89d838b Add GetAveragePrice function to the binance API (#212)
* Add GetAveragePrice function to the binance API

* Add new filters

* Remove typo
2018-11-19 10:53:49 +11:00
Andrey Grehov
5fe12a5adc CoinbasePro: fixed Sandbox API URL (#205) 2018-11-05 16:43:58 +11:00
Ryan O'Hara-Reid
f6060ff1fc Requester update (#203)
* Adds upgrade to re-do request on client timeout.

* Updated readme with documentation tool.

* Add Requester variable for timeout retry
Improve tests
2018-11-05 12:14:54 +11:00
Scott
baffb46300 Exchange withdraw capabilities (#199)
* Initial broken commit for updating exchanges to store data on whether withdrawals can be handled completely by the API

* Changes to use base exchange method to determine withdrawal permissions using bitshifting

* Adds withdrawal capabilities for alphapoint, anx, binance, bitfinex, bitflyer, bithumb, bitmex, bitstamp, bittrex exchanges

* Adds withdraw capabilities for btcmarkets, coinbasepro, coinut, exmo, gateio, gemini, hitbtc, huobi, hadax

* Adds withdraw capabilities for itbit, kraken, lakebtc, liqui, localbitcoins, okcoin, okex, poloniex, wex, yobit, zb

* Titillating tests & Wonderful wrappers

* Fixes typo, double checks all apis and corrects permissions

* Fixes gemini test

* Fixes incorrect log placement. Removes breaks

* Addresses PR comments. Changes readable function to: FormatWithdrawPermissions, adds new function 'GetWithdrawPermissions' and 'SupportsWithdrawPermissions'. Adds three functions to interface

* Removes unnecessary config_example.json additions

* Fixes bitwise comparisons. Adds more tests to highlight expected outcomes
2018-11-05 10:35:03 +11:00
Ryan O'Hara-Reid
19f65df236 Exchange interface update (#202)
* Adds helper function to get available asset types to the exchange interface

* Adds test to function
2018-11-02 09:26:26 +11:00
Scott Grant
c1b2959606 Adds more international withdrawal fee details for bithumb, gemini, itbit and lakebtc 2018-11-01 12:03:10 +11:00
Ryan O'Hara-Reid
c320114167 Fix websocket API due to exchange update. Uncompresses binary messages. (#198) 2018-10-31 14:33:20 +11:00
Adrian Gallagher
1f2516dbd0 ProcessTicker: added a condtion to check for existing tickers
In line with https://github.com/thrasher-/gocryptotrader/pull/197/

Thanks to @shazbert and @andreygrehov
2018-10-31 11:46:49 +11:00
Andrey Grehov
640a7e6a83 ProcessOrderbook: added a condition to check for existing orderbooks (#197)
* ProcessOrderbook: added a condition to check for existing orderbooks

* ProcessOrderbook: simplified the logic by removing useless code

* Covered orderbook read/write stability with tests

* Fixes race condition writing to a test array
2018-10-31 11:24:15 +11:00
Adrian Gallagher
36b37b0571 Kraken: bugfix - don't use internal ticker map
It's up to the calling application to handle concurrency

Addresses https://github.com/thrasher-/gocryptotrader/issues/167
2018-10-30 13:12:45 +11:00
Scott
e4c443b901 Calculating each exchange's fees (#188)
* Adds some constants for fee types
Adds some fee calculation in an attempt to be generic
Adds fee stuff to Bittrex
Adds fee stuff to bitstamp

* Fixes bitstamp fee calculation

* Tests
Tests all scenarios for GetFeeByType

* Adds method to wrapper
Adds err to response
Checks for err

* Adds support for Bittrex fees

* Adds maker/taker dynamic to fees
Updates tests
Adds bitmex fee support
Removes unused switch case scenarios to not waste space

* Adds bithumb support for fee calculation

* Adds Bitfinex fee support
Adds list of currencies as const strings
Sets up bitflyer

* Fixes arguments

* Greatly expands symbols
Adds Binance fee calculation support
Cleans up previous exchanges

* Fixes errors for fee calculations

* Adds ANX fee support

* Adds btcc fee support
Adds alphapoint fee wrapper support
Renames method to match "enum"
Uses symbols in tests, not inline strings

* Adds support for BTCMarkets fee calculation
Adds new method to retrieve fee amount from BTCMarkets
Adds new fee type struct: FeeBuilder
Updates ANX and BTCMarkets to use new FeeBuilder type struct
Standardises the tests to run when it comes to fee calculation

* Migrates all existing exchange fee to use new feebuilder type struct
Uses standard testing model

* Fixes unit tests

* Updates maker taker fees in test config

* Removes parallel from fee testing

* Removes more parallel from tests

* Adds coinbasepro fee support

* Adds Coinut fee support

* Adds Exmo fee support
Adds maker fee support to coinut
Introduces a type for fees and bank transfers to prevent random strings being used

* Adds partial bitflyer support
Moves bitflyer to feeBuilder struct

* Adds gateio fee support

* Adds Gemini fee support

* Adds hitbtc fee support

* Adds huobi fee support

* Adds HuobiHadax fee support

* Adds itbit fee support

* Adds partial kraken fee support with trading fees

* Finishes basic Kraken fee support

* Adds basic LakeBTC fee support

* Adds basic liqui fee support

* Adds localbitcoins fee support.......

* Adds basic okcoin fee support

* Adds simple OKEX fee support
Adds many new currency symbols
Fixes liqui's fees

* Adds poloniex fee support

* Adds fee support for Yobit

* Adds WEX fee support

* Adds ZB fee support

* Removes bad reference

* Improves accuracy of variable name

* trading fee method names are now consistent

(cherry picked from commit 21c82e8b90cae590cfd73d365d7be39e1a00e973)

* Fixes rebasing issues

* Fixes issues from rebase
Removes "IsTaker" as IsMaker bool can imply taker
Updates tests to actually work.

* Adds a zero to the test

* Fixes bitfinex api endpoints and fixes fee calculations

* Updates btcmarkets trading fee calculation

* Verifies tests with apis for all exchanges except coinbasepro, itbit and bitflyer
Removes taker fee test as taker is default

* Removes redundant all exchange wrapper error checks due to the error checks being redundant

* Addresses review comments:
- Renames variables
- Changes how functions return data
- Fixes typo
2018-10-29 12:32:46 +11:00
Ryan O'Hara-Reid
d3c2800fe0 Initial overhaul of websocket connection and feeds (#189)
* Initial overhaul of websocket connection and feeds
* Added proxy support
* Piped to routines.go

* Added new websocket file in exchanges
Refactored orderbook handling into exchange_websocket.go
Added better error responses for binance_websocket.go
General clean for binance_websocket.go

* General fixes - bitfinex_websocket.go
Refactored orderbook cache code - bitfinex_websocket.go
Removed fatal error with unhandled type - routines.go

* Added general improvements to bitmex_websocket.go
Refactored orderbook handling to exchange_websocket.go
Added variable in Item struct in orderbook.go for looking up orders by ID

* Fix issue when routines are blocked due to Data Handler not started
Updated traffic handler
General fixes for bitstamp_websocket.go

* General fixes for coinbasepro_websocket.go

* General fixes for coinut_websocket.go
Fixed error return in exchange_websocket.go

* Removed comments in coinut_wrapper.go
Refactor orderbook logic from hitbtc_websocket.go to exchange_websocket.go

* General fixes

* Removed comments
General fixes

* Updated routines.go

* After rebase fix

* Fixed update config pairs in okcoin.go

* fixed config currency issue in okcoin.go for okcoin China

* exchange_websocket.go
*Removed unused const dec
*Removed state change routine
*Improved trafficMonitor routine
*Increased verbosity for error returns
*Removed uneeded mutex locks

exchange_websocket_test.go
*Added new tests for websocket and orderbook updating

routines.go
*Removed string cased

* Fixed race conditions on sync.waitgroup in exchanges_websocket.go

* Changes variable name in config.go

* Removes unnecessary comment

* Removes indefinite lock on error return

* Removes unnecessary comment

* Adds support for BTCC websocket
Drops support for BTCC REST

* Rewords comment in exchange_websocket.go
Moves types to poloniex_types.go

* Moves types to coinut_types.go

* Removes uneeded range for accessing array variables for coinbase_websocket.go
Removes comments in coinut_types.go

* Adds verbosity flag to GCT
Suppresses verbose output from routines.go

* Fixes setting proxy for REST and Websocket per exchange
Upgrades error handling
Drops unused *url.Url variable in exchange type

* Adds test for setting proxy

* Fixes bug that closes connection due to incorrect timeout time through a proxy connection

* Clarify verbose flag message
2018-10-24 14:22:40 +11:00
Adrian Gallagher
7315e6604c Kraken: Add support for XTZ based pairs 2018-10-23 17:12:06 +11:00
Adrian Gallagher
d0f5f46c9d Exchanges: Don't set or update currencies when supplied with a nil array 2018-10-23 15:10:56 +11:00
cranktakular
f4766fb4dd Coinbase error fix, deleting nearly completely unused test file, other minor changes (#191) 2018-10-12 12:53:32 +11:00
Adrian Gallagher
58096b689c Fix TestSetAssetTypes 2018-10-11 16:18:02 +11:00
Adrian Gallagher
be561dd077 Periodic available pairs update for manual exchanges 2018-10-11 15:47:12 +11:00
Adrian Gallagher
9b85b431ab BTCMarkets: Add automatic available pair updates 2018-10-11 12:25:58 +11:00
cranktakular
7c21cb6f84 Common.go testing (#190)
* Common.go testing:
Improved GetHMAC test
Cut ByteArrayToString from common, already have a function that does the same thing
more coverage for SendHTTPRequest test
Improved SendHTTPGetRequest test
added JSONDecode test
added UnixMillis test
added RecvWindow test
added FloatFromString test
added IntFromString test
added Int64FromString test
added TestTimeFromUnixTimestampFloat test
2018-10-09 14:49:21 +11:00
Adrian Gallagher
9dd0474c7c Huobi Hadax no longer supports BTC-USDT; update API endpoints and config available/enabled pairs 2018-10-03 17:17:23 +10:00
herenow
604443fbbb Fix Huobi's POST requests (#186)
* Fix Huobi's POST request content-type

If we try to send a POST request to Huobi w/ a content-type of
"application/x-www-form-urlencoded" we will receive an error:

Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

Their english documentation is incorrect, it does not specify this atm,
translating their chinese documentation, it states:

"Content-Type: application/json must be declared in the POST request header;
Content-Type: application/x-www-form-urlencoded must be declared in the GET
request header. (Chinese users recommend setting Accept-Language: zh-cn)"

* Fix Huobi's place new order request (send as json)

We should not send the order details through url parameters, this
needs to be sent as a json payload via the request body.

Documentation:

https://github.com/huobiapi/API_Docs_en/wiki/REST_Reference#post-v1orderordersplace--make-an-order-in-huobipro

* Fix Huobi's margin transfer/margin order/withdraw requests

This requests data need to be sent as json, not as a query string.

Docs:

https://github.com/huobiapi/API_Docs_en/wiki/REST_Reference#post-v1dwtransfer-inmargin--transfer-asset-from-spot-account-to-margin-account

https://github.com/huobiapi/API_Docs_en/wiki/REST_Reference#post-v1marginorders--margin-application

https://github.com/huobiapi/API_Docs_en/wiki/REST_Reference#post-v1dwwithdrawapicreate---create-a-withdraw-application

* Fix Huobi's margin repayment request

This request data needs to be sent a json, not via the query string.

Also note, that the "order-id" parameter is already sent through the
url path, it does not need to be included in the request body.
2018-10-03 10:58:32 +10:00
herenow
0fdf76d264 Optional Huobi’s auth private key signature param
This is a security feature that was introduced briefly, where you were
required to upload a public key while generating your api keys, and for
authentication you had to use your private keys to sign the request and
send it through this “PrivateSignature” param.

This security feature was rolled back and it is not mentioned anymore
in Huobi’s documentation.

For backwards compatibility purposes we should still keep this feature
though, they still seem to accept this parameter, I guess if you have
one of this old api keys, that was generated with a given public key,
you still have to send it.
2018-09-29 19:25:38 -03:00
Adrian Gallagher
a2c5123c9e gemini: ensure interface isn't nil because conversion 2018-09-26 13:39:19 +10:00
Adrian Gallagher
a1bd39ddac bitmex: supports auto pair updating 2018-09-21 16:22:17 +10:00