infura

package
v0.0.0-...-b634e5d Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TrendUp   = "up"
	TrendDown = "down"
)

Variables

This section is empty.

Functions

func NewClient

func NewClient(apiKey string) *client

Types

type Client

type Client interface {
	GetSuggestedGasFees(ctx context.Context, chainID int) (*SuggestedGasFees, error)
}

func NewCache

func NewCache(client Client, expiry time.Duration) Client

type RecommendedGasValues

type RecommendedGasValues struct {
	SuggestedMaxPriorityFeePerGas decimal.Decimal `json:"suggestedMaxPriorityFeePerGas"`
	SuggestedMaxFeePerGas         decimal.Decimal `json:"suggestedMaxFeePerGas"`
	MinWaitTimeEstimateMillis     int64           `json:"minWaitTimeEstimate"`
	MaxWaitTimeEstimateMillis     int64           `json:"maxWaitTimeEstimate"`
}

type SuggestedGasFees

type SuggestedGasFees struct {
	Low                        RecommendedGasValues `json:"low"`
	Medium                     RecommendedGasValues `json:"medium"`
	High                       RecommendedGasValues `json:"high"`
	EstimatedBaseFee           decimal.Decimal      `json:"estimatedBaseFee"`
	NetworkCongestion          float64              `json:"networkCongestion"`
	LatestPriorityFeeRange     []decimal.Decimal    `json:"latestPriorityFeeRange"`
	HistoricalPriorityFeeRange []decimal.Decimal    `json:"historicalPriorityFeeRange"`
	HistoricalBaseFeeRange     []decimal.Decimal    `json:"historicalBaseFeeRange"`
	PriorityFeeTrend           Trend                `json:"priorityFeeTrend"`
	BaseFeeTrend               Trend                `json:"baseFeeTrend"`
}

func GetSuggestedGasFees

func GetSuggestedGasFees(ctx context.Context, apiKey string, chainID int) (*SuggestedGasFees, error)

func GetSuggestedGasFeesFromURL

func GetSuggestedGasFeesFromURL(ctx context.Context, reqURL string) (*SuggestedGasFees, error)

type Trend

type Trend string

Jump to

Keyboard shortcuts

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