-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set custom gas price when creating NFT
Polygon increased it's minimum gas price from 30 Gwei to 1Gwei to curb spam. Other blockchains might change their default gas price as well so we should get that value from the provider. see: https://medium.com/stakingbits/polygon-minimum-gas-fee-is-now-30-gwei-to-curb-spam-8bd4313c83a2 ethers-io/ethers.js#2828 (comment) ethers-io/ethers.js#40 (comment)
- Loading branch information
Showing
5 changed files
with
55 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { getProvider } from "./utils/network-helpers" | ||
|
||
const chainId = "137" | ||
const provider = getProvider(chainId); | ||
|
||
provider.getGasPrice(); | ||
|
||
export const main = async () => { | ||
|
||
const gasPrice = await provider.getGasPrice(); | ||
const feeData = await provider.getFeeData(); | ||
|
||
console.log("gasPrice", gasPrice); | ||
console.log("feeData",feeData); | ||
}; | ||
|
||
main(); |