fftm

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: Apache-2.0 Imports: 30 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig added in v0.9.3

func InitConfig()

Types

type ManagedTransactionEventHandler added in v1.2.4

type ManagedTransactionEventHandler struct {
	Ctx                 context.Context
	ConfirmationManager confirmations.Manager
	WsServer            ws.WebSocketServer
	TxHandler           txhandler.TransactionHandler
}

func (*ManagedTransactionEventHandler) HandleEvent added in v1.2.4

type Manager added in v0.9.3

type Manager interface {
	Start() error
	Close()

	APIRouter() *mux.Router

	// API managed event streams have checkpoints stored externally.
	// Events are access by calling PollAPIMangedStream() on the returned stream.
	// - The spec must have a name, but no UUID or type.
	// - The name must be unique to managed API streams (separate namespace to persisted ones)
	// - Multiple calls with the same ID will return the same object.
	// - Use "isNew" to determine if the event stream was freshly initialized from the listener array
	// - If not freshly initialized, the listeners array ignored (you can choose to do check the existing listener list yourself)
	//
	// Checkpoints are commonly tied to individual listeners, so it is critical that the caller manages
	// deterministically the IDs of the listeners passed in. They cannot be empty (an error will be returned)
	GetAPIManagedEventStream(spec *apitypes.EventStream, listeners []*apitypes.Listener) (isNew bool, es eventapi.EventStream, err error)

	// Resources will be used by the stream in the background, so if your object is deleted
	// then this function should be called to clean-up any in-memory state (if there is any
	// possibility you previously called GetAPIManagedEventStream)
	CleanupAPIManagedEventStream(name string) error

	// Access directly to the transaction completions polling interface, which allows blocking-polling interactions with an
	// ordered stream of transaction completions
	TransactionCompletions() txhandler.TransactionCompletions

	// Ability to query a transaction by ID to get full status
	GetTransactionByIDWithStatus(ctx context.Context, txID string, withHistory bool) (transaction *apitypes.TXWithStatus, err error)

	// Ability to reconcile confirmations for a transaction
	// This function uses the single in-memory canonical chain to check and build the confirmation map of a given transaction hash
	ReconcileConfirmationsForTransaction(ctx context.Context, txHash string, existingConfirmations []*ffcapi.MinimalBlockInfo, targetConfirmationCount uint64) (*ffcapi.ConfirmationUpdateResult, error)

	// Ability to submit new transactions into the transaction handler for management/submission
	TransactionHandler() txhandler.TransactionHandler
}

func NewManager added in v0.9.3

func NewManager(ctx context.Context, connector ffcapi.API) (Manager, error)

Jump to

Keyboard shortcuts

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