Skip to content

Releases: hrharder/go-gas

v1.0.1

06 Feb 01:44
a5332f4
Compare
Choose a tag to compare

Release: go-gas@v1.0.1

This is a patch release to the go-gas module (gas package) with minor internal enhancements.

There are no changes to any exported types, functions, or constants.

Changes

  • Improvements to internal data management (see #5)
  • Code cleanup

v1.0.0

03 Feb 17:53
8d9b0d9
Compare
Choose a tag to compare

Overview

Package gas provides two main ways to fetch a gas price from the ETH Gas Station API.

  1. Fetch the current recommended price for a given priority level with a new API call each time
    • Use gas.SuggestGasPrice for a specific priority level
    • Use gas.SuggestFastGasPrice to fetch the fast priority level (no arguments)
  2. Create a new GasPriceSuggester which maintains a cache of results for a user-defined duration
    • Use gas.NewGasPriceSuggester and specify a max result age
    • Use the returned function to fetch new gas prices, or use the cache based on how old the results are

New in v1

  • Adds a closure (NewGasPriceSuggester outer function) that allows user-defined max result age
    • Powered by gasPriceManager which maintains result cache, with max age
    • Thread safe inner function (of type GasPriceSuggester)
    • Adds tests for gasPriceManager which emulate functionality of NewGasPriceSuggester
  • Use float64 type for ETH Gas Station API results rather than json.Number
    • Allows simplification of private parsing method

Notes

  • Thanks to @jalextowle for the initial implementation of NewGasPriceSuggester

v1.0-beta.0

31 Jan 17:08
8d9b0d9
Compare
Choose a tag to compare

Overview

This is the first official beta release of the go-gas module. Be sure to report any issues or bugs if you use this package so we can address them prior to a full v1.0 tag.