gas

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AvgGasLimit

type AvgGasLimit struct {
	Timestamp time.Time `etherscan:"unixTimeStamp"`
	GasLimit  uint64    `etherscan:"gasLimit"`
}

AvgGasLimit describes the average gas limit on a particular day.

type AvgGasPrice

type AvgGasPrice struct {
	Timestamp   time.Time `etherscan:"unixTimeStamp"`
	MaxGasPrice *big.Int  `etherscan:"maxGasPrice_Wei"`
	MinGasPrice *big.Int  `etherscan:"minGasPrice_Wei"`
	AvgGasPrice *big.Int  `etherscan:"avgGasPrice_Wei"`
}

AvgGasPrice describes the average gas prices on a particular day.

type GasClient

type GasClient struct {
	API *httpapi.APIClient
}

GasClient is the client for gas actions.

func (*GasClient) EstimateConfirmationTime

func (c *GasClient) EstimateConfirmationTime(
	ctx context.Context, gasPriceGwei int64,
) (uint64, error)

EstimateConfirmationTime returns the estimated time, in seconds, for a transaction to be confirmed on the blockchain.

func (*GasClient) GetDailyAvgGasLimit

func (c *GasClient) GetDailyAvgGasLimit(
	ctx context.Context, req *ecommon.DateRange,
) (result []AvgGasLimit, err error)

GetDailyAvgGasLimit returns the historical daily average gas limit of the Ethereum network.

func (*GasClient) GetDailyAvgGasPrice

func (c *GasClient) GetDailyAvgGasPrice(
	ctx context.Context, req *ecommon.DateRange,
) (result []AvgGasPrice, err error)

GetDailyAvgGasPrice returns the daily average gas price used on the Ethereum network.

func (*GasClient) GetDailyTotalGasUsed

func (c *GasClient) GetDailyTotalGasUsed(
	ctx context.Context, req *ecommon.DateRange,
) (result []GasUsed, err error)

GetDailyTotalGasUsed returns the total amount of gas used daily for transctions on the Ethereum network.

func (*GasClient) GetGasOracle

func (c *GasClient) GetGasOracle(ctx context.Context) (*GasPrices, error)

GetGasOracle returns the current Safe, Proposed and Fast gas prices.

type GasPrices

type GasPrices struct {
	LastBlock       uint64            `etherscan:"LastBlock"`
	SafeGasPrice    uint64            `etherscan:"SafeGasPrice"`
	ProposeGasPrice uint64            `etherscan:"ProposeGasPrice"`
	FastGasPrice    uint64            `etherscan:"FastGasPrice"`
	SuggestBaseFee  decimal.Decimal   `etherscan:"suggestBaseFee"`
	GasUsedRatio    []decimal.Decimal `etherscan:"gasUsedRatio,sep"`
}

GasPrices describes the current recommended gas prices.

type GasUsed

type GasUsed struct {
	Timestamp time.Time `etherscan:"unixTimeStamp"`
	GasUsed   *big.Int  `etherscan:"gasUsed"`
}

GasUsed describes the total amount of gas used on a particular day.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL