Bitmex: Subscription templating (#1586)

* Exchanges: Allow empty batches in ParallelChanOp

In keeping with both common.Batch and "It's not my responsibility",
ParallelChanOp should just do nothing when given an empty list (and
implicitly an empty batch size.
Whatever it's going to do, it'll delegate to common.Batch,
and this allows us to just inline calls:
```
	return common.AppendError(
		b.ParallelChanOp(subs.Public(), func(l subscription.List) error { return b.manageSubs(wsSubscribeMethod, l, wsPublicStream) }, len(subs)),
		b.ParallelChanOp(subs.Private(), func(l subscription.List) error { return b.manageSubs(wsSubscribeMethod, l, wsPrivateStream) }, len(subs)),
	)
```

* Bitmex: Test config updates

* Bitmex: Sub Templating

* Bitmex: Enable websocket for tests

* Bitmex: Handle subscription errors

This switches to multiplexing so that we know which errors belong to
which stream, particularly for the auth attempt

* Bitmex: Fix ws order side err going to data stream

Shouldn't fall into classification error if it's actually a parsing
error
This commit is contained in:
Gareth Kirwan
2024-10-22 08:21:35 +02:00
committed by GitHub
parent bd2cc9d7bb
commit 2232340d49
6 changed files with 468 additions and 508 deletions

View File

@@ -852,26 +852,9 @@
"websocketOrderbookBufferLimit": 5,
"baseCurrencies": "USD",
"currencyPairs": {
"assetTypes": [
"perpetualcontract",
"futures",
"downsideprofitcontract",
"upsideprofitcontract"
],
"pairs": {
"downsideprofitcontract": {
"enabled": "XBT7D_D95",
"available": "XBT7D_D95",
"requestFormat": {
"uppercase": true,
"delimiter": "_"
},
"configFormat": {
"uppercase": true,
"delimiter": "_"
}
},
"futures": {
"assetEnabled": true,
"enabled": "BCHZ19",
"available": "XRPZ19,BCHZ19,ADAZ19,EOSZ19,TRXZ19,XBTZ19,ETHZ19,LTCZ19",
"requestFormat": {
@@ -882,6 +865,7 @@
}
},
"perpetualcontract": {
"assetEnabled": true,
"enabled": "ETHUSD",
"available": "XBTUSD,ETHUSD",
"requestFormat": {
@@ -890,18 +874,6 @@
"configFormat": {
"uppercase": true
}
},
"upsideprofitcontract": {
"enabled": "XBT7D_U105",
"available": "XBT7D_U105",
"requestFormat": {
"uppercase": true,
"delimiter": "_"
},
"configFormat": {
"uppercase": true,
"delimiter": "_"
}
}
}
},
@@ -934,7 +906,7 @@
},
"enabled": {
"autoPairUpdates": true,
"websocketAPI": false
"websocketAPI": true
}
},
"bankAccounts": [
@@ -951,7 +923,13 @@
"iban": "",
"supportedCurrencies": ""
}
]
],
"orderbook": {
"verificationBypass": false,
"websocketBufferLimit": 5,
"websocketBufferEnabled": false,
"publishPeriod": 10000000000
}
},
{
"name": "Bitstamp",