Documentation
¶
Index ¶
- func NewHandler(service Service) http.Handler
- type Address
- type BlockData
- type Bytes
- type Bytes32
- type JSONRPCClient
- func (c *JSONRPCClient) AccTypedData(ctx context.Context, txn *protocol.Transaction, sig protocol.Signature) (*encoding.EIP712Call, error)
- func (c *JSONRPCClient) EthBlockNumber(ctx context.Context) (*Number, error)
- func (c *JSONRPCClient) EthChainId(ctx context.Context) (*Number, error)
- func (c *JSONRPCClient) EthGasPrice(ctx context.Context) (*Number, error)
- func (c *JSONRPCClient) EthGetBalance(ctx context.Context, addr Address, block string) (*Number, error)
- func (c *JSONRPCClient) EthGetBlockByNumber(ctx context.Context, block string, expand bool) (*BlockData, error)
- type JSONRPCHandler
- type Number
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
Types ¶
type BlockData ¶
type BlockData struct { Number Number Hash Bytes32 ParentHash Bytes32 Nonce []byte SHA3Uncles Bytes32 LogsBloom []byte TransactionsRoot Bytes32 StateRoot Bytes32 ReceiptsRoot Bytes32 Miner Address Difficulty Number TotalDifficulty Number ExtraData []byte Size Number GasLimit Number GasUsed Number GasTimestamp Number Transactions []json.RawMessage Uncles []Bytes32 }
func (*BlockData) MarshalJSON ¶
MarshalBinary marshals the BlockData to JSON.
func (*BlockData) UnmarshalJSON ¶
UnmarshalJSON unmarshals the BlockData from JSON.
type JSONRPCClient ¶
type JSONRPCClient struct { Client jsonrpc.HTTPClient Endpoint string }
func (*JSONRPCClient) AccTypedData ¶
func (c *JSONRPCClient) AccTypedData(ctx context.Context, txn *protocol.Transaction, sig protocol.Signature) (*encoding.EIP712Call, error)
func (*JSONRPCClient) EthBlockNumber ¶
func (c *JSONRPCClient) EthBlockNumber(ctx context.Context) (*Number, error)
func (*JSONRPCClient) EthChainId ¶
func (c *JSONRPCClient) EthChainId(ctx context.Context) (*Number, error)
func (*JSONRPCClient) EthGasPrice ¶
func (c *JSONRPCClient) EthGasPrice(ctx context.Context) (*Number, error)
func (*JSONRPCClient) EthGetBalance ¶
func (*JSONRPCClient) EthGetBlockByNumber ¶
type JSONRPCHandler ¶
type JSONRPCHandler struct {
Service Service
}
func (*JSONRPCHandler) ServeJSONRPC ¶
func (h *JSONRPCHandler) ServeJSONRPC(ctx context.Context, method string, params json.RawMessage) (result any, err error)
type Service ¶
type Service interface { EthChainId(ctx context.Context) (*Number, error) EthBlockNumber(ctx context.Context) (*Number, error) EthGasPrice(ctx context.Context) (*Number, error) EthGetBalance(ctx context.Context, addr Address, block string) (*Number, error) EthGetBlockByNumber(ctx context.Context, block string, expand bool) (*BlockData, error) AccTypedData(context.Context, *protocol.Transaction, protocol.Signature) (*encoding.EIP712Call, error) }
Click to show internal directories.
Click to hide internal directories.