sendandconfirmtransaction

package
v1.11.8 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout = fmt.Errorf("timeout")

Functions

func SendAndConfirmTransaction

func SendAndConfirmTransaction(
	ctx context.Context,
	rpcClient *rpc.Client,
	wsClient *ws.Client,
	transaction *solana.Transaction,
) (signature solana.Signature, err error)

Send and wait for confirmation of a transaction.

func SendAndConfirmTransactionWithOpts

func SendAndConfirmTransactionWithOpts(
	ctx context.Context,
	rpcClient *rpc.Client,
	wsClient *ws.Client,
	transaction *solana.Transaction,
	opts rpc.TransactionOpts,
	timeout *time.Duration,
) (sig solana.Signature, err error)

Send and wait for confirmation of a transaction.

func SendAndConfirmTransactionWithTimeout

func SendAndConfirmTransactionWithTimeout(
	ctx context.Context,
	rpcClient *rpc.Client,
	wsClient *ws.Client,
	transaction *solana.Transaction,
	timeout time.Duration,
) (signature solana.Signature, err error)

func WaitForConfirmation

func WaitForConfirmation(
	ctx context.Context,
	wsClient *ws.Client,
	sig solana.Signature,
	timeout *time.Duration,
) (confirmed bool, err error)

WaitForConfirmation waits for a transaction to be confirmed. If the transaction was confirmed, but it failed while executing (one of the instructions failed), then this function will return an error (true, error). If the transaction was confirmed, and it succeeded, then this function will return nil (true, nil).

Types

This section is empty.

Jump to

Keyboard shortcuts

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