metamask

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 21 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RPC = struct {
	RPCService struct{ Eth_BlockNumber, Net_Version, Eth_ChainId, Eth_GetBalance, Eth_GetBlockByNumber, Eth_GetBlockByHash, Eth_GasPrice, Eth_EstimateGas, Eth_Call, Eth_GetCode, Eth_GetTransactionCount, Eth_SendRawTransaction, Eth_GetTransactionReceipt, Eth_GetTransactionByHash string }
}{
	RPCService: struct{ Eth_BlockNumber, Net_Version, Eth_ChainId, Eth_GetBalance, Eth_GetBlockByNumber, Eth_GetBlockByHash, Eth_GasPrice, Eth_EstimateGas, Eth_Call, Eth_GetCode, Eth_GetTransactionCount, Eth_SendRawTransaction, Eth_GetTransactionReceipt, Eth_GetTransactionByHash string }{
		Eth_BlockNumber:           "eth_blocknumber",
		Net_Version:               "net_version",
		Eth_ChainId:               "eth_chainid",
		Eth_GetBalance:            "eth_getbalance",
		Eth_GetBlockByNumber:      "eth_getblockbynumber",
		Eth_GetBlockByHash:        "eth_getblockbyhash",
		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",
		Eth_GetTransactionByHash:  "eth_gettransactionbyhash",
	},
}

Functions

func APILogMiddleware

func APILogMiddleware(handler zenrpc.InvokeFunc) zenrpc.InvokeFunc

Types

type GetBlockByHashResponse

type GetBlockByHashResponse struct {
	BaseFeePerGas string `json:"baseFeePerGas"`
}

type GetBlockByNumberResponse

type GetBlockByNumberResponse struct {
	Number *string `json:"number"`
}

type GetTransactionByHashResponse

type GetTransactionByHashResponse struct {
	Hash             proto.EthereumHash      `json:"hash"`
	Nonce            string                  `json:"nonce"`
	BlockHash        string                  `json:"blockHash"`
	BlockNumber      string                  `json:"blockNumber"`
	TransactionIndex string                  `json:"transactionIndex"`
	From             proto.EthereumAddress   `json:"from"`
	To               *proto.EthereumAddress  `json:"to"`
	Value            string                  `json:"value"`
	GasPrice         string                  `json:"gasPrice"`
	Gas              string                  `json:"gas"`
	Input            string                  `json:"input"`
	V                string                  `json:"v"`
	StandardV        string                  `json:"standardV"`
	R                string                  `json:"r"`
	Raw              string                  `json:"raw"`
	PublicKey        proto.EthereumPublicKey `json:"publickey"`
}

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

type RPCService struct {
	zenrpc.Service
	// contains filtered or unexported fields
}

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, blockOrTag string) (string, error)

Eth_Call returns information about assets.

  • params: the tx call object
  • block: QUANTITY|TAG - integer block number, or the string "latest", "earliest" or "pending"

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(ethAddr proto.EthereumAddress, blockOrTag string) (string, error)

Eth_GetBalance returns the balance in wei of the account of given address. 1 ether is equivalent to 1 x 10^18 wei

  • address: 20 Bytes - address to check for balance
  • block: QUANTITY|TAG - integer block number, or the string "latest", "earliest" or "pending"

func (RPCService) Eth_GetBlockByHash

func (s RPCService) Eth_GetBlockByHash(blockIDBytes proto.HexBytes, filterTxObj bool) (*GetBlockByHashResponse, error)

Eth_GetBlockByHash returns block by provided blockID.

  • blockIDBytes: block id in hexadecimal notation.
  • filterTxObj: if true it returns the full transaction objects, if false only the hashes of the transactions.

func (RPCService) Eth_GetBlockByNumber

func (s RPCService) Eth_GetBlockByNumber(blockOrTag string, filterTxObj bool) (GetBlockByNumberResponse, error)

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(ethAddr proto.EthereumAddress, 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_GetTransactionByHash

func (s RPCService) Eth_GetTransactionByHash(ethTxID proto.EthereumHash) (*GetTransactionByHashResponse, error)

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

Jump to

Keyboard shortcuts

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