| 1 | import 'package:cw_core/wallet_info.dart'; |
| 2 | |
| 3 | class WalletGroup { |
| 4 | WalletGroup(this.groupKey) : wallets = []; |
| 5 | |
| 6 | /// Primary identifier for the group. Previously was `parentAddress`. |
| 7 | /// Now we store either the wallet's hash OR fallback to parentAddress/address. |
| 8 | final String groupKey; |
| 9 | |
| 10 | /// Child wallets that share the same group key |
| 11 | final List<WalletInfo> wallets; |
| 12 | |
| 13 | /// Custom name for the group, editable for multi-child wallet groups |
| 14 | String? groupName; |
| 15 | |
| 16 | /// Allows editing of the group name (only for multi-child groups). |
| 17 | void setCustomName(String name) { |
| 18 | if (wallets.length > 1) { |
| 19 | groupName = name; |
| 20 | } |
| 21 | } |
| 22 | } |