delegation

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package delegation contains a light wrapper of the EventsReplayClient[Redelegation] generic which listens for redelegation events on chain and emits them through a ReplayObservable. This enables consumers to listen for on-chain application redelegation events and react to them asynchronously.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDelegationClient

func NewDelegationClient(
	ctx context.Context,
	deps depinject.Config,
	opts ...client.DelegationClientOption,
) (_ client.DelegationClient, err error)

NewDelegationClient creates a new delegation client from the given dependencies and cometWebsocketURL. It uses a pre-defined delegationEventQuery to subscribe to newly emitted redelegation events which are mapped to Redelegation objects.

This lightly wraps the EventsReplayClient[Redelegation] generic to correctly mock the interface.

Required dependencies:

  • client.EventsQueryClient

func WithConnRetryLimit

func WithConnRetryLimit(limit int) client.DelegationClientOption

WithConnRetryLimit returns an option function which sets the number of times the underlying replay client should retry in the event that it encounters an error or its connection is interrupted. If connRetryLimit is < 0, it will retry indefinitely.

Types

This section is empty.

Jump to

Keyboard shortcuts

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