rpcclient

package
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: MIT Imports: 9 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 {
	Client   sdk.FullNodeClient                                       // Underlying Tron full node client
	SignHash func(ctx context.Context, txHash []byte) ([]byte, error) // Function used to sign transactions
}

Client is a wrapper around the Tron RPC client that provides additional functionality such as signing, sending, and confirming transactions. It abstracts signing logic and retry-based confirmation flows.

func New

func New(client sdk.FullNodeClient, signHash func(ctx context.Context, txHash []byte) ([]byte, error)) *Client

New creates a new Client instance with the provided Tron RPC client and signing function. This prepares the client to sign and send transactions using the given signing function.

func (*Client) CheckContractDeployed

func (c *Client) CheckContractDeployed(address address.Address) error

CheckContractDeployed checks if a contract is deployed at the given address. This ensures the contract code exists at the address before interacting with it.

func (*Client) SendAndConfirmTx

func (c *Client) SendAndConfirmTx(
	ctx context.Context,
	tx *common.Transaction,
	opts *tron.ConfirmRetryOptions,
) (*soliditynode.TransactionInfo, error)

SendAndConfirmTx builds, signs, sends, and confirms a transaction. It applies any provided options for retries (delay and attempts) and returns the transaction info. This is the main entry point for broadcasting a transaction and ensuring it is mined successfully.

Jump to

Keyboard shortcuts

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