waittx

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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