feat: 添加 Lighter 适配器的调试日志功能,优化错误处理和订单簿数据规范化

This commit is contained in:
discountry
2025-10-03 02:27:58 +08:00
parent 599b4ec3f3
commit e478fb4330
3 changed files with 41 additions and 10 deletions
+3 -1
View File
@@ -61,7 +61,9 @@ export class HttpNonceManager implements LighterNonceManager {
async refresh(apiKeyIndex: number): Promise<void> {
const nonce = await this.http.getNextNonce(this.accountIndex, apiKeyIndex);
// eslint-disable-next-line no-console
console.debug("[LighterNonceManager] refresh", { apiKeyIndex, nonce: nonce.toString() });
if (process.env.LIGHTER_DEBUG === "1" || process.env.LIGHTER_DEBUG === "true") {
console.debug("[LighterNonceManager] refresh", { apiKeyIndex, nonce: nonce.toString() });
}
this.slots.set(apiKeyIndex, { apiKeyIndex, next: nonce, lastIssued: null });
}