Documentation ¶
Index ¶
- Constants
- Variables
- type AccessList
- type AccessTuple
- type Address
- type AddressContractBalanceResponse
- type BlockData
- type BlockResponse
- type CallMsg
- type DecError
- type Hash
- type JSONRPCRequest
- type JSONRPCResult
- type Log
- type MemPoolTXCount
- type MemPoolTXCountResult
- type MemPoolTransactionByStatusBlob
- type MemPoolTransactionByStatusData
- type MempoolCall
- type MempoolData
- type MempoolParams
- type ParamObject
- type Params
- type RecieptResult
- type Result
- type ResultData
- type TransactionConfirmation
- type TransactionData
- type TransactionRecieptResponse
- type TransactionResponse
- type Wallet
- type WalletBalanceResponse
- type WebSocketResponses
Constants ¶
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 ¶
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 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 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 MemPoolTXCount ¶
type MemPoolTXCount struct { JSONRPC string `json:"jsonrpc"` ID int `json:"id"` Result MemPoolTXCountResult `json:"result"` }
type MemPoolTXCountResult ¶
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 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 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.