widgets/widgets library

Classes

AlbyGoConnectConfig
Configuration for launching the Alby Go NWC connection intent.
CashuMintReview
CashuMintSuggestion
Community-rated Cashu mint discovered from signed NIP-87 events.
LnBitsConnectionInput
NBanner
NCashuSeedBackupWarning
Standalone warning banner shown when at least one cashu wallet exists and the user has not yet confirmed they backed up the cashu recovery (seed) phrase. The seed is global (not per wallet), so place this once in the wallets screen rather than inside each wallet card.
NLnBitsIcon
NLocaleSwitcher
Widget that allows switching between available locales.
NLocaleSwitcherDropdown
Alternative dropdown version of the locale switcher
NLogin
NName
NPendingRequests
A widget that displays pending signer requests (for signer app, bunker, extension).
NPendingTransactions
Horizontal list of pending wallet transactions for a specific wallet when provided.
NPicture
NRecentTransactions
Vertical list of recent transactions for a specific wallet when provided.
NSwitchAccount
NUserProfile
NWalletActions
Card with Send/Receive actions and dialogs for a selected wallet.
NWalletCard
Individual wallet card widget used by the wallets UI.
NWalletCardList
Reorderable list of wallet cards backed by ndk.wallets.walletsStream.
NWallets
High-level wallets section widget that mirrors the sample app's wallets tab.
NWalletsState
NwcConnectionOption
Host-provided wallet app or web service that can authorize an NWC connection.
NwcWalletAuthCoordinator
WalletConnectionState
WalletIconConfig
Configuration for wallet type icons
WalletInputScannerConfiguration
Content and actions for a host-provided wallet scanner screen.
WalletInputScanResult
WalletScannerConnectionOption

Enums

AlbyGoConnectMethod
NPendingRequestsState
State of the pending requests widget
WalletConnectionPhase
WalletInputKind
Wallet input categories recognized by the unified add-wallet flow.
WalletInputOrigin
Result returned by a host-provided wallet scanner screen.
WalletScannerConnectionKind
Wallet connection choice displayed inside a host-provided scanner screen.

Constants

kDefaultAlbyGoConnectConfig → const AlbyGoConnectConfig
Default Alby Go parameters aligned with the sample app's NWC auth flow.

Functions

buildNwcCallbackUri({required AlbyGoConnectConfig config, String scheme = 'nostrnwc'}) Uri
Builds an NWC-07 callback URI handled by Primal, Alby Go, and other wallets registered for nostrnwc://connect.
buildNwcWalletAuthUri({required String appPubkey, required AlbyGoConnectConfig config, required String state, String scheme = 'nostr+walletauth', bool includeReturnTo = true}) Uri
Builds standard NWC wallet-auth URI handled by compatible wallet apps.
buildNwcWebWalletAuthUri({required Uri authorizationEndpoint, required String appName, required String pubkey, required String state, Map<String, String> additionalQueryParameters = const {}}) Uri
Builds client-key web-wallet authorization URL.
classifyWalletInput(String input) WalletInputKind?
Classifies locally recognizable wallet input without performing network I/O.
defaultNwcConnectionOptions({AlbyGoConnectConfig config = kDefaultAlbyGoConnectConfig}) List<NwcConnectionOption>
Default assisted web wallet connections, using the host app's identity and callback from config. Pass an explicit list to override or disable them.
generateNwcWalletAuthState() String
Generates NWC-08 correlation state with 128 bits of secure randomness.
matchesNwcWalletAuthInfoEvent(Nip01Event event, {required String appPubkey, required String state, String? walletServicePubkey, bool requireAppPubkeyTag = true}) bool
Validates discovery against client key and any returned correlation state. Missing state remains accepted for wallets implementing earlier drafts.
showAddBolt12WalletDialog(BuildContext context, NdkFlutter ndkFlutter, {bool returnToWalletType = false, AlbyGoConnectConfig albyGoConnectConfig = kDefaultAlbyGoConnectConfig, NwcWalletAuthCoordinator? nwcWalletAuthCoordinator, NwcUriScanner? nwcUriScanner, Bolt12InputScanner? bolt12InputScanner}) Future<Bolt12Wallet?>
Shows a dialog to add a receive-only BOLT12 offer wallet.
showAddCashuWalletDialog(BuildContext context, NdkFlutter ndkFlutter, {String defaultMintUrl = _defaultMintUrl, bool returnToWalletType = false, AlbyGoConnectConfig albyGoConnectConfig = kDefaultAlbyGoConnectConfig, NwcWalletAuthCoordinator? nwcWalletAuthCoordinator, NwcUriScanner? nwcUriScanner}) Future<CashuWallet?>
Shows a dialog to add a Cashu wallet.
showAddLnurlWalletDialog(BuildContext context, NdkFlutter ndkFlutter, {bool returnToWalletType = false, AlbyGoConnectConfig albyGoConnectConfig = kDefaultAlbyGoConnectConfig, NwcWalletAuthCoordinator? nwcWalletAuthCoordinator, NwcUriScanner? nwcUriScanner}) Future<Wallet?>
Shows a dialog to add an LNURL wallet.
showAddNwcWalletDialog(BuildContext context, NdkFlutter ndkFlutter, {int defaultBalance = 10000, NwcUriScanner? nwcUriScanner}) Future<NwcWallet?>
Shows a dialog to add an NWC wallet.
showAddWalletTypeDialog(BuildContext context, NdkFlutter ndkFlutter, {AlbyGoConnectConfig albyGoConnectConfig = kDefaultAlbyGoConnectConfig, NwcWalletAuthCoordinator? nwcWalletAuthCoordinator, WalletInputScanner? walletInputScanner, WalletQrScannerBuilder? walletQrScannerBuilder, List<NwcConnectionOption>? nwcConnectionOptions, NwcUriScanner? nwcUriScanner, Bolt12InputScanner? bolt12InputScanner}) Future<bool>
Shows the unified add-wallet flow.
showNwcConnectionOptionsDialog(BuildContext context, NdkFlutter ndkFlutter, {AlbyGoConnectConfig albyGoConnectConfig = kDefaultAlbyGoConnectConfig, NwcWalletAuthCoordinator? nwcWalletAuthCoordinator, NwcUriScanner? nwcUriScanner}) Future<bool>
Shows a dialog to choose NWC connection method.
showWalletInputDialog(BuildContext context, WalletInputScannerConfiguration configuration, {WalletQrScannerBuilder? qrScannerBuilder}) Future<WalletInputScanResult?>
Opens the shared scanner, manual input, wallet and Cashu mint chooser UI. Without qrScannerBuilder, all non-camera input methods remain available.
walletAuthConnectionRelay(Nip01Event event, {required String fallbackRelay}) String
Uses wallet-service relay recommendation when NWC-08 info provides one.

Typedefs

Bolt12InputScanner = Future<String?> Function(BuildContext context)
Opens a host-provided scanner and returns a BOLT12, BIP321, or BIP353 input.
NwcConnectionLauncher = Future<void> Function(BuildContext context, NdkFlutter ndkFlutter, NwcWalletAuthCoordinator coordinator)
Launches a wallet-assisted NWC connection flow.
NwcUriScanner = Future<String?> Function(BuildContext context)
Opens a host-provided NWC QR scanner and returns the scanned URI.
WalletInputScanner = Future<WalletInputScanResult?> Function(BuildContext context, WalletInputScannerConfiguration configuration)
Opens a host-provided scanner accepting every supported wallet input.
WalletQrScannerBuilder = Widget Function(BuildContext context, ValueChanged<String> onScan, ValueChanged<Object> onError)
Builds only the camera preview/decoder used by the wallet input dialogs.