block

package
v0.0.110 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	ID        string `json:"id"`
	Number    string `json:"number"`
	Timestamp string `json:"timestamp"`
}

type BlockInterface

type BlockInterface interface {
	GetBlockNumberWithTS(timestamp int64) (int64, error)
	GetLatestBlockNumberAndTS() (int64, int64, error)
	GetTimestampWithBN(blockNumber int64) (int64, error)
}

type Client

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

func NewClient

func NewClient(logger logging.Logger, graphUrl string, goClient *goEth.Client) *Client

func (*Client) GetBlockNumberWithTS

func (b *Client) GetBlockNumberWithTS(timestamp int64) (int64, error)

GetBlockNumberWithTS which is the closest but less than or equal to timestamp

func (*Client) GetLatestBlockNumberAndTS added in v0.0.87

func (b *Client) GetLatestBlockNumberAndTS() (int64, int64, error)

GetLatestBlockNumberAndTS get the closest block number.

func (*Client) GetTimestampWithBN added in v0.0.75

func (b *Client) GetTimestampWithBN(blockNumber int64) (int64, error)

GetTimestampWithBN get timestamp with block number

type Errors added in v0.0.82

type Errors []struct {
	Message string
}

func (Errors) Error added in v0.0.82

func (e Errors) Error() string

type MultiBlockInterface

type MultiBlockInterface interface {
	GetMultiBlockNumberWithTS(timestamp int64) ([]int64, error)
}

type MultiClient

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

func NewMultiClient

func NewMultiClient(logger logging.Logger, clients []BlockInterface) *MultiClient

func (*MultiClient) GetMultiBlockNumberWithTS

func (c *MultiClient) GetMultiBlockNumberWithTS(timestamp int64) ([]int64, error)

Jump to

Keyboard shortcuts

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