model

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountResponse

type AccountResponse struct {
	Jsonrpc string   `json:"jsonrpc"`
	ID      int      `json:"id"`
	Result  []string `json:"result"`
}

func (*AccountResponse) ToString

func (ar *AccountResponse) ToString() string

type BlockByNumberResponse

type BlockByNumberResponse struct {
	Jsonrpc string `json:"jsonrpc"`
	ID      int    `json:"id"`
	Result  struct {
		BaseFeePerGas   string `json:"baseFeePerGas"`
		Difficulty      string `json:"difficulty"`
		ExtraData       string `json:"extraData"`
		GasLimit        string `json:"gasLimit"`
		GasUsed         string `json:"gasUsed"`
		Hash            string `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    []struct {
			AccessList           []interface{} `json:"accessList,omitempty"`
			BlockHash            string        `json:"blockHash"`
			BlockNumber          string        `json:"blockNumber"`
			ChainID              string        `json:"chainId"`
			From                 string        `json:"from"`
			Gas                  string        `json:"gas"`
			GasPrice             string        `json:"gasPrice"`
			Hash                 string        `json:"hash"`
			Input                string        `json:"input"`
			MaxFeePerGas         string        `json:"maxFeePerGas,omitempty"`
			MaxPriorityFeePerGas string        `json:"maxPriorityFeePerGas,omitempty"`
			Nonce                string        `json:"nonce"`
			R                    string        `json:"r"`
			S                    string        `json:"s"`
			To                   string        `json:"to"`
			TransactionIndex     string        `json:"transactionIndex"`
			Type                 string        `json:"type"`
			V                    string        `json:"v"`
			Value                string        `json:"value"`
		} `json:"transactions"`
		TransactionsRoot string        `json:"transactionsRoot"`
		Uncles           []interface{} `json:"uncles"`
		Withdrawals      []struct {
			Address        string `json:"address"`
			Amount         string `json:"amount"`
			Index          string `json:"index"`
			ValidatorIndex string `json:"validatorIndex"`
		} `json:"withdrawals"`
		WithdrawalsRoot string `json:"withdrawalsRoot"`
	} `json:"result"`
}

type BlockNumberResponse

type BlockNumberResponse struct {
	Jsonrpc string `json:"jsonrpc"`
	ID      int    `json:"id"`
	Result  string `json:"result"`
}

type EphemeralRequest

type EphemeralRequest struct {
	Base64Hash  []byte
	Request     RPCRequest
	Response    string
	BlockNumber uint64
	When        int64
}

func (*EphemeralRequest) IsStillValid

func (erpc *EphemeralRequest) IsStillValid() (ok bool)

type RPCRequest

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

func (*RPCRequest) Base64Hash

func (rpc *RPCRequest) Base64Hash(userSelectedChainId *int) (hash string)

func (*RPCRequest) Hash

func (rpc *RPCRequest) Hash(userSelectedChainId *int) (hash []byte)

func (*RPCRequest) IsAfterFinalCacheable

func (rpc *RPCRequest) IsAfterFinalCacheable() (resp bool)

func (*RPCRequest) IsCacheable

func (rpc *RPCRequest) IsCacheable() (resp bool)

func (*RPCRequest) IsEnvCacheable

func (rpc *RPCRequest) IsEnvCacheable() (resp bool)

func (*RPCRequest) IsResultFinal

func (rpc *RPCRequest) IsResultFinal(resp string) (final bool)

func (*RPCRequest) IsTimelyCacheable

func (rpc *RPCRequest) IsTimelyCacheable() (resp bool)

func (*RPCRequest) ToByte

func (rpc *RPCRequest) ToByte(userSelectedChainId *int) (data []byte)

Jump to

Keyboard shortcuts

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