Is there any api to find the current gas price, which i can see in ethgasstation, also i wonder how meta mask determine the current gas price automatically.
You are viewing a single comment's thread from:
Is there any api to find the current gas price, which i can see in ethgasstation, also i wonder how meta mask determine the current gas price automatically.
Gas price is calculated on ethgasstation and metamask by looking at the average gas price of previous blocks. You can't query the blockchain for gas price, it's not something the blockchain manages or has control over.
Here's a link to the ethgasstation-api github repo: https://github.com/ethgasstation/ethgasstation-api