Skip to content

Commit

Permalink
Contract options fix (#6118)
Browse files Browse the repository at this point in the history
* added maxPriorityFeePerGas and maxFeePerGas in contract options

* changelog update
  • Loading branch information
jdevcs committed May 25, 2023
1 parent bf1311f commit fe959a1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/web3-eth-contract/CHANGELOG.md
Expand Up @@ -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)
8 changes: 8 additions & 0 deletions packages/web3-eth-contract/src/types.ts
Expand Up @@ -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<Inputs = unknown[], Outputs = unknown[]> {
Expand Down
6 changes: 6 additions & 0 deletions packages/web3-eth-contract/src/utils.ts
Expand Up @@ -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<string, unknown>,
) as unknown as TransactionCall;
Expand Down Expand Up @@ -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<string, unknown>,
) as unknown as TransactionCall;
Expand Down Expand Up @@ -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<string, unknown>,
) as unknown as TransactionForAccessList;
Expand Down

0 comments on commit fe959a1

Please sign in to comment.