evm

package
v0.0.0-...-efbd42f Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTooManyRequests = fmt.Errorf("too many requests")

Functions

This section is empty.

Types

type EvmRequest

type EvmRequest struct {
	Jsonrpc string `json:"jsonrpc"`
	Method  string `json:"method"`
	Params  []any  `json:"params"`
	ID      int    `json:"id"`
}

type EvmSDK

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

func NewEvmSDK

func NewEvmSDK(url string, rl ratelimit.Limiter, metrics metrics.Metrics) *EvmSDK

func (*EvmSDK) GetBlock

func (s *EvmSDK) GetBlock(ctx context.Context, block uint64) (*GetBlockResult, error)

func (*EvmSDK) GetLatestBlock

func (s *EvmSDK) GetLatestBlock(ctx context.Context) (uint64, error)

func (*EvmSDK) GetTransactionReceipt

func (s *EvmSDK) GetTransactionReceipt(ctx context.Context, txHash string) (*TransactionReceiptResult, error)

type GetBlockResult

type GetBlockResult struct {
	Hash         string        `json:"hash"`
	Number       string        `json:"number"`
	Timestamp    string        `json:"timestamp"`
	Transactions []Transaction `json:"transactions"`
}

type Transaction

type Transaction struct {
	BlockHash            string `json:"blockHash"`
	BlockNumber          string `json:"blockNumber"`
	From                 string `json:"from"`
	Gas                  string `json:"gas"`
	GasPrice             string `json:"gasPrice"`
	MaxFeePerGas         string `json:"maxFeePerGas"`
	MaxPriorityFeePerGas string `json:"maxPriorityFeePerGas"`
	Hash                 string `json:"hash"`
	Input                string `json:"input"`
	Nonce                string `json:"nonce"`
	To                   string `json:"to"`
	TransactionIndex     string `json:"transactionIndex"`
	Value                string `json:"value"`
	Type                 string `json:"type"`
	AccessList           any    `json:"accessList"`
	ChainID              string `json:"chainId"`
	V                    string `json:"v"`
	R                    string `json:"r"`
	S                    string `json:"s"`
}

type TransactionReceiptResult

type TransactionReceiptResult struct {
	BlockHash         string  `json:"blockHash"`
	BlockNumber       string  `json:"blockNumber"`
	ContractAddress   *string `json:"contractAddress"`
	CumulativeGasUsed string  `json:"cumulativeGasUsed"`
	EffectiveGasPrice string  `json:"effectiveGasPrice"`
	From              string  `json:"from"`
	GasUsed           string  `json:"gasUsed"`
	Logs              []any   `json:"logs"`
	LogsBloom         string  `json:"logsBloom"`
	Status            string  `json:"status"`
	To                *string `json:"to"`
	TransactionHash   *string `json:"transactionHash"`
	TransactionIndex  *string `json:"transactionIndex"`
	Type              string  `json:"type"`
}

Jump to

Keyboard shortcuts

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