types

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HashLength is the expected length of the hash
	HashLength = 32
	// AddressLength is the expected length of the address
	AddressLength = 20
)

Lengths of hashes and addresses in bytes.

Variables

View Source
var NotFound = errors.New("not found")

NotFound is returned by API methods if the requested item does not exist.

Functions

This section is empty.

Types

type AccessList added in v0.0.10

type AccessList []AccessTuple

AccessList is an EIP-2930 access list.

type AccessTuple added in v0.0.10

type AccessTuple struct {
	Address     Address `json:"address"     gencodec:"required"`
	StorageKeys Hash    `json:"storageKeys" gencodec:"required"`
}

AccessTuple is the element type of an access list.

type Address added in v0.0.10

type Address [AddressLength]byte

Address represents the 20 byte address of an Ethereum account.

type AddressContractBalanceResponse

type AddressContractBalanceResponse struct {
	Balance string `json:"balance"`
}

type BlockData

type BlockData struct {
	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     []string `json:"transactions"`
	TransactionsRoot string   `json:"transactionsRoot"`
	Uncles           []string `json:"uncles"`
}

type BlockResponse

type BlockResponse struct {
	JSONRPC string    `json:"jsonrpc"`
	ID      int       `json:"id"`
	Result  BlockData `json:"result"`
}

type CallMsg added in v0.0.10

type CallMsg struct {
	From      Address  // the sender of the 'transaction'
	To        Address  // the destination contract (nil for contract creation)
	Gas       uint64   // if 0, the call executes with near-infinite gas
	GasPrice  *big.Int // wei <-> gas exchange ratio
	GasFeeCap *big.Int // EIP-1559 fee cap per gas.
	GasTipCap *big.Int // EIP-1559 tip per gas.
	Value     *big.Int // amount of wei sent along with the call
	Data      []byte   // input data, usually an ABI-encoded contract method invocation

	AccessList AccessList // EIP-2930 access list.
}

CallMsg contains parameters for contract calls.

type DecError added in v0.0.10

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

type Hash added in v0.0.10

type Hash [HashLength]byte

Hash represents the 32 byte Keccak256 hash of arbitrary data.

type JSONRPCRequest

type JSONRPCRequest struct {
	JSONRPC string      `json:"jsonrpc"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
	ID      int         `json:"id"`
}

JSONRPCRequest represents a JSON-RPC request.

type JSONRPCResult

type JSONRPCResult struct {
	Id      int    `json:"id"`
	Jsonrpc string `json:"jsonrpc"`
	Result  string `json:"result"`
}

type Log

type Log struct {
}

Log represents the log data within the logs array.

type MemPoolTXCount

type MemPoolTXCount struct {
	JSONRPC string               `json:"jsonrpc"`
	ID      int                  `json:"id"`
	Result  MemPoolTXCountResult `json:"result"`
}

type MemPoolTXCountResult

type MemPoolTXCountResult struct {
	Pending string `json:"pending"`
	Queued  string `json:"queued"`
}

type MemPoolTransactionByStatusBlob

type MemPoolTransactionByStatusBlob struct {
	JSONRPC string     `json:"jsonrpc"`
	ID      int        `json:"id"`
	Result  ResultData `json:"result"`
}

type MemPoolTransactionByStatusData

type MemPoolTransactionByStatusData 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     interface{}   `json:"transactionIndex"`
	Value                string        `json:"value"`
	Type                 string        `json:"type"`
	AccessList           []interface{} `json:"accessList"`
	ChainID              string        `json:"chainId"`
	V                    string        `json:"v"`
	R                    string        `json:"r"`
	S                    string        `json:"s"`
	Creates              interface{}   `json:"creates"`
	Wait                 interface{}   `json:"wait"`
}

type MempoolCall

type MempoolCall struct {
	JSONRPC      string        `json:"jsonrpc"`
	Method       string        `json:"method"`
	Params       MempoolParams `json:"params"`
	Subscription string        `json:"subscription"`
}

type MempoolData

type MempoolData struct {
	BlockHash        *string `json:"blockHash"`
	BlockNumber      *string `json:"blockNumber"`
	From             string  `json:"from"`
	Gas              string  `json:"gas"`
	GasPrice         string  `json:"gasPrice"`
	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"`
	V                string  `json:"v"`
	R                string  `json:"r"`
	S                string  `json:"s"`
}

type MempoolParams

type MempoolParams struct {
	Result MempoolData `json:"result"`
}

type ParamObject

type ParamObject struct {
	To   string `json:"to"`
	From string `json:"from"`
	Data string `json:"data"`
}

type Params

type Params struct {
	Result       Result `json:"result"`
	Subscription string `json:"subscription"`
}

type RecieptResult

type RecieptResult struct {
	BlockHash         string      `json:"blockHash"`
	BlockNumber       string      `json:"blockNumber"`
	ContractAddress   interface{} `json:"contractAddress"` // It can be a string or null
	CumulativeGasUsed string      `json:"cumulativeGasUsed"`
	EffectiveGasPrice string      `json:"effectiveGasPrice"`
	From              string      `json:"from"`
	GasUsed           string      `json:"gasUsed"`
	Logs              []Log       `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"`
}

TransactionResult represents the result data within a transaction response.

type Result

type Result struct {
	BlockHash        interface{} `json:"blockHash"`
	BlockNumber      interface{} `json:"blockNumber"`
	From             string      `json:"from"`
	Gas              string      `json:"gas"`
	GasPrice         string      `json:"gasPrice"`
	Hash             string      `json:"hash"`
	Input            string      `json:"input"`
	Nonce            string      `json:"nonce"`
	To               string      `json:"to"`
	TransactionIndex interface{} `json:"transactionIndex"`
	Value            string      `json:"value"`
	V                string      `json:"v"`
	R                string      `json:"r"`
	S                string      `json:"s"`
}

type ResultData

type ResultData struct {
	Pending map[string]map[string]MemPoolTransactionByStatusData `json:"pending"`
	Queued  map[string]map[string]MemPoolTransactionByStatusData `json:"queued"`
}

type TransactionConfirmation

type TransactionConfirmation struct {
	To            string
	From          string
	Confirmations string
	Amount        string
}

type TransactionData

type TransactionData struct {
	BlockHash        string `json:"blockHash"`
	BlockNumber      string `json:"blockNumber"`
	From             string `json:"from"`
	Gas              string `json:"gas"`
	GasPrice         string `json:"gasPrice"`
	Hash             string `json:"hash"`
	Input            string `json:"input"`
	Nonce            string `json:"nonce"`
	To               string `json:"to"`
	TransactionIndex string `json:"transactionIndex"`
	Value            string `json:"value"`
	V                string `json:"v"`
	R                string `json:"r"`
	S                string `json:"s"`
}

TransactionData represents the data within a transaction response.

type TransactionRecieptResponse

type TransactionRecieptResponse struct {
	JSONRPC string        `json:"jsonrpc"`
	ID      int           `json:"id"`
	Result  RecieptResult `json:"result"`
}

TransactionResponse represents the JSON response for a transaction.

type TransactionResponse

type TransactionResponse struct {
	JSONRPC string          `json:"jsonrpc"`
	ID      int             `json:"id"`
	Result  TransactionData `json:"result"`
}

TransactionResponse represents the JSON response for a transaction.

type Wallet added in v0.1.0

type Wallet struct {
	Address    string `json:"address"`
	PublicKey  string `json:"public_key"`
	PrivateKey string `json:"private_key"`
}

type WalletBalanceResponse

type WalletBalanceResponse struct {
	Balance string `json:"balance"`
	Address string `json:"address"`
}

type WebSocketResponses

type WebSocketResponses struct {
	JSONRPC string `json:"jsonrpc"`
	Method  string `json:"method"`
	Params  Params `json:"params"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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