Skip to content

Commit

Permalink
fix: hexidecimal number for eth_feehistory blockcount (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-abrioux authored Nov 10, 2022
1 parent 55ab6c8 commit 980e6a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { JsonRpcProvider } from '@ethersproject/providers';
import { utils } from 'ethers';
import { ema } from 'moving-averages';
import {
BASE_FEE_ADDITIONAL_PADDING,
Expand Down Expand Up @@ -27,7 +28,7 @@ export const suggestMaxBaseFee = async (
blockCountHistory = 100
): Promise<MaxFeeSuggestions> => {
const feeHistory: FeeHistoryResponse = await provider.send('eth_feeHistory', [
blockCountHistory,
utils.hexStripZeros(utils.hexlify(blockCountHistory)),
fromBlock,
[],
]);
Expand Down Expand Up @@ -109,7 +110,7 @@ export const suggestMaxPriorityFee = async (
fromBlock = 'latest'
): Promise<MaxPriorityFeeSuggestions> => {
const feeHistory: FeeHistoryResponse = await provider.send('eth_feeHistory', [
10,
utils.hexStripZeros(utils.hexlify(10)),
fromBlock,
[10, 15, 30, 45],
]);
Expand Down

0 comments on commit 980e6a6

Please sign in to comment.