@clonegod/ttd-core 2.0.33 → 2.0.34
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.
|
@@ -48,7 +48,7 @@ export declare class ArbCache {
|
|
|
48
48
|
cache_trade_group(update_group_id?: string): Promise<void>;
|
|
49
49
|
update_trade_group(input_trade_config: TradeServiceConfigType): Promise<void>;
|
|
50
50
|
get_trade_group_id_list(): Promise<string[]>;
|
|
51
|
-
get_trade_service_by_group_id(group_id: string): Promise<TradeServiceConfigType>;
|
|
51
|
+
get_trade_service_by_group_id(group_id: string, force_refresh?: boolean): Promise<TradeServiceConfigType>;
|
|
52
52
|
get_trade_service_by_group_id_no_cache(group_id: string): Promise<TradeServiceConfigType>;
|
|
53
53
|
create_trade_runtime(chain_id: string, group_id: string, dex_id: string, pair_name: string): Promise<TradeRuntimeType>;
|
|
54
54
|
find_pair_in_trade_config(pair_name: string, trade_config: TradeServiceConfigType): TradePairType;
|
|
@@ -75,6 +75,6 @@ export declare class ArbCache {
|
|
|
75
75
|
get_pair_dex_pool_list(quote_pair_list: string[], dex_id_list: string[]): Promise<StandardPoolInfoType[]>;
|
|
76
76
|
get_trade_dex_pool_list(dex_id_list: string[], trade_runtime: TradeRuntimeType): Promise<StandardPoolInfoType[]>;
|
|
77
77
|
get_group_trade_pair_info(chain_id: CHAIN_ID, group_id: string, pair: string): Promise<Map<string, StandardPairType>>;
|
|
78
|
-
get_all_trade_tokens(): Promise<StandardTokenInfoType[]>;
|
|
78
|
+
get_all_trade_tokens(force_refresh?: boolean): Promise<StandardTokenInfoType[]>;
|
|
79
79
|
get_all_trade_pools(group_id?: string): Promise<StandardPoolInfoType[]>;
|
|
80
80
|
}
|
package/dist/cache/arb_cache.js
CHANGED
|
@@ -591,10 +591,10 @@ class ArbCache {
|
|
|
591
591
|
return value;
|
|
592
592
|
});
|
|
593
593
|
}
|
|
594
|
-
get_trade_service_by_group_id(
|
|
595
|
-
return __awaiter(this,
|
|
594
|
+
get_trade_service_by_group_id(group_id_1) {
|
|
595
|
+
return __awaiter(this, arguments, void 0, function* (group_id, force_refresh = false) {
|
|
596
596
|
let trade_group_config;
|
|
597
|
-
if (this.trade_config_map.has(group_id)) {
|
|
597
|
+
if (this.trade_config_map.has(group_id) && !force_refresh) {
|
|
598
598
|
trade_group_config = this.trade_config_map.get(group_id);
|
|
599
599
|
}
|
|
600
600
|
else {
|
|
@@ -947,11 +947,11 @@ class ArbCache {
|
|
|
947
947
|
});
|
|
948
948
|
}
|
|
949
949
|
get_all_trade_tokens() {
|
|
950
|
-
return __awaiter(this,
|
|
950
|
+
return __awaiter(this, arguments, void 0, function* (force_refresh = false) {
|
|
951
951
|
let token_address_set = new Set();
|
|
952
952
|
let group_id_list = yield this.get_trade_group_id_list();
|
|
953
953
|
for (let group_id of group_id_list) {
|
|
954
|
-
let trade_group_conifg = yield this.get_trade_service_by_group_id(group_id);
|
|
954
|
+
let trade_group_conifg = yield this.get_trade_service_by_group_id(group_id, force_refresh);
|
|
955
955
|
let { pair_list } = trade_group_conifg;
|
|
956
956
|
let trade_group_pool_id_list = [];
|
|
957
957
|
for (let trade_pair of pair_list) {
|