etherscan

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: AGPL-3.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Blocking.  Returns the gas price.
	GetGasPrice(ctx context.Context) (*GasPriceEtherscan, error)
}

Client is the interface to a ServerProof that calculates zk proofs

type GasPriceEtherscan

type GasPriceEtherscan struct {
	LastBlock       string `json:"LastBlock"`
	SafeGasPrice    string `json:"SafeGasPrice"`
	ProposeGasPrice string `json:"ProposeGasPrice"`
	FastGasPrice    string `json:"FastGasPrice"`
}

GasPriceEtherscan definition

type MockEtherscanClient

type MockEtherscanClient struct {
}

MockEtherscanClient is a mock EtherscanServer to be used in tests. It doesn't calculate anything

func (*MockEtherscanClient) GetGasPrice

func (p *MockEtherscanClient) GetGasPrice(ctx context.Context) (*GasPriceEtherscan, error)

GetGasPrice retrieves the gas price estimation from etherscan

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service definition

func NewEtherscanService

func NewEtherscanService(etherscanURL string, apikey string) (*Service, error)

NewEtherscanService is the constructor that creates an etherscanService

func (*Service) GetGasPrice

func (p *Service) GetGasPrice(ctx context.Context) (*GasPriceEtherscan, error)

GetGasPrice retrieves the gas price estimation from etherscan

Jump to

Keyboard shortcuts

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