@clonegod/ttd-core 3.1.10 → 3.1.11
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.
- package/dist/cache/arb_cache.d.ts +3 -2
- package/dist/cache/arb_cache.js +1 -1
- package/dist/cache/arb_event_pub.d.ts +3 -2
- package/dist/cache/arb_event_sub.d.ts +4 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +2 -6
- package/dist/redis/redis_client.d.ts +0 -1
- package/dist/redis/redis_client.js +1 -2
- package/package.json +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { EventEmitter } from 'events';
|
|
2
|
-
import { CommonServiceType, LoadingCache, OrderMessageType, PriceMessageType,
|
|
2
|
+
import { CommonServiceType, LoadingCache, OrderMessageType, PriceMessageType, StandardDexPoolConfigType, StandardPairType, StandardPoolInfoType, StandardTokenInfoType, TradePairDexPoolsType, TradePairType, TradeResponseType, TradeRuntimeType, TradeServiceConfigType } from "../../types";
|
|
3
|
+
import { RedisClient } from "../redis";
|
|
3
4
|
import { CHAIN_ID } from "../index";
|
|
4
5
|
import { ArbEventPublisher } from './arb_event_pub';
|
|
5
6
|
export declare class ArbCache {
|
|
6
7
|
chain_id: CHAIN_ID;
|
|
7
8
|
loading_cache: LoadingCache;
|
|
8
|
-
redis_cmd:
|
|
9
|
+
redis_cmd: RedisClient;
|
|
9
10
|
redis_event_publisher: ArbEventPublisher;
|
|
10
11
|
token_list: StandardTokenInfoType[];
|
|
11
12
|
token_symbol_map: Map<string, StandardTokenInfoType>;
|
package/dist/cache/arb_cache.js
CHANGED
|
@@ -20,7 +20,7 @@ class ArbCache {
|
|
|
20
20
|
constructor(env_args) {
|
|
21
21
|
this.chain_id = env_args.chain_id;
|
|
22
22
|
this.loading_cache = (0, index_1.getLoadingCache)();
|
|
23
|
-
this.redis_cmd = (0, index_1.
|
|
23
|
+
this.redis_cmd = (0, index_1.getRedisClient)();
|
|
24
24
|
this.token_list = [];
|
|
25
25
|
this.token_symbol_map = new Map();
|
|
26
26
|
this.token_address_map = new Map();
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RedisConfigChangeEventMessageType, RedisOrderEventMessageType, RedisQuoteEventMessageType, TradeResponseType } from "../../types";
|
|
2
|
+
import { RedisClient } from "../redis";
|
|
2
3
|
import { CHAIN_ID, DEX_ID } from "../index";
|
|
3
4
|
import { ArbCache } from "./arb_cache";
|
|
4
5
|
export declare class ArbEventPublisher {
|
|
5
6
|
arb_cache: ArbCache;
|
|
6
7
|
chain_id: CHAIN_ID;
|
|
7
|
-
redis_cmd:
|
|
8
|
+
redis_cmd: RedisClient;
|
|
8
9
|
constructor(arb_cache: ArbCache);
|
|
9
10
|
publish_config_change_event(message: RedisConfigChangeEventMessageType): Promise<void>;
|
|
10
11
|
publish_quote_price_event(chain_id: string, message: RedisQuoteEventMessageType): Promise<void>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RedisConfigChangeEventMessageType } from "../../types";
|
|
2
|
+
import { RedisClient } from "../redis";
|
|
3
|
+
import { ArbCache } from "./arb_cache";
|
|
2
4
|
import { CHAIN_ID, DEX_ID } from "../index";
|
|
3
5
|
export declare class ArbEventSubscriber {
|
|
4
6
|
arb_cache: ArbCache;
|
|
5
7
|
chain_id: CHAIN_ID;
|
|
6
|
-
redis_cmd:
|
|
8
|
+
redis_cmd: RedisClient;
|
|
7
9
|
constructor(arb_cache: ArbCache);
|
|
8
10
|
pre_load_config_cache(): Promise<void>;
|
|
9
11
|
subscribe_config_change_event(callback?: Function): Promise<void>;
|
package/dist/index.d.ts
CHANGED
|
@@ -136,7 +136,6 @@ export declare const parse_unique_orderbook_id: (unique_orderbook_id: string) =>
|
|
|
136
136
|
export declare const format_unique_order_msg_id: (group_id: string, price_id: string, order_trace_id: string) => string;
|
|
137
137
|
export declare const format_order_lock_key: (chain_id: string, group_id: string, price_id: string, order_trace_id: string) => string;
|
|
138
138
|
export declare const getRedisClient: (lockPrefix?: string) => redis.RedisClient;
|
|
139
|
-
export declare const getRedisCommamd: () => redis.RedisClient;
|
|
140
139
|
export declare const getLoadingCache: () => cache.LoadingCache;
|
|
141
140
|
export declare const getArbCache: (env_args: any) => cache.ArbCache;
|
|
142
141
|
export declare const getArbEventPublisher: (arb_cache: any) => cache.ArbEventPublisher;
|
package/dist/index.js
CHANGED
|
@@ -48,8 +48,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
48
48
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
49
|
};
|
|
50
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
-
exports.DATE_TIME_FORMAT_DEFAULT = exports.to_json_str = exports.DecimalUtil = exports.generateRandomNumber = exports.LOG = exports._active_log_level = exports.LOG_LEVEL = exports.REDIS_EVENT_TYPE_TRADE_INSTANCE_CHANGE = exports.REDIS_EVENT_TYPE_ORDER = exports.REDIS_EVENT_TYPE_QUOTE = exports.REDIS_EVENT_TYPE_CONFIG_CHANGE = exports.REDIS_EVENT_CHANNEL = exports.get_new_block_channel_name = exports.get_tx_result_channel_name = exports.get_wallet_raw_tx_channel_name = exports.get_order_channel_name = exports.get_quote_channel_name = exports.get_config_channel_name = exports.get_cache_key = exports.getArbEventSubscriber = exports.getArbEventPublisher = exports.getArbCache = exports.getLoadingCache = exports.
|
|
52
|
-
exports.execute_bash = exports.inspect_arb_local_cache = exports.save_trade_execution_logs = exports.parse_trade_cmdline_args = exports.get_input_out_token_fix = exports.get_input_out_token = exports.calc_amount_in_token = exports.estimate_amount_in_token = exports.failed = exports.success = exports.home_dir = exports.postJSON = exports.deep_merge_object = exports.isArray = exports.isTrue = exports.deep_clone = exports.uuid =
|
|
51
|
+
exports.DATE_TIME_FORMAT_NO_WHITESPACE = exports.DATE_TIME_FORMAT_DEFAULT = exports.to_json_str = exports.DecimalUtil = exports.generateRandomNumber = exports.LOG = exports._active_log_level = exports.LOG_LEVEL = exports.REDIS_EVENT_TYPE_TRADE_INSTANCE_CHANGE = exports.REDIS_EVENT_TYPE_ORDER = exports.REDIS_EVENT_TYPE_QUOTE = exports.REDIS_EVENT_TYPE_CONFIG_CHANGE = exports.REDIS_EVENT_CHANNEL = exports.get_new_block_channel_name = exports.get_tx_result_channel_name = exports.get_wallet_raw_tx_channel_name = exports.get_order_channel_name = exports.get_quote_channel_name = exports.get_config_channel_name = exports.get_cache_key = exports.getArbEventSubscriber = exports.getArbEventPublisher = exports.getArbCache = exports.getLoadingCache = exports.getRedisClient = exports.format_order_lock_key = exports.format_unique_order_msg_id = exports.parse_unique_orderbook_id = exports.format_unique_orderbook_id = exports.format_symbol_name = exports.LOCAL_EVENT_NAME = exports.CACHE_KEY_TYPE = exports.OnChainDataSubscribeType = exports.TradeErrorCodeType = exports.SystemErrorCodeType = exports.TRADE_TYPE = exports.GROUP_ID = exports.DEX_ID = exports.CHAIN_ID = exports.STREAMING_TRANSACTION_CONFIRMED = exports.TRANSACTION_STATE_FAILED = exports.TRANSACTION_STATE_SUCCESS = exports.TRANSACTION_STATE_PROCESSING = exports.QUOTE_AMOUNT_USD_MAX = exports.QUOTE_AMOUNT_USD_MIN = exports.REGEX_HEX_PREFIX = exports.PROCESSING = exports.NOT_FOUND = exports.SUCCESS = exports.FAILED = void 0;
|
|
52
|
+
exports.execute_bash = exports.inspect_arb_local_cache = exports.save_trade_execution_logs = exports.parse_trade_cmdline_args = exports.get_input_out_token_fix = exports.get_input_out_token = exports.calc_amount_in_token = exports.estimate_amount_in_token = exports.failed = exports.success = exports.home_dir = exports.postJSON = exports.deep_merge_object = exports.isArray = exports.isTrue = exports.deep_clone = exports.uuid = void 0;
|
|
53
53
|
exports._caller = _caller;
|
|
54
54
|
exports.log_trace = log_trace;
|
|
55
55
|
exports.log_debug = log_debug;
|
|
@@ -260,10 +260,6 @@ const getRedisClient = (lockPrefix = '') => {
|
|
|
260
260
|
return new redis.RedisClient(lockPrefix);
|
|
261
261
|
};
|
|
262
262
|
exports.getRedisClient = getRedisClient;
|
|
263
|
-
const getRedisCommamd = () => {
|
|
264
|
-
return new redis.RedisClient();
|
|
265
|
-
};
|
|
266
|
-
exports.getRedisCommamd = getRedisCommamd;
|
|
267
263
|
const getLoadingCache = () => {
|
|
268
264
|
return new cache.LoadingCache();
|
|
269
265
|
};
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.RedisClient = void 0;
|
|
13
13
|
const index_1 = require("../index");
|
|
14
14
|
const redis_connection_1 = require("./redis_connection");
|
|
15
15
|
const MAX_SUBSCRIBE_RECONNECT = 10;
|
|
@@ -282,4 +282,3 @@ class RedisClient {
|
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
exports.RedisClient = RedisClient;
|
|
285
|
-
exports.RedisCommand = RedisClient;
|