@clonegod/ttd-bsc-common 1.0.23 → 1.0.24
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.
|
@@ -4,6 +4,7 @@ import { DexConfig, EvmChainConfig } from "../types";
|
|
|
4
4
|
export declare abstract class AbstractEvmDexTrade extends AbastrcatTrade {
|
|
5
5
|
protected appConfig: AppConfig;
|
|
6
6
|
protected wallet: ethers.Wallet;
|
|
7
|
+
protected group_wallets: ethers.Wallet[];
|
|
7
8
|
protected provider: ethers.providers.JsonRpcProvider;
|
|
8
9
|
protected approvedTokens: Map<string, boolean>;
|
|
9
10
|
protected pairContracts: Map<string, ethers.Contract>;
|
|
@@ -27,9 +27,15 @@ class AbstractEvmDexTrade extends dist_1.AbastrcatTrade {
|
|
|
27
27
|
}
|
|
28
28
|
init() {
|
|
29
29
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
var _a;
|
|
30
31
|
this.provider = new ethers_1.ethers.providers.JsonRpcProvider(this.chainConfig.rpcEndpoint);
|
|
31
32
|
this.wallet = new ethers_1.ethers.Wallet(this.appConfig.trade_runtime.wallet.private_key, this.provider);
|
|
32
33
|
(0, dist_1.log_info)(`钱包已初始化,地址: ${this.wallet.address}`);
|
|
34
|
+
if (process.env.WALLET_GROUP_IDS) {
|
|
35
|
+
let wallet_infos = (0, dist_1.load_wallet_multi)(((_a = process.env.WALLET_GROUP_IDS) === null || _a === void 0 ? void 0 : _a.split(',')) || [], false);
|
|
36
|
+
this.group_wallets = wallet_infos.map(info => new ethers_1.ethers.Wallet(info.private_key, this.provider));
|
|
37
|
+
(0, dist_1.log_info)(`组钱包已初始化,数量: ${this.group_wallets.length}`, this.group_wallets.map(e => e.address));
|
|
38
|
+
}
|
|
33
39
|
this.routerContract = new ethers_1.ethers.Contract(this.dexConfig.routerAddress, this.dexConfig.routerAbi, this.wallet);
|
|
34
40
|
(0, dist_1.log_info)(`${this.dexConfig.dexName} Router已初始化, 地址: ${this.dexConfig.routerAddress}`);
|
|
35
41
|
});
|