fromStorage static method
Creates a wallet instance from storage data Delegates to subclass static fromStorage methods based on wallet type
Implementation
static Wallet fromStorage({
required String id,
required String name,
required WalletType type,
required Set<String> supportedUnits,
required Map<String, dynamic> metadata,
}) {
switch (type) {
case WalletType.CASHU:
return CashuWallet.fromStorage(
id: id,
name: name,
supportedUnits: supportedUnits,
metadata: metadata,
);
case WalletType.NWC:
return NwcWallet.fromStorage(
id: id,
name: name,
supportedUnits: supportedUnits,
metadata: metadata,
);
case WalletType.LNURL:
return LnurlWallet.fromStorage(
id: id,
name: name,
supportedUnits: supportedUnits,
metadata: metadata,
);
}
}