Deribit seems to have opened up more instruments for future combos and
is using a `-` delimiter in them, throwing off our parsing rule that
it's always 3 parts for them.
This change adds in the "FS" part, which seems consistent.
I would have added checking for such a part to option_combo but some of
them are missing it :/
* Bybit: Fix race in TestUpdateAccountInfo and TestWSHandleData
* DriveBy rename TestWSHandleData
* This doesn't address running with -race=2+ due to the singleton
* Accounts: Add account.GetService()
* exchange: Assertify TestSetupDefaults
* Exchanges: Add account.Service override for testing
* Exchanges: Remove duplicate IsWebsocketEnabled test from TestSetupDefaults
* Dispatch: Replace nil checks with NilGuard
* Engine: Remove deprecated printAccountHoldingsChangeSummary
* Dispatcher: Add EnsureRunning method
* Accounts: Move singleton accounts service to exchange Accounts
* Move singleton accounts service to exchange Accounts
This maintains the concept of a global store, whilst allowing exchanges
to override it when needed, particularly for testing.
APIServer:
* Remove getAllActiveAccounts from apiserver
Deprecated apiserver only thing using this, so remove it instead of
updating it
* Update comment for UpdateAccountBalances everywhere
* Docs: Add punctuation to function comments
* Bybit: Coverage for wsProcessWalletPushData Save
* Exchanges: Remove example BespokeGenerateMessageID
* Okx: Replace conn.RequestIDGenerator with MesssageID
Continued overall direction to remove the closed-loop of e => conn => e
roundtrip for message ids
* Exchanges: Add MessageSequence
This method removes the either/or nature of message id generation.
We don't tie the message ids to connections, or to anything.
Consumers just call whichever they want, or even combine them as they
want.
Anything more complicated will need a separate installation anyway
* GateIO: Split usage of MessageID and MessageSequence
* Binance: Switch to UUID message IDs
* Kraken: Switch to e.MessageSequence
* Kucoin: Switch to MessageID
* HitBTC: Switch to UUIDv7 for ws message ID
* Bybit: Switch to UUIDv7 for ws message ID
* Bitfinex: Switch to UUIDv7 and MessageSequence
Tested CID - It accepts 53 bits only for an int, so MessageSequence
makes sense. Can't use MessageID
* Websocket: Remove now unused MessageID function
Moved all MessageID usage into funcs and onto base methods, to remove
the closed loop of message IDs
* Docs: Update guidance for message signatures
```
❯ go test ./engine/... -run TestGetDefaultConfig
--- FAIL: TestGetDefaultConfigurations (2.01s)
--- FAIL: TestGetDefaultConfigurations/hitbtc (0.39s)
panic: runtime error: slice bounds out of range [:-1] [recovered, repanicked]
```
The code was using strings.Index to find the quote currency position in the
symbol ID, then slicing the ID. When Index returns -1 (not found), it caused
a panic with 'slice bounds out of range [:-1]'.
Fixed by using the BaseCurrency and QuoteCurrency fields directly from the
Symbol struct, which is the correct approach and what the API provides.
* codebase: Remove web frontend and related services
* refactor: Update StartPPROF to accept context and adjust related tests
* refactor: Simplify SetIfZero functions and update related tests
* config: Clarify DowngradeConfig method documentation regarding permanent removal of deprecated fields
* refactor: Rename setIfZeroAndWarn to setDefaultIfZeroWarn for clarity and update related calls
* refactor: Update error handling in DataHistoryManager and remove redundant error variable
* Binance: Refactor GetAggregatedTradesBatched and fix test
Fixes#2010
* Binance: Fix TestGetHistoricTrades
* BinanceUS: Refactor and fix GetAggregatedTradesBatched
* Binance: Add QuoteAsset to UCompositeIndexInfo and fix intermittent test fail
* fixup! Binance: Refactor GetAggregatedTradesBatched and fix test
* fix whoops
* const trafficCheckInterval; rm testmain
* y
* fix lint
* bump time check window
* stream: fix intermittant test failures while testing routines and remove code that is not needed.
* spells
* cant do what I did
* protect race due to routine.
* update testURL
* use mock websocket connection instead of test URL's
* linter: fix
* remove url because its throwing errors on CI builds
* connections drop all the time, don't need to worry about not being able to echo back ws data as it can be easily reviewed _test file side.
* remove another superfluous url thats not really set up for this
* spawn overwatch routine when there is no errors, inline checker instead of waiting for a time period, add sleep inline with echo handler as this is really quick and wanted to ensure that latency is handing correctly
* linter: fixerino uperino
* fix ID bug, why I do this, I don't know.
* glorious: panix
* linter: things
* whoops
* dont need to make consecutive Unix() calls
* websocket: fix potential panic on error and no responses and adding waitForResponses
* bybit: enable multiconnection handling across websocket endpoints
* rm debug lines
* bybit: Add websocket trading functionality across all assets
* rm json parser and handle in json package instead
* in favour of json package unmarshalling
* Add bool ConnectionDoesNotRequireSubscriptions so that we don't need to handle dummy sub
* handle pong response
* spelling
* linter: fix
* fix processing issues with tickers
* fix processing issues with tickers
* linter: fix
* linter: fix again
* * change field name OutboundRequestSignature to WrapperDefinedConnectionSignature for agnostic inbound and outbound connections.
* change method name GetOutboundConnection to GetConnection for agnostic inbound and outbound connections.
* drop outbound field map for improved performance just using a range and field check (less complex as well)
* change field name connections to connectionToWrapper for better clarity
* spells and magic and wands
* merge: fixup
* linter: fix
* spelling: fix
* glorious: nits
* comparable check for signature
* mv err var
* rm comment as it does not
* update time fields for orderbook latency
* fix time conversion
* Add func MatchReturnResponses
* glorious: nits and stuff
* lint: fix
* attempt to fix race
* linter: fix
* fix tests
* types/time: strict usage of time type for usage with unix timestamps
* fix tests etc
* Allow match back with order details
* Add time in force values for different order types + extra return information on websocket trading
* glorious: nits
* gk: nits; engine log cleanup
* gk: nits; OCD
* gk: nits; move function change file names
* gk: nits; 🚀
* gk: nits; convert variadic function and message inspection to interface and include a specific function for that handling so as to not need nil on every call
* gk: nits; continued
* gk: engine nits; rm loaded exchange
* gk: nits; drop WebsocketLoginResponse
* stream: Add match method EnsureMatchWithData
* gk: nits; rn Inspect to IsFinal
* gk: nits; rn to MessageFilter
* linter: fix
* gateio: update rate limit definitions (cherry-pick)
* Add test and missing
* Shared REST rate limit definitions with Websocket service, set lookup item to nil for systems that do not require rate limiting; add glorious nit
* integrate rate limits for websocket trading spot
* bybit: split public and private processing to dedicated handler add supporting function and tests
* use correct handler for private inbound connection
* bybit/websocket: allow a shared ID between outbound payloads for inbound matching
* conform to match upstream changes
* standardise names to upstream style
* fix wrapper standards test when sending a auth request through a websocket connection
* whoops
* Update exchanges/gateio/gateio_types.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* glorious: nits
* linter: fix
* linter: overload
* whoops
* spelling fixes on recent merge
* glorious: nits
* linter: fix?
* glorious: nits
* gk: assert errors touched
* gk: unexport derive functions
* gk: nitssssssss
* fix test
* gk: nitters v1
* gk: http status
* gk/nits: Add getAssetFromFuturesPair
* gk: nits single response when submitting
* gk: new pair with delimiter in tests
* gk: param update slice to slice of pointers
* gk: add asset type in params, includes t.Context() for tests
* linter: fix
* linter: fix
* fix merge whoopsie
* glorious: nits
* gk: nit
* linter: fix
* glorious: nits
* linter/misc: fix and remove meows
* linter: fix
* misc/linter: fix
* change function names
* okx: update requestID gen func without func wrapping
* RM: functions not needed
* Update docs/ADD_NEW_EXCHANGE.md
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* gk: nitsssssss
* linter: fix
* Update exchanges/bybit/bybit_test.go
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* Update exchanges/bybit/bybit_test.go
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* gk: nit words
* cranktakular: nits
* websocket: skip connections with subscriptions not required during channel flush
* websocket: simplify error handling in FlushChannels using if short
* linter: fix
* cranktakular: nits and expand coverage
* linter: fix?
* misc fix
* cranktakular: missing nit which I thumbed up but did not do. Sillllllly billlyyyy nilllyyy
* fix comments
* bybit: fix merge regression on websocket message filter
* cranktakular: nits
* bybit: Add global rate limits for websocket
* ai: nits
* linter: fix
* cranktakular: purge DCP ref/handling and add another TODO
* Update exchanges/bybit/bybit_websocket.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* glorious: nits
* fix test
* fix alignment issue and rm println
* Update exchanges/bybit/bybit_websocket.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* Update exchanges/bybit/bybit_websocket.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* glorious: fix
* Update exchanges/bybit/bybit_websocket.go
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* bybit: use connection method for segregated match on multi-connection
* cleanup after master merge
* fix test and config whoops
* cranktakular: nits
* exchange: add missing tests for base method websocket order funcs
* cranktakular: nits and refresh + tests
* cranktakular: pedantic nits
* linter: fixes
* t.Parallel tests
* glorious nit
* Update exchange/websocket/connection.go
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* gk: nits
* boss king: nits
* canktakular: nits
* Update exchanges/bybit/bybit_websocket.go
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* Update exchanges/bybit/bybit_websocket_requests.go
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* Update exchanges/bybit/bybit_websocket_requests.go
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* Update exchanges/bybit/bybit_websocket_requests.go
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* Update exchanges/bybit/bybit_websocket_requests.go
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* gk: nits
* linter: fix
* Update exchanges/bybit/bybit.go
Co-authored-by: Samuael A. <39623015+samuael@users.noreply.github.com>
* Update exchanges/bybit/bybit.go
Co-authored-by: Samuael A. <39623015+samuael@users.noreply.github.com>
* bossking: nits
* gk: much nicer design
* gk: revised naming for consideration
* gk: nits
* gk: nits restrict in configtest.json and not worry about many pairs enabled
* rm log
* linter: fix
* codex: nit
* cranktakular: nits
* Update exchanges/bybit/bybit_websocket_requests.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* Update exchanges/bybit/bybit_websocket_requests.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* Update exchanges/bybit/bybit_wrapper.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* glorious: nits!
* thrasher: nits
---------
Co-authored-by: shazbert <ryan.oharareid@thrasher.io>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
Co-authored-by: Samuael A. <39623015+samuael@users.noreply.github.com>
* Deribit: Switch to string IDs
Switch from int to string IDs so we can use UUID.v7 instead of (the only) local high precision message id implementation
* Deribit: Dedup wsResponse / wsResponse
* Deribit: Use uuid v7 for IDs
This moves away from centralising message ids.
There's no real benefit to moving them to a central generator, since we
can one-line it, and reduce our testing plane and complexity.
And it's more concise for exchanges to say "I'm using this UUID".
* Deribit: Handle errors from StartHeartbeat
* Deribit: Simplify WS ID matching
* Exchanges: Add MessageID function to base
* set limiter to first level mock data list and updated unit tests
* address nested slices length limit
* minor fix recording file and update unit tests
* minor updates on unit tests
* re-record mock files and minor fix on the unit tests ti adapt the mock data change
* improve http recording limit value and fix issues with mock data in binance
* added MockDataSliceLimit in request items and resolve minor unit test issues
* resolve missed conflict
* rename mock variables, resolve unit test issues, and other updates
* minor fix to CheckJSON and update unit tests
* minor unit test fix
* further optimization on mock CheckJSON method, unit tests, and re-record poloniex
* common and recording unit tests fix
* minor linter issues fix
* unit tests format fix
* fix miscellaneous error
* unit tests fix and minor docs update
* re-record and reduce mock file size
* indentation fix
* minor assertion test fix
* reverted log.Printf line in live testing
* rename variables
* update NewVCRServer unit test
* replace string comparison with *net.OpError check
* restructur net error test
* exchanges/mock: Remove redundant error assertion message in TestNewVCRServer
---------
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* build/linters: Bump Go to v1.25 and golangci-lint to v2.4.0
* refactor: Update TODO comments for net.Listen and net.DialTimeout; improve variable naming in websocket and exchange methods
* refactor: Rename massageMissingData to backfillMissingData for clarity and update references in RSI and MFI calculations
* fix: Correct typo in TODO comment for net.Listen in RPC server
* #1947
bugfix: added a filter to eliminate zero quantity of bids and asks at bithumb::GetOrderBook
feature: added assertions in TestGetOrderBook
* resolved comments
* refactor: rename FilterZeros to FilterZeroQuantities and update orderbook filtering logic
---------
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* glorious: whooops
* gk: nits
* Leak issue and edge case
* Websocket: Add SendMessageReturnResponses
* whooooooopsie
* gk: nitssssss
* Update exchanges/stream/stream_match.go
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* Update exchanges/stream/stream_match_test.go
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* linter: appease the linter gods
* gk: nits
* gk: drain brain
* started
* more changes before merge match pr
* gateio: still building out
* gateio: finish spot
* fix up tests in gateio
* Add tests for stream package
* rm unused field
* glorious: nits
* rn files, specifically set function names to asset and offload routing to websocket type.
* linter: fix
* Add futures websocket request support
* gateio: integrate with IBOTExchange (cherry pick my nose)
* linter: fix
* glorious: nits
* add counter and update gateio
* fix collision issue
* Update exchanges/stream/websocket.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* glorious: nits
* add tests
* linter: fix
* After merge
* Add error connection info
* upgrade to upstream merge
* Fix edge case where it does not reconnect made by an already closed connection
* stream coverage
* glorious: nits
* glorious: nits removed asset error handling in stream package
* linter: fix
* rm block
* Add basic readme
* fix asset enabled flush cycle for multi connection
* spella: fix
* linter: fix
* Add glorious suggestions, fix some race thing
* reinstate name before any routine gets spawned
* stop on error in mock tests
* glorious: nits
* Set correct price
* glorious: nits found in CI build
* Add test for drain, bumped wait times as there seems to be something happening on macos CI builds, used context.WithTimeout because its instant.
* mutex across shutdown and connect for protection
* lint: fix
* test time withoffset, reinstate stop
* fix whoops
* const trafficCheckInterval; rm testmain
* y
* fix lint
* bump time check window
* stream: fix intermittant test failures while testing routines and remove code that is not needed.
* spells
* cant do what I did
* protect race due to routine.
* update testURL
* use mock websocket connection instead of test URL's
* linter: fix
* remove url because its throwing errors on CI builds
* connections drop all the time, don't need to worry about not being able to echo back ws data as it can be easily reviewed _test file side.
* remove another superfluous url thats not really set up for this
* spawn overwatch routine when there is no errors, inline checker instead of waiting for a time period, add sleep inline with echo handler as this is really quick and wanted to ensure that latency is handing correctly
* linter: fixerino uperino
* fix ID bug, why I do this, I don't know.
* glorious: panix
* linter: things
* whoops
* dont need to make consecutive Unix() calls
* websocket: fix potential panic on error and no responses and adding waitForResponses
* bybit: enable multiconnection handling across websocket endpoints
* rm debug lines
* rm json parser and handle in json package instead
* in favour of json package unmarshalling
* fix processing issues with tickers
* linter: fix
* linter: fix again
* * change field name OutboundRequestSignature to WrapperDefinedConnectionSignature for agnostic inbound and outbound connections.
* change method name GetOutboundConnection to GetConnection for agnostic inbound and outbound connections.
* drop outbound field map for improved performance just using a range and field check (less complex as well)
* change field name connections to connectionToWrapper for better clarity
* spells and magic and wands
* merge: fixup
* linter: fix
* spelling: fix
* glorious: nits
* comparable check for signature
* mv err var
* glorious: nits and stuff
* attempt to fix race
* linter: fix
* fix tests
* types/time: strict usage of time type for usage with unix timestamps
* fix tests etc
* glorious: nits
* gk: nits; engine log cleanup
* gk: nits; OCD
* gk: nits; move function change file names
* gk: nits; 🚀
* gk: nits; convert variadic function and message inspection to interface and include a specific function for that handling so as to not need nil on every call
* gk: nits; continued
* gk: engine nits; rm loaded exchange
* gk: nits; drop WebsocketLoginResponse
* stream: Add match method EnsureMatchWithData
* gk: nits; rn Inspect to IsFinal
* gk: nits; rn to MessageFilter
* linter: fix
* gateio: update rate limit definitions (cherry-pick)
* Add test and missing
* Shared REST rate limit definitions with Websocket service, set lookup item to nil for systems that do not require rate limiting; add glorious nit
* integrate rate limits for websocket trading spot
* bybit: split public and private processing to dedicated handler add supporting function and tests
* use correct handler for private inbound connection
* conform to match upstream changes
* standardise names to upstream style
* fix wrapper standards test when sending a auth request through a websocket connection
* whoops
* Update exchanges/gateio/gateio_types.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* glorious: nits
* linter: fix
* linter: overload
* whoops
* spelling fixes on recent merge
* glorious: nits
* linter: fix?
* glorious: nits
* gk: assert errors touched
* gk: unexport derive functions
* gk: nitssssssss
* fix test
* gk: nitters v1
* gk: http status
* gk/nits: Add getAssetFromFuturesPair
* gk: nits single response when submitting
* gk: new pair with delimiter in tests
* gk: param update slice to slice of pointers
* gk: add asset type in params, includes t.Context() for tests
* linter: fix
* linter: fix
* fix merge whoopsie
* glorious: nits
* gk: nit
* linter: fix
* glorious: nits
* linter/misc: fix and remove meows
* okx: update requestID gen func without func wrapping
* RM: functions not needed
* Update docs/ADD_NEW_EXCHANGE.md
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* gk: nitsssssss
* linter: fix
* Update exchanges/bybit/bybit_test.go
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* Update exchanges/bybit/bybit_test.go
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* gk: nit words
* cranktakular: nits
* linter: fix
* cranktakular: nits and expand coverage
* linter: fix?
* misc fix
* cranktakular: missing nit which I thumbed up but did not do. Sillllllly billlyyyy nilllyyy
* cranktakular: nits
* cranktakular: purge DCP ref/handling and add another TODO
* Update exchanges/bybit/bybit_websocket.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* glorious: nits
* fix test
* fix alignment issue and rm println
* Update exchanges/bybit/bybit_websocket.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* Update exchanges/bybit/bybit_websocket.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* glorious: fix
* Update exchanges/bybit/bybit_websocket.go
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* Update common/common.go
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* Update common/common_test.go
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* Update exchanges/bybit/bybit_test.go
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* gk: nits
* gk: nit with test
---------
Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
Co-authored-by: Adrian Gallagher <adrian.gallagher@thrasher.io>
* docs: Create new CODING_GUIDELINES doc
Rids excess contribution instructions from other packages
Adds AGENTS.md file for the AI overlords
Rids unused templates
Updates ADD_NEW_EXCHANGE.md with minor fixes
* docs: Fix linter issues and minor adjustments based on Copilot feedback
* docs: Update coding guidelines for API parameters and testing practices
* docs: Remove redundant GoDoc references
Adds copilot-instructions.md
* docs: Update CODING_GUIDELINES with export recommendations and test commentary
* docs: Fix formatting inconsistencies in ADD_NEW_EXCHANGE.md links
* docs: Update struct naming conventions for request and response types
* docs: Improve clarity and consistency in ADD_NEW_EXCHANGE.md and CODING_GUIDELINES.md
* refactor: Simplify error handling in QueryOrder method
* gateio: Add multi asset websocket support WIP.
* meow
* Add tests and shenanigans
* integrate flushing and for enabling/disabling pairs from rpc shenanigans
* some changes
* linter: fixes strikes again.
* Change name ConnectionAssociation -> ConnectionCandidate for better clarity on purpose. Change connections map to point to candidate to track subscriptions for future dynamic connections holder and drop struct ConnectionDetails.
* Add subscription tests (state functional)
* glorious:nits + proxy handling
* Spelling
* linter: fixerino
* instead of nil, dont do nil.
* clean up nils
* cya nils
* don't need to set URL or check if its running
* stream match update
* update tests
* linter: fix
* glorious: nits + handle context cancellations
* stop ping handler routine leak
* * Fix bug where reader routine on error that is not a disconnection error but websocket frame error or anything really makes the reader routine return and then connection never cycles and the buffer gets filled.
* Handle reconnection via an errors.Is check which is simpler and in that scope allow for quick disconnect reconnect without waiting for connection cycle.
* Dial now uses code from DialContext but just calls context.Background()
* Don't allow reader to return on parse binary response error. Just output error and return a non nil response
* Allow rollback on connect on any error across all connections
* fix shadow jutsu
* glorious/gk: nitters - adds in ws mock server
* linter: fix
* fix deadlock on connection as the previous channel had no reader and would hang connection reader for eternity.
* glorious: whooops
* gk: nits
* Leak issue and edge case
* Websocket: Add SendMessageReturnResponses
* whooooooopsie
* gk: nitssssss
* Update exchanges/stream/stream_match.go
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* Update exchanges/stream/stream_match_test.go
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
* linter: appease the linter gods
* gk: nits
* gk: drain brain
* glorious: nits
* glorious: nits
* glorious: nits
* start to decouple match from a global reference to a connection
* Update exchanges/stream/websocket.go
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* glorious: nits
* add tests
* linter: fix
* After merge
* Add error connection info
* Fix edge case where it does not reconnect made by an already closed connection
* stream coverage
* glorious: nits
* glorious: nits removed asset error handling in stream package
* linter: fix
* rm block
* Add basic readme
* fix asset enabled flush cycle for multi connection
* spella: fix
* linter: fix
* Add glorious suggestions, fix some race thing
* reinstate name before any routine gets spawned
* stop on error in mock tests
* glorious: nits
* glorious: nits found in CI build
* Add test for drain, bumped wait times as there seems to be something happening on macos CI builds, used context.WithTimeout because its instant.
* mutex across shutdown and connect for protection
* lint: fix
* test time withoffset, reinstate stop
* fix whoops
* const trafficCheckInterval; rm testmain
* y
* fix lint
* bump time check window
* stream: fix intermittant test failures while testing routines and remove code that is not needed.
* spells
* cant do what I did
* protect race due to routine.
* update testURL
* use mock websocket connection instead of test URL's
* linter: fix
* remove url because its throwing errors on CI builds
* connections drop all the time, don't need to worry about not being able to echo back ws data as it can be easily reviewed _test file side.
* remove another superfluous url thats not really set up for this
* spawn overwatch routine when there is no errors, inline checker instead of waiting for a time period, add sleep inline with echo handler as this is really quick and wanted to ensure that latency is handing correctly
* linter: fixerino uperino
* glorious: panix
* linter: things
* whoops
* match naming with master changes
* stream: Add tests
* gk: nits on potential blockage in test
* gk; nits assert value
---------
Co-authored-by: shazbert <ryan.oharareid@thrasher.io>
Co-authored-by: Gareth Kirwan <gbjkirwan@gmail.com>
Co-authored-by: Scott <gloriousCode@users.noreply.github.com>
* workflows: Add check for zero width unicode characters
* refactor: exclude .git directory in zero width unicode character check
* Include additional zero width unicode character in check
* refactor: update zero width unicode check to include format characters
* Added TimeInForce type and updated related files
* Linter issue fix and minor coinbasepro type update
* Bitrex consts update
* added unit test and minor changes in bittrex
* Unit tests update
* Fix minor linter issues
* Update TestStringToTimeInForce unit test
* Exchange test template change
* A different approach
* fix conflict with gateio timeInForce
* minor exchange template update
* Minor fix to test_files template
* Update order tests
* Complete updating the order unit tests
* Updating exchange wrapper and test template files
* update kucoin and deribit wrapper to match the time in force change
* minor comment update
* fix time-in-force related test errors
* linter issue fix
* ADD_NEW_EXCHANGE documentation update
* time in force constants, functions and unit tests update
* shift tif policies to TimeInForce
* Update time-in-force, related functions, and unit tests
* fix linter issue and time-in-force processing
* added a good till crossing tif value
* order type fix and fix related tim-in-force entries
* update time-in-force unmarshaling and unit test
* consistency guideline added
* fix time-in-force error in gateio
* linter issue fix
* update based on review comments
* add unit test and fix missing issues
* minor fix and added benchmark unit test
* change GTT to GTC for limit
* fix linter issue
* added time-in-force value to place order param
* fix minor issues based on review comment and move tif code to separate files
* update on exchanges linked to time-in-force
* resolve missing review comments
* minor linter issues fix
* added time-in-force handler and update timeInForce parametered endpoint
* minor fixes based on review
* nits fix
* update based on review
* linter fix
* rm getTimeInForce func and minor change to time-in-force
* minor change
* update based on review comments
* wrappers and time-in-force calling approach
* minor change
* update gateio string to timeInForce conversion and unit test
* update exchange template
* update wrapper template file
* policy comments, and template files update
* rename all exchange types name to Exchange
* update on template files and template generation
* templates and generation code and other updates
* linter issue fix
* added subscriptions and websocket templates
* update ADD_NEW_EXCHANGE.md with recent binance functions and implementations
* rename template files and update unit tests
* minor template and unit test fix
* rename templates and fix on unit tests
* update on template files and documentation
* removed unnecessary tag fix and update templates
* fix Add_NEW_EXCHANGE.md doc file
* formatting, comments, and error checks update on template files
* rename exchange receivers to e and ex for consistency
* rename unit test exchange receiver and minor updates
* linter issues fix
* fix deribit issue and minor style update
* fix test issues caused by receiver change
* raname local variables exchange declaration variables
* update templates comments
* update templates and related comments
* renamed ex to e
* update template comments
* toggle WS to false to improve coverage
* template comments update
* added test coverage to Ws enabled and minor changes
---------
Co-authored-by: Samuel Reid <43227667+cranktakular@users.noreply.github.com>
* exchanges: Refactor time handling and other minor improvements
- Updated Kraken wrapper to utilise new time handling methods.
- Simplified Kucoin types by removing unnecessary structures and using direct JSON unmarshalling.
- Improved websocket handling in Kucoin to directly parse candlestick data.
- Modified Lbank types to use the new time representation.
- Adjusted Poloniex wrapper and types to utilise the new time handling.
- Updated Yobit types and wrapper to reflect changes in time representation.
- Introduced DateTime type for better handling of specific time formats.
- Added tests for DateTime unmarshalling to ensure correctness.
- Rid UTC().Unix and UTC().UnixMilli as it's not needed
- Correct Huobi timestamp usage for some endpoints.
- Rid RFC3339 time parsing since Go does that automatically.
* exchanges: Refactor JSON unmarshalling for various types and improve test coverage
* linter: Update error message in TestGetKlines
* refactor: Simplify JSON unmarshalling in MovementHistory and improve test assertions in GetKlines
* refactor: Improve JSON unmarshalling for channel name and clarify comment in wsProcessOpenOrders
* refactor: Update time handling in Huobi types to use types.Time for createdAt fields and relax GetLiquidationOrders test
* refactor: Move wsTicker, wsSpread, wsTrades, and wsCandle types to kraken_types.go for better organistion
* refactor: Add validation for underlying parameter in GetExpirationTime and update tests
* Bitmex: Enhance leaderboard and stats history tests with mock server responses
* Bitmex: Validate HTTP method in leaderboard and stats historical tests
* Bitmex: Improve assertions in leaderboard and stats historical tests for clarity