Skip to content

⛽ Flask API which estimates and presents Ethereum Gas Price after eip1559

Notifications You must be signed in to change notification settings

muhammet-mucahit/gas-price-estimator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gas Price Estimator

Requirements

  • Python v3.9 (Any Python version greater than 3.6 because of f strings)
  • API Key from infura.io

Installation

Package installation

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Environment Variables

cp .env.example .env

Set PROJECT_ID to your infura.io API Key

Run

flask run

Test

pytest .

API

Request

GET /api/gas_price

Response (Example)

{
  "prices": {
    "fast": {
      "base_fee": "3.60",
      "priority_fee": "1.86",
      "value": "5.46"
    },
    "normal": {
      "base_fee": "3.60",
      "priority_fee": "1.56",
      "value": "5.16"
    },
    "slow": {
      "base_fee": "3.60",
      "priority_fee": "1.19",
      "value": "4.79"
    }
  }
}

About

⛽ Flask API which estimates and presents Ethereum Gas Price after eip1559

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published