etherscan

package
v2.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: AGPL-3.0 Imports: 6 Imported by: 0

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