ваше сообщение коммита

This commit is contained in:
2025-09-25 03:02:31 +03:00
parent 792282cd75
commit 7b2f6937c8
34 changed files with 2900 additions and 2570 deletions

View File

@@ -88,4 +88,16 @@ async function getRpcUrlByChainId(chainId) {
return providers[0]?.rpc_url || null;
}
module.exports = { getAllRpcProviders, saveAllRpcProviders, upsertRpcProvider, deleteRpcProvider, getRpcUrlByNetworkId, getRpcUrlByChainId };
async function getEtherscanApiUrlByChainId(chainId) {
console.log(`[RPC Service] Поиск Etherscan API URL для chain_id: ${chainId}`);
const providers = await encryptedDb.getData('rpc_providers', { chain_id: chainId }, 1);
console.log(`[RPC Service] Найдено провайдеров: ${providers.length}`);
if (providers.length > 0) {
console.log(`[RPC Service] Найден Etherscan API URL: ${providers[0].etherscan_api_url || 'НЕТ'}`);
} else {
console.log(`[RPC Service] Etherscan API URL для chain_id ${chainId} не найден`);
}
return providers[0]?.etherscan_api_url || null;
}
module.exports = { getAllRpcProviders, saveAllRpcProviders, upsertRpcProvider, deleteRpcProvider, getRpcUrlByNetworkId, getRpcUrlByChainId, getEtherscanApiUrlByChainId };