Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/config/rethProviders.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { ClientFactory, type EthereumClient } from "@openscan/network-connectors";

/**
* Hardcoded reth RPC providers for eth_getTransactionBySenderAndNonce support.
* These are separate from user-configured RPCs and used only for nonce-based tx lookups.
*/
export const RETH_PROVIDER_URLS = [
"https://eth-pokt.nodies.app",
"https://eth.api.onfinality.io/public",
"https://ethereum.rpc.subquery.network/public",
];

/** Chain ID where nonce-based transaction lookup is available */
export const NONCE_LOOKUP_CHAIN_ID = 1;

let rethClient: EthereumClient | null = null;

/**
* Get a singleton EthereumClient configured with reth providers using race strategy.
* Race strategy means the fastest provider wins each call.
*/
export function getRethClient(): EthereumClient {
if (!rethClient) {
rethClient = ClientFactory.createTypedClient(1, {
rpcUrls: RETH_PROVIDER_URLS,
type: "race",
});
}
return rethClient;
}
4 changes: 3 additions & 1 deletion src/locales/en/address.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,7 @@
"errorResolvingENS": "Error resolving ENS",
"unknownError": "Unknown error",
"failedToFetchAddressData": "Failed to fetch address data",
"nonce": "Nonce (Transactions Sent)"
"nonce": "Nonce (Transactions Sent)",
"fetchingSentTxsByNonce": "Fetching sent transactions ({{current}}/{{total}})...",
"searchingReceivedTxs": "Searching for received transactions..."
}
4 changes: 3 additions & 1 deletion src/locales/es/address.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,7 @@
"errorResolvingENS": "Error al resolver ENS",
"unknownError": "Error desconocido",
"failedToFetchAddressData": "No se pudieron obtener los datos de la dirección",
"nonce": "Nonce (transacciones enviadas)"
"nonce": "Nonce (transacciones enviadas)",
"fetchingSentTxsByNonce": "Obteniendo transacciones enviadas ({{current}}/{{total}})...",
"searchingReceivedTxs": "Buscando transacciones recibidas..."
}
Loading
Loading