block

package
v0.0.60 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: MIT Imports: 6 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)
}

type Client

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

func NewClient

func NewClient(logger logging.Logger, url string) *Client

func (*Client) GetBlockNumberWithTS

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

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

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