types

package
v0.0.0-...-dc9146d Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 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 Account

type Account struct {
	Address    string
	PrivateKey *ecdsa.PrivateKey
}

type Block

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

type CallParams

type CallParams struct {
	From     string   `json:"from"`
	To       string   `json:"to"`
	Gas      uint64   `json:"gas,omitempty"`
	GasPrice *big.Int `json:"gasPrice,omitempty"`
	Value    *big.Int `json:"value"`
	Data     []byte   `json:"data"`
}

eth_call params

func (CallParams) MarshalJSON

func (c CallParams) MarshalJSON() ([]byte, error)

type Chain

type Chain struct {
	Id     int64
	Name   string
	RpcUrl string
}

type ContractInteractionParams

type ContractInteractionParams struct {
	Address              string
	Abi                  string
	FunctionName         string
	Args                 []interface{}
	MaxFeePerGas         *big.Int
	MaxPriorityFeePerGas *big.Int
	GasLimit             uint64
	Value                *big.Int
	Nonce                uint64
	Account              *Account
}

type FeeHistoryResult

type FeeHistoryResult struct {
	OldestBlock   string
	Reward        [][]string
	BaseFeePerGas []string
	GasUsedRatio  []float64
}

type GetBlockParams

type GetBlockParams struct {
	BlockHash   *string  `json:"blockHash"`
	BlockNumber *big.Int `json:"blockNumber"`
	BlockTag    *string  `json:"blockTag"`
}

type GetBlockTransactionCountParams

type GetBlockTransactionCountParams struct {
	BlockHash   *string  `json:"blockHash"`
	BlockNumber *big.Int `json:"blockNumber"`
	BlockTag    *string  `json:"blockTag"`
}

type NewPublicClientParams

type NewPublicClientParams struct {
	RpcUrl string
}

type NewRpcClientParams

type NewRpcClientParams struct {
	RpcUrl string
	Chain  Chain
}

type NewWalletClientParams

type NewWalletClientParams struct {
	RpcUrl  string
	Chain   Chain
	Account *Account
}

type RawBlock

type RawBlock struct {
	Number           string           `json:"number"`
	Hash             string           `json:"hash"`
	ParentHash       string           `json:"parentHash"`
	Nonce            string           `json:"nonce"`
	Sha3Uncles       string           `json:"sha3Uncles"`
	LogsBloom        string           `json:"logsBloom"`
	TransactionsRoot string           `json:"transactionsRoot"`
	StateRoot        string           `json:"stateRoot"`
	Miner            string           `json:"miner"`
	Difficulty       string           `json:"difficulty"`
	TotalDifficulty  string           `json:"totalDifficulty"`
	ExtraData        string           `json:"extraData"`
	Size             string           `json:"size"`
	GasLimit         string           `json:"gasLimit"`
	GasUsed          string           `json:"gasUsed"`
	Timestamp        string           `json:"timestamp"`
	Transactions     []RawTransaction `json:"transactions"`
	Uncles           []string         `json:"uncles"`
}

type RawTransaction

type RawTransaction struct {
	Hash             string `json:"hash"`
	From             string `json:"from"`
	To               string `json:"to,omitempty"`
	Value            string `json:"value"`
	GasPrice         string `json:"gasPrice"`
	Gas              string `json:"gas"`
	Nonce            string `json:"nonce"`
	TransactionIndex string `json:"transactionIndex"`
}

type ReadContractParams

type ReadContractParams struct {
	Address      string
	Abi          string
	FunctionName string
	Args         []interface{}
}

type RpcError

type RpcError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type RpcRequest

type RpcRequest struct {
	Jsonrpc string      `json:"jsonrpc"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
	Id      int         `json:"id"`
}

type RpcResponse

type RpcResponse struct {
	Jsonrpc string          `json:"jsonrpc"`
	Result  json.RawMessage `json:"result"`
	Error   *RpcError       `json:"error"`
	Id      int             `json:"id"`
}

type SendTxOptions

type SendTxOptions struct {
	Simulate bool
}

type SimulateTxResult

type SimulateTxResult struct {
	Tx     *ethTypes.Transaction
	Result string
}

type Transaction

type Transaction struct {
	Hash             string   `json:"hash"`
	From             string   `json:"from"`
	To               string   `json:"to,omitempty"`
	Value            *big.Int `json:"value"`
	GasPrice         *big.Int `json:"gasPrice"`
	Gas              uint64   `json:"gas"`
	Nonce            string   `json:"nonce"`
	TransactionIndex uint64   `json:"transactionIndex"`
}

type TxData

type TxData struct {
	ChainId              *big.Int
	Nonce                uint64
	MaxFeePerGas         *big.Int
	MaxPriorityFeePerGas *big.Int
	Gas                  uint64
	To                   string
	Value                *big.Int
	Data                 []byte
}

type TxInteractionParams

type TxInteractionParams struct {
	TxData  *TxData
	Account *Account
}

Jump to

Keyboard shortcuts

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