Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit fe959a1

Browse files
authored
Contract options fix (#6118)
* added maxPriorityFeePerGas and maxFeePerGas in contract options * changelog update
1 parent bf1311f commit fe959a1

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

packages/web3-eth-contract/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,4 @@ const transactionHash = receipt.transactionHash;
258258
### Added
259259

260260
- Added support for `getPastEvents` method to filter `allEvents` and specific event (#6010)
261+
- Added `maxPriorityFeePerGas` and `maxFeePerGas` in `ContractOptions` type and updated function using it in utils (#6118)

packages/web3-eth-contract/src/types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ export interface ContractOptions {
135135
* ```
136136
*/
137137
address?: Address; // All transactions generated by web3.js from this contract will contain this address as the "to".
138+
/**
139+
* The max priority fee per gas to use for transactions.
140+
*/
141+
maxPriorityFeePerGas?: Uint;
142+
/**
143+
* The max fee per gas to use for transactions.
144+
*/
145+
maxFeePerGas?: Uint;
138146
}
139147

140148
export interface NonPayableMethodObject<Inputs = unknown[], Outputs = unknown[]> {

packages/web3-eth-contract/src/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export const getSendTxParams = ({
6363
gasPrice: contractOptions.gasPrice,
6464
from: contractOptions.from,
6565
input: contractOptions.input,
66+
maxPriorityFeePerGas: contractOptions.maxPriorityFeePerGas,
67+
maxFeePerGas: contractOptions.maxFeePerGas,
6668
},
6769
options as unknown as Record<string, unknown>,
6870
) as unknown as TransactionCall;
@@ -99,6 +101,8 @@ export const getEthTxCallParams = ({
99101
gasPrice: contractOptions.gasPrice,
100102
from: contractOptions.from,
101103
input: contractOptions.input,
104+
maxPriorityFeePerGas: contractOptions.maxPriorityFeePerGas,
105+
maxFeePerGas: contractOptions.maxFeePerGas,
102106
},
103107
options as unknown as Record<string, unknown>,
104108
) as unknown as TransactionCall;
@@ -185,6 +189,8 @@ export const getCreateAccessListParams = ({
185189
gasPrice: contractOptions.gasPrice,
186190
from: contractOptions.from,
187191
input: contractOptions.input,
192+
maxPriorityFeePerGas: contractOptions.maxPriorityFeePerGas,
193+
maxFeePerGas: contractOptions.maxFeePerGas,
188194
},
189195
options as unknown as Record<string, unknown>,
190196
) as unknown as TransactionForAccessList;

0 commit comments

Comments
 (0)