coordinator library

LibSpiffy Coordinator API - The canonical public interface for third-party apps.

Import this library to interact with LibSpiffy through the unified coordinator:

import 'package:libspiffy/coordinator.dart';

// Send commands
libspiffy.coordinator.tell(CreateWalletCommand(walletId: 'my-wallet', name: 'My Wallet'));

// Subscribe to events
libspiffy.coordinatorEvents?.listen((event) {
  if (event is WalletCreatedEvent) { ... }
  if (event is PaymentReadyEvent) { ... }
});

This provides clean command/event names without collisions with internal domain types. For access to internal actors and domain types, use package:libspiffy/libspiffy.dart.

Classes

AcceptChannelCommand
Accept an incoming channel request
BalanceResponse
Balance query response
BalanceUpdatedEvent
Balance updated asynchronously (e.g., new UTXO received)
BEEFValidationResultEvent
BEEF validation result
BlockHeadersStoredEvent
Block headers stored
ChannelClosedEvent
Channel closed
ChannelOpenedEvent
Channel opened successfully
ChannelP2PAdapter
Transport-agnostic adapter that translates between P2P protocol messages (as raw maps) and LibSpiffy's PaymentChannelManagerActor messages.
ChannelP2PMessageToSendEvent
Outgoing P2P message that the app must transmit to the peer
ChannelP2PReceived
Incoming P2P message for a payment channel
ChannelPayCommand
Make a payment over an open channel
ChannelPaymentEvent
Payment made or received on a channel
ChannelRequestReceivedEvent
Incoming channel request from a peer (app should show UI for approval)
ClientChannelInfo
Tracks state for a channel we initiated (client role).
CloseChannelCommand
Close a payment channel
CoordinatorEvent
Base class for all coordinator events emitted on the event stream.
CreateInvoiceCommand
Create a payment invoice
CreateWalletCommand
Create a new wallet
ErrorEvent
Error from the coordinator
GetBalanceQuery
Query wallet balance
GetTransactionDetailQuery
Query specific transaction detail
GetTransactionsQuery
Query wallet transactions
HeaderSyncProgressEvent
CDN/P2P header sync progress
ImportCompleteEvent
Wallet import completed
ImportProgressEvent
Wallet import progress update
ImportTransactionCommand
Import a transaction into the wallet
ImportWalletCommand
Import a wallet from extended private key or WIF
InvoiceCreatedEvent
Invoice created successfully
InvoicePaidEvent
Invoice paid
OpenChannelCommand
Open a payment channel with a peer
PayInvoiceCommand
Pay an invoice (builds BEEF, does NOT broadcast)
PaymentReadyEvent
BEEF payment constructed and ready for transmission to counterparty
PeerInfo
Tracks which peers are involved in a channel.
PendingRequest
A pending incoming channel request awaiting accept/reject.
ReceiveTransactionCommand
Receive a transaction via BEEF (combined structural + SPV validation + wallet update)
RecordOutgoingCommand
Record an outgoing transaction in the wallet
RefreshWalletCommand
Refresh wallet data
RegisterWatchAddressCommand
Register an address to watch for activity
RejectChannelCommand
Reject an incoming channel request
ReleaseUTXOsCommand
Release reserved UTXOs
ServerChannelInfo
Tracks state for a channel we accepted (server role).
ShutdownCommand
Gracefully shutdown the coordinator
SplitUTXOsCommand
Split UTXOs using Benford's Law distribution for privacy
SPVValidationResultEvent
SPV validation result for a received transaction
StoreHeadersCommand
Store block headers for SPV validation
TimestampCommand
Create a timestamp archive (OP_RETURN data on-chain)
TimestampCompleteEvent
Timestamp archive completed
TransactionConfirmedEvent
Transaction confirmed on-chain
TransactionDetailResponse
Transaction detail query response
TransactionImportedEvent
Transaction imported into wallet
TransactionReceivedEvent
Transaction received (incoming or outgoing detected)
TransactionsResponse
Transactions query response
UTXOSplitCompleteEvent
Benford UTXO split completed
UTXOSplitStartedEvent
Benford UTXO split started
ValidateBEEFCommand
Validate incoming BEEF data (structural + SPV validation)
WalletCoordinatorActor
The canonical public interface for third-party apps using LibSpiffy.
WalletCreatedEvent
Wallet successfully created
WalletStatusEvent
Wallet status update
WatchAddressRegisteredEvent
Watch address registered