@clonegod/ttd-core 2.0.51 → 2.0.54

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.
@@ -17,6 +17,12 @@ export declare const EvmChainConfig: {
17
17
  chain_full_name: string;
18
18
  weth_addr: string;
19
19
  };
20
+ AVAX: {
21
+ chain_id: number;
22
+ chain_short_name: string;
23
+ chain_full_name: string;
24
+ weth_addr: string;
25
+ };
20
26
  };
21
27
  export type EvmChainInfoType = {
22
28
  chain_id: number;
@@ -20,4 +20,10 @@ exports.EvmChainConfig = {
20
20
  chain_full_name: 'ARBITRUM',
21
21
  weth_addr: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1".toLowerCase(),
22
22
  },
23
+ "AVAX": {
24
+ chain_id: 43114,
25
+ chain_short_name: 'AVAX',
26
+ chain_full_name: 'AVALANCHE',
27
+ weth_addr: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7".toLowerCase(),
28
+ },
23
29
  };
package/dist/index.d.ts CHANGED
@@ -27,7 +27,7 @@ export declare enum CHAIN_ID {
27
27
  ETH = "ETH",
28
28
  BASE = "BASE",
29
29
  ARBITRUM = "ARBITRUM",
30
- AVALANCHE = "AVALANCHE",
30
+ AVAX = "AVAX",
31
31
  SUI = "SUI",
32
32
  APTOS = "APTOS",
33
33
  POLYGON = "POLYGON",
@@ -52,7 +52,9 @@ export declare enum DEX_ID {
52
52
  AERODROME_CLMM = "AERODROME-CLMM",
53
53
  UNISWAP_AMM = "UNISWAP-AMM",
54
54
  UNISWAP_CLMM = "UNISWAP-CLMM",
55
- UNISWAP_V4 = "UNISWAP-V4"
55
+ UNISWAP_V4 = "UNISWAP-V4",
56
+ LFJ_V1 = "LFJ-V1",
57
+ LFJ_V2 = "LFJ-V2"
56
58
  }
57
59
  export declare enum GROUP_ID {
58
60
  TRON_DEV1 = "TRON-DEV1",
package/dist/index.js CHANGED
@@ -110,7 +110,7 @@ var CHAIN_ID;
110
110
  CHAIN_ID["ETH"] = "ETH";
111
111
  CHAIN_ID["BASE"] = "BASE";
112
112
  CHAIN_ID["ARBITRUM"] = "ARBITRUM";
113
- CHAIN_ID["AVALANCHE"] = "AVALANCHE";
113
+ CHAIN_ID["AVAX"] = "AVAX";
114
114
  CHAIN_ID["SUI"] = "SUI";
115
115
  CHAIN_ID["APTOS"] = "APTOS";
116
116
  CHAIN_ID["POLYGON"] = "POLYGON";
@@ -137,6 +137,8 @@ var DEX_ID;
137
137
  DEX_ID["UNISWAP_AMM"] = "UNISWAP-AMM";
138
138
  DEX_ID["UNISWAP_CLMM"] = "UNISWAP-CLMM";
139
139
  DEX_ID["UNISWAP_V4"] = "UNISWAP-V4";
140
+ DEX_ID["LFJ_V1"] = "LFJ-V1";
141
+ DEX_ID["LFJ_V2"] = "LFJ-V2";
140
142
  })(DEX_ID || (exports.DEX_ID = DEX_ID = {}));
141
143
  var GROUP_ID;
142
144
  (function (GROUP_ID) {
@@ -18,6 +18,7 @@ const axios_1 = __importDefault(require("axios"));
18
18
  const index_1 = require("../../index");
19
19
  const gecko_terminal_1 = require("./gecko_terminal");
20
20
  const price_cache_1 = require("./price_cache");
21
+ const chains_1 = require("../../chains");
21
22
  function get_eth_token_price_info(evm_chain_info, addresses) {
22
23
  return __awaiter(this, void 0, void 0, function* () {
23
24
  addresses = addresses.map(addr => addr.toLowerCase());
@@ -155,4 +156,14 @@ function fetchPriceFromUniSwap(chain_name, addresses) {
155
156
  });
156
157
  }
157
158
  if (require.main === module) {
159
+ (() => __awaiter(void 0, void 0, void 0, function* () {
160
+ let evm_chain_info = chains_1.EvmChainConfig.AVAX;
161
+ let addresses = [
162
+ "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7".toLowerCase(),
163
+ "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB".toLowerCase(),
164
+ "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E".toLowerCase(),
165
+ "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7".toLowerCase(),
166
+ ];
167
+ console.log(yield fetchPriceFromUniSwap(evm_chain_info.chain_full_name, addresses));
168
+ }))();
158
169
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clonegod/ttd-core",
3
- "version": "2.0.51",
3
+ "version": "2.0.54",
4
4
  "description": "Common types and utilities for trading systems - use `npm run push` to publish",
5
5
  "main": "dist/index.js",
6
6
  "types": "types/index.d.ts",