From c295d699e759fabb81120856267ec0c246d3a86e Mon Sep 17 00:00:00 2001 From: Alan Sapede Date: Thu, 23 Jun 2022 13:22:05 -0400 Subject: [PATCH] Adds Eth feeHistory & maxPriorityFeePerGas rpc (#4956) * Adds Eth feeHistory & maxPriorityFeePerGas * linted * Fixes rpc method ordering --- .../types/src/interfaces/eth/definitions.ts | 6 +++++ packages/types/src/interfaces/eth/rpc.ts | 23 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/packages/types/src/interfaces/eth/definitions.ts b/packages/types/src/interfaces/eth/definitions.ts index e83f7f5b65..fcd7a30c89 100644 --- a/packages/types/src/interfaces/eth/definitions.ts +++ b/packages/types/src/interfaces/eth/definitions.ts @@ -164,6 +164,12 @@ const types: DefinitionsTypes = objectSpread({}, V0, V1, V2, { data: 'Option', nonce: 'Option' }, + EthFeeHistory: { + oldestBlock: 'U256', + baseFeePerGas: 'Vec', + gasUsedRatio: 'Vec', + reward: 'Option>>' + }, EthFilter: { fromBlock: 'Option', toBlock: 'Option', diff --git a/packages/types/src/interfaces/eth/rpc.ts b/packages/types/src/interfaces/eth/rpc.ts index f3df792753..e3a4c78146 100644 --- a/packages/types/src/interfaces/eth/rpc.ts +++ b/packages/types/src/interfaces/eth/rpc.ts @@ -96,6 +96,24 @@ export const rpc: DefinitionsRpc = objectSpread({}, netRpc, web3Rpc, { ], type: 'U256' }, + feeHistory: { + description: 'Returns fee history for given block count & reward percentiles', + params: [ + { + name: 'blockCount', + type: 'U256' + }, + { + name: 'newestBlock', + type: 'BlockNumber' + }, + { + name: 'rewardPercentiles', + type: 'Option>' + } + ], + type: 'EthFeeHistory' + }, gasPrice: { description: 'Returns current gas price.', params: [], @@ -368,6 +386,11 @@ export const rpc: DefinitionsRpc = objectSpread({}, netRpc, web3Rpc, { params: [], type: 'U256' }, + maxPriorityFeePerGas: { + description: 'Returns max priority fee per gas', + params: [], + type: 'U256' + }, mining: { description: 'Returns true if client is actively mining new blocks.', params: [],