Tool for fetching actual gasprice in ethereum blockchain
Project description
Ethereum gasprice: Actual gasprice for ethereum blockchain
Library for fetching actual ethereum blockchain gasprice from different sources: Etherscan Gas Tracker, Eth Gas Station, Etherchain Gasprice Oracle, Web3 RPC Method.
Read more about gas and fee from this article
Installation
poetry add ethereum-gasprice
or
pip3 install ethereum-gasprice
Quickstart
from ethereum_gasprice import GaspriceController, GaspriceStrategy, EthereumUnit
ETHERSCAN_API_KEY = "..."
# Pass api key to GaspriceController to initialize provider
controller = GaspriceController(
etherscan_api_key=ETHERSCAN_API_KEY,
return_unit=EthereumUnit.WEI,
)
# Get gasprice by one of these strategies:
# GaspriceStrategy.SLOW, GaspriceStrategy.REGULAR, GaspriceStrategy.FAST, GaspriceStrategy.FASTEST
actual_gasprice = controller.get_gasprice_by_strategy(GaspriceStrategy.FAST) # output: 69000000000
# Get all gasprice straregies from first available source:
actual_gasprices = controller.get_gasprices() # output: {'slow': 10, 'regular': 15, 'fast': 20, 'fastest': 21}
Documentation
TBD
License
Ethereum gasprice is licensed under the terms of the MIT License (see the file LICENSE).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ethereum-gasprice-1.1.0.tar.gz
.
File metadata
- Download URL: ethereum-gasprice-1.1.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.0 Darwin/17.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 551fbe570e693fd44a32f8163ec940d6be66316f2100c731d9659d5d8e7c8065 |
|
MD5 | 45bd44eb9ac441924216ec9d1aa7c23d |
|
BLAKE2b-256 | d29bdcb6d003eac076ce0d3ffa534c3a83012b37dcc3e9ad7ffa8e8cce8d7115 |
File details
Details for the file ethereum_gasprice-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: ethereum_gasprice-1.1.0-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.4 CPython/3.8.0 Darwin/17.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3911f45878e3116e9981e3828b11fdfa6afd98ac5d4ee98933e2d4b4d5ff0e99 |
|
MD5 | d59ab30ed193e6cd033a5a2a161855e7 |
|
BLAKE2b-256 | e74d139d931d0521f480d4bd0b51ce0d5627c12c294c9a787fe40c0e87336707 |