storeWallet abstract method

Future<void> storeWallet(
  1. String walletId,
  2. String name, {
  3. String? rootAddress,
  4. String? networkType,
  5. Map<String, dynamic>? metadata,
})

Store or update wallet metadata.

Creates the wallet when no metadata row exists (including after deleteWallet); otherwise merges into the existing row: a null rootAddress, networkType or metadata keeps what is stored, and a metadata map is merged key by key, so a caller may resupply only the keys it changed.

A store never removes a metadata key. Writing a key null blanks it and keeps it; the whole document goes only with deleteWallet.

networkType is canonicalised on the way in (WalletRowRules.canonicalNetwork), so the 'main' / 'test' / 'regtest' spelling the actor system, importer and P2P layer use is stored as the read model's own 'mainnet' / 'testnet' / 'regtest' and never sits in a row beside it. A wallet CREATED without a network gets WalletRowRules.defaultNetwork -- mainnet, which is what NetworkName, the wallet aggregate and the actor system resolve an unspecified network to (bead libspiffy-sxk5; mainnet since 6.0.0, testnet before). A testnet wallet passes its networkType.

Implementation

Future<void> storeWallet(
  String walletId,
  String name, {
  String? rootAddress,
  String? networkType,
  Map<String, dynamic>? metadata,
});