Documentation
¶
Index ¶
- type Block
- type Client
- func (c *Client) BlockNumber(ctx context.Context) (*big.Int, error)
- func (c *Client) ChainId(ctx context.Context) (string, error)
- func (c *Client) Close()
- func (c *Client) Connect(closeHandler func(error error)) error
- func (c *Client) HandleSubscription(subscriptionId string) chan *SubscriptionNotification
- func (c *Client) Invoke(ctx context.Context, method string, params any, resp *jsonrpc.Response) error
- func (c *Client) InvokeRequest(ctx context.Context, req jsonrpc.Request, resp *jsonrpc.Response) error
- func (c *Client) LatestBlock(ctx context.Context) (*Block, error)
- func (c *Client) NetVersion(ctx context.Context) (string, error)
- func (c *Client) NodeInfo(ctx context.Context) (*NodeInfo, error)
- func (c *Client) Subscribe(ctx context.Context, params []interface{}) (string, error)
- func (c *Client) SubscribeToNewHeads(context context.Context) (string, error)
- func (c *Client) SubscribeToSyncStatus(context context.Context) (string, error)
- func (c *Client) SyncProgress(ctx context.Context) (bool, error)
- func (c *Client) Unsubscribe(ctx context.Context, subscriptionId string) (bool, error)
- func (c *Client) Web3ClientVersion(ctx context.Context) (*ClientVersion, error)
- type ClientVersion
- type Head
- type NewHead
- type NodeInfo
- type SubscriptionNotification
- type SyncStatus
- type Syncing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
Author string `json:"author,omitempty"`
Miner string `json:"miner,omitempty"`
Difficulty string `json:"difficulty"`
TotalDifficulty string `json:"totalDifficulty"`
GasLimit string `json:"gasLimit"`
GasUsed string `json:"gasUsed"`
Hash string `json:"hash"`
MixHash string `json:"mixHash"`
LogsBloom string `json:"logsBloom"`
ExtraData string `json:"extraData"`
Nonce string `json:"nonce"`
Number string `json:"number"`
ParentHash string `json:"parentHash"`
ReceiptsRoot string `json:"receiptsRoot"`
SealFields string `json:"sealFields,omitempty"`
Sha3Uncles string `json:"sha3Uncles"`
Size string `json:"history,omitempty"`
StateRoot string `json:"stateRoot"`
Timestamp string `json:"timestamp"`
TransactionsRoot string `json:"transactionsRoot"`
BaseFeePerGas string `json:"baseFeePerGas,omitempty"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) HandleSubscription ¶
func (c *Client) HandleSubscription(subscriptionId string) chan *SubscriptionNotification
func (*Client) InvokeRequest ¶
func (*Client) SubscribeToNewHeads ¶
func (*Client) SubscribeToSyncStatus ¶
func (*Client) Unsubscribe ¶
func (*Client) Web3ClientVersion ¶
func (c *Client) Web3ClientVersion(ctx context.Context) (*ClientVersion, error)
type ClientVersion ¶
type ClientVersion struct {
Name string `json:"name"`
Version string `json:"version"`
OS string `json:"os"`
Language string `json:"language"`
}
func ParseClientVersion ¶
func ParseClientVersion(str string) (ClientVersion, error)
func (ClientVersion) String ¶
func (cv ClientVersion) String() string
type Head ¶
type NewHead ¶
type NewHead struct {
ParentHash string `json:"parentHash"`
Sha3Uncles string `json:"sha3Uncles"`
Miner string `json:"miner,omitempty"`
StateRoot string `json:"stateRoot"`
TransactionsRoot string `json:"transactionsRoot"`
ReceiptsRoot string `json:"receiptsRoot"`
LogsBloom string `json:"logsBloom"`
Difficulty string `json:"Difficulty"`
Number string `json:"number"`
GasLimit string `json:"gasLimit"`
GasUsed string `json:"gasUsed"`
Author string `json:"author,omitempty"`
Timestamp string `json:"timestamp"`
ExtraData string `json:"extraData"`
MixHash string `json:"mixHash"`
Nonce string `json:"nonce"`
BaseFeePerGas string `json:"baseFeePerGas,omitempty"`
Hash string `json:"hash"`
SealFields string `json:"sealFields,omitempty"`
Size string `json:"history,omitempty"`
TotalDifficulty string `json:"totalDifficulty,omitempty"`
Uncles string `json:"uncles,omitempty"`
Transactions string `json:"transactions,omitempty"`
}
type NodeInfo ¶
type NodeInfo struct {
Id string `json:"id"`
Name string `json:"name"`
Enode string `json:"enode"`
Ports json.RawMessage `json:"ports"`
Protocols json.RawMessage `json:"protocols"`
ListenAddress string `json:"listenAddr"`
}
func (*NodeInfo) ParseClientVersion ¶
func (n *NodeInfo) ParseClientVersion() (ClientVersion, error)
type SubscriptionNotification ¶
type SubscriptionNotification struct {
SubscriptionId string `json:"subscription"`
Result json.RawMessage `json:"result"`
}
func (*SubscriptionNotification) UnmarshalResult ¶
func (sn *SubscriptionNotification) UnmarshalResult(result interface{}) error
type SyncStatus ¶
type SyncStatus struct {
Syncing bool `json:"syncing"`
}
type Syncing ¶
type Syncing struct {
IsSyncing bool `json:"syncing"`
Status json.RawMessage
}
Click to show internal directories.
Click to hide internal directories.