Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add missing details #4

Merged
merged 1 commit into from
Sep 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ const networkGasPrice = await getNetworkGasPrice("ethereum");
// high: {
// maxPriorityFeePerGas: number;
// maxFeePerGas: number;
// },
// asap: {
// maxPriorityFeePerGas: number;
// maxFeePerGas: number;
// }
// }

Expand All @@ -55,7 +59,7 @@ const networkGasPrice = await getNetworkGasPrice("ethereum");
> 💡 The price level ("low", "average", "high", "asap") you should use depends on your type of application. Most use cases will do okay with "average" or "high". If your application has background transactions support and execution is not time critical, you could use "low". If your application has a strong need to execute transactions as soon as possible, we recommend using the
> "asap" option that adds 20% on top of the "high" reported gas price.

> 🌐 The package currently supports the Ethereum and Polygon networks (both mainnet and testnet). If you would like to add support for a new network, please open an issue or pull request.
> 🌐 The package currently supports the Ethereum (`"ethereum"`), Polygon (`"polygon"`), Rinkeby (`"rinkeby"`), and Mumbai (`"mumbai"`) networks. If you would like to add support for a new network, please open an issue or pull request.

3. Use gas prices (with [Ethers.js](https://github.com/ethers-io/ethers.js/) as an example):

Expand All @@ -67,6 +71,7 @@ function getGweiEthers(gweiAmount: number): BigNumber {
}

try {
const networkGasPrice = await getNetworkGasPrice("ethereum");
const transaction = await someContract.someMethod(someArgument, {
maxPriorityFeePerGas: getGweiEthers(
networkGasPrice.high.maxPriorityFeePerGas
Expand Down