microservice_ethereum_block_fluid_transfers_amqp

package
v0.0.0-...-07d62d3 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogsFromHash

func GetLogsFromHash(gethHttpApi, blockHash string) (logs []types.Log, err error)

Types

type Block

type Block struct {
	Difficulty       string        `json:"difficulty"`
	ExtraData        string        `json:"extraData"`
	GasLimit         string        `json:"gasLimit"`
	GasUsed          string        `json:"gasUsed"`
	Hash             types.Address `json:"hash"`
	LogsBloom        string        `json:"logsBloom"`
	Miner            string        `json:"miner"`
	MixHash          string        `json:"mixHash"`
	Nonce            string        `json:"nonce"`
	Number           string        `json:"number"`
	ParentHash       string        `json:"parentHash"`
	ReceiptsRoot     string        `json:"receiptsRoot"`
	Sha3Uncles       string        `json:"sha3Uncles"`
	Size             string        `json:"size"`
	StateRoot        string        `json:"stateRoot"`
	Timestamp        string        `json:"timestamp"`
	TotalDifficulty  string        `json:"totalDifficulty"`
	Transactions     []Transaction `json:"transactions"`
	TransactionsRoot string        `json:"transactionsRoot"`
	Uncles           []interface{} `json:"uncles"`
}

Block is eth_getBlockByHash's result. Does not match ethereum's internal Block structure

func GetBlockFromHash

func GetBlockFromHash(gethHttpApi, blockHash string, retries int, delay int) (*Block, error)

type BlockParams

type BlockParams [2]interface{}

type BlocksResponse

type BlocksResponse struct {
	JsonRpc string `json:"jsonrpc"`
	Id      string `json:"id"`
	// this can be Block or null
	Result json.RawMessage `json:"result"`
}

type GethBody

type GethBody struct {
	JsonRpc string      `json:"jsonrpc"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
	Id      string      `json:"id"`
}

type Log

type Log struct {
	Address     string   `json:"address"`
	Topics      []string `json:"topics"`
	Data        string   `json:"data"`
	BlockNumber string   `json:"blockNumber"`
	TxHash      string   `json:"transactionHash"`
	TxIndex     string   `json:"transactionIndex"`
	BlockHash   string   `json:"blockHash"`
	Index       string   `json:"logIndex"`
	Removed     bool     `json:"removed"`
}

type LogParams

type LogParams [1]struct {
	BlockHash string   `json:"blockHash"`
	Topics    []string `json:"topics"`
}

type LogsResponse

type LogsResponse struct {
	JsonRpc string `json:"jsonrpc"`
	Id      string `json:"id"`
	Result  []Log  `json:"result"`
}

type Transaction

type Transaction struct {
	BlockHash   types.Hash `json:"blockHash"`
	BlockNumber hexInt     `json:"blockNumber"`

	From types.Address `json:"from"`

	GasPrice             hexInt `json:"gasPrice"`
	MaxFeePerGas         hexInt `json:"maxFeePerGas"`
	MaxPriorityFeePerGas hexInt `json:"maxPriorityFeePerGas"`

	Hash types.Hash `json:"hash"`

	// Data encoded as a hex byte array received in the form of a string
	Data string `json:"input"`

	To types.Address `json:"to"`

	// Type encoded as a hex uint8
	Type hexInt `json:"type"`
}

Transaction is eth_blockByHash return data

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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