Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/user-stories.md
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ As a developer, I want to shield DASH directly from my Core wallet so that I can

- Select Core Wallet source and enter a shielded address as destination.
- System creates an asset lock, waits for proof, and shields the credits.
- The amount entered is the amount shielded: the fee the network takes is paid on top, shown before sending, and reserved by Max. When the wallet cannot cover that fee, the form says so instead of offering an amount.
- The amount entered is the amount shielded: the fee the network takes is paid on top and shown before sending. When the wallet cannot cover that fee, the form says so instead of offering an amount.
- Max moves the whole available balance: the fees are taken from it, so the exact amount is known only once the transfer is built. Before the user confirms, the confirmation shows the spendable balance the transfer spends, the fees and the expected shielded amount, quoted over every Core account the transfer draws from. If that balance changes before the transfer starts, it is not started and the user is asked to confirm again. Editing the amount, switching wallet or network, or resetting the form returns to an exact-amount send.
- An interrupted Max transfer stays visible after a restart: the Shielded tab says it has not finished yet and offers "Finish now", which continues with the same funds and never moves them twice. A new Max transfer waits until the earlier one is settled.
- Progress banner shows multi-step operation status.
- Available only on Platform protocol v12 or later when Expert view or Developer view is selected.

Expand Down
38 changes: 38 additions & 0 deletions src/backend_task/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3384,6 +3384,44 @@ pub enum TaskError {
source: Box<platform_wallet::error::PlatformWalletError>,
},

/// A "Max" transfer from the Core wallet to the shielded balance is still
/// unsettled, so a new one was not started. Nothing was built or sent.
#[error(
"An earlier transfer of your whole wallet balance to your shielded balance has not finished yet. Open the Shielded tab of this wallet and choose Finish now."
)]
ShieldedMaxTransferAlreadyPending,

/// A "Max" transfer started but stopped before it finished. Its id is
/// kept, so finishing it continues with the same funds.
#[error(
"Your transfer to the shielded balance has started but has not finished yet. Your funds are safe. Open the Shielded tab of this wallet and choose Finish now."
)]
ShieldedMaxTransferUnfinished {
#[source]
source: Box<TaskError>,
},

/// The Core wallet's confirmed funds do not cover the fees of a "Max"
/// transfer to the shielded balance.
#[error(
"Your wallet does not have enough confirmed funds to cover the fees of this transfer. Wait for incoming payments to confirm, then try again."
)]
ShieldedMaxInsufficientFunds,

/// The Core wallet holds more separate payments than one transfer to the
/// shielded balance can spend.
#[error(
"Your wallet holds too many separate payments to move in one transfer. Enter a smaller amount instead of using Max."
)]
ShieldedMaxTooManyCoins,

/// The Core balance a "Max" transfer would spend differs from the one the
/// user confirmed, so the transfer was not started.
#[error(
"Your balance changed after you confirmed this transfer, so it was not started. Review the new amount and confirm the transfer again."
)]
ShieldedMaxBalanceChanged,

/// An earlier identity-funded shielded payment is still unresolved, so the
/// upstream coordinator refused to start this one. Nothing was built or
/// broadcast; retrying immediately hits the same refusal.
Expand Down
12 changes: 12 additions & 0 deletions src/backend_task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,18 @@ pub enum BackendTaskSuccessResult {
seed_hash: WalletSeedHash,
amount: u64,
},
/// What a "Max" transfer from the Core wallet would move, for the user to
/// confirm.
ShieldedMaxTransferQuote {
seed_hash: WalletSeedHash,
quote: crate::model::wallet::shielded_max_transfer::ShieldedMaxTransferQuote,
},
/// Where the wallet's "Max" transfer from the Core wallet stands; `None`
/// when the wallet has none.
ShieldedMaxTransferStatus {
seed_hash: WalletSeedHash,
state: Option<crate::model::wallet::shielded_max_transfer::ShieldedMaxTransferState>,
},

/// Core RPC client and SDK were successfully rebuilt (e.g. after password change).
CoreClientReinitialized,
Expand Down
Loading