mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-11 17:28:08 +00:00
refactor: extract shared adapter utilities (safeInvoke + initManager)
Created src/exchanges/adapter-utils.ts with createSafeInvoke() and createInitManager() factories. Converted 7/8 adapters to use shared utilities, eliminating ~350 lines of duplicated retry/init/error-handling boilerplate. Lighter adapter kept as-is (no retry logic by design). Also translated Chinese comments in adapter.ts and order-schema.ts.
This commit is contained in:
@@ -77,7 +77,7 @@ export interface ExchangeAdapter {
|
||||
cancelOrders(params: { symbol: string; orderIdList: Array<number | string> }): Promise<void>;
|
||||
cancelAllOrders(params: { symbol: string }): Promise<void>;
|
||||
getPrecision?(): Promise<ExchangePrecision | null>;
|
||||
// 连接保护相关方法(可选,仅 StandX 支持)
|
||||
// Connection protection methods (optional)
|
||||
onConnectionEvent?(listener: ConnectionEventListener): void;
|
||||
offConnectionEvent?(listener: ConnectionEventListener): void;
|
||||
onRestHealthEvent?(listener: RestHealthListener): void;
|
||||
|
||||
Reference in New Issue
Block a user