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