@clonegod/ttd-core 2.0.81 → 2.0.83
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/index.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ export declare enum DEX_ID {
|
|
|
51
51
|
JUPITER_AGGR = "JUPITER-AGGR",
|
|
52
52
|
PANCAKE_AMM = "PANCAKE-AMM",
|
|
53
53
|
PANCAKE_CLMM = "PANCAKE-CLMM",
|
|
54
|
+
PANCAKE_CLAMM = "PANCAKE-CLAMM",
|
|
55
|
+
PANCAKE_BIN = "PANCAKE-BIN",
|
|
54
56
|
AERODROME_AMM = "AERODROME-AMM",
|
|
55
57
|
AERODROME_CLMM = "AERODROME-CLMM",
|
|
56
58
|
UNISWAP_AMM = "UNISWAP-AMM",
|
package/dist/index.js
CHANGED
|
@@ -135,6 +135,8 @@ var DEX_ID;
|
|
|
135
135
|
DEX_ID["JUPITER_AGGR"] = "JUPITER-AGGR";
|
|
136
136
|
DEX_ID["PANCAKE_AMM"] = "PANCAKE-AMM";
|
|
137
137
|
DEX_ID["PANCAKE_CLMM"] = "PANCAKE-CLMM";
|
|
138
|
+
DEX_ID["PANCAKE_CLAMM"] = "PANCAKE-CLAMM";
|
|
139
|
+
DEX_ID["PANCAKE_BIN"] = "PANCAKE-BIN";
|
|
138
140
|
DEX_ID["AERODROME_AMM"] = "AERODROME-AMM";
|
|
139
141
|
DEX_ID["AERODROME_CLMM"] = "AERODROME-CLMM";
|
|
140
142
|
DEX_ID["UNISWAP_AMM"] = "UNISWAP-AMM";
|
|
@@ -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 defi_llama_1 = require("./defi_llama");
|
|
21
22
|
function get_bsc_token_price_info(addresses) {
|
|
22
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
24
|
addresses = addresses.map(addr => addr.toLowerCase());
|
|
@@ -30,10 +31,10 @@ function get_bsc_token_price_info(addresses) {
|
|
|
30
31
|
batchDelay: 1000,
|
|
31
32
|
},
|
|
32
33
|
{
|
|
33
|
-
name: '
|
|
34
|
-
fetchFn:
|
|
34
|
+
name: 'DefiLlama',
|
|
35
|
+
fetchFn: (address_list) => (0, defi_llama_1.fetchPriceFromDefiLlama)(index_1.CHAIN_ID.BSC, address_list),
|
|
35
36
|
batchSize: 10,
|
|
36
|
-
batchDelay:
|
|
37
|
+
batchDelay: 2000,
|
|
37
38
|
},
|
|
38
39
|
{
|
|
39
40
|
name: 'GeckoTerminal',
|
|
@@ -101,6 +102,7 @@ function fetchPriceFromPancakeSwap(addresses) {
|
|
|
101
102
|
const retrysleepMs = 500;
|
|
102
103
|
const addressString = addresses.map(addr => `56:${addr}`).join('%2C');
|
|
103
104
|
const url = `https://wallet-api.pancakeswap.com/v1/prices/list/${addressString}`;
|
|
105
|
+
console.log(url);
|
|
104
106
|
(0, index_1.log_debug)(`[fetchPriceFromPancakeSwap] Requesting PancakeSwap API for ${addresses.length} tokens`);
|
|
105
107
|
let retryCount = 0;
|
|
106
108
|
while (retryCount <= maxRetries) {
|
|
@@ -145,8 +147,9 @@ if (require.main === module) {
|
|
|
145
147
|
"0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
|
|
146
148
|
"0x55d398326f99059ff775485246999027b3197955",
|
|
147
149
|
"0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82",
|
|
150
|
+
"0x8263CD1601FE73C066bf49cc09841f35348e3be0",
|
|
148
151
|
];
|
|
149
|
-
console.log(yield
|
|
152
|
+
console.log(yield (0, gecko_terminal_1.fetchPriceFromGeckoTerminal)(index_1.CHAIN_ID.BSC, addresses));
|
|
150
153
|
}))();
|
|
151
154
|
}))();
|
|
152
155
|
}
|