feat(app): suggest fee rates from the server and enforce the relay fee

After connecting, the Send tab offers Fast/Normal/Economy rates from the
server's fee estimates (never below the relay fee, implausible values
ignored). A manual rate below the relay fee is refused before building and
a fee above 1% of the amount is flagged in the preview. See ADR 0039.
This commit is contained in:
davide committed 2026-11-03 14:33:32 +01:00
1 parent 92fd783658
commit c8ba2294f2
13 files changed
+507 -7

No files matched your search

+20
View File
@@ -504,6 +504,16 @@
MaxWidth="120" HorizontalAlignment="Left"
FontFamily="monospace"/>
</Grid>
<!-- Fee presets from the server estimate (shown once the server answered) -->
<StackPanel Spacing="4" IsVisible="{Binding HasFeeEstimates}">
<StackPanel Orientation="Horizontal" Spacing="8">
<Button Content="{Binding Loc[send.fee.fast]}" Command="{Binding UseFeePresetCommand}" CommandParameter="fast"/>
<Button Content="{Binding Loc[send.fee.normal]}" Command="{Binding UseFeePresetCommand}" CommandParameter="normal"/>
<Button Content="{Binding Loc[send.fee.economy]}" Command="{Binding UseFeePresetCommand}" CommandParameter="economy"/>
</StackPanel>
<TextBlock Text="{Binding FeeEstimateHint}" FontSize="11" TextWrapping="Wrap"
Foreground="{DynamicResource TextSecondaryBrush}"/>
</StackPanel>
</StackPanel>
</Border>
</Grid>
@@ -626,6 +636,16 @@
<TextBox Text="{Binding SendFeeRate}"
FontFamily="monospace" FontSize="15"
MinHeight="48" HorizontalAlignment="Stretch"/>
<!-- Fee presets from the server estimate (shown once the server answered) -->
<StackPanel Spacing="4" IsVisible="{Binding HasFeeEstimates}">
<StackPanel Orientation="Horizontal" Spacing="8">
<Button Content="{Binding Loc[send.fee.fast]}" Command="{Binding UseFeePresetCommand}" CommandParameter="fast"/>
<Button Content="{Binding Loc[send.fee.normal]}" Command="{Binding UseFeePresetCommand}" CommandParameter="normal"/>
<Button Content="{Binding Loc[send.fee.economy]}" Command="{Binding UseFeePresetCommand}" CommandParameter="economy"/>
</StackPanel>
<TextBlock Text="{Binding FeeEstimateHint}" FontSize="11" TextWrapping="Wrap"
Foreground="{DynamicResource TextSecondaryBrush}"/>
</StackPanel>
</StackPanel>
</StackPanel>
</Border>