Documentation
¶
Index ¶
- type Client
- func (c *Client) Account(addr *thor.Address, opts ...Option) (*accounts.Account, error)
- func (c *Client) AccountCode(addr *thor.Address, opts ...Option) (*accounts.GetCodeResult, error)
- func (c *Client) AccountStorage(addr *thor.Address, key *thor.Bytes32, opts ...Option) (*accounts.GetStorageResult, error)
- func (c *Client) Block(revision string) (blocks *blocks.JSONCollapsedBlock, err error)
- func (c *Client) ChainTag() (byte, error)
- func (c *Client) ExpandedBlock(revision string) (blocks *blocks.JSONExpandedBlock, err error)
- func (c *Client) FilterEvents(req *events.EventFilter) ([]events.FilteredEvent, error)
- func (c *Client) FilterTransfers(req *transfers.TransferFilter) ([]*transfers.FilteredTransfer, error)
- func (c *Client) InspectClauses(calldata *accounts.BatchCallData, opts ...Option) ([]*accounts.CallResult, error)
- func (c *Client) InspectTxClauses(tx *tx.Transaction, senderAddr *thor.Address, opts ...Option) ([]*accounts.CallResult, error)
- func (c *Client) Peers() ([]*node.PeerStats, error)
- func (c *Client) RawHTTPClient() *httpclient.Client
- func (c *Client) RawTransaction(id *thor.Bytes32, opts ...Option) (*transactions.RawTransaction, error)
- func (c *Client) RawWSClient() *wsclient.Client
- func (c *Client) SendRawTransaction(rlpTx []byte) (*transactions.SendTxResult, error)
- func (c *Client) SendTransaction(tx *tx.Transaction) (*transactions.SendTxResult, error)
- func (c *Client) SubscribeBeats2(pos string) (*common.Subscription[*subscriptions.Beat2Message], error)
- func (c *Client) SubscribeBlocks(pos string) (*common.Subscription[*subscriptions.BlockMessage], error)
- func (c *Client) SubscribeEvents(pos string, filter *subscriptions.EventFilter) (*common.Subscription[*subscriptions.EventMessage], error)
- func (c *Client) SubscribeTransfers(pos string, filter *subscriptions.TransferFilter) (*common.Subscription[*subscriptions.TransferMessage], error)
- func (c *Client) SubscribeTxPool(txID *thor.Bytes32) (*common.Subscription[*subscriptions.PendingTxIDMessage], error)
- func (c *Client) Transaction(id *thor.Bytes32, opts ...Option) (*transactions.Transaction, error)
- func (c *Client) TransactionReceipt(id *thor.Bytes32, opts ...Option) (*transactions.Receipt, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents the VeChainThor client, allowing communication over HTTP and WebSocket.
func NewWithHTTP ¶
NewWithHTTP creates a new Client using the provided HTTP URL and HTTP client.
func NewWithWS ¶
NewWithWS creates a new Client using the provided HTTP and WebSocket URLs. Returns an error if the WebSocket connection fails.
func (*Client) Account ¶
Account retrieves an account from the blockchain based on the provided address and options.
func (*Client) AccountCode ¶
AccountCode retrieves the account code for a given address.
func (*Client) AccountStorage ¶
func (c *Client) AccountStorage(addr *thor.Address, key *thor.Bytes32, opts ...Option) (*accounts.GetStorageResult, error)
AccountStorage retrieves the storage value for a given address and key.
func (*Client) Block ¶
func (c *Client) Block(revision string) (blocks *blocks.JSONCollapsedBlock, err error)
Block retrieves a block by its revision.
func (*Client) ExpandedBlock ¶
func (c *Client) ExpandedBlock(revision string) (blocks *blocks.JSONExpandedBlock, err error)
ExpandedBlock retrieves an expanded block by its revision.
func (*Client) FilterEvents ¶
func (c *Client) FilterEvents(req *events.EventFilter) ([]events.FilteredEvent, error)
FilterEvents filters events based on the provided filter request.
func (*Client) FilterTransfers ¶
func (c *Client) FilterTransfers(req *transfers.TransferFilter) ([]*transfers.FilteredTransfer, error)
FilterTransfers filters transfers based on the provided filter request.
func (*Client) InspectClauses ¶
func (c *Client) InspectClauses(calldata *accounts.BatchCallData, opts ...Option) ([]*accounts.CallResult, error)
InspectClauses inspects the clauses of a batch call data and returns the call results.
func (*Client) InspectTxClauses ¶
func (c *Client) InspectTxClauses(tx *tx.Transaction, senderAddr *thor.Address, opts ...Option) ([]*accounts.CallResult, error)
InspectTxClauses inspects the clauses of a transaction and returns the call results. It accepts both signed and unsigned transactions.
func (*Client) RawHTTPClient ¶
func (c *Client) RawHTTPClient() *httpclient.Client
RawHTTPClient returns the underlying HTTP client.
func (*Client) RawTransaction ¶
func (c *Client) RawTransaction(id *thor.Bytes32, opts ...Option) (*transactions.RawTransaction, error)
RawTransaction retrieves the raw transaction data by its ID.
func (*Client) RawWSClient ¶
RawWSClient returns the underlying WebSocket client.
func (*Client) SendRawTransaction ¶
func (c *Client) SendRawTransaction(rlpTx []byte) (*transactions.SendTxResult, error)
SendRawTransaction sends a raw RLP-encoded transaction to the blockchain.
func (*Client) SendTransaction ¶
func (c *Client) SendTransaction(tx *tx.Transaction) (*transactions.SendTxResult, error)
SendTransaction sends a signed transaction to the blockchain.
func (*Client) SubscribeBeats2 ¶
func (c *Client) SubscribeBeats2(pos string) (*common.Subscription[*subscriptions.Beat2Message], error)
SubscribeBeats2 subscribes to Beat2 message updates over WebSocket.
func (*Client) SubscribeBlocks ¶
func (c *Client) SubscribeBlocks(pos string) (*common.Subscription[*subscriptions.BlockMessage], error)
SubscribeBlocks subscribes to block updates over WebSocket.
func (*Client) SubscribeEvents ¶
func (c *Client) SubscribeEvents(pos string, filter *subscriptions.EventFilter) (*common.Subscription[*subscriptions.EventMessage], error)
SubscribeEvents subscribes to event updates over WebSocket.
func (*Client) SubscribeTransfers ¶
func (c *Client) SubscribeTransfers(pos string, filter *subscriptions.TransferFilter) (*common.Subscription[*subscriptions.TransferMessage], error)
SubscribeTransfers subscribes to transfer updates over WebSocket.
func (*Client) SubscribeTxPool ¶
func (c *Client) SubscribeTxPool(txID *thor.Bytes32) (*common.Subscription[*subscriptions.PendingTxIDMessage], error)
SubscribeTxPool subscribes to pending transaction updates over WebSocket.
func (*Client) Transaction ¶
func (c *Client) Transaction(id *thor.Bytes32, opts ...Option) (*transactions.Transaction, error)
Transaction retrieves a transaction by its ID.
func (*Client) TransactionReceipt ¶
func (c *Client) TransactionReceipt(id *thor.Bytes32, opts ...Option) (*transactions.Receipt, error)
TransactionReceipt retrieves the receipt for a transaction by its ID.
Directories
¶
Path | Synopsis |
---|---|
Package httpclient provides an HTTP client to interact with the VeChainThor blockchain.
|
Package httpclient provides an HTTP client to interact with the VeChainThor blockchain. |
Package wsclient provides a WebSocket client for subscribing to various VeChainThor blockchain events.
|
Package wsclient provides a WebSocket client for subscribing to various VeChainThor blockchain events. |