feat(): start websocket API client wrapper, chore(): misc typo fixes & cleaning

This commit is contained in:
tiagosiebler
2025-05-19 12:38:04 +01:00
parent b5e109d362
commit c4cc09489f
5 changed files with 150 additions and 13 deletions

View File

@@ -343,23 +343,23 @@ export class WebsocketClient extends BaseWebsocketClient<
// do not trigger excess property checks
// Without these overloads, TypeScript won't complain if you include an
// unexpected property with your request (if it doesn't clash with an existing property)
sendWSAPIRequest<TWSOpreation extends WSAPIOperation = 'order.create'>(
sendWSAPIRequest<TWSOperation extends WSAPIOperation = 'order.create'>(
wsKey: typeof WS_KEY_MAP.v5PrivateTrade,
operation: TWSOpreation,
params: WsAPITopicRequestParamMap[TWSOpreation],
): Promise<WsAPIOperationResponseMap[TWSOpreation]>;
operation: TWSOperation,
params: WsAPITopicRequestParamMap[TWSOperation],
): Promise<WsAPIOperationResponseMap[TWSOperation]>;
sendWSAPIRequest<TWSOpreation extends WSAPIOperation = 'order.amend'>(
sendWSAPIRequest<TWSOperation extends WSAPIOperation = 'order.amend'>(
wsKey: typeof WS_KEY_MAP.v5PrivateTrade,
operation: TWSOpreation,
params: WsAPITopicRequestParamMap[TWSOpreation],
): Promise<WsAPIOperationResponseMap[TWSOpreation]>;
operation: TWSOperation,
params: WsAPITopicRequestParamMap[TWSOperation],
): Promise<WsAPIOperationResponseMap[TWSOperation]>;
sendWSAPIRequest<TWSOpreation extends WSAPIOperation = 'order.cancel'>(
sendWSAPIRequest<TWSOperation extends WSAPIOperation = 'order.cancel'>(
wsKey: typeof WS_KEY_MAP.v5PrivateTrade,
operation: TWSOpreation,
params: WsAPITopicRequestParamMap[TWSOpreation],
): Promise<WsAPIOperationResponseMap[TWSOpreation]>;
operation: TWSOperation,
params: WsAPITopicRequestParamMap[TWSOperation],
): Promise<WsAPIOperationResponseMap[TWSOperation]>;
async sendWSAPIRequest<
TWSKey extends keyof WsAPIWsKeyTopicMap,