diff --git a/packages/abstract-provider/src.ts/index.ts b/packages/abstract-provider/src.ts/index.ts index b6f82eaf9..630b0cddc 100644 --- a/packages/abstract-provider/src.ts/index.ts +++ b/packages/abstract-provider/src.ts/index.ts @@ -71,7 +71,7 @@ interface _Block { miner: string; extraData: string; - baseFee?: null | BigNumber; + baseFeePerGas?: null | BigNumber; } export interface Block extends _Block { @@ -238,12 +238,12 @@ export abstract class Provider implements OnceBlockable { let maxFeePerGas = null, maxPriorityFeePerGas = null; - if (block && block.baseFee) { + if (block && block.baseFeePerGas) { // We may want to compute this more accurately in the future, // using the formula "check if the base fee is correct". // See: https://eips.ethereum.org/EIPS/eip-1559 maxPriorityFeePerGas = BigNumber.from("1000000000"); - maxFeePerGas = block.baseFee.mul(2).add(maxPriorityFeePerGas); + maxFeePerGas = block.baseFeePerGas.mul(2).add(maxPriorityFeePerGas); } return { maxFeePerGas, maxPriorityFeePerGas, gasPrice }; diff --git a/packages/providers/src.ts/formatter.ts b/packages/providers/src.ts/formatter.ts index 88471681e..5893630bf 100644 --- a/packages/providers/src.ts/formatter.ts +++ b/packages/providers/src.ts/formatter.ts @@ -145,7 +145,7 @@ export class Formatter { transactions: Formatter.allowNull(Formatter.arrayOf(hash)), - baseFee: Formatter.allowNull(bigNumber) + baseFeePerGas: Formatter.allowNull(bigNumber) }; formats.blockWithTransactions = shallowCopy(formats.block); diff --git a/packages/transactions/src.ts/index.ts b/packages/transactions/src.ts/index.ts index 2c32fe6b5..8b3ab6f5c 100644 --- a/packages/transactions/src.ts/index.ts +++ b/packages/transactions/src.ts/index.ts @@ -362,7 +362,7 @@ function _parseEip1559(payload: Uint8Array): Transaction { nonce: handleNumber(transaction[1]).toNumber(), maxPriorityFeePerGas: maxPriorityFeePerGas, maxFeePerGas: maxFeePerGas, - gasPrice: maxPriorityFeePerGas.add(maxFeePerGas), + gasPrice: maxFeePerGas, gasLimit: handleNumber(transaction[4]), to: handleAddress(transaction[5]), value: handleNumber(transaction[6]), @@ -375,7 +375,7 @@ function _parseEip1559(payload: Uint8Array): Transaction { tx.hash = keccak256(payload); - _parseEipSignature(tx, transaction.slice(9), _serializeEip2930); + _parseEipSignature(tx, transaction.slice(9), _serializeEip1559); return tx; }