Commit Graph

843 Commits

Author SHA1 Message Date
Ryan O'Hara-Reid
5dd0fecc62 Adds go module support that came into effect in go version 1.11 (#201)
Adds go module support that came into effect in go version 1.11
2018-11-01 17:40:54 +11:00
Ryan O'Hara-Reid
506940587e Added .github folder for issue, contrib, and PR templates. (#200)
* Added .github folder for issue, contrib, and PR templates.

* Requested changes to templates

* Improved templates
2018-11-01 16:05:53 +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
cranktakular
4a879bf1a1 Config.go testing (#196)
More coverage for GetExchangeBankAccounts test
More coverage for UpdateExchangeBankAccounts test
Adding CheckClientBankAccounts test
Fixing bug in CheckClientBankAccounts
Adding CheckCommunicationsConfig test
Fixing bugs in CheckCommunicationsConfig
Adding CheckPairConsistency test
Removing superfluous commas
More coverage for GetForexProviderConfig test
More coverage for GetPrimaryForexProvider
2018-10-30 15:55:50 +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
Adrian Gallagher
83263f3245 Update exchange generators template files 2018-10-25 15:08:27 +11:00
Adrian Gallagher
e6027cfede Preserve ticker/orderbook output 2018-10-24 15:07:19 +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
cranktakular
8cbe99cf2f Telegram testing and race condition fix. (#195)
* Telegram testing and race condition fix.

Improving telegram Setup test
More coverage for telegram PushEvent test
Adding telegram HandleMessages test
Adding telegram GetUpdates test
Adding telegram TestConnection test
Adding telegram SendMessage test
(Hopefully) completely fixed race conditions with slack testing

* Adding testing to communications.go
2018-10-23 15:40:25 +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
Adrian Gallagher
a94d88debf Update config test code 2018-10-19 00:07:42 -07:00
Adrian Gallagher
c2c7032858 Add debug logger and default data directory support 2018-10-19 17:26:00 +11:00
cranktakular
415332b446 Slack.go improvements and increasing coverage (#193)
* Slack.go improvements and increasing converage

Slack.go Adding handling for trying to send responses when the websocket isn't connected
Slack.go Adding handling for an error response other than "Socket URL has expired"
Slack.go Making handleErrorResponse return an error
Slack.go Making use of s.Connected
Slack.go Making HandleMessage return an error
Slack.go Removing SendHTTPGetRequestSlack, code now calls SendHTTPGetRequest from common.go instead

More coverage for slack GetChannelsString test
More coverage for slack GetUsernameByID test
Improving slack GetIDByName test
Adding slack GetGroupIDByName test
Improving slack GetChannelIDByName test
More coverage for slack GetUsersInGroup test
Adding slack WebSocketConnect test
Adding slack handlePresenceChange test
Adding slack handleMessageResponse test
Adding slack handleErrorResponse test
Adding slack handleHelloResponse test
Adding slack handleReconnectResponse test
Adding slack WebsocketSend test
Adding slack HandleMessage test
Adding slack SendHTTPGetRequestSlack test

* Fixing race conditions and missing exclamation mark.
2018-10-18 17:33:24 +11:00
Adrian Gallagher
0c92ccfa21 config: don't warn user of limited APIKey level for default forex provider 2018-10-17 16:13:32 +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
f6bce891c4 Add additional helper functions to pairs package 2018-10-05 15:21:06 +10: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
Adrian Gallagher
7186ac2602 Merge pull request #187 from thrasher-/test123
Fixes frontend security issues
2018-10-03 10:57:36 +10:00
Scott Grant
2d334a9faf Fixes security issues
Signed-off-by: Scott Grant <scott.grant@thrasher.io>
2018-10-02 16:03:29 +10:00
Adrian Gallagher
17d9e92550 Merge pull request #185 from herenow/chore/optional-auth-pem-key
Optional Huobi’s auth private key signature param
2018-09-30 12:16:16 +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
bdd1fa3cdf config consistency check to ensure an enabled pair is supported by the exchange 2018-09-21 16:25:27 +10:00
Adrian Gallagher
a1bd39ddac bitmex: supports auto pair updating 2018-09-21 16:22:17 +10:00
Adrian Gallagher
6aa0359060 bugfix: okex - fix authenticated path requests 2018-09-20 15:27:01 +10:00
Adrian Gallagher
96cbf90446 Remove non-needed getter functions for currency pairs
Fixes https://github.com/thrasher-/gocryptotrader/issues/180
2018-09-20 15:01:11 +10:00
Adrian Gallagher
042c4bfef2 bugfix: don't index or range over data if length is zero 2018-09-20 14:46:38 +10:00
soxipy
fb4e2d1452 localbitcoins fixes (#177)
* General LocalBitcoin fixes

* Added override variables to config for exchange packages to allow different API URL's
2018-08-27 14:19:29 +10:00
Ryan O'Hara-Reid
ca0c22f422 Merge pull request #169 from ermalguni/master
OKEX websocket
resolves #158
2018-08-27 10:11:19 +10:00
Adrian Gallagher
b656c23295 Merge pull request #175 from shazbert/unreachable_code_fix
Fixed unreachable code in websocket client front-end code
2018-08-17 10:45:32 +10:00
Ryan O'Hara-Reid
9918896923 Fixed unreachable code 2018-08-17 10:41:04 +10:00
Adrian Gallagher
cdb4df98e7 Merge pull request #174 from gloriousCode/master
Fix build errors, warnings, vulnerabilities, linting for front-end
2018-08-17 08:22:58 +10:00
GloriousCode
a03e85ebfd Removes commented out imports in polyfills.ts
Keeps structure for future potential use
2018-08-16 18:35:17 +10:00
GloriousCode
6c0ad602da Lint fixes 2018-08-16 17:32:25 +10:00
GloriousCode
bdcf87ab03 0 vulnerabilities 2018-08-16 08:58:14 +10:00
GloriousCode
d80b2c96b2 npm audit run
Removes npx
2018-08-16 08:44:32 +10:00
GloriousCode
0a20061cc2 more fixes 2018-08-16 07:53:19 +10:00
GloriousCode
f7bc2433dd Fixes build issues. Removes warnings. 2018-08-16 07:16:40 +10:00
Adrian Gallagher
a7ed69c843 Merge pull request #173 from marcofranssen/hotfix/lowercase-missed-configs
Hotfix/lowercase missed configs
2018-08-13 12:04:31 +10:00
Marco Franssen
18489f7a30 Added test for config/all json response 2018-08-10 16:05:20 +02:00