thorclient

package
v0.0.0-...-8de788b Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

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 New

func New(url string) *Client

New creates a new Client using the provided HTTP URL.

func (*Client) Block

func (c *Client) Block(revision string) (blocks *blocks.JSONCollapsedBlock, err error)

Block retrieves a block by its revision.

func (*Client) ChainTag

func (c *Client) ChainTag() (byte, error)

ChainTag retrieves the chain tag from the genesis block.

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) 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) 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) 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.

type Option

type Option func(*getOptions)

Option represents a functional option for customizing client requests.

func Pending

func Pending() Option

Pending returns an Option to specify that the client should fetch pending results.

func Revision

func Revision(revision string) Option

Revision returns an Option to specify the revision for requests.

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.

Jump to

Keyboard shortcuts

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