@clonegod/ttd-core 3.1.93 → 3.1.95
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/chains/index.d.ts
CHANGED
|
@@ -11,6 +11,12 @@ export declare const EvmChainConfig: {
|
|
|
11
11
|
chain_full_name: string;
|
|
12
12
|
weth_addr: string;
|
|
13
13
|
};
|
|
14
|
+
ROBINHOOD: {
|
|
15
|
+
chain_id: number;
|
|
16
|
+
chain_short_name: string;
|
|
17
|
+
chain_full_name: string;
|
|
18
|
+
weth_addr: string;
|
|
19
|
+
};
|
|
14
20
|
ARBITRUM: {
|
|
15
21
|
chain_id: number;
|
|
16
22
|
chain_short_name: string;
|
package/dist/chains/index.js
CHANGED
|
@@ -14,6 +14,12 @@ exports.EvmChainConfig = {
|
|
|
14
14
|
chain_full_name: 'BASE',
|
|
15
15
|
weth_addr: "0x4200000000000000000000000000000000000006".toLowerCase(),
|
|
16
16
|
},
|
|
17
|
+
ROBINHOOD: {
|
|
18
|
+
chain_id: 4663,
|
|
19
|
+
chain_short_name: 'ROBINHOOD',
|
|
20
|
+
chain_full_name: 'ROBINHOOD',
|
|
21
|
+
weth_addr: "0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73".toLowerCase(),
|
|
22
|
+
},
|
|
17
23
|
ARBITRUM: {
|
|
18
24
|
chain_id: 42161,
|
|
19
25
|
chain_short_name: 'ARBITRUM',
|
package/dist/index.js
CHANGED
|
@@ -234,7 +234,7 @@ const format_pair_symbol = (symbol) => {
|
|
|
234
234
|
if (!symbol)
|
|
235
235
|
return symbol;
|
|
236
236
|
return (0, exports.format_token_symbol)(symbol)
|
|
237
|
-
.replace('USDC', 'USDT').replace('USD1', 'USDT')
|
|
237
|
+
.replace('USDC', 'USDT').replace('USD1', 'USDT').replace('USDG', 'USDT')
|
|
238
238
|
.replace('WTRX', 'TRX').replace('WSOL', 'SOL').replace('WBTC', 'BTC')
|
|
239
239
|
.replace('WETH', 'ETH').replace('WBNB', 'BNB').replace('WOKB', 'OKB');
|
|
240
240
|
};
|
package/dist/pool/pool_util.js
CHANGED
|
@@ -58,8 +58,8 @@ function valid_fetch_pool_data(formatted_pool, min_tvl, min_vol, native_token) {
|
|
|
58
58
|
reasons.push(`vol_24h=${vol_24h} < minVol=${min_vol}`);
|
|
59
59
|
throw new Error(`pool is too small: ${pool_name}, ${pool_address}, ${reasons.join(', ')}`);
|
|
60
60
|
}
|
|
61
|
-
if (!symbols.includes(native_token) && !symbols.includes('USDC') && !symbols.includes('USDT') && !symbols.includes('USD1')) {
|
|
62
|
-
throw new Error(`pool don't contains: ${native_token}, USDC, USDT, USD1, ${pool_name}, ${pool_address}`);
|
|
61
|
+
if (!symbols.includes(native_token) && !symbols.includes('USDC') && !symbols.includes('USDT') && !symbols.includes('USD1') && !symbols.includes('USDG')) {
|
|
62
|
+
throw new Error(`pool don't contains: ${native_token}, USDC, USDT, USD1, USDG, ${pool_name}, ${pool_address}`);
|
|
63
63
|
}
|
|
64
64
|
if (!(0, token_util_1.is_valid_symbol)(tokenA.symbol)) {
|
|
65
65
|
throw new Error(`pool contains bad symbol: tokenA.symbol=${tokenA.symbol}, ${pool_name}, ${pool_address}`);
|
|
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.get_eth_token_price_info = get_eth_token_price_info;
|
|
16
16
|
require('dotenv').config();
|
|
17
17
|
const axios_1 = __importDefault(require("axios"));
|
|
18
|
+
const chains_1 = require("../../chains");
|
|
18
19
|
const index_1 = require("../../index");
|
|
19
20
|
const defi_llama_1 = require("./defi_llama");
|
|
20
21
|
const gecko_terminal_1 = require("./gecko_terminal");
|
|
@@ -177,4 +178,15 @@ function fetchPriceFromUniSwap(chain_name, addresses) {
|
|
|
177
178
|
});
|
|
178
179
|
}
|
|
179
180
|
if (require.main === module) {
|
|
181
|
+
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
182
|
+
let evm_chain_info = chains_1.EvmChainConfig.ROBINHOOD;
|
|
183
|
+
let addresses = [
|
|
184
|
+
"0x0bd7d308f8e1639fab988df18a8011f41eacad73",
|
|
185
|
+
"0x5fc5360d0400a0fd4f2af552add042d716f1d168".toLowerCase(),
|
|
186
|
+
"0x020bfc650a365f8bb26819deaabf3e21291018b4".toLowerCase(),
|
|
187
|
+
];
|
|
188
|
+
console.log(yield get_eth_token_price_info(evm_chain_info, addresses));
|
|
189
|
+
console.log(yield fetchPriceFromUniSwap(evm_chain_info.chain_full_name, addresses));
|
|
190
|
+
console.log(yield (0, gecko_terminal_1.fetchPriceFromGeckoTerminal)(evm_chain_info.chain_short_name, addresses));
|
|
191
|
+
}))();
|
|
180
192
|
}
|