import type { ErrorType } from '../errors/utils.js' import type { FeeHistory, RpcFeeHistory } from '../types/fee.js' export type FromRpcFeeHistoryErrorType = ErrorType export function fromRpcFeeHistory(feeHistory: RpcFeeHistory): FeeHistory { return { baseFeePerGas: feeHistory.baseFeePerGas.map((value) => BigInt(value)), gasUsedRatio: feeHistory.gasUsedRatio, oldestBlock: BigInt(feeHistory.oldestBlock), reward: feeHistory.reward?.map((reward) => reward.map((value) => BigInt(value)), ), } }