logs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComparisonOperator

type ComparisonOperator int32

ComparisonOperator is an enumeration of topic comparison operators. ENUM(and,or)

const (
	// ComparisonOperatorAnd is a ComparisonOperator of type And.
	ComparisonOperatorAnd ComparisonOperator = iota
	// ComparisonOperatorOr is a ComparisonOperator of type Or.
	ComparisonOperatorOr
)

func ParseComparisonOperator

func ParseComparisonOperator(name string) (ComparisonOperator, error)

ParseComparisonOperator attempts to convert a string to a ComparisonOperator

func (ComparisonOperator) String

func (x ComparisonOperator) String() string

String implements the Stringer interface.

type LogResponse

type LogResponse struct {
	Address          common.Address
	BlockNumber      uint64 `etherscan:"blockNumber,hex"`
	Data             []byte
	GasPrice         *big.Int  `etherscan:"gasPrice,hex"`
	GasUsed          *big.Int  `etherscan:"gasUsed,hex"`
	LogIndex         uint32    `etherscan:"logIndex,hex"`
	Timestamp        time.Time `etherscan:"timeStamp,hex"`
	Topics           []common.Hash
	TransactionHash  common.Hash `etherscan:"transactionHash"`
	TransactionIndex uint32      `etherscan:"transactionIndex,hex"`
}

LogResponse contains information on an ethereum log.

type LogsBlockParam

type LogsBlockParam struct {
	Number uint64
	Latest bool
}

LogsBlockParam contain block-related parameters.

type LogsClient

type LogsClient struct {
	API *httpapi.APIClient
}

LogsClient is the client for logs related actions.

func (*LogsClient) GetLogs

func (c *LogsClient) GetLogs(ctx context.Context, req *LogsRequest) ([]LogResponse, error)

GetLogs provides an alternative to the native eth_getLogs.

type LogsRequest

type LogsRequest struct {
	FromBlock   LogsBlockParam
	ToBlock     LogsBlockParam
	Address     common.Address
	Topics      []common.Hash
	Comparisons []TopicComparison
}

LogsRequest contains the request parameters for GetLogs.

type TopicComparison

type TopicComparison struct {
	Topics   [2]uint8
	Operator ComparisonOperator
}

TopicComparison contains parameters for comparing two topics.

Jump to

Keyboard shortcuts

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