rpc

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PollTransaction

func PollTransaction(
	ctx context.Context,
	client TransactionGetter,
	txHash string,
	cfg PollConfig,
) (protocol.GetTransactionResponse, error)

PollTransaction polls for transaction completion with proper logging. It returns the full GetTransactionResponse on success and any error encountered.

Types

type PollConfig

type PollConfig struct {
	MaxAttempts  int
	PollInterval time.Duration
	Logger       *slog.Logger
}

PollConfig configures the polling behavior

func DefaultPollConfig

func DefaultPollConfig() PollConfig

DefaultPollConfig returns the default polling configuration

type TransactionGetter

type TransactionGetter interface {
	GetTransaction(ctx context.Context, req protocol.GetTransactionRequest) (protocol.GetTransactionResponse, error)
}

TransactionGetter is the interface for fetching transaction status

Jump to

Keyboard shortcuts

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