Hide the receive rotation notice for static Zcash address types (#3444)
Seth For Privacy committed
Aug 6, 2026 at 20:20 UTC
fb790120ed39455ffa915e66a0388107888e201f
4 files changed
+28
-1
lib/new-ui/pages/receive_page.dart
+12
@@ -97,6 +97,10 @@ class _NewReceivePageState extends State<NewReceivePage> {
97
) as WalletAddressListItem?;
98
99
reaction((_) => widget.receiveOptionViewModel.selectedReceiveOption, (option) {
100
+ // The infobox depends on the selected address type, so the page has to be
101
+ // rebuilt when it changes.
102
+ if (mounted) setState(() {});
103
+
104
if (widget.dashboardViewModel.type == WalletType.bitcoin &&
105
bitcoin!.isBitcoinReceivePageOption(option)) {
106
widget.addressListViewModel.setAddressType(bitcoin!.getOptionToType(option));
@@ -179,6 +183,7 @@ class _NewReceivePageState extends State<NewReceivePage> {
183
autoGenerateSubaddressStatus: widget.lightningMode
184
? AutoGenerateSubaddressStatus.disabled
185
: widget.dashboardViewModel.settingsStore.autoGenerateSubaddressStatus,
186
+ addressRotates: _selectedAddressRotates,
187
);
188
189
return Container(
@@ -366,6 +371,13 @@ class _NewReceivePageState extends State<NewReceivePage> {
371
);
372
}
373
374
+ /// Zcash is the only wallet type that also offers static address types, so
375
+ /// the rotation notice must not be shown for it unless the disposable
376
+ /// transparent type is the one currently selected.
377
+ bool get _selectedAddressRotates =>
378
+ widget.addressListViewModel.type != WalletType.zcash ||
379
+ zcash!.isRotatingAddressOption(widget.receiveOptionViewModel.selectedReceiveOption);
380
+
381
void _showLabelModal() {
382
showMaterialModalBottomSheet(
383
context: context,
lib/new-ui/widgets/receive_page/receive_info_box.dart
+7
-1
@@ -16,10 +16,15 @@ class ReceiveInfoBox extends StatelessWidget {
16
required this.onDismissed,
17
this.bottomWidget});
18
19
+ /// [addressRotates] tells whether the address type currently selected on the
20
+ /// receive page actually rotates. Most wallet types only ever expose rotating
21
+ /// address types, so it defaults to true; Zcash also offers static types, for
22
+ /// which the rotation notice would be wrong.
23
static ReceiveInfoBox? forWalletType(WalletType type,
24
{required VoidCallback onDismissed,
25
required AutoGenerateSubaddressStatus autoGenerateSubaddressStatus,
22
- List<CryptoCurrency>? supportedCurrencies}) {
26
+ List<CryptoCurrency>? supportedCurrencies,
27
+ bool addressRotates = true}) {
28
switch (type) {
29
case WalletType.nano:
30
return null;
@@ -43,6 +48,7 @@ class ReceiveInfoBox extends StatelessWidget {
48
));
49
default:
50
if (autoGenerateSubaddressStatus == AutoGenerateSubaddressStatus.disabled) return null;
51
+ if (!addressRotates) return null;
52
return ReceiveInfoBox(
53
iconPath: "assets/new-ui/info.svg",
54
message: S.current.infobox_auto_address,
lib/zcash/cw_zcash.dart
+8
@@ -176,6 +176,14 @@ class CWZcash extends Zcash {
176
return getSelectedAddressType(wallet) == ZcashReceivePageOption.transparentRotated;
177
}
178
179
+ /// The disposable transparent type is the only Zcash address type that
180
+ /// rotates. The public transparent address, both shielded types and the
181
+ /// unified address are all derived from the account and stay the same.
182
+ @override
183
+ bool isRotatingAddressOption(ReceivePageOption option) {
184
+ return option == ZcashReceivePageOption.transparentRotated;
185
+ }
186
+
187
@override
188
dynamic getZcashAddressType(ReceivePageOption option) {
189
return (option as ZcashReceivePageOption).toType();
tool/configure.dart
+1
@@ -1766,6 +1766,7 @@ abstract class Zcash {
1766
ReceivePageOption getSelectedAddressType(Object wallet);
1767
dynamic getZcashAddressType(ReceivePageOption option);
1768
bool hasSelectedTransparentAddress(Object wallet);
1769
+ bool isRotatingAddressOption(ReceivePageOption option);
1770
Future<void> setAddressType(Object wallet, dynamic option);
1771
dynamic getOptionToType(ReceivePageOption option);
1772
void unlockDatabase(String password);