Skip to content

feat: Add WalletService with createWallet Impl#61

Draft
Johnosezele wants to merge 1 commit intobitcoindevkit:mainfrom
Johnosezele:feat/wallet-creation
Draft

feat: Add WalletService with createWallet Impl#61
Johnosezele wants to merge 1 commit intobitcoindevkit:mainfrom
Johnosezele:feat/wallet-creation

Conversation

@Johnosezele
Copy link
Contributor

Description

This PR addresses issue #5.

Notes To Reviewers

Provider/state ownership is split intentionally:

  • activeWalletProvider owns the BDK wallet handle.
  • activeWalletRecordProvider owns selected persisted metadata.

This commit introduces the core provider state and network mapping required for wallet management, focusing on active wallet ownership and lifecycle handling.

Key changes:

Implement active wallet ownership and lifecycle handling in wallet_providers.dart.
Add a self-dispose guard in the provider when set() receives the same wallet instance.
Ensure safe disposal behavior on both clear() and provider disposal.
Introduce a service-layer network mapper in wallet_network_mapper.dart.
Testing:

Add unit tests for ActiveWalletNotifier and WalletNetworkMapper.
Include clear-path lifecycle coverage, verifying that clear() properly disposes of the wallet and resets the state to null.
Verified that flutter analyze and flutter test pass successfully.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant