Documentation
¶
Overview ¶
Package httpclient provides an HTTP client to interact with the VeChainThor blockchain. It offers various methods to retrieve accounts, transactions, blocks, events, and other blockchain data through HTTP requests.
Index ¶
- type Client
- func (c *Client) FilterEvents(req *events.EventFilter) ([]events.FilteredEvent, error)
- func (c *Client) FilterTransfers(req *transfers.TransferFilter) ([]*transfers.FilteredTransfer, error)
- func (c *Client) GetAccount(addr *thor.Address, revision string) (*accounts.Account, error)
- func (c *Client) GetAccountCode(addr *thor.Address, revision string) (*accounts.GetCodeResult, error)
- func (c *Client) GetAccountStorage(addr *thor.Address, key *thor.Bytes32, revision string) (*accounts.GetStorageResult, error)
- func (c *Client) GetBlock(blockID string) (*blocks.JSONCollapsedBlock, error)
- func (c *Client) GetExpandedBlock(revision string) (*blocks.JSONExpandedBlock, error)
- func (c *Client) GetPeers() ([]*node.PeerStats, error)
- func (c *Client) GetRawTransaction(txID *thor.Bytes32, head string, isPending bool) (*transactions.RawTransaction, error)
- func (c *Client) GetTransaction(txID *thor.Bytes32, head string, isPending bool) (*transactions.Transaction, error)
- func (c *Client) GetTransactionReceipt(txID *thor.Bytes32, head string) (*transactions.Receipt, error)
- func (c *Client) InspectClauses(calldata *accounts.BatchCallData, revision string) ([]*accounts.CallResult, error)
- func (c *Client) RawHTTPGet(url string) ([]byte, int, error)
- func (c *Client) RawHTTPPost(url string, calldata interface{}) ([]byte, int, error)
- func (c *Client) SendTransaction(obj *transactions.RawTx) (*transactions.SendTxResult, error)
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 HTTP client for interacting with the VeChainThor blockchain. It manages communication via HTTP requests.
func (*Client) FilterEvents ¶
func (c *Client) FilterEvents(req *events.EventFilter) ([]events.FilteredEvent, error)
FilterEvents filters events based on the provided event filter.
func (*Client) FilterTransfers ¶
func (c *Client) FilterTransfers(req *transfers.TransferFilter) ([]*transfers.FilteredTransfer, error)
FilterTransfers filters transfer based on the provided transfer filter.
func (*Client) GetAccount ¶
GetAccount retrieves the account details for the given address at the specified revision.
func (*Client) GetAccountCode ¶
func (c *Client) GetAccountCode(addr *thor.Address, revision string) (*accounts.GetCodeResult, error)
GetAccountCode retrieves the contract code for the given address at the specified revision.
func (*Client) GetAccountStorage ¶
func (c *Client) GetAccountStorage(addr *thor.Address, key *thor.Bytes32, revision string) (*accounts.GetStorageResult, error)
GetAccountStorage retrieves the storage value for the given address and key at the specified revision.
func (*Client) GetBlock ¶
func (c *Client) GetBlock(blockID string) (*blocks.JSONCollapsedBlock, error)
GetBlock retrieves a block by its block ID.
func (*Client) GetExpandedBlock ¶
func (c *Client) GetExpandedBlock(revision string) (*blocks.JSONExpandedBlock, error)
GetExpandedBlock retrieves an expanded block by its revision.
func (*Client) GetRawTransaction ¶
func (c *Client) GetRawTransaction(txID *thor.Bytes32, head string, isPending bool) (*transactions.RawTransaction, error)
GetRawTransaction retrieves the raw transaction data by the transaction ID, along with options for head and pending status.
func (*Client) GetTransaction ¶
func (c *Client) GetTransaction(txID *thor.Bytes32, head string, isPending bool) (*transactions.Transaction, error)
GetTransaction retrieves the transaction details by the transaction ID, along with options for head and pending status.
func (*Client) GetTransactionReceipt ¶
func (c *Client) GetTransactionReceipt(txID *thor.Bytes32, head string) (*transactions.Receipt, error)
GetTransactionReceipt retrieves the receipt for the given transaction ID at the specified head.
func (*Client) InspectClauses ¶
func (c *Client) InspectClauses(calldata *accounts.BatchCallData, revision string) ([]*accounts.CallResult, error)
InspectClauses performs a clause inspection on batch call data at the specified revision.
func (*Client) RawHTTPGet ¶
RawHTTPGet sends a raw HTTP GET request to the specified URL.
func (*Client) RawHTTPPost ¶
RawHTTPPost sends a raw HTTP POST request to the specified URL with the provided data.
func (*Client) SendTransaction ¶
func (c *Client) SendTransaction(obj *transactions.RawTx) (*transactions.SendTxResult, error)
SendTransaction sends a raw transaction to the blockchain.