Skip to content

Commit

Permalink
add doc for defaultMaxPriorityFeePerGas
Browse files Browse the repository at this point in the history
  • Loading branch information
blackmoshui authored and mmyyrroonn committed Jun 27, 2024
1 parent 6787e8b commit 8297909
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion docs/docs/guides/web3_config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ There is list of configuration params that can be set for modifying behavior of
- [defaultChain](/api/web3-core/class/Web3Config#defaultChain)
- [defaultHardfork](/api/web3-core/class/Web3Config#defaultHardfork)
- [defaultCommon](/api/web3-core/class/Web3Config#defaultCommon)
- [defaultTransactionType](/api/web3-core/class/Web3Config#defaultTransactionType)
- [defaultTransactionType](/api/web3-core/class/Web3Config#defaultTransactionType)
- [defaultMaxPriorityFeePerGas](/api/web3-core/class/Web3Config#defaultMaxPriorityFeePerGas)
- [defaultReturnFormat](/api/web3-core/class/Web3Config#defaultReturnFormat)

## Global level Config
Expand Down Expand Up @@ -745,6 +746,32 @@ console.log(web3.eth.getContextObject().config)
```
:::

### defaultMaxPriorityFeePerGas
The `defaultMaxPriorityFeePerGas` is used to send transactions with the maximum priority gas fee. The default value is 2500000000 (2.5gwei) in hexstring format.
```ts
import { Web3 } from 'web3';
import { numberToHex } from 'web3-utils'

const web3 = new Web3('http://127.0.0.1:7545');

web3.defaultMaxPriorityFeePerGas = numberToHex(2100000000); // 2.1gwei

console.log(web3.getContextObject().config)
```
:::info
The `defaultMaxPriorityFeePerGas` can be configured both globally and at the package level:
```ts
import { Web3 } from 'web3';
import { numberToHex } from 'web3-utils'

const web3 = new Web3('http://127.0.0.1:7545');

web3.eth.defaultMaxPriorityFeePerGas = numberToHex(2100000000); // 2.1gwei

console.log(web3.eth.getContextObject().config)
```
:::

### defaultReturnFormat
The `defaultReturnFormat` allows users to specify the format in which certain types of data should be returned by default. It is a configuration parameter that can be set at the global level and affects how data is returned across the entire library.
```ts
Expand Down

0 comments on commit 8297909

Please sign in to comment.