waittx

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.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 Backoff

type Backoff interface {
	Next(attempt int) time.Duration
}

Backoff controls polling cadence.

func NewBackoff added in v1.0.3

func NewBackoff(cfg clientconfig.WaitTxConfig) Backoff

NewBackoff constructs a poller backoff from the WaitTx configuration.

type Querier

type Querier interface {
	GetTx(ctx context.Context, req *txtypes.GetTxRequest) (*txtypes.GetTxResponse, error)
}

Querier fetches transactions over gRPC.

type Result

type Result struct {
	Code   uint32
	Events map[string][]string
}

Result represents the outcome produced by waiting on a tx.

type Source

type Source interface {
	Wait(ctx context.Context, txHash string) (Result, error)
}

Source abstracts a tx wait mechanism (poller, subscriber, etc).

type Waiter

type Waiter struct {
	// contains filtered or unexported fields
}

Waiter coordinates a subscriber (WS) and poller (gRPC) to observe a tx.

func New

func New(cfg clientconfig.WaitTxConfig, rpcEndpoint string, querier Querier) (*Waiter, error)

New creates a waiter based on the provided config and querier.

func (*Waiter) Wait

func (w *Waiter) Wait(ctx context.Context, txHash string, timeout time.Duration) (Result, error)

Wait blocks until the transaction reaches a final state or the context ends.

Jump to

Keyboard shortcuts

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