Documentation ¶
Index ¶
- Variables
- type Endpoint
- func (ep *Endpoint) Call(tr Transaction) (*http.Response, error)
- func (ep *Endpoint) ClientVersion() (*http.Response, error)
- func (ep *Endpoint) GetBalance(address string) (*http.Response, error)
- func (ep *Endpoint) GetBlockReceipts(blockNumber string) (*http.Response, error)
- func (ep *Endpoint) GetCode(address string) (*http.Response, error)
- func (ep *Endpoint) GetCoinbase() (*http.Response, error)
- func (ep *Endpoint) GetGasPrice() (*http.Response, error)
- func (ep *Endpoint) GetStorageAt(contractAdress string, storageAddr int) (*http.Response, error)
- func (ep *Endpoint) GetTransactionByHash(transactionHash string) (*http.Response, error)
- func (ep *Endpoint) GetTransactionCount(address string) (*http.Response, error)
- func (ep *Endpoint) GetTransactionReceipt(transactionHash string) (*http.Response, error)
- func (ep *Endpoint) HttpRequest(Params []Parameters, rpcDetail RPCMethod) (*http.Response, error)
- func (ep *Endpoint) MostRecentBlock() (*http.Response, error)
- func (ep *Endpoint) SendRawTransaction(rawSignedTransaction string) (*http.Response, error)
- func (ep *Endpoint) SendTransaction(transaction Transaction) (*http.Response, error)
- func (ep *Endpoint) Sha3(data string) (*http.Response, error)
- func (ep *Endpoint) SignTransaction(transaction Transaction) (*http.Response, error)
- type Parameters
- type RPCMethod
- type RPCTransaction
- type Transaction
Constants ¶
This section is empty.
Variables ¶
View Source
var RPCendpoint = map[string]RPCMethod{ "ClientVersion": RPCMethod{"web3_clientVersion", "get"}, "Sha3": RPCMethod{"web3_sha3", "post"}, "NetworkId": RPCMethod{"net_id", "get"}, "MostRecentBlock": RPCMethod{"eth_blockNumber", "get"}, "GetBalance": RPCMethod{"eth_getBalance", "get"}, "GetStorageAt": RPCMethod{"eth_getStorageAt", "get"}, "GetTransactionCount": RPCMethod{"eth_getTransactionCount", "get"}, "GetCode": RPCMethod{"eth_getCode", "get"}, "GetBlockByHash": RPCMethod{"eth_getBlockByHash", "get"}, "Sign": RPCMethod{"eth_sign", "post"}, "SignTransaction": RPCMethod{"eth_signTransaction", "post"}, "SendTransaction": RPCMethod{"eth_sendTransaction", "post"}, "SendRawTransaction": RPCMethod{"eth_sendRawTransaction", "post"}, "GasPrice": RPCMethod{"eth_gasPrice", "get"}, "Coinbase": RPCMethod{"eth_coinbase", "get"}, "GetTransactionByHash": RPCMethod{"eth_getTransactionByHash", "get"}, "GetBlockReceipts": RPCMethod{"eth_getBlockReceipts", "get"}, "GetTransactionReceipt": RPCMethod{"eth_getTransactionReceipt", "post"}, "Call": RPCMethod{"eth_call", "post"}, "Account": RPCMethod{"eth_accounts", "get"}, "EstimateGas": RPCMethod{"eth_estimateGas", "get"}, "FeeHistory": RPCMethod{"eth_feeHistory", "get"}, "GetBlockByNumber": RPCMethod{"eth_getBlockByNumber", "get"}, "GetBlockTransactionCountByHash": RPCMethod{"eth_getBlockTransactionCountByhash", "get"}, "GetBlockTransactionCountByNumber": RPCMethod{"eth_getBlockTransactionCountByNumber", "get"}, "GetProof": RPCMethod{"eth_getProof", "get"}, }
https://ethereum.github.io/execution-apis/api-documentation/
Functions ¶
This section is empty.
Types ¶
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
represent the endpoint used as the entry point to the network. This can be a public endpoint as well as a personal node
func ConnectEndpoint ¶
NOTE does it really make sense to keep this Endpoint in this form? Initialize the endpoint.
func (*Endpoint) GetBalance ¶
func (*Endpoint) GetBlockReceipts ¶
func (*Endpoint) GetStorageAt ¶
func (*Endpoint) GetTransactionByHash ¶
func (*Endpoint) GetTransactionCount ¶
func (*Endpoint) GetTransactionReceipt ¶
func (*Endpoint) HttpRequest ¶
func (*Endpoint) SendRawTransaction ¶
func (*Endpoint) SendTransaction ¶
func (ep *Endpoint) SendTransaction(transaction Transaction) (*http.Response, error)
func (*Endpoint) SignTransaction ¶
func (ep *Endpoint) SignTransaction(transaction Transaction) (*http.Response, error)
TODO should do a build transaction function
type RPCTransaction ¶
type RPCTransaction struct { Jsonrpc string `json:"jsonrpc"` Method string `json:"method"` Params []Parameters `json:"params"` Id int `json:"id"` //not sure what this is used for, seems like it can be anything. }
The structure of the RPC call made to the endpoint
type Transaction ¶
type Transaction struct { From string `json:"from"` To string `json:"to"` Value string `json:"value"` Input string `json:"input"` }
Represent the transaction
func BuildTransaction ¶
func BuildTransaction(from string, to string, value string, input string) Transaction
Click to show internal directories.
Click to hide internal directories.