Commit Graph

1749 Commits

Author SHA1 Message Date
TaltaM
a024ad53ae websocket: Check for slice size to avoid panic when classifying empty binary message (#1219)
* Check for slice size to avoid panic when classifying empty resp

* Simplify according to suggestion
2023-06-09 09:24:33 +10:00
Gareth Kirwan
bb449c2085 Binance: Fix WorkingTime breaking executionReport (#1218)
This new field was added in the 2022-12-05 updates.
It's not always in an execution report, but only if isWorking=true
2023-06-06 11:26:13 +10:00
dependabot[bot]
bfe0be0ff2 build(deps): bump github.com/spf13/viper from 1.15.0 to 1.16.0 (#1215)
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.15.0 to 1.16.0.
- [Release notes](https://github.com/spf13/viper/releases)
- [Commits](https://github.com/spf13/viper/compare/v1.15.0...v1.16.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/viper
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-05 17:25:17 +10:00
dependabot[bot]
dcb66aab56 build(deps): bump github.com/grpc-ecosystem/grpc-gateway/v2 (#1212)
Bumps [github.com/grpc-ecosystem/grpc-gateway/v2](https://github.com/grpc-ecosystem/grpc-gateway) from 2.15.2 to 2.16.0.
- [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases)
- [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/main/.goreleaser.yml)
- [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v2.15.2...v2.16.0)

---
updated-dependencies:
- dependency-name: github.com/grpc-ecosystem/grpc-gateway/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-05 17:10:07 +10:00
dependabot[bot]
81f53ba9c8 build(deps): bump github.com/mattn/go-sqlite3 from 1.14.16 to 1.14.17 (#1213)
Bumps [github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) from 1.14.16 to 1.14.17.
- [Release notes](https://github.com/mattn/go-sqlite3/releases)
- [Commits](https://github.com/mattn/go-sqlite3/compare/v1.14.16...v1.14.17)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-sqlite3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-05 16:44:24 +10:00
dependabot[bot]
97869f494f build(deps): bump github.com/urfave/cli/v2 from 2.25.4 to 2.25.5 (#1214)
Bumps [github.com/urfave/cli/v2](https://github.com/urfave/cli) from 2.25.4 to 2.25.5.
- [Release notes](https://github.com/urfave/cli/releases)
- [Changelog](https://github.com/urfave/cli/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/urfave/cli/compare/v2.25.4...v2.25.5)

---
updated-dependencies:
- dependency-name: github.com/urfave/cli/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-05 16:22:10 +10:00
dependabot[bot]
42238b03b9 build(deps): bump bufbuild/buf-setup-action from 1.19.0 to 1.20.0 (#1216)
Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action) from 1.19.0 to 1.20.0.
- [Release notes](https://github.com/bufbuild/buf-setup-action/releases)
- [Commits](https://github.com/bufbuild/buf-setup-action/compare/v1.19.0...v1.20.0)

---
updated-dependencies:
- dependency-name: bufbuild/buf-setup-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-05 16:20:45 +10:00
Ryan O'Hara-Reid
d086c45b0a Bitfinex: filter security asset type from spot trading pairs (#1191)
* bitfinex: filter security pairs from spot trading

* asset: add securities type

* bitfinex: remove print

* linter: fix

* gomod tidy

* glorious: nits

* bitfinex: just some orderbook fun and added a pass through for bitfinex funding rate when rate == 0

* bitfinex: move update function from testmain to localised test

* test: fix up

* glorious:nits

* bitfinex; fix casing test

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-06-05 11:53:07 +10:00
Gareth Kirwan
86a540173d websocket: Fix redundant connection monitor error upon disconnect (#1210)
When an existing ws disconnects the connection manager goro will call Connect.
This prevents Connect trying to start another connection manager if it's
already running
2023-06-05 11:51:43 +10:00
Adrian Gallagher
400bcb6b56 telegram: Fix pushing events to an authorised client list (#1208)
* fix_communications_authorised_clients

* Telegram: Link config to authorised clients list

* Telegram: Prevent multiple spam messages from unauthed user

* Telegram: Improve command handling for authenticated users

Telegram doesn't allow you to easily fetch the user ID of a user unless they have previously sent you a message and is currently waiting to be processed, or if they message you on the fly once the bot is connected. This ensures that the user ID is stored for future usage upon a single successful auth command.

It also fixes the offset as the previous code wouldn't be able to process incoming messages once connected and instead only relay them.

* Bump docs

* default to UTC time in case bot is run on a server with diff time zones

* Enhance config for already upgraded configs

---------

Co-authored-by: shanhuhai5739 <shanhu5739@gmail.com>
2023-06-05 10:37:13 +10:00
Samuael A
3eac6d12bd exchanges: Update GateIO exchange to V4 (#1058)
* Adding Public Endpoints and test functions

* Adding public endpoints and test functions

* Adding private spot endpoints

* Adding private endpoints and corresponding tests for margin

* Adding Margin Private endpoints

* Adding cross margin and flash swap endpoints

* Adding futures private endpoints

* Adding futures private endpoints and corresponding tests

* Adding Options and SubAccount endpoints and their unit tests

* Adding Wrapper functions

* Complete wrapper functions and corresponding unit test functions

* Fixing wrapper issues and adding websocket functions

* Update of Spot websocket and adding futures websocket handlers

* completed futures WS push data endpoints

* Completed Options websocket endpoints

* Adding websocket support for delivery futures and slight update on endpoint funcs

* Added Delivery websocket support and fix linter issues

* Update on Unit tests

* fix slight currency format error

* Fix slight endpoint tempos

* Update on conditional statements and unit tests issues

* fixing slight tempos

* Slight model and websocket data push method change

* Fix unit test tempos and updating models

* Fix on code structures and update on unit tests

* Slight code fix

* Remove print statements

* Update on tradable pairs fetch eps

* Fix websocket tempos

* Adding types to websocket routine manager

* Fix slight issues

* Slight fixes

* Updating wrapper funcs and models

* Slight update

* Update on test

* Update on tradable pairs

* update conditional statements

* Fixing slight issues

* Updating unit tests

* Minor fixes depending review comments

* Remove redundant method declaration

* Adding missing intervals

* Updating fetch tradable pairs

* update tradable pairs issues

* Addressing small tempos

* Slight fix on ticker

* Minor Fixes

* Minor review comment fixes

* Unit test and minor code updates

* Slight code updates

* Minor updates depending review comments

* Fixes

* Updating incoming message matcher

* Fix missing merge issue

* Fix minor wrapper issues

* Updating ratelimit and other issues

* Updating endpoint models and adding missing eps

* Update on code structure and models

* Minor codespell fixes

* Minor update on models

* fix unit test panic

* Minor race fix

* Fix issues in generating signature and unit tests

* Minor update on wrapper and unit tests

* Minor fix on wrapper

* Mini linter issues fix

* Minor fix

* endpoint fixes and slight update

* Minor fixes

* Updating exchange functions and unit tests

* Unit test and wrapper updates

* Remove options candlestick support

* Minor unit test and wrapper fix

* Unit test update

* minor fix on unit test and wrapper

* endpoints constants name change

* Add minor wrapper issues

* endpoint constants update

* endpoint url updates

* Updating subscriptions

* fixing dual mode endpoint methods

* minor fix

* rm small tempo

* Update on websocket orderbook handling

* Orderbook and currency pair update

* fix linter and test issues

* minor helper function update

* Fix wrapper coverage and wrapper issues

* delete unused variables

* Minor fix on ReadData() call

* separating websocket handlers

* separating websocket handlers

* Minor fix on enabled pair

* minor fix

* check instrument availability in spot

* create a separate subscriber for sake of multiple websocket connection

* linter fix

* minor websocket and gateio endpoints fix

* fix nil pointer exception

* minor fixes

* spelling fix decerializes -> deserializes

* fix Bitfinex unit test issues

* minor unknown currency pair labling fix

* minor currency pair handling fix

* slight update on GetDepositAddress wrapper unit test

* setting max request job to 200

* fixing numerical and timestamp type convert

* fix value overflow error

* change method of parsing orderbook price

* unifying timestamp conversion types to gateioTime

---------

Co-authored-by: Samuael Adnew <samuaelad@Samuaels-MacBook-Air.local>
2023-05-30 14:03:53 +10:00
dependabot[bot]
d6bff305c7 build(deps): bump github.com/urfave/cli/v2 from 2.25.3 to 2.25.4 (#1207)
Bumps [github.com/urfave/cli/v2](https://github.com/urfave/cli) from 2.25.3 to 2.25.4.
- [Release notes](https://github.com/urfave/cli/releases)
- [Changelog](https://github.com/urfave/cli/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/urfave/cli/compare/v2.25.3...v2.25.4)

---
updated-dependencies:
- dependency-name: github.com/urfave/cli/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-30 10:09:58 +10:00
dependabot[bot]
9bb7361fab build(deps): bump bufbuild/buf-setup-action from 1.18.0 to 1.19.0 (#1205)
Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action) from 1.18.0 to 1.19.0.
- [Release notes](https://github.com/bufbuild/buf-setup-action/releases)
- [Commits](https://github.com/bufbuild/buf-setup-action/compare/v1.18.0...v1.19.0)

---
updated-dependencies:
- dependency-name: bufbuild/buf-setup-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-23 09:20:52 +10:00
Gareth Kirwan
0ecd082254 wsManager: Fix IsRunning true before flushed (#1201)
* Engine: Expose WebsocketRoutineManager

Without exposing the manager users don't know when it's ready to use.

* wsManager: Remove duplicate shutdown chan make

The shutdown channel was already in setup.
Consumers could reasonably expect it to not be replaced in between the
two, and it's not really part of Start to assign it.

* wsManager: Fix IsRunning true before flushed

Consumers must be able to tell when it's safe to start new
subscriptions. Before this fix any new subscriptions would get unsubbed
as part of the flush during `websocketRoutine`.

* WSM: Fix Stop/Start/Stop failing

We previously removed the shutdown channel from Start to avoid duplicate
allocation.
However that will result in a closed channel after the first Stop
So it's better to remove it from the setup.
It's private anyway.

* WSM: Export WebsocketRoutineManager type
2023-05-23 09:19:28 +10:00
Gareth Kirwan
d4e7736bf7 Okx: Fix ping handler (#1203)
Ping handler for okx is not the RFC compat version gorilla would
support. Even if it was, I think the UseGorillaHandler is
broken/misconceived because it does not send keepalive pings, it responds to them.

This also increases the delay to 27, in keeping with the 30 second
timeout documented.

I think this issue was hidden by the noisy default subs.
When just using funding-rates, it showed straight away.
2023-05-18 13:52:06 +10:00
Gareth Kirwan
234287307d Okx: Fix GetFundingRateHistory limit (#1204)
Fix limit of 100 rejected
Allow a limit of 0 for using the default value of limit (currently 100).
2023-05-18 12:17:52 +10:00
Gareth Kirwan
4095bc9133 Okx: Fix websocket fundingRate sub not sending instId (#1200)
instId is a required API field
2023-05-16 17:34:28 +10:00
Adrian Gallagher
b2eb030578 OKX: Update to new savings module (#1195)
* OKX: Update to new savings module

* Update exchanges/okx/okx_types.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

---------

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
2023-05-16 14:55:07 +10:00
dependabot[bot]
f051118724 build(deps): bump golang.org/x/crypto from 0.8.0 to 0.9.0 (#1198)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.8.0 to 0.9.0.
- [Commits](https://github.com/golang/crypto/compare/v0.8.0...v0.9.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-15 16:37:10 +10:00
Gareth Kirwan
6464a8a7e0 Binance: Fix exchange order limits not populating (#1187)
* Binance: Fix Exchange Order Limits not populating

The order of the filters cannot be trusted. New filters have been added
after the 2nd filter, breaking all filter passing afterwards.

This adds a basic test that the data is being populated, but more could
be done on testing.

We should have stricter typing on the filters, perhaps by unmarshalling into
json.RawMessage initially and then into typed stuct fields based on the
filterType. Finally we should spot both missing and unhandled filters, at least in
tests.

* Binance: Add TODO for unhandled filterTypes
2023-05-12 17:20:01 +10:00
Ryan O'Hara-Reid
8309ddf80c orders: Add AdjustBaseAmount (#1181)
* orders: Add AdjustBaseAmount method that alerts if non-fatal change occurs exchange side, adjust BTCM

* glorious: nits

* glorious: nits

* thrasher: nits

* Update exchanges/btcmarkets/btcmarkets_wrapper.go

Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>

* Update exchanges/btcmarkets/btcmarkets_wrapper.go

Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>

* thrasher: nits and whoopsie

* orders_test: fix

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2023-05-12 14:06:04 +10:00
Ryan O'Hara-Reid
db8735ec99 log: Add structured logging (#1171)
* basic implementation

* log: deprecate duplicate function, add tests and refine calls.

* linter: fixes

* linter: update struct

* linter and new type

* log tests: update to not lint issue

* linter: stop complaining please

* glorious: nits

* log: rm comment code

* glorious: nits

* glorious: nits

* glorious: nits

* glorious: nits missed

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-05-10 17:52:53 +10:00
Gareth Kirwan
6e1cbfc31e OKX: Support exchange order limits (#1186)
* OKX: Support exchange order limits

Adds support for PriceStepIncrementSize and MinAmount limits

* OKX: Test UpdateOrderExecutionLimits on all assets

* OKX: Added asset types for order limit tests
2023-05-09 10:59:09 +10:00
Gareth Kirwan
970f65ba72 OKX: Fix balance using funding account (#1175)
It looks like this was an oversight.
No other exchange uses the funding account for balance and it wouldn't
make sense.
Again, this aims to be minimally invasive and backwards compatible, so
GetBalance is left alone to preserve compat.
2023-05-09 10:49:23 +10:00
Ryan O'Hara-Reid
616b45ae14 exmo: refactor UpdateTickers function (#1180)
* exmo: filter pairs that are not currently enabled by last update time

* stop filtering, add tests to qualify all deployable can be retrieved

* glorious: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-05-09 10:17:15 +10:00
Ryan O'Hara-Reid
2d2d115ac9 hitbtc: optimise fetching tradable pairs and tickers (#1184)
* hitbtc: fix and optimise tradable pairs and tickers fetching

* Update exchanges/hitbtc/hitbtc_test.go

Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>

* Update exchanges/hitbtc/hitbtc_test.go

Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>

* thrasher: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2023-05-09 10:09:24 +10:00
dependabot[bot]
ef3337deee build(deps): bump google.golang.org/grpc from 1.54.0 to 1.55.0 (#1188)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.54.0 to 1.55.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.54.0...v1.55.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-08 17:33:01 +10:00
Ryan O'Hara-Reid
22fd3562b2 kraken: when fetching tradable pairs filter by status (#1183)
* kraken: when fetching tradable pairs filter by status

* linter/nits: fixed

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-05-08 17:31:58 +10:00
dependabot[bot]
26edb59f6b build(deps): bump github.com/urfave/cli/v2 from 2.25.2 to 2.25.3 (#1189)
Bumps [github.com/urfave/cli/v2](https://github.com/urfave/cli) from 2.25.2 to 2.25.3.
- [Release notes](https://github.com/urfave/cli/releases)
- [Changelog](https://github.com/urfave/cli/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/urfave/cli/compare/v2.25.2...v2.25.3)

---
updated-dependencies:
- dependency-name: github.com/urfave/cli/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-08 16:59:45 +10:00
Ryan O'Hara-Reid
8a6916353f OKX: Fix GetAvailableTransferChains bug (#1177)
* okx: fix get cryptocurrency deposit address for chain bug

* Update exchanges/okx/okx_wrapper.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* Update exchanges/okx/okx_wrapper.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* Revert "Update exchanges/okx/okx_wrapper.go"

This reverts commit 4345f57ce0e984f562ec576aeebc09407a1d2544.

* okx: temp filter for available transfer chain

* glorious: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
2023-05-08 16:09:13 +10:00
dependabot[bot]
19897e99c5 build(deps): bump bufbuild/buf-setup-action from 1.17.0 to 1.18.0 (#1190)
Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action) from 1.17.0 to 1.18.0.
- [Release notes](https://github.com/bufbuild/buf-setup-action/releases)
- [Commits](https://github.com/bufbuild/buf-setup-action/compare/v1.17.0...v1.18.0)

---
updated-dependencies:
- dependency-name: bufbuild/buf-setup-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-08 16:08:33 +10:00
Ryan O'Hara-Reid
31efa4f35e poloniex: filter non-liquid and unused assets (#1185)
* poloniex: filter non-liquid and unused assets

* glorious: nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-05-08 15:41:49 +10:00
Ryan O'Hara-Reid
f6fbe77f8c BTSE: Filter no liquidity pairs (#1182)
* BTSE: Filter no liquidity pairs

* thrasher: update commentary

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-05-05 10:55:00 +10:00
dependabot[bot]
e74461173c build(deps): bump github.com/urfave/cli/v2 from 2.25.1 to 2.25.2 (#1179)
Bumps [github.com/urfave/cli/v2](https://github.com/urfave/cli) from 2.25.1 to 2.25.2.
- [Release notes](https://github.com/urfave/cli/releases)
- [Changelog](https://github.com/urfave/cli/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/urfave/cli/compare/v2.25.1...v2.25.2)

---
updated-dependencies:
- dependency-name: github.com/urfave/cli/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-01 16:47:05 +10:00
dependabot[bot]
5657fa5d28 build(deps): bump github.com/lib/pq from 1.10.8 to 1.10.9 (#1178)
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.10.8 to 1.10.9.
- [Release notes](https://github.com/lib/pq/releases)
- [Commits](https://github.com/lib/pq/compare/v1.10.8...v1.10.9)

---
updated-dependencies:
- dependency-name: github.com/lib/pq
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-01 16:44:04 +10:00
Ryan O'Hara-Reid
f8d567eec2 OKX: Fix GetActiveOrders bug and remove redundant json.Unmarshal call (#1176)
* Fix GetActiveOrders bug and remove redundant json.unmarshal call.

* @thrasher- eagle eye nits

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
2023-05-01 13:47:49 +10:00
Gareth Kirwan
229f965192 OKX: Fix authenticated websocket blocking during login (#1174)
The channels for the ws multiplexer weren't made;
so any interaction with it would block.
Tests passed because they invasively setup the multiplexer.

There are quite a few architectural risks with this implementation
pattern, such as leaking an uncancellable goro in a for-select loop.
Ideally WsConnect should take a cancellable context and any selects
should watch for ctx.Done()

That's a very invasive and pervasive change though, so this fix is as minimal and
atomic as possible.
Will consider opening a PR for cancellable context or improving this
multiplexer pattern.
2023-05-01 10:40:53 +10:00
Ryan O'Hara-Reid
b20cf75d13 sharedtestvalues: Add helper functions and implement throughout exchange tests (#1163)
* exchanges/sharedtestvalues: implement new functions to handle test skipping and announcements for standardising.

* exchanges: fin test impl.

* linter: fixes

* exchange_template: fix test

* allocate so it doesn't make a panic at the disco

* glorious: nits

* glorious: nits

* Update exchanges/sharedtestvalues/sharedtestvalues.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* Update exchanges/sharedtestvalues/sharedtestvalues.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* glorious: nits

* linter: fix

* linter: shhhh

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
2023-04-28 13:05:42 +10:00
Derek
492ea20f21 fix_ok_sell_bug (#1173) 2023-04-27 10:16:12 +10:00
Samuael A
969669cb0d linters: Bump golangci-lint version to v1.52.2 and fix issues (#1169)
* fix linter issues

* linter issue suppressing and fixing

* change linter version and linter issues fix

* Bump version
2023-04-27 10:13:46 +10:00
Ryan O'Hara-Reid
42475bf2b8 exchanges: add setTimeWindow boolean to GetKlineRequest param (#1160)
* exchanges: add setTimeWindow boolean to GetKlineRequest params to differentiate between a set time period return from endpoint.

* glorious: nits

* exchange: conjugation

* Update exchanges/exchange.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* glorious: nits and an assortment of differences

* exchanges: remove some comments

* glorious: nits

* cleanup

* tests: fix

* Update exchanges/hitbtc/hitbtc_wrapper.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* Update exchanges/kline/kline.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* Update exchanges/kline/kline_test.go

Co-authored-by: Scott <gloriousCode@users.noreply.github.com>

* glorious: nits

* kline: fix test

* rm unused variables

* almost: nits

* glorious: nits

* linter: fix

* rm unused variable

* Refactored comment in the okex tests to ensure that it accurately reflects the variable name and the issue related to the time window, as requested by GloriousCode. The previous comment did not align with the identifier assigned to the property, which could cause confusion and misunderstanding among other programmers or stakeholders. The updated comment will improve the clarity and readability of the codebase and make it easier to understand the intended purpose of the associated variables. The change was made with the aim of improving the overall quality and maintainability of the code.

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
2023-04-27 10:10:19 +10:00
dependabot[bot]
668d083749 build(deps): bump github.com/lib/pq from 1.10.7 to 1.10.8 (#1170)
Bumps [github.com/lib/pq](https://github.com/lib/pq) from 1.10.7 to 1.10.8.
- [Release notes](https://github.com/lib/pq/releases)
- [Commits](https://github.com/lib/pq/compare/v1.10.7...v1.10.8)

---
updated-dependencies:
- dependency-name: github.com/lib/pq
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-27 10:01:09 +10:00
dependabot[bot]
2c54822374 build(deps): bump github.com/d5/tengo/v2 from 2.14.0 to 2.16.0 (#1172)
Bumps [github.com/d5/tengo/v2](https://github.com/d5/tengo) from 2.14.0 to 2.16.0.
- [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.14.0...v2.16.0)

---
updated-dependencies:
- dependency-name: github.com/d5/tengo/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-27 09:11:59 +10:00
dependabot[bot]
21ff7d3dd3 build(deps): bump golang.org/x/crypto from 0.7.0 to 0.8.0 (#1167)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/golang/crypto/releases)
- [Commits](https://github.com/golang/crypto/compare/v0.7.0...v0.8.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-11 10:12:11 +10:00
dependabot[bot]
3b7cc2f7ee build(deps): bump bufbuild/buf-setup-action from 1.16.0 to 1.17.0 (#1168)
Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/bufbuild/buf-setup-action/releases)
- [Commits](https://github.com/bufbuild/buf-setup-action/compare/v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: bufbuild/buf-setup-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-11 10:09:53 +10:00
Ryan O'Hara-Reid
d23898e63a engine: Adds shutdown method to exchange manager and unload all exchanges when engine is stopped (#1112)
* engine: shutdown and unload exchange when engine is stopped

* linter: fixes

* engine/exchMan: add nil check

* engine/exchanges: add shutdown method to exchanges, rm len check lock not needed, expanded code coverage, address some nits

* exchMan: report all failed shutdowns across exchanges, implement timer and monitoring routines.

* exchMan: improve shutdown sequence and aloc.

* further improvement

* exchman: log from warn to error

* websockconnection: Suppress error return when closure is caused by library

* linter: fix

* fix racies

* add note on why not parallel tests

* glorious: nits

* spelling kween

* thrasher: nits

* engine: change print of setting using reflection, I keep forgetting to implement this so program around forgetfulness

* engine/exchange_management: remove wait group and just rely on intermediary lock

* glorious: nits

* Update common/common.go

Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>

* Update main.go

Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>

---------

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
2023-04-05 13:07:35 +10:00
dependabot[bot]
4a50a72e4a build(deps): bump bufbuild/buf-setup-action from 1.15.1 to 1.16.0 (#1165)
Bumps [bufbuild/buf-setup-action](https://github.com/bufbuild/buf-setup-action) from 1.15.1 to 1.16.0.
- [Release notes](https://github.com/bufbuild/buf-setup-action/releases)
- [Commits](https://github.com/bufbuild/buf-setup-action/compare/v1.15.1...v1.16.0)

---
updated-dependencies:
- dependency-name: bufbuild/buf-setup-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-03 17:52:19 +10:00
dependabot[bot]
c45c48f6fa build(deps): bump golang.org/x/crypto from 0.6.0 to 0.7.0 (#1148)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/golang/crypto/releases)
- [Commits](https://github.com/golang/crypto/compare/v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-02 11:58:57 +10:00
dependabot[bot]
35c9d755c8 build(deps): bump github.com/grpc-ecosystem/grpc-gateway/v2 (#1147)
Bumps [github.com/grpc-ecosystem/grpc-gateway/v2](https://github.com/grpc-ecosystem/grpc-gateway) from 2.15.1 to 2.15.2.
- [Release notes](https://github.com/grpc-ecosystem/grpc-gateway/releases)
- [Changelog](https://github.com/grpc-ecosystem/grpc-gateway/blob/main/.goreleaser.yml)
- [Commits](https://github.com/grpc-ecosystem/grpc-gateway/compare/v2.15.1...v2.15.2)

---
updated-dependencies:
- dependency-name: github.com/grpc-ecosystem/grpc-gateway/v2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-02 11:43:28 +10:00
dependabot[bot]
1c57ab9feb build(deps): bump google.golang.org/protobuf from 1.28.1 to 1.30.0 (#1155)
Bumps [google.golang.org/protobuf](https://github.com/protocolbuffers/protobuf-go) from 1.28.1 to 1.30.0.
- [Release notes](https://github.com/protocolbuffers/protobuf-go/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf-go/blob/master/release.bash)
- [Commits](https://github.com/protocolbuffers/protobuf-go/compare/v1.28.1...v1.30.0)

---
updated-dependencies:
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-02 11:41:39 +10:00