Documentation
¶
Index ¶
- Variables
- func RunMetaMaskService(ctx context.Context, address string, service RPCService, ...) error
- type GetBlockByNumberResponse
- type GetTransactionReceiptResponse
- type RPCService
- func (s RPCService) Eth_BlockNumber() (string, error)
- func (s RPCService) Eth_Call(params ethCallParams) (string, error)
- func (s RPCService) Eth_ChainId() string
- func (s RPCService) Eth_EstimateGas(req estimateGasRequest) (string, error)
- func (s RPCService) Eth_GasPrice() string
- func (s RPCService) Eth_GetBalance(address, blockOrTag string) (string, error)
- func (s RPCService) Eth_GetBlockByNumber(blockOrTag string, filterTxObj bool) GetBlockByNumberResponse
- func (s RPCService) Eth_GetCode(address, blockOrTag string) (string, error)
- func (s RPCService) Eth_GetTransactionCount(address, blockOrTag string) string
- func (s RPCService) Eth_GetTransactionReceipt(ethTxID proto.EthereumHash) (GetTransactionReceiptResponse, error)
- func (s RPCService) Eth_SendRawTransaction(signedTxData string) (proto.EthereumHash, error)
- func (s RPCService) Invoke(ctx context.Context, method string, params json.RawMessage) zenrpc.Response
- func (s RPCService) Net_Version() string
- func (RPCService) SMD() smd.ServiceInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var RPC = struct { RPCService struct{ Eth_BlockNumber, Net_Version, Eth_ChainId, Eth_GetBalance, Eth_GetBlockByNumber, Eth_GasPrice, Eth_EstimateGas, Eth_Call, Eth_GetCode, Eth_GetTransactionCount, Eth_SendRawTransaction, Eth_GetTransactionReceipt string } }{ RPCService: struct{ Eth_BlockNumber, Net_Version, Eth_ChainId, Eth_GetBalance, Eth_GetBlockByNumber, Eth_GasPrice, Eth_EstimateGas, Eth_Call, Eth_GetCode, Eth_GetTransactionCount, Eth_SendRawTransaction, Eth_GetTransactionReceipt string }{ Eth_BlockNumber: "eth_blocknumber", Net_Version: "net_version", Eth_ChainId: "eth_chainid", Eth_GetBalance: "eth_getbalance", Eth_GetBlockByNumber: "eth_getblockbynumber", Eth_GasPrice: "eth_gasprice", Eth_EstimateGas: "eth_estimategas", Eth_Call: "eth_call", Eth_GetCode: "eth_getcode", Eth_GetTransactionCount: "eth_gettransactioncount", Eth_SendRawTransaction: "eth_sendrawtransaction", Eth_GetTransactionReceipt: "eth_gettransactionreceipt", }, }
Functions ¶
func RunMetaMaskService ¶
Types ¶
type GetBlockByNumberResponse ¶
type GetBlockByNumberResponse struct {
Number string `json:"number"`
}
type GetTransactionReceiptResponse ¶
type GetTransactionReceiptResponse struct {
TransactionHash proto.EthereumHash `json:"transactionHash"`
TransactionIndex string `json:"transactionIndex"`
BlockHash string `json:"blockHash"`
BlockNumber string `json:"blockNumber"`
From proto.EthereumAddress `json:"from"`
To *proto.EthereumAddress `json:"to"`
CumulativeGasUsed string `json:"cumulativeGasUsed"`
GasUsed string `json:"gasUsed"`
ContractAddress *proto.EthereumAddress `json:"contractAddress"`
Logs []string `json:"logs"`
LogsBloom proto.EthereumHash `json:"logsBloom"`
Status string `json:"status"`
}
type RPCService ¶
func NewRPCService ¶
func NewRPCService(nodeServices *services.Services) RPCService
func (RPCService) Eth_BlockNumber ¶
func (s RPCService) Eth_BlockNumber() (string, error)
Eth_BlockNumber returns the number of most recent block
func (RPCService) Eth_Call ¶
func (s RPCService) Eth_Call(params ethCallParams) (string, error)
func (RPCService) Eth_ChainId ¶
func (s RPCService) Eth_ChainId() string
Eth_ChainId returns the chain id
func (RPCService) Eth_EstimateGas ¶
func (s RPCService) Eth_EstimateGas(req estimateGasRequest) (string, error)
func (RPCService) Eth_GasPrice ¶
func (s RPCService) Eth_GasPrice() string
Eth_GasPrice returns the current price per gas in wei
func (RPCService) Eth_GetBalance ¶
func (s RPCService) Eth_GetBalance(address, blockOrTag string) (string, error)
Eth_GetBalance returns the balance of the account of given address
- address: 20 Bytes - address to check for balance
- block: QUANTITY|TAG - integer block number, or the string "latest", "earliest" or "pending" */
func (RPCService) Eth_GetBlockByNumber ¶
func (s RPCService) Eth_GetBlockByNumber(blockOrTag string, filterTxObj bool) GetBlockByNumberResponse
Eth_GetBlockByNumber returns information about a block by block number.
- block: QUANTITY|TAG - integer block number, or the string "latest", "earliest" or "pending"
- filterTxObj: if true it returns the full transaction objects, if false only the hashes of the transactions */
func (RPCService) Eth_GetCode ¶
func (s RPCService) Eth_GetCode(address, blockOrTag string) (string, error)
Eth_GetCode returns the compiled smart contract code, if any, at a given address.
- address: 20 Bytes - address to check for balance
- block: QUANTITY|TAG - integer block number, or the string "latest", "earliest" or "pending"
func (RPCService) Eth_GetTransactionCount ¶
func (s RPCService) Eth_GetTransactionCount(address, blockOrTag string) string
Eth_GetTransactionCount returns the number of transactions sent from an address.
- address: 20 Bytes - address to check for balance
- block: QUANTITY|TAG - integer block number, or the string "latest", "earliest" or "pending"
func (RPCService) Eth_GetTransactionReceipt ¶
func (s RPCService) Eth_GetTransactionReceipt(ethTxID proto.EthereumHash) (GetTransactionReceiptResponse, error)
func (RPCService) Eth_SendRawTransaction ¶
func (s RPCService) Eth_SendRawTransaction(signedTxData string) (proto.EthereumHash, error)
Eth_SendRawTransaction creates new message call transaction or a contract creation for signed transactions.
- signedTxData: The signed transaction data.
func (RPCService) Invoke ¶
func (s RPCService) Invoke(ctx context.Context, method string, params json.RawMessage) zenrpc.Response
Invoke is as generated code from zenrpc cmd
func (RPCService) Net_Version ¶
func (s RPCService) Net_Version() string
Net_Version returns the current network id
func (RPCService) SMD ¶
func (RPCService) SMD() smd.ServiceInfo
Click to show internal directories.
Click to hide internal directories.