diff --git a/packages/web3-eth-contract/CHANGELOG.md b/packages/web3-eth-contract/CHANGELOG.md index 6b23870bec4..16ff2053da8 100644 --- a/packages/web3-eth-contract/CHANGELOG.md +++ b/packages/web3-eth-contract/CHANGELOG.md @@ -258,3 +258,4 @@ const transactionHash = receipt.transactionHash; ### Added - Added support for `getPastEvents` method to filter `allEvents` and specific event (#6010) +- Added `maxPriorityFeePerGas` and `maxFeePerGas` in `ContractOptions` type and updated function using it in utils (#6118) diff --git a/packages/web3-eth-contract/src/types.ts b/packages/web3-eth-contract/src/types.ts index dfa8c7da02b..43cc490efb7 100644 --- a/packages/web3-eth-contract/src/types.ts +++ b/packages/web3-eth-contract/src/types.ts @@ -135,6 +135,14 @@ export interface ContractOptions { * ``` */ address?: Address; // All transactions generated by web3.js from this contract will contain this address as the "to". + /** + * The max priority fee per gas to use for transactions. + */ + maxPriorityFeePerGas?: Uint; + /** + * The max fee per gas to use for transactions. + */ + maxFeePerGas?: Uint; } export interface NonPayableMethodObject { diff --git a/packages/web3-eth-contract/src/utils.ts b/packages/web3-eth-contract/src/utils.ts index 7a9b52fdf2a..bff0c1772ee 100644 --- a/packages/web3-eth-contract/src/utils.ts +++ b/packages/web3-eth-contract/src/utils.ts @@ -63,6 +63,8 @@ export const getSendTxParams = ({ gasPrice: contractOptions.gasPrice, from: contractOptions.from, input: contractOptions.input, + maxPriorityFeePerGas: contractOptions.maxPriorityFeePerGas, + maxFeePerGas: contractOptions.maxFeePerGas, }, options as unknown as Record, ) as unknown as TransactionCall; @@ -99,6 +101,8 @@ export const getEthTxCallParams = ({ gasPrice: contractOptions.gasPrice, from: contractOptions.from, input: contractOptions.input, + maxPriorityFeePerGas: contractOptions.maxPriorityFeePerGas, + maxFeePerGas: contractOptions.maxFeePerGas, }, options as unknown as Record, ) as unknown as TransactionCall; @@ -185,6 +189,8 @@ export const getCreateAccessListParams = ({ gasPrice: contractOptions.gasPrice, from: contractOptions.from, input: contractOptions.input, + maxPriorityFeePerGas: contractOptions.maxPriorityFeePerGas, + maxFeePerGas: contractOptions.maxFeePerGas, }, options as unknown as Record, ) as unknown as TransactionForAccessList;