diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e238649f..7933ed68f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - added: (Solana) Add new tokens: BSOL, DRIFT, HAWK, JITOSOL, JSOL, JTO, JUP, MIMO, MNGO, MSOL, SOL, USDC.e, WBTC, and WETH - added: (EVM) Add dRPC nodes +- changed: Add evmscan fallback for `eth_getTransactionReceipt`in `getL1RollupFee` ## 4.19.0 (2024-08-12) diff --git a/src/ethereum/networkAdapters/EvmScanAdapter.ts b/src/ethereum/networkAdapters/EvmScanAdapter.ts index 1b2af89f5..d5c7d642e 100644 --- a/src/ethereum/networkAdapters/EvmScanAdapter.ts +++ b/src/ethereum/networkAdapters/EvmScanAdapter.ts @@ -1,4 +1,5 @@ import { add, max, mul, sub } from 'biggystring' +import { asMaybe } from 'cleaners' import { EdgeConfirmationState, EdgeCurrencyInfo, @@ -367,11 +368,18 @@ export class EvmScanAdapter extends NetworkAdapter { let l1RollupFee = '0' if (isSpend && this.ethEngine.networkInfo.optimismRollup === true) { - const response = await this.ethEngine.ethNetwork.multicastRpc( + const rpcResponse = await this.ethEngine.ethNetwork.multicastRpc( 'eth_getTransactionReceipt', [txid] ) - const json = asGetTransactionReceipt(response.result.result) + let json = asMaybe(asGetTransactionReceipt)(rpcResponse.result.result) + if (json == null) { + const path = `?module=proxy&action=eth_getTransactionReceipt&txhash=${txid}` + const evmScanResponse = await this.serialServers( + async server => await this.fetchGetEtherscan(server, path) + ) + json = asGetTransactionReceipt(evmScanResponse.result) + } l1RollupFee = add(l1RollupFee, decimalToHex(json.l1Fee)) }