Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bitfinex: Refactor websocket wsUpdate handling and various improvemen…
…ts (thrasher-corp#1317) * Bitfinex: Fix cancel/update order WS ack not seen Fixes thrasher-corp#1288 * Bitfinex: Fix ws Unsubscribe and Resubscribe Unsubscribe needed to use the channel id. Resubscribe needs to have the original subscription params. * Bitfinex: Fix ws Trades Fees on te The ws channel for authenticated Trades sends two types of update: * te, Trade Executed * tu, Trade Execution Update Only the second one contains fee information. [See the docs](https://docs.bitfinex.com/reference/ws-auth-trades) This commit fixes: `exchange Bitfinex websocket error - unable to type assert trade fee` after an executed market trade on the te update * Bitfinex: Fix error on ws auth ok This fixes: `Bitfinex Could not find an existing channel subscription: account Pair: ChannelID: 0` It's not clear from history why we'd want to store a reference to the ubiquitous 0 channel like this, but it's definitely wrong, and anything that attempts to get channel information about 0 chan needs to be fixed anyway. * Bitfinex: Refactor wsUpdate handling This commit doesn't break out all the sub-updater, but attempts to do something about the unmanagable size of ws update handling * Binfinex: Fix linter issue on chanId casing * Bitfinex: Fix linter outdent complaint * Bitfinex: Fix linter issues on test * Bitfinex: Fix TestWsTradingPairSnapshot chan lookup * Bitfinex: Remove unnecessary WsAddSubs in test * Bitfinex: Fix TestWsSubscribedResponse chan * Bitfinex: Throw a specific error for bad event * Bitfinex: WS Type assertions for positionSnapshots * Bitfinex: tradeUpdate type assertion * Bitfinex: Reinstate default subscriptions * Bitfinex: Assert chan assetType is the same * Bitfinex: Lowercase error string * Bitfinex: Refactor WS eventType/chanId handling * Bitfinex: Fix linter issues * Bitfinex: Fix delimiter for pairs with more than 6 chars * Bitfinex: Fix WS handling of subscribed symbols This simplifies the handling of subscription symbols. Now that we know the channel up front from handling the subscribed response we can limit the parsing forms needed * Bitfinex: Placate the linter * Bitfinex: Disable margin assets for WS Margin WS Currently not fully implemented and causes subscription collisions with spot * Bitfinex: Fix parsing of 4 part funding keys This improves overall handling and errors on a few current assumptions about key structure * Bitfinex: Linter fixes * Bitfinex: Remove key parsing from assetPairFromSymbol * Bitfinex: Use native error wrapping * Bitfinex: Skip disabled assets in default ws subs
- Loading branch information