@clonegod/ttd-sui-common 1.0.83 → 1.0.85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -35,7 +35,7 @@ export declare abstract class AbstractSuiDexTradePlus extends AbastrcatTrade {
|
|
|
35
35
|
protected getObjectInfo(objectId: string): Promise<PoolObjectInfo | null>;
|
|
36
36
|
protected compareBigIntBalance(a: any, b: any): number;
|
|
37
37
|
protected mergeTokenObjects(tx: Transaction, primaryCoin: any, objectsToMerge: any[], tokenSymbol: string): void;
|
|
38
|
-
protected try_refresh_wallet_objects(wallet: string, txid: string, context: TradeContext, initial_delay_ms?: number, try_times?: number, try_delay_ms?: number): void
|
|
38
|
+
protected try_refresh_wallet_objects(wallet: string, txid: string, context: TradeContext, initial_delay_ms?: number, try_times?: number, try_delay_ms?: number): Promise<void>;
|
|
39
39
|
abstract execute(context: TradeContext, retryCount?: number): Promise<string>;
|
|
40
40
|
protected abstract initConfigs(): Promise<void>;
|
|
41
41
|
}
|
|
@@ -316,16 +316,18 @@ class AbstractSuiDexTradePlus extends dist_1.AbastrcatTrade {
|
|
|
316
316
|
tx.mergeCoins(primaryCoin, other_objects);
|
|
317
317
|
(0, dist_1.log_info)(`✅ ${tokenSymbol} 进行对象合并,涉及 ${other_objects.length} 个对象`);
|
|
318
318
|
}
|
|
319
|
-
try_refresh_wallet_objects(
|
|
320
|
-
|
|
319
|
+
try_refresh_wallet_objects(wallet_1, txid_1, context_1) {
|
|
320
|
+
return __awaiter(this, arguments, void 0, function* (wallet, txid, context, initial_delay_ms = 0, try_times = 5, try_delay_ms = 400) {
|
|
321
321
|
for (let i = 0; i < try_times; i++) {
|
|
322
|
+
let delay_ms = initial_delay_ms + i * try_delay_ms;
|
|
322
323
|
setTimeout(() => {
|
|
323
324
|
let group_id = this.appConfig.trade_runtime.group.id;
|
|
324
325
|
let coin_types = [context.pool_info.tokenA.address, context.pool_info.tokenB.address];
|
|
325
326
|
this.appConfig.arb_cache.redis_event_publisher.publish_wallet_raw_tx_event(group_id, wallet, { group_id, wallet, txid, coin_types, remark: `PRE_REFRESH_OBJECTS_${i}` });
|
|
326
|
-
},
|
|
327
|
+
}, delay_ms);
|
|
328
|
+
(0, dist_1.log_info)(`try_refresh_wallet_objects, txid=${txid}, i=${i}, delay_ms = ${delay_ms}ms`);
|
|
327
329
|
}
|
|
328
|
-
}
|
|
330
|
+
});
|
|
329
331
|
}
|
|
330
332
|
}
|
|
331
333
|
exports.AbstractSuiDexTradePlus = AbstractSuiDexTradePlus;
|