diff --git a/packages/relay/src/lib/eth.ts b/packages/relay/src/lib/eth.ts index 3188b50cb1..de48d5a47c 100644 --- a/packages/relay/src/lib/eth.ts +++ b/packages/relay/src/lib/eth.ts @@ -51,6 +51,7 @@ import { IDebugService } from './services/debugService/IDebugService'; import { DebugService } from './services/debugService'; import { isValidEthereumAddress } from '../formatters'; import { IFeeHistory } from './types/IFeeHistory'; +import { ITransactionReceipt } from './types/ITransactionReceipt'; const _ = require('lodash'); const createHash = require('keccak'); @@ -93,7 +94,7 @@ export class EthImpl implements Eth { oldestBlock: EthImpl.zeroHex, baseFeePerGas: undefined, }; - static feeHistoryEmptyResponse: IFeeHistory = { + static readonly feeHistoryEmptyResponse: IFeeHistory = { baseFeePerGas: [], gasUsedRatio: [], reward: [], @@ -1892,7 +1893,7 @@ export class EthImpl implements Eth { * * @param hash */ - async getTransactionReceipt(hash: string, requestIdPrefix?: string): Promise { + async getTransactionReceipt(hash: string, requestIdPrefix?: string): Promise { this.logger.trace(`${requestIdPrefix} getTransactionReceipt(${hash})`); const cacheKey = `${constants.CACHE_KEY.ETH_GET_TRANSACTION_RECEIPT}_${hash}`; @@ -1913,7 +1914,7 @@ export class EthImpl implements Eth { if (cachedLog) { const gasPriceForTimestamp = await this.getCurrentGasPriceForBlock(cachedLog.blockHash); - const receipt: any = { + const receipt: ITransactionReceipt = { blockHash: cachedLog.blockHash, blockNumber: cachedLog.blockNumber, contractAddress: cachedLog.address, @@ -1969,7 +1970,7 @@ export class EthImpl implements Eth { }); }); - const receipt: any = { + const receipt: ITransactionReceipt = { blockHash: toHash32(receiptResponse.block_hash), blockNumber: numberTo0x(receiptResponse.block_number), from: await this.resolveEvmAddress(receiptResponse.from, requestIdPrefix), diff --git a/packages/relay/src/lib/types/ITransactionReceipt.ts b/packages/relay/src/lib/types/ITransactionReceipt.ts new file mode 100644 index 0000000000..248b402a91 --- /dev/null +++ b/packages/relay/src/lib/types/ITransactionReceipt.ts @@ -0,0 +1,20 @@ +import type { Log } from '../model'; + +export interface ITransactionReceipt { + blockHash: string; + blockNumber: string; + contractAddress: string; + cumulativeGasUsed: string; + effectiveGasPrice: string; + from: string; + gasUsed: string; + logs: Log[]; + logsBloom: string; + root: string; + status: string; + to: string; + transactionHash: string; + transactionIndex: string | null; + type: string | null; + revertReason?: string; +}