batch subscribe for spot v3

This commit is contained in:
tiagosiebler
2022-09-28 10:11:29 +01:00
parent 7fa82e099a
commit 1f19306477
3 changed files with 146 additions and 20 deletions

View File

@@ -256,6 +256,28 @@ export function getWsKeyForTopic(
}
}
export function getMaxTopicsPerSubscribeEvent(
market: APIMarket
): number | null {
switch (market) {
case 'inverse':
case 'linear':
case 'usdcOption':
case 'usdcPerp':
case 'unifiedOption':
case 'unifiedPerp':
case 'spot': {
return null;
}
case 'spotv3': {
return 10;
}
default: {
throw neverGuard(market, `getWsKeyForTopic(): Unhandled market`);
}
}
}
export function getUsdcWsKeyForTopic(
topic: string,
subGroup: 'option' | 'perp'