Commit Graph

1141 Commits

Author SHA1 Message Date
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
Andrew
f6fd94ea69 Engine: Scripting support (#383)
* WIP

* updated appveyor and increased deadline 5 seconds due to increased linters being added

* revert files to upstream/engine

* WIP

* WIP

* mod file changes

* added script manager

* Added manager/and cli interfaces to scripting

* Added script task handler

* WIP - Added timer/repeat support and fleshed out wrapper further

* autoload support added + WIP

* WIP commit

* added account balance info

* btc markets temp work around

* WIP - merged with upstream for new order package BTC Markets responses broken

* Cancel order wrapper WIP

*  order wrapper update

* Added test coverage for VM

* moved to map for VM List shutdown of all VM now handled added gctcli commands for list and stop of running scripts

* added override to load/execute for path

* fixed incorrect channel shutdown added further test coverage and restructured gctcli commands into sub commands

* increased test coverage for packages

* Added docs cleaned up tests and example scripts

* Test coverage increased for module/gct/exchange package

* windows fixes

* merged upstream/engine

* WIP

* logger fixes - removed pointer to bool check removed duplicate test check for logger

* remove unused mutex

* added inital upload support

* fix linter issues for go-fmt

* added zip support for uploading and added base for fund withdrawing

* changed error return types and also log errors, fix zip path issue

* improved error outputs and code flow

* pairs response fix added protobuf defs for stop all and list all

* added stop all running scripts general clean up and moved across to OrderManager

* linter fixes (gofmt)

* added list all command

* rewrote zip handler to be cleaner also fixed file overwrite on upload

* added query command reworked tests

* added further error checking to compileandrun corrected use of pointers for accountinfo

* bumped tengo version

* Removed named returns reworded log messages removed unused falseptr

* WIP

* Added virutal machine limit improved config options

* added model for script event added upload validation

* script_event table has been completed, tests for wrapper functions implemented

* README updates

* reverted changes opened new PR to move withdraw struct outs

* intial work on adding withdraw support after merger of withdraw package

* started work on examples

* Added crypto withdraw support

* fix switch case assignment and gofmt project

* Reworking Fiat withdraw request pending #402

* removed double pointer call

* added withdraw support for fiat  currencies

* added tests for withdraw methods increased readme

* removed local tengo require and also fix linter issues

* Added default log size const added basic test for invalid script execution

* First pass at moving wrapper to validator package to allow proper validation of uploaded scripts

* Added script details to README added config test added test for no file extension

* moved tests to const and fixed incorrect pathing

* added test coverage to withdraw package

* corrected file close handling

* point to included configtest.json

* extended validator support when a script is uploaded

* Bug fix on bool logic

* Added mutex

* Don't create autit events on test execution

* reverted common to master

* moved file rename to unix timestamp format

* converted logger enabled back to pointer as i need nilness check also moved scriptid to text over blob

* started work on autoload add/remove support

* First round of PR fixes (mostly commented exports)

* Moved GCTScript load to last, removed unneeded error from cleanup()

* Comment clairty for AuitEventID

* added autoload add/remove command to cli

* added tests for autoload

* Test updates for Exchanges

* linter fixes (gofmt)

* Removed double check of engine pointer

* remove possible nil pointer on GetSpecificTicker

* Fixed not closing file handler on write that causes archive removal to fail

* file handler Close clean ups

* corrected spelling on error return and return invalid name n autoload

* moved strings to cosnt moved bool pointer creation to convert package

* new zip extractor added

* Validation has been added to archive uploads

* removed shadow var on err

* added ok check to conversion

* converted condition check

* basic test for zip extract added

* new zip handler

* reverted back to old atomic loading system

* removed shadow err

* lets add a new line

* added space to error return

* command line toggle for script now works properly

* readme updated

* set configLoaded to true

* check for configLoaded condition

* added mutex to allow for multiple access on virtual machine increased test coverage disable script manager if scripting is disabled

* linked up to enable/disablesubsystem commands

* added start/stop example to readme

* reworked logic on test as check should be done on Load()

* updated to tengo v2

* linters

* lower time on ntp client to stop slippage

* remove all fails if any fail validtion from an archive

* remove vm from list if timer is invalid

* removed shadow on err

* remove config creation from NTPCheck test

* WIP testing DB changes

* add unique constraint

* WIP: created has many model

* linters run

* basic sqlite3 support added for new database format

* linters run

* Added test coverage for script repo

* removed unused print

* updated env vars for CI instances

* updated env vars for CI instances

* Updated test packages

* Test updates for postgresql

* removed invalid tests from postgres

* remove duplication of struct and improved code flow

* general cleanup

* wording changes on log output

* use databasemgr logger and add support for autoload without file extension

* corrected test naming

* return correct error

* return correct error again version 82

* store scriptdata on creation

* Hello

* Errorln -> Errorf

* Removed unused vars

* Read me updates

* testing without parallel

* comment on exported type

* added nil check against VM for test

* add debugging information

* gofmt

* remove verbose and data sent to channel

* Added debug information

* linter fixes (gofmt)

* remove unused CompileAndRun() call

* test sleep to see if issue is timing related

* semi-concurrent map fixes

* one day i will run gofmt or setup precommit hooks

* new line :D

* increased test coverage

* added correct sleep time

* Moved over to sync map

* linter fixes (gofmt)

* goimports

* moved VM related methods to vm.go

* new line at end of file

* trying increased timeout on golangci-lint for appveyor

* add debugging information

* removed timeout

* reworked timeout logic

* linter fixes (gofmt)

* increased test coverage

* increased test coverage

* one day i will run gofmt or setup precommit hooks

* removed unused exchange test

* increased golangci-lint timeout

* Added nil check on shutdown and test coverage for it lowered timeout back to 1:30

* reworked ID system

* removed script hash as it was unused

* added comments on exported methods and read me update

* reorder code

* removed to atomic.value for test execution flag

* increased test coverage

* move add further up execution

* point to correct script file
2020-01-23 13:54:04 +11:00
Vazha
4c33a0738a Bittrex - changed type of field "Id" in DepositHistory struct (#419)
* 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
2020-01-22 11:30:14 +11:00
Scott
4b9de0fdd0 LintFix: Bittrex properties and tests (#418)
* Updates id property. Changes int to int64. Updates tests

* Adds some happy little spaces
2020-01-16 09:56:09 +11:00
Adrian Gallagher
7a90aecf6f Bugfix: Introduces a new config.DefaultFilePath func (#415)
* Introduces a new config.DefaultFilePath func

* FiX GrAmMeRiNo
2020-01-16 08:10:25 +11:00
Vazha
838b378c21 Bittrex GetDepositHistory method return new DepositHistory struct type (#417) 2020-01-16 08:10:07 +11:00
Adrian Gallagher
26b8e95eb0 Use atomic.LoadInt32/AddInt32 for database subsystem (#412) 2020-01-14 10:27:26 +11:00
Andrew
12159e36fa (COMMON/FILE) Add Zip create/extract support (#411)
* Added Zip archive support

* extended test coverage

* extended test coverage for unzip and zip

* cleaned up Zip() and moved walk to non-exported method increased test coverage

* underscore unused params

* remove unneeded var

* check against correct error and return after

* Errorf

* z -> f

* fixed wording on tests

* handle fine handler close error
2020-01-13 10:55:10 +11:00
Scott
44ac3586a0 Bugfix: Websocket ping/pong improvements (#406)
* Renames func. Creates new func to setup pinghander either via gorilla style or our own

* Cleans up all ping pong handlers.......

* Clears up issues, makes naming a bit better

* Adds tests

* Adds ping support to binance

* Cleans up ping pongs and adds a comment

* Cleans up waitgroup stuff.

* DISCREETLY cleans up woeful function

* Fixes Kraken ping message type. Removes unnecessary test property. Adds `if err == websocket.ErrCloseSent {` to ping func

* +1 for +v
2020-01-03 15:47:46 +11:00
Adrian Gallagher
4e05ad41e3 Exchanges: Remove ANX from codebase (#408)
* Remove ANX from codebase

* Doc changes
2020-01-03 14:12:52 +11:00
Scott
f8ef6da93d Logger: Add support for toggling sub logger name output for log events (#407)
* Adds new optional log field. Adds padding to the fields to make it have a consistent output

* Line space and correct err message

* Removes padding code

* Moves `ShowLogSystemName` to advanced settings

* Uppers the names. Prevents pointer crash. Adds to config_example.json

* Adds test scenario for nil and true ShowLogSystemName

* buffer reset
2020-01-03 14:12:23 +11:00
Ryan O'Hara-Reid
98a277a4c3 Bugfixes: Bitfinex websocket, ZB market response and portfolio (#397)
* bug fix for websocket orderbook processing

* Fix more panics

* fix linter issue

* kick panic can down the road

* temp fix for issue with a 404 returned error as chainz.cryptoid dropped eth support

* Address nits and fixed orderbook updating

* Fix trade data, rm'd event time from struct

* fix time conversion for huobi

* Actually process kline data and fix time stamps

* btse time conversion fix and RM log, as it seems that the gain is reflecting transaction side. Drop ticker fetching support because there does not seem to be support on docs. And added trade fetching support.

* revert huobi println

* Adressed suggestion

* rm unnecessary assignment

* rm unnecessary check and assign

* fix conversion mishap

* fix currency conversion bug

* update websocket logging

* RM websocket type which stops conversion and copy

* fix linter issue, add in unknown side type
2019-12-19 13:40:30 +11:00
Adrian Gallagher
467d8d91a2 Coinbene: Add swap endpoints and code cleanup/bugfixes (#403)
* Start Coinbene SWAP implementation

* Flesh out more API endpoints

* Code cleanup

* Add more endpoints, bug fixes and order validation checks

* More endpoints, tests and bugfixes

* Remove omitempty for enabled/available pairs
2019-12-18 17:36:07 +11:00
Andrew
edc07f7839 [Config] Add "ID" field to BankAccount struct & GetBankAccountByID method (#402)
* added id field to bank struct

* fixed casing on error message

* whitespace :D

* turns out you shouldn't turn multiple tests at the same time that modify a var
2019-12-18 11:38:36 +11:00
Andrew
e37512e94f (BTC Markets) Ticker batching support (#399)
* moved to getticekers endpoint

* add support for tickerbatching

* const and things

* moved openOrders to bool

* gofmt and clean up test logs

* revert canManipulateRealOrders to false
2019-12-18 10:56:02 +11:00
Andrew
40122b3094 (CLI) Fix getorders command currency pair filtering (#400)
* add currency pair filtering to getorders

* long live the Queen

* fixed wording on tests
2019-12-18 09:12:58 +11:00
Andrew
75ac5ee791 (Exchange Interface) Convert Fetch & Update orderbook/ticker methods to return pointers (#398)
* moved order and ticker fetching to return a pointer

* return nil instead of empty struct

* fixed incorrect nil

* general cleanup
2019-12-17 15:54:09 +11:00
Adrian Gallagher
44aa1e306c Fix exchange_template missing import (#401) 2019-12-17 15:53:11 +11:00
Andrew
a727beeb15 (BTC Markets): Wrapper SubmitOrder parameter order fix & IsOrderPlaced condition correction (#394)
* corrected param order Side -> Type, also corrected condition check for IsOrderPlaced

* send open status for GetActiveOrders

* GetActiveOrder() changes to include OrderID and status matching

* BTC Markets batch order limit fixes & SplitStringSliceByLimit  method

BTC markets batch end points have limits (20 for cancel 50 for query) adds new method SplitStringSliceByLimit in common to split a slice by limit and return slice of slice

* rm line :D

* Added test for SplitStringSliceByLimit and moved to const

* ntp client reworked to not return error if no valid time servers are found but default to system

* clean up

* new line added

* use TimeMgr sublogger and wording correction on output

* Moved to DialTimeout() & Removed SetDeadline call

* removed line

* added setdeadline fix

* goimport file

* removed unused error from NTPClient as we now default to system time if no server can be reached

* Added checks for number overflows

* converted to uint as you should not be passing a negative number in

* Increased test cases for NTPClient

* Removed Helper call as no longer outputting any data from function

* removed unused param
2019-12-16 14:47:54 +11:00
Adrian Gallagher
25e290563c Exchange: Pair formatting/loading/SetDefaults improvements (#396)
* Improve exchange pair loading/setting/formatting

* Update configs

* Link up forceUpdate for OKEX

* Fix linter issues

* Rearrange exchPS

* Fix typerino

* Config updates
2019-12-13 13:10:17 +11:00
Adrian Gallagher
bab4cd98be Merge pull request #395 from xtda/withdrawal
[Exchanges] Move withdraw related struct's into own package
2019-12-13 13:03:53 +11:00
Andrew Jackson
64e5997ab1 goimport file 2019-12-13 12:15:35 +11:00
Andrew Jackson
9178dbcc61 removed withdraw from struct name: 2019-12-13 08:36:07 +11:00
Andrew Jackson
b8e8c25f78 Renamed structs to remove package name 2019-12-13 08:26:55 +11:00
Andrew Jackson
732e9735ba reverted rpc.pb.go change 2019-12-12 14:22:47 +11:00
Andrew Jackson
db25bb1374 removed empty file 2019-12-12 14:17:02 +11:00
Andrew Jackson
a91d147781 Moved withdraw structs into own package 2019-12-12 14:16:45 +11:00
Adrian Gallagher
473092a69c Merge pull request #382 from thrasher-corp/engine
Merge engine branch into master
2019-12-09 16:35:58 +11:00
lozdog245
8c30505d46 String concatenation/conversion/formatting improvements (#393)
* Magic strings

* Comment, format and builder fixes
2019-12-09 11:44:01 +11:00
Adrian Gallagher
17a786536d Engine pre-merge changes (#392)
* Engine pre merge changes

* Remove redundant "seconds"
2019-12-04 16:25:55 +11:00
Scott
11a68a9bb7 Utilising authenticated websocket functions in exchange wrappers (#384)
* Basic concept commit

* Initial changes to support bitfinex v2. Reverts linter changes as they suck. Exports bitfinex ws types

* Adds ticker, trade and orderbook support

* Candles sub that returns no data COMPLETE

* Adds authenticated ws support

* Adds the barebones endpoints to support

* Adds more endpoints

* Even more endpoints

* minicommit to switch and test

* All the interactive types

* Adds support for simultaneous connections. Updates tests. Nothing is working

* Successfully adds place order. Moves all authenticated endpoints to new switch case

* Cancel order and modify order

* Cancel all orders, cancel multi orders

* Finalises implementation. Uses testMain

* Adds WS wrapper support for some funcs

* Fixing rebasing issues

* Replaces use of currency as a variable. Updates a lot of coinut websocket auth endpoint stuff

* Fixes some fun for loops with GetEnabledPairs

* Fixes tests impacted by currency var change

* Adds coinut support for WS functions. Replaces `order` vars with `ord`. Fixes some for loops too. Removes verbose from bitfinex

* So many panics

* I'm fixing a hole, where the panics get in, and stops my mind from wandering, where it will go

* Moves func `CanUseAuthenticatedWebsocketEndpoint` to Websocket package as it fits better. Adds test coverage of `CanUseAuthenticatedWebsocketEndpoint`

* Finishes up all of coinuts ws implementations.

* GateIO implementation

* Adds some helper funcs for types, sides and status. Adds support for huobi. Removes unnecessary type

* Adds forgotten huobi endpoint

* Fixes cancel order endpoint

* go hates my formatting and so do I

* The process to get authenticated kraken websocket to work. Uses testmain. Adds new auth channel, auth subscriptions, auth data handling. Not working yet

* Finishes open orders handling

* Mini update for status only updates

* Fixes some kraken points

* Finishes WS kraken since it doesn't work

* Unfinished commit, cleaning up types

* Finishes the const replacing

* Fixes extra GetNAmes after rebase

* An end to the cleanup. testmain for gateio

* Adds ZB support

* Bitfinex cleanup. Renamed func

* Testmain-47s for everyone!!! yayaaaaaaa

* Adds kraken websocket wrapper support

* Fixes rebase issues

* Fixes tests from rebase

* Adds test for conversion. Fixes for loop. Updates test order pricing. Fixes some poor made tests. Adds proper error handling for ws responses instead of logging them. Fixed issue where commented code ruined kraken ws.

* Fixes secret linting issues. Prioritises bitfinex channelID responses over authorised

* Fixes sloppy error/var declarations

* Fixes crazy bad logic where submit order errors weren't really considered. Parralols alphapoint/alphapoint_test.go. Removes buffer for multi-websocket comms channel.

* Removal of inline string and removal of redundant nil checkerinos

* Fixes err checks. Checks whether float has decimal. Fixes append. Drops omitempties. Parallel to some tests. Moves var declarations

* Replaces my lazy sprintfs with strconv.FormatInt(time.Now().Unix(), 10)

* Adds shiny new FullyMatched bool. Fixes coinbene buy sell consts

* Fixes oopsie with coinbene const replacement

* Fixes currency issue

* Cleans up new places that use JSONDecode

* Fixes huge panic bug from string int conversion. Adds large testtable for strings to order types

* Fixes some more strconversion issues. Fixes table test var usage. Changes mapperino name

* Added some new scenarios for number splitting

* Fixes lint issues

* negative num fix

* Typo fix

* Accuracy warning comment
2019-12-04 14:16:23 +11:00
Adam
a33ddcfa0a Engine: BTC Markets V3 Updates (#385)
* Broken WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

* Errors Fixed

* PR Changes

* PR Changes

* PR Changes

* PR Changes

* PR Changes

* PR Changes

* PR Changes

* PR Changes

* PR Changes

* Offline Fees Fixed

* MarketCandles fixed and constants added

* t.log deleted

* Broken WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

WIP

* Errors Fixed

* PR Changes

* PR Changes

* PR Changes

* MarketCandles fixed and constants added

* t.log deleted

* Added BSB and Order Status

* WIP

* Websocket and BatchPlaceCancelOrder and other minor nits fixed

* Linter Issues Fixed

* Function Name Change

* Replacing b.GetMarkets with b.GetEnabledPairs

* Pagination param changes and PlaceCancelBatch changes

* Merge Conflicts WIP

* Linter Issue Fixed

* optional params fixed
2019-12-04 11:53:35 +11:00
Adrian Gallagher
49b9eced66 Always set go.sum/go.mod line endings as LF (#391)
Saves having Windows users experience pain and suffering as documented
here:

https://github.com/golang/go/issues/31870
2019-12-03 13:33:28 +11:00
Ryan O'Hara-Reid
0c5d75b22c (Engine) Variety of engine updates (#390)
* drop common uuid v4 func and imported package as needed

* removed common functions regarding json marshal and unmarshal and used the json package directly. WRT unmarshal it was calling reflect and converted to string which is also checked in the JSON package so it was doing a double up, this will be a tiny gain as it was directly used in the requester package for all our outbound requests.

* add in string

* explicitly throw away return error value

* atleast return the error that websocket initialise returns

* return error when not connected

* fix comment

* Adds comments

* move package declarations

* drop append whenever we call supported

* remove unused import

* Change incorrect spelling

* fix tests

* fix go import issue
2019-12-03 10:06:08 +11:00
Adrian Gallagher
c27b8657e2 Add 32-bit linux build target for Travis (#389)
* Add 32bit build matrix test

* Adjust travis/Makefile

* Set dist back to xenial

* export CGO_ENABLED=1

* Add gcc-multilib

* Sudo installerino

* make check -> make test
2019-12-03 08:44:57 +11:00
Ryan O'Hara-Reid
24bddcc090 Add directories to exclusion list && change default repo string (#387)
* Add directories to exclusion list && change default repo string

* Add in .idea folder to directory exclusion list

* cleaned

* Added support for calling the tool outside of its file

* fix formatting

* changed strings
2019-11-29 11:14:19 +11:00
Adrian Gallagher
d636882310 Use sync.Mutex instead of sync/atomic for 32 bit systems (#388)
Change CLRF -> LF
2019-11-29 10:38:44 +11:00
Adrian Gallagher
e20d204b19 Fix Docker os.Rename invalid cross-device link issue (#386)
* Adds new file.Move func to address a bug with Golang/Docker volumes when using os.Rename

Also uses TempDir for tests instead of live directories and increases test coverage for file.Write

* Goimport the imports

* Make usage of file package name consistent so it no longer clashes with vars

* Remove outputFile if io.Copy fails
2019-11-28 11:56:05 +11:00
Adrian Gallagher
63191ce3ec Engine QA (#381)
* 1) Update Dockerfile/docker-compose.yml
2) Remove inline strings for buy/sell/test pairs
3) Remove dangerous order submission values
4) Fix consistency with audit_events (all other spec files use
CamelCase)
5) Update web websocket endpoint
6) Fix main param set (and induce dryrun mode on specific command line
params)

* Engine QA

Link up exchange syncer to cmd params, disarm market selling bombs and fix OKEX endpoints

* Fix linter issue after merge

* Engine QA changes

Template updates
Wrapper code cleanup
Disarmed order bombs
Documentation updates

* Daily engine QA

Bitstamp improvements
Spelling mistakes
Add Coinbene exchange to support list
Protect API authenticated calls for Coinbene/LBank

* Engine QA changes

Fix exchange_wrapper_coverage tool
Add SupportsAsset to exchange interface
Fix inline string usage and add BCH withdrawal support

* Engine QA

Fix Bitstamp types
Inform user of errors when parsing time accross the codebase
Change time parsing warnings to errors (as they are)
Update markdown docs [with linter fixes]

* Engine QA changes

1) Add test for dryrunParamInteraction
2) Disarm OKCoin/OKEX bombs if someone accidently sets canManipulateRealOrders to true and runs all package tests
3) Actually check exchange setup errors for BTSE and Coinbene, plus address this in the wrapper template
4) Hardcode missing/non-retrievable contributors and bump the contributors
5) Convert numbers/strings to meaningful types in Bitstamp and OKEX
6) If WS is supported for the exchange wrapper template, preset authWebsocketSupport var

* Fix the shadow people

* Link the SyncContinuously paramerino

* Also show SyncContinuously in engine.PrintSettings

* Address nitterinos and use correct filepath for logs

* Bitstamp: Extract ALL THE APM

* Fix additional nitterinos

* Fix time parsing error for Bittrex
2019-11-22 16:07:30 +11:00
lozdog245
52e2686b9e Change exchanges usage of GetName to Name (#378)
* Change exchanges usage of GetName to Name

* Changed GetName to Name
2019-11-20 09:50:14 +11:00
Adrian Gallagher
af5556efe6 Merge branch 'master' into engine 2019-11-18 17:19:11 +11:00