Commit Graph

1181 Commits

Author SHA1 Message Date
Scott
4cb2f4603a Bugfix: Fixes OKCoin websocket port (#475) 2020-04-01 09:27:24 +11:00
Scott
74cb7558cc (FIX) Update ZB API URLs (#474)
* Updates websocket URL

* Minor test changes, URL changes too

* verbosity purposity prepostery

* Fixes issue where websocket data passed through the round trip was invalid

* Adds a test protection
2020-03-27 13:19:21 +11:00
dependabot-preview[bot]
ce11dfcf39 Bump github.com/gorilla/websocket from 1.4.1 to 1.4.2 (#473)
Bumps [github.com/gorilla/websocket](https://github.com/gorilla/websocket) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/gorilla/websocket/releases)
- [Commits](https://github.com/gorilla/websocket/compare/v1.4.1...v1.4.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-20 17:26:41 +11:00
Andrew
47cf874911 (BTC Markets) Add support for GetHistoricCandles wrapper (#472)
* reworked btcmarkets GetMarketCandles()

* pass utc back
2020-03-17 10:02:13 +11:00
Ryan O'Hara-Reid
2c7e531c5c Initial kline trade converter && restructure wrapper functions (#454)
* Initial kline trade converter && restructure wrapper function

* Addr nits

* fix linter issues

* fix requested

* fix after merge interface issue with fakepassingexchange

* consistentizations

* Addr glorious nits

* Added in explicit interval strings for gctcli client (ease of use)

* rm value stutter

* Addr nits

* update protobuf and push regen

* go mod tidy

* change description of usage for granularity
2020-03-16 10:31:07 +11:00
Harry Ma
99e8d2f167 (BUG FIX) Fix order submission crash due to missing "exchange" parameter (#468)
* fix the return problem

* fix the return problem

* add the mandatory parameter

* fix the symbol empity problem

* fix the symbol empty problem

* add Pair parameter for order.Cancel parameters

* follow the gofmt rule

Co-authored-by: MK <mk@MKdeMacBook-Pro.local>
2020-03-14 13:02:27 +11:00
dependabot-preview[bot]
1deeca9953 Bump google.golang.org/grpc from 1.27.1 to 1.28.0 (#470)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.27.1 to 1.28.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.27.1...v1.28.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-12 09:09:45 +11:00
dependabot-preview[bot]
25bdc3c691 Bump github.com/grpc-ecosystem/grpc-gateway from 1.14.2 to 1.14.3 (#469)
Bumps [github.com/grpc-ecosystem/grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) from 1.14.2 to 1.14.3.
- [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases)
- [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/CHANGELOG.md)
- [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v1.14.2...v1.14.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-12 09:08:44 +11:00
dependabot-preview[bot]
25a23af1fb Bump github.com/grpc-ecosystem/grpc-gateway from 1.14.1 to 1.14.2 (#465)
Bumps [github.com/grpc-ecosystem/grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) from 1.14.1 to 1.14.2.
- [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases)
- [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/CHANGELOG.md)
- [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v1.14.1...v1.14.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-10 10:28:19 +11:00
dependabot-preview[bot]
550b71f2c2 Bump github.com/urfave/cli from 1.22.2 to 1.22.3 (#466)
Bumps [github.com/urfave/cli](https://github.com/urfave/cli) from 1.22.2 to 1.22.3.
- [Release notes](https://github.com/urfave/cli/releases)
- [Changelog](https://github.com/urfave/cli/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/urfave/cli/compare/v1.22.2...v1.22.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-10 10:25:41 +11:00
dependabot-preview[bot]
b577d80aa5 Bump github.com/d5/tengo/v2 from 2.1.1 to 2.1.2 (#464)
Bumps [github.com/d5/tengo/v2](https://github.com/d5/tengo) from 2.1.1 to 2.1.2.
- [Release notes](https://github.com/d5/tengo/releases)
- [Changelog](https://github.com/d5/tengo/blob/master/.goreleaser.yml)
- [Commits](https://github.com/d5/tengo/compare/v2.1.1...v2.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-03-10 10:18:48 +11:00
Allie
80f4cf1784 Bug-fixes: #459 #460 (#461)
* Fix bitmex order params

* Fix insecure endpoint check

* comment on Title funcs

* tests for Title func

* fix order_test

Co-authored-by: Allie c( ⁰ 〰 ⁰ )੭ <88z@pm.me>
2020-03-09 09:20:33 +11:00
Adrian Gallagher
13e7db3565 Bump github.com/grpc-ecosystem/grpc-gateway from 1.13.0 to 1.14.1 (#463)
Bumps [github.com/grpc-ecosystem/grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) from 1.13.0 to 1.14.1.
- [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases)
- [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/CHANGELOG.md)
- [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v1.13.0...v1.14.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-06 10:42:40 +11:00
Adrian Gallagher
3fae5a0924 Implementation of Exchange GetOrder through GRPC for Coinbase (#453)
* fix 440: SubmitOrder and CB-ACCESS-TIMESTAMP value

* removed gctcli executable and added it to gitignore

* implemented GetOrderInfo

* getOrder also has trades attached to an order

* getOrder also has trades attached to an order

* fix 440: SubmitOrder and CB-ACCESS-TIMESTAMP value

* removed gctcli executable and added it to gitignore

* fix 440: SubmitOrder and CB-ACCESS-TIMESTAMP value

* removed gctcli executable and added it to gitignore

* minor

* go lint fixes

* removed clutter

* fixed Amount, Executed Amount, Remaining Amount

* removed default value declarations

* removed useless nil chceck

* iteration rewritten go style from java style

* returning error if GetFills fails

* returning error if GetOrderInfo fails

* ExecutedAmont value is FilledSize

* added TODO to fix asset type

* chnages after merging #446

* range without copy value, using index

* removed useless slice initialisation

* couple of nits from code review

* fix indentation

* Update rpc.proto

Fixes indentation

Co-authored-by: Adrian Gallagher <thrasher@addictionsoftware.com>
2020-03-05 10:19:58 +11:00
Adrian Gallagher
97b71dd9bd Bump github.com/d5/tengo/v2 from 2.0.5 to 2.1.1 (#462)
Bumps [github.com/d5/tengo/v2](https://github.com/d5/tengo) from 2.0.5 to 2.1.1.
- [Release notes](https://github.com/d5/tengo/releases)
- [Changelog](https://github.com/d5/tengo/blob/master/.goreleaser.yml)
- [Commits](https://github.com/d5/tengo/compare/v2.0.5...v2.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-05 08:44:55 +11:00
Adrian Gallagher
ba07c86af9 Bitfinex: Implement leaderboard API (#458)
* Bitfinex: Implement leaderboard API

* Expand test coverage

* fix grammer
2020-03-05 08:40:23 +11:00
Scott
b686cf2e0e Feature: Websocket order handling (#446)
* Initial changes, removing exchange name as an arg and puts it in the pointer struct. Adds case to ws routines

* Adds CancelAllOrders func, adds GetByExchangeAndID. Adds modify handler in routines.go

* initial poor attempts to have bitmex work with new datahandler handlers. fixes ordersides

* bitmex Completes new order

* Better bitmex handling, but not complete. Begins a gargantuan task of unifying order data structs. Sometimes an order update will contain lot's of information, so its best to be able to update all fields of our orders, rather than just an arbitrary subset. As a result, everything will be broken for the foreseeable future :glitch_crab:

* Removes old order handler which did nothing. Updates order properties for everything everywhere - now consistent. Changes order status. Adds asset type and wallet address to all order types

* Adds order updater to update only relevant fields since the object is generic, we don't know what fields are passed from what exchanges. Adds "lastupdated" field to order.Detail. Expands order cancellation for engine orders.

* Ensures that new orders are added to the ordermanager's order store. Saaa many comments. Internalises orderStore get func. Adds internalOrderID to orderdetail and adds websocket support for it

* Fixes a cancelAllOrders oopsie doopsie

* Adds potential func to update orderdetails from an orderdetail struct. Unsure if will keep.

* Begins btcmarkets implementation. Expands order "stringToOrder" funcs to allow for some more flexible string coversions. Removes order.Submit via websocket as it would cause unlimited order place issues :D

* Finishes btc markets without testing

* Adds untested ws auth func to btse

* Finises btse, fixes btcmarkets bug

* Adds coinbasepro support

* Fixes a few more fields in coinbase pro and readds the extra subs

* Begins work on coinbene. Plus theyve added a new ws connection yeee

* Wasted a bunch of time adding support to an additional websocket that isn't needed ;_; Fixed a bug in coinbasepro. Fully kitted out coinbene support. Updates order types with all fields

* Removes extra websocket connection ;_;

* Finishes gemini. Fixes order side unknown

* Adds okgroup support. Moves byte reading to another function to allow for unit testing. Updates routines to use pointers. Updates date update handling for order details

* Finishes order data for okgroup websocket, but starts the STRANGE process of converting all other websocket endpoints to be a little less silly

* Cleans up okroup websocket implementation. Fixes bug in Gemini

* Adds poloniex support. Updates ws order handling

* new bitmex support. Adds some tests now that its all in its own func. Fixes poloniex bug

* Begins work on authenticated binance websocket

* Attempts to track user data via binance websocket

* Maybe finishes Binance websocket support

* Begins adding test coverage to orders.go. Updates names of script properties to match updated

* Begins an experiment with code coverage. Fixes more rebase issues

* Completes orders coverage. Botches a few other things though. Fixes more scripting stuff

* All tests in engine package pass

* Adds some loevely routine tests

* Moves ordermanager to test Bot ordermanager
Adds lovely routine tests to ensure things that get sent to be handled the data handler are handled by the data handler by handling them

* Replaces "wsHandleData" with "wsReadData" as that's what its going to do now.

* Splits all wsHandleData into wsReadData and wsHandleData to allow for easy testing via sending []byte json examples to test proper functionality. Breaks so many tests

* Fixes majority of test issues. But data races which are tough on the engine package

* "Fixes" test by removing shutdown test. It interferes with too many things. Requires some thought

* Tests all the binance websocket points

* Adds better bitfinex websocket support.

* Adds testing for bitfinex, bitstamp and btcmarkets. Fixes websocket bugs encountered

* Adds BTSE ws tests. Fixes bugs in ws

* Adds coinbase pro tests. Fixes any issues

* Coinbene tests

* Starts to handle coinut. Runs into a problem conceptually regarding websocket roundtrip and orders. Both events need to happen without impacting eachother/racing

* Addresses a data race issue regarding websocket and bot order management submission - order submission locks at an earlier point to prevent routines.go from creating an order before order submission creates it. Updates rpcserver to use order management bot to submit orders.

* Finishes the hectic coinut testing

* Adds tests for gateio

* Fixes rebase issues. Updates tests to work without being overloaded

* Begins testing of gemini. fixes up minor issues

* ginishes gemini tests and fixes

* Adds hitbtc tests. Fixes all the many issues with hitbtc websocket

* Adds remaining tests. Increases default test channel limit again

* Begins work towards huobi tests

* Finishes huobi tests

* Fixed all mythical rebase adventures

* Begins kraken transformation

* Finishes kraken. Fixes coinbene leverage now that its changed

* Begins okgroup testing

* Adds okgroup ws tests

* Does some poloniex

* Fixes basic curreny issue by extracting to func

* Begins redesign of poloniex websocket datahandling. Completes authenticated handling, now onto unauth

* Finishes poloniex revision

* Finishes ZB additions

* Fixes data races

* Fixes rebase issues. Fixes bad kraken logic

* Fixes after reviewing code

* lint everywhere

* Fixes lingering lints

* lint

* Adds test coverage to order detail and modify updating

* Fixes linting

* Fixes huge int, fixes date tests

* Adds GetByExchange, adds test for it. Protects fakepass echange. Renames DisplayQty to DisplayQuantity. Removes verbose. Adds some websocket properties.  Updates bitmex asset type in test

* Addresses timestamps, type abbreviations, verbosity. Expands binance kline switch cases. Updates some websocket capabilities.

* Adds coverage to the stringToOrderType/Status functions introduced in PR

* Minor fixes addressing some time, error text and use of StringDataCompareInsensitive

* Introduces shiny new system which checks if there is an awaiting ID, if found, processes via wrapper method, else, goes through wsHandleData method. Removes weird locking system from wrapper/websocket data race. Updates bitfinex to properly handle websocket order requests and notifications

* Moves fakePassingExchange to test_helper. Fixes some order side implementations for trades. Botches a new error type

* Adds new error type to track and handle order classification errors separately

* Fully fleshes out ClassificationError for all instances of status conversion. Even in order trades and some wrapper functions

* Introduces common.SimpleTimeFormat for "2006-01-02 15:04:05". Fixes binance and bitfinex issues with auth endpoint use, map casting. Expands more order.ClassificationError usage. Fixes some more generic websocket response errors

* Future proofs order updating by utilising asset types. Expands testing to accomodate. Adds shiny new time type. Expands wrapper websocket functionality definitions

* minty linty

* Broken end of day code addressing basic nits on comments, returns and currency conversion

* Adds testing to btcmarkets websocket. Also updates websocket orderbook to use update instead

* Fixes fun rebase fun fun so fun

* Addresses minor nits regarding changed interface and comments

* Creates new function `GetRequestFormattedPairAndAssetType` to retrieve a currency pair and asset type based on a string. It will iterate over enabled pairs and compare them to formatted pairs and then return that pair if found.

* Fixes test

* Adds a single line to the end of the file, because that would be really bad if it wasn't there

* Updates fakepassexchange to not use params, updates test params, uses fatal in some tests where its important, updates order manager to have a rwmutex, removes some returns, improves ws key test for binance, updates properties to reflect their actual values, adds some more websocket properties

* Addresses binance switch linting

* Updates leverage property to int64

* Fixes what was broken
2020-03-03 13:32:14 +11:00
David Merkel
9d49184bc6 Fixed rpc.proto and regenerated files (#457) 2020-03-02 09:36:15 +11:00
Adrian Gallagher
31fe74a380 Fix Coinut nonce issue based on new API nonce rule (#456) 2020-02-28 16:31:52 +11:00
dependabot-preview[bot]
ade3220673 Bump github.com/golang/protobuf from 1.3.3 to 1.3.4 (#455)
Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.3.3 to 1.3.4.
- [Release notes](https://github.com/golang/protobuf/releases)
- [Commits](https://github.com/golang/protobuf/compare/v1.3.3...v1.3.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-28 08:57:52 +11:00
Andrew
b26ec86d43 Withdraw additional functionality (validation/submission/tracking) (#409)
* reworked request struct and exchange response started work on validation system

* removed import cycle until work around

* Added intial withdraw support via CLI added

* Added Crypto command to gctcli

* moved var declartion to single line

* Test updates for binance and anx

* All exchange tests have been updated test coverage added to validate

* First pass at adding withdrawl select from database

* started adding basic lru cache system

* Added basic LRU cache including Add Get Remove Contains ContainsOrAdd Clear

* wording changes on comments

* removed exported var's in strut as they are not required

* Added README

* README updates

* corrected ID on commands

* rm line :D

* merged in origin/cache

* linter fixes (gofmt)

* Added basic cache lookup to events

* swapped to mutex over rwmutex updated comments

* unexported getNewest & getOldest

* unexported getNewest & getOldest

* Updated comments and cited references in source

* updated comments

* WIP

* Migrated exchange WithdrawFiat wrapper to new struct response

* Migrated exchange WithdrawFiat wrapper to new struct response

* started work on bank management

* Added exchange level banking details back with migration to banking package

* Removed broken tests for now

* Added validation to bank accounts

* removed duplicate bank details from withdraw struct

* Test coverage increased

* gofmt

* merged upstream/master with clean up

* First pass at adding command line linking to gctcli

* added validation for crypto address, added gctcli support to retreive previous withdrawal requests

* general cleanup

* general cleanup

* reordered imports

* Increased test coverage moved to database sublogger

* Pass incorrect currency no longer return error from c.CheckBankAccountConfig

* remove TestMain() for now as other tests in this package will need to be reworked

* Happy little race car

* Reverted to upstream tests

* Added test covarege for validation method, corrected response on cli protobuf

* query clean up and removal of duplicated code

* cleaned up queries into singlem ethod increased test coverage

* Migrated international fund withdraw to new exchange response and added cache size override

* Migrated international fund withdraw to new exchange response and added cache size override

* Extended gctcli commands

* lowered default cache to 25

* small code clean up

* added get by date method

* add returned error

* cli commands cleaing return error on nil results to fix out of bounds

* merged write & read helpers into one for test coverage and increased engine/withdraw test coverage

* gofmt

* Added test coverage for valid ID

* removed unused param

* converted to use timestamp package from protobuf

* gofmt

* use built in RFC3339 timestamp

* remove setting of CreatedAt & UpdatedAt and allow ORm to take care of it

* also use ptype on byid

* code flow improvements

* remove inverse conditional check and linters run

* removed test data

* removed comment

* removed comment

* also write failures to database for auditing

* converted to use default time for start & end

* Default to time.Now() minus 30 days

* Default to time.Now() minus 30 days

* small code clean up

* fixed missing semicolon on migrations, code clean up

* updated sqlite migrations

* Added additonal check for exchange level bank account if global is not found

* case sensativity fix for currency names

* use correct compare

* test coverage fixed

* removed space

* return pointer to banking.Account

* return pointer to banking.Account

* added else check back to validate()

* Added empty string as default to migration over NULL due to retrivial of data
2020-02-26 15:45:13 +11:00
Christian Achilli
def3cdf226 fix 440: SubmitOrder and CB-ACCESS-TIMESTAMP value (#441)
* fix 440: SubmitOrder and CB-ACCESS-TIMESTAMP value

* removed gctcli executable and added it to gitignore

* removed nonce from conibasepro send payload

* fixed typo in executable name

* Bump github.com/grpc-ecosystem/grpc-gateway from 1.12.2 to 1.13.0 (#442)

Bumps [github.com/grpc-ecosystem/grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) from 1.12.2 to 1.13.0.
- [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases)
- [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/CHANGELOG.md)
- [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v1.12.2...v1.13.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Minor general cleanup and bug fixes (#443)

* Bugfix, remove non-needed code and cleanup some code

* Run go mod tidy

* Remove non-needed test and fix tautological err

* Fix Huobi interim var reference

* (Logger) Rename package to log (#444)

* renamed package to log to stop side import requirement

* reverted comment changes

* reverted comment changes

* one more reverting wording back to logger

* wording changes on comments

* Bump github.com/gorilla/mux from 1.7.3 to 1.7.4 (#445)

Bumps [github.com/gorilla/mux](https://github.com/gorilla/mux) from 1.7.3 to 1.7.4.
- [Release notes](https://github.com/gorilla/mux/releases)
- [Commits](https://github.com/gorilla/mux/compare/v1.7.3...v1.7.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* (QOL) Improve test setup for logger, improve test coverage for database (#447)

* Improved test setup for logger, improved test coverage for database

* removed some new lines

* add new line

* removed database config detailS

* removed lines

* code cleanup

* Bump github.com/d5/tengo/v2 from 2.0.2 to 2.0.4 (#449)

Bumps [github.com/d5/tengo/v2](https://github.com/d5/tengo) from 2.0.2 to 2.0.4.
- [Release notes](https://github.com/d5/tengo/releases)
- [Changelog](https://github.com/d5/tengo/blob/master/.goreleaser.yml)
- [Commits](https://github.com/d5/tengo/compare/v2.0.2...v2.0.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump github.com/d5/tengo/v2 from 2.0.4 to 2.0.5 (#450)

Bumps [github.com/d5/tengo/v2](https://github.com/d5/tengo) from 2.0.4 to 2.0.5.
- [Release notes](https://github.com/d5/tengo/releases)
- [Changelog](https://github.com/d5/tengo/blob/master/.goreleaser.yml)
- [Commits](https://github.com/d5/tengo/compare/v2.0.4...v2.0.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Adrian Gallagher <thrasher@addictionsoftware.com>
Co-authored-by: Andrew <andrew@disvelop.net>
2020-02-25 09:30:44 +11:00
dependabot-preview[bot]
5e85a9e842 Bump github.com/d5/tengo/v2 from 2.0.4 to 2.0.5 (#450)
Bumps [github.com/d5/tengo/v2](https://github.com/d5/tengo) from 2.0.4 to 2.0.5.
- [Release notes](https://github.com/d5/tengo/releases)
- [Changelog](https://github.com/d5/tengo/blob/master/.goreleaser.yml)
- [Commits](https://github.com/d5/tengo/compare/v2.0.4...v2.0.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-20 10:38:48 +11:00
dependabot-preview[bot]
3574742d4d Bump github.com/d5/tengo/v2 from 2.0.2 to 2.0.4 (#449)
Bumps [github.com/d5/tengo/v2](https://github.com/d5/tengo) from 2.0.2 to 2.0.4.
- [Release notes](https://github.com/d5/tengo/releases)
- [Changelog](https://github.com/d5/tengo/blob/master/.goreleaser.yml)
- [Commits](https://github.com/d5/tengo/compare/v2.0.2...v2.0.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-18 09:19:18 +11:00
Andrew
f515a2bcbd (QOL) Improve test setup for logger, improve test coverage for database (#447)
* Improved test setup for logger, improved test coverage for database

* removed some new lines

* add new line

* removed database config detailS

* removed lines

* code cleanup
2020-02-17 11:29:26 +11:00
dependabot-preview[bot]
72658dc987 Bump github.com/gorilla/mux from 1.7.3 to 1.7.4 (#445)
Bumps [github.com/gorilla/mux](https://github.com/gorilla/mux) from 1.7.3 to 1.7.4.
- [Release notes](https://github.com/gorilla/mux/releases)
- [Commits](https://github.com/gorilla/mux/compare/v1.7.3...v1.7.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-13 08:29:24 +11:00
Andrew
7fccc03164 (Logger) Rename package to log (#444)
* renamed package to log to stop side import requirement

* reverted comment changes

* reverted comment changes

* one more reverting wording back to logger

* wording changes on comments
2020-02-12 18:09:56 +11:00
Adrian Gallagher
168c966441 Minor general cleanup and bug fixes (#443)
* Bugfix, remove non-needed code and cleanup some code

* Run go mod tidy

* Remove non-needed test and fix tautological err

* Fix Huobi interim var reference
2020-02-12 16:52:05 +11:00
dependabot-preview[bot]
1f3bb58a6b Bump github.com/grpc-ecosystem/grpc-gateway from 1.12.2 to 1.13.0 (#442)
Bumps [github.com/grpc-ecosystem/grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) from 1.12.2 to 1.13.0.
- [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases)
- [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/CHANGELOG.md)
- [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v1.12.2...v1.13.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-12 09:28:18 +11:00
dependabot-preview[bot]
946eb604c7 Bump google.golang.org/grpc from 1.27.0 to 1.27.1 (#439)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.27.0 to 1.27.1.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.27.0...v1.27.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-07 11:34:47 +11:00
Adrian Gallagher
b949388994 General engine improvements (#437)
* Add exchange manager to engine

* Several improvements for engine and friends

1) New file.Exists func
2) gRPC TLS cert expiration date check and regeneration
3) New donation var for use across the codebase
4) Use Go log package until the logger is initialised

* Add cert tests and create dir tree if it doesn't exist for file.Write

* Link up donation address to documentation tool plus minor adjustments

* Fix remaining donation addrs

* Move non-needed reload exchange funcs

* Revert accidental config_example.json changes 🕯️

* Use go logger for logging until the logger has initiliased, otherwise no output will be seen

* Link up portfolio delay val and other fixes

* Run go mod tidy after dependabot PR

* Address nitterinos
2020-02-06 12:32:01 +11:00
Vazha
2e6ff1c398 Engine: SyncTimeout can't be set (#438)
* Bittrex GetDepositHistory method return new DepositHistory struct type

* Id field of DepositHistory type changed to int64

* check exchange (exist and enabled) before calling methods on, to avoid program crashes

* Update bittrex_types.go

* t2

* Program always uses the DefaultSyncerTimeout because c.SyncTimeout in engine/syncer.go newer set in code

* gofmt file

Co-authored-by: Ryan O'Hara-Reid <oharareid.ryan@gmail.com>
2020-02-06 12:02:37 +11:00
Ryan O'Hara-Reid
0a84c5d97a Request package update & rate limit system expansion (#413)
* Initial rework of rework of requester - WIP

* Implementing and checking rate limits - WIP

* implemented coinbene rate limiting shenanigans

* add in remaining WIP

* fixy

* use authenticated rate limit

* drop ceiling as this can be done with a counter later

* add functionality to struct

* purge config options for rate limiting so as to keep things minimal

* prepare futures and swap rate limiting for implementation

* Address linter issues

* Addressed nits, fixed race

* fix linter issue

* remove global var as this was only setting when newrequester was called

* moved rate limit functionality into its own file

* Update Bitfinex with correct rate limit and test endpoints (WIP)

* finish off bitfinex adjustments

* fixes

* fix linter issues

* slowed rate for coinbasepro

* drop rate limit for huobi as the doc times have intermittent 429 issues.

* Set MACOSX_DEPLOYMENT_TARGET to remove linking warning

* Addr Thrasher nits

* Addr glorious nits

* unexport do request function

* fixed nitorinos

* Fixed something I missed

* move disabled rate limiter into loadexchange and use interface functionality

* Add temp quick fix
2020-02-06 11:44:28 +11:00
dependabot-preview[bot]
4625ef9b94 Bump github.com/grpc-ecosystem/go-grpc-middleware from 1.1.0 to 1.2.0 (#436)
Bumps [github.com/grpc-ecosystem/go-grpc-middleware](https://github.com/grpc-ecosystem/go-grpc-middleware) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/grpc-ecosystem/go-grpc-middleware/releases)
- [Changelog](https://github.com/grpc-ecosystem/go-grpc-middleware/blob/master/CHANGELOG.md)
- [Commits](https://github.com/grpc-ecosystem/go-grpc-middleware/compare/v1.1.0...v1.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-04 12:48:53 +11:00
Adrian Gallagher
b8dfa443d3 Huobi: Add deposit address and withdraw quota API support (#433)
* Add Huobi deposit and withdraw quota API support
Plus perform come code deduplication

* Go mod tidy
2020-02-03 12:44:46 +11:00
Ryan O'Hara-Reid
a32d16e1f5 Expose auth validator functionality for wrapper (#416)
* expose auth validator functionality for wrapper

* Add REST validation after keys set, package account types for future syncing

* Add transient error checking for initial creddemtial validation

* fix command types

* Addressed nits from glorious person

* Amalgamate body within error when not between 2xx status, added btcmarket specific auth error check

* nit fix for glorious person

* Format fix

* removed unused code

* check transient first then validate if its an exchange specific authentication error, all others will be disregarded

* Addressed glorious nits

* Addressed glorious nits

* Moved account processing to updateaccountinfo func and added in fetch account info

* Add GRPC Account streaming (NOTE: could not complete until sync item added)

* RM exchange check

* Address xtda nits

* RM comment code

* Fix linter issues

* used most recent protoc version

* lbank linter issues fixed

* Addressed nits and changed len check to range in for loops

* Fixed timeout issue

* thrasher nits addressed

* add string holdings
2020-01-31 12:09:24 +11:00
dependabot-preview[bot]
db23af2ed6 Bump github.com/spf13/viper from 1.4.0 to 1.6.2 (#425)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.4.0 to 1.6.2.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.4.0...v1.6.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-30 14:38:02 +11:00
dependabot-preview[bot]
c49181d91c Bump github.com/lib/pq from 1.2.0 to 1.3.0 (#424)
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/lib/pq/releases)
- [Commits](https://github.com/lib/pq/compare/v1.2.0...v1.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-30 14:18:03 +11:00
dependabot-preview[bot]
aa080cc465 Bump github.com/grpc-ecosystem/grpc-gateway from 1.11.3 to 1.12.2 (#429)
Bumps [github.com/grpc-ecosystem/grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) from 1.11.3 to 1.12.2.
- [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases)
- [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/master/CHANGELOG.md)
- [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v1.11.3...v1.12.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-30 13:21:10 +11:00
Andrew
bc0c32de3e (PROFILING): Add config support for setting runtime.SetMutexProfileFraction() value (#432)
* Added config option for SetMutexProfileFraction() to profiler increased test coverage and made tests runnable standalone

* Removed duplicate host and no longer const

* Added pprof endpoint to log
2020-01-30 13:20:41 +11:00
dependabot-preview[bot]
5746fbb804 Bump github.com/pkg/errors from 0.8.1 to 0.9.1 (#431)
Bumps [github.com/pkg/errors](https://github.com/pkg/errors) from 0.8.1 to 0.9.1.
- [Release notes](https://github.com/pkg/errors/releases)
- [Commits](https://github.com/pkg/errors/compare/v0.8.1...v0.9.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-30 12:18:05 +11:00
dependabot-preview[bot]
a4b318316b Bump github.com/gorilla/websocket from 1.4.0 to 1.4.1 (#428)
Bumps [github.com/gorilla/websocket](https://github.com/gorilla/websocket) from 1.4.0 to 1.4.1.
- [Release notes](https://github.com/gorilla/websocket/releases)
- [Commits](https://github.com/gorilla/websocket/compare/v1.4.0...v1.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-30 12:04:40 +11:00
dependabot-preview[bot]
e8c7f9e2fe Bump google.golang.org/grpc from 1.21.1 to 1.27.0 (#426)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.21.1 to 1.27.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.21.1...v1.27.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-30 11:55:19 +11:00
dependabot-preview[bot]
de02a3356d Bump github.com/mattn/go-sqlite3 from 1.11.0 to 1.13.0 (#430)
Bumps [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) from 1.11.0 to 1.13.0.
- [Release notes](https://github.com/mattn/go-sqlite3/releases)
- [Commits](https://github.com/mattn/go-sqlite3/compare/v1.11.0...v1.13.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-30 11:27:32 +11:00
dependabot-preview[bot]
49a4fb557a Bump github.com/urfave/cli from 1.20.0 to 1.22.2 (#427)
Bumps [github.com/urfave/cli](https://github.com/urfave/cli) from 1.20.0 to 1.22.2.
- [Release notes](https://github.com/urfave/cli/releases)
- [Changelog](https://github.com/urfave/cli/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/urfave/cli/compare/v1.20.0...v1.22.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-30 11:10:56 +11:00
dependabot-preview[bot]
0cb0e4806b Bump github.com/grpc-ecosystem/go-grpc-middleware from 1.0.0 to 1.1.0 (#423)
Bumps [github.com/grpc-ecosystem/go-grpc-middleware](https://github.com/grpc-ecosystem/go-grpc-middleware) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/grpc-ecosystem/go-grpc-middleware/releases)
- [Changelog](https://github.com/grpc-ecosystem/go-grpc-middleware/blob/master/CHANGELOG.md)
- [Commits](https://github.com/grpc-ecosystem/go-grpc-middleware/compare/v1.0.0...v1.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-30 10:42:40 +11:00
dependabot-preview[bot]
500868b196 Bump github.com/golang/protobuf from 1.3.2 to 1.3.3 (#422)
Bumps [github.com/golang/protobuf](https://github.com/golang/protobuf) from 1.3.2 to 1.3.3.
- [Release notes](https://github.com/golang/protobuf/releases)
- [Commits](https://github.com/golang/protobuf/compare/v1.3.2...v1.3.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-30 10:25:07 +11:00
Adrian Gallagher
01e2ab1499 GCTCLI: Destination var/arg check usage fixes (#421)
* GCTCLI param and linter fixes

* Linter fixes

* Add more basic validation and address codelingo nits

* Add arg number support to cancelOrder and more validity checks
2020-01-29 16:27:06 +11:00
Christian Achilli
5ac5ec8fc1 Add OHLC retrieval func (GetHistoricCandles) to all exchanges and expose it as a wrapper func (#414)
* initial wiring to providegethistoricalcandles

* initial wiring to providegethistoricalcandles

* initial wiring to providegethistoricalcandles

* gethistriccandles work from cli using hard coded inputs

* gethistoriccandles RPC service and CLI working fine for coinbasepro

* fixed unit test

* input check on grpc for gethistoriccandles

* updated deps

* fixed the return value when a method is not yet implemented

* code review: fixed CLI input check and int32->int64

* code review: handling wrong exchange name

* added check on granularity and allowing start and end being empty

* code review: removed currency2

* code review: dependency reverted

* improved func comment

* typo in func comment

* get historic values tests

* unit tests for get historical rates on coinbasepro

* using time format time.RFC3339

* names to camel case and improved comments

* test cleanup

* changed to camel case

* added InArray tests

* dropped not needed string time

* enforced use of int64

* fixed make check

* cleaned up code organisation to be consistent

* fixed Travis remarks

* more Travis remarks

* added comments

* regenerated proto files after merge

* linter fix
2020-01-24 16:10:33 +11:00
Andrew
e5b64a5580 (COMMON): Basic (Least Recently Used) LRU caching system (#420)
* started adding basic lru cache system

* Added basic LRU cache including Add Get Remove Contains ContainsOrAdd Clear

* wording changes on comments

* removed exported var's in strut as they are not required

* Added README

* README updates

* rm line :D

* swapped to mutex over rwmutex updated comments

* unexported getNewest & getOldest

* unexported getNewest & getOldest

* Updated comments and cited references in source

* updated comments
2020-01-24 13:59:33 +11:00