Skip to main content

Tool for fetching actual gasprice in ethereum blockchain

Project description

Ethereum gasprice: Actual gasprice for ethereum blockchain

PyPI PyPI - Downloads

Library for fetching actual ethereum blockchain gasprice from different sources: Etherscan Gas Tracker, Eth Gas Station, 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

ethereum-gasprice-1.0.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

ethereum_gasprice-1.0.1-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file ethereum-gasprice-1.0.1.tar.gz.

File metadata

  • Download URL: ethereum-gasprice-1.0.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.8.0 Darwin/17.7.0

File hashes

Hashes for ethereum-gasprice-1.0.1.tar.gz
Algorithm Hash digest
SHA256 ddcb184d5ff8f7d6f40e0e66adde441229862cb0c228664538dec3ce8569934c
MD5 97909de4c4b0432f6c61fca7cf435a05
BLAKE2b-256 b2005e4843735d9499ab61c9a0558cd7696c2382860a1a520d1f68eb59685a56

See more details on using hashes here.

File details

Details for the file ethereum_gasprice-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ethereum_gasprice-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a873a90be9d463f4fcb8b3033aafcdaff0c0cec6d9b0c02308b045394f728791
MD5 ad96dfac93d2022aca1f20d1c84834c9
BLAKE2b-256 90077e8d96d7e13fecd03cca88b87e0d3548c4ac721742903bcce82d89a5ba95

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page