diff --git a/DashWallet/Sources/Infrastructure/SwiftDashSDK/SwiftDashSDKTransactionSender.swift b/DashWallet/Sources/Infrastructure/SwiftDashSDK/SwiftDashSDKTransactionSender.swift index d9a3367b77..e8e5535c19 100644 --- a/DashWallet/Sources/Infrastructure/SwiftDashSDK/SwiftDashSDKTransactionSender.swift +++ b/DashWallet/Sources/Infrastructure/SwiftDashSDK/SwiftDashSDKTransactionSender.swift @@ -43,7 +43,7 @@ final class SwiftDashSDKTransactionSender: NSObject { /// `MAX_STANDARD_TX_INPUTS`, which the builder hard-rejects if exceeded — so /// this cap is a proactive split, and a drifted value still fails safe (an /// error) rather than mis-signing. - private static let maxInputsPerSweep = 500 + static let maxInputsPerSweep = 500 /// Relay-minimum fee rate: 1 duff/byte == 1000 duffs per kB. private static let feeRateSatPerKb: UInt64 = 1000 /// `AccountBalance.typeTag` discriminant for CoinJoin (matches @@ -219,16 +219,37 @@ final class SwiftDashSDKTransactionSender: NSObject { /// ready to record in `CoinJoinWithdrawalStore` (matches /// `Transaction.txHashData`). let txids: [Data] - /// How many chunks did not broadcast. + /// How many chunks were not accepted, including the unknown ones. let failedChunkCount: Int - /// The first failed chunk's error; nil when every chunk broadcast. + /// The first failed chunk's error, preferring one that was not unknown + /// (it says why coins are left); nil when every chunk broadcast. let firstFailure: Error? - - /// Some chunks broadcast and some did not: coins remain in the CoinJoin - /// account, and a re-run sweeps the remainder. + /// Wire-order txids of the chunks whose broadcast ended + /// `transactionStatusUnknown`: they may have reached peers. + let unknownTxids: [Data] + + /// Some chunks broadcast and some did not. A rejected chunk's coins + /// remain in the CoinJoin account; an unknown chunk's were applied to + /// the wallet before the broadcast waited for peers (see + /// `WalletSendService.coinJoinSweepFailure`). var isPartial: Bool { !txids.isEmpty && failedChunkCount > 0 } } + /// Thrown by `sweepCoinJoin` when no chunk was accepted and at least one + /// ended `transactionStatusUnknown`; carries every such chunk's txid. + struct CoinJoinSweepUnknownError: LocalizedError { + /// Wire-order txids of the chunks whose outcome is unknown. + let unknownTxids: [Data] + /// The first unknown chunk's error. + let underlying: Error + /// Every chunk that was not accepted, unknown or not. + let failedChunkCount: Int + /// The first failed chunk's error that was not unknown, if any. + let otherFailure: Error? + + var errorDescription: String? { underlying.localizedDescription } + } + /// Sweep the entire CoinJoin-account balance to `address` (the user's own /// BIP44 receive address), fully emptying the CoinJoin account across one or /// more transactions. @@ -244,11 +265,24 @@ final class SwiftDashSDKTransactionSender: NSObject { /// longer supported, so we move the user's mixed coins into their normal /// spendable balance. /// - /// - Parameter address: Destination Dash address (the user's own BIP44 - /// receive address, resolved via `SwiftDashSDKReceiveAddressReader`). + /// - Parameters: + /// - address: Destination Dash address (the user's own BIP44 receive + /// address, resolved via `SwiftDashSDKReceiveAddressReader`, or a fresh + /// CoinJoin address for the Shielded consolidation). + /// - binding: When set, the sweep refuses to run unless this is still the + /// active wallet and network. + /// - outpoints: When set, only these UTXOs are spent (the ones still + /// unspent), and fewer than two of them are not swept: one input + /// would only pay a fee. The Shielded consolidation passes the final + /// ones it planned from: an unconfirmed input that never locks would + /// leave every coin swept with it behind a transaction that cannot + /// confirm. /// - Returns: A `CoinJoinSweepOutcome` carrying the broadcast chunks' txids /// and any chunk failure. Throws only when nothing broadcast at all. - static func sweepCoinJoin(to address: String) throws -> CoinJoinSweepOutcome { + static func sweepCoinJoin( + to address: String, expecting binding: CoinJoinWalletBinding? = nil, + outpoints: Set? = nil + ) throws -> CoinJoinSweepOutcome { logger.info("💸 TXSEND :: sweeping CoinJoin account → spendable balance") let sweep = { @MainActor () throws -> CoinJoinSweepOutcome in @@ -257,23 +291,13 @@ final class SwiftDashSDKTransactionSender: NSObject { let network = host.runningNetwork else { throw SendError.walletNotReady("PlatformWalletManager wallet is not available") } - let core = try wallet.coreWallet() - let walletId = wallet.walletId - - // CoinJoin account-0 balance descriptor (mirrors - // SwiftDashSDKCoinJoinBalanceReader: typeTag 1, index 0). Used only to - // address the account for UTXO enumeration. - guard let cjBalance = manager.accountBalances(for: walletId).first(where: { - $0.typeTag == Self.coinJoinTypeTag && $0.index == Self.coinJoinAccountIndex - }) else { - return CoinJoinSweepOutcome(txids: [], failedChunkCount: 0, firstFailure: nil) + if let binding, binding != CoinJoinWalletBinding.current() { + throw SendError.walletNotReady("the active wallet changed") } - - // Snapshot the account's spendable UTXOs (after the recovery scan has - // materialized deep `/0/` + `/1/` addresses). - let utxos = manager.accountUtxos(for: walletId, balance: cjBalance) + let core = try wallet.coreWallet() + let utxos = Self.sweepUtxos(manager: manager, walletId: wallet.walletId, restrictedTo: outpoints) guard !utxos.isEmpty else { - return CoinJoinSweepOutcome(txids: [], failedChunkCount: 0, firstFailure: nil) + return CoinJoinSweepOutcome(txids: [], failedChunkCount: 0, firstFailure: nil, unknownTxids: []) } // Drain each balanced ≤500-input chunk to `address`. `useOnlyAddedInputs` @@ -283,12 +307,19 @@ final class SwiftDashSDKTransactionSender: NSObject { // no change (the addOutput amount is ignored); `finalizeAtomic` resolves // dual-chain `/0/`+`/1/` signing. // Partial-failure tolerant: keep the txs that broadcast, log the rest, and - // throw only if nothing broadcast at all (a re-run sweeps the remainder). - // A mixed outcome is reported through `CoinJoinSweepOutcome`, not swallowed. + // throw only if none was accepted (`CoinJoinSweepUnknownError` when one + // may still land). A mixed outcome is reported through + // `CoinJoinSweepOutcome`, not swallowed. var txids: [Data] = [] var failedChunkCount = 0 - var firstError: Error? - for (index, chunk) in Self.balancedChunks(utxos).enumerated() { + var firstOther: Error? + // An unconfirmed broadcast may have reached peers: when nothing was + // accepted it is the error reported, ahead of a rejection, so a + // caller can tell it apart from "nothing moved". + var firstUnknown: Error? + var unknownTxids: [Data] = [] + for (index, chunk) in Self.balancedChunks(utxos, maxPerChunk: Self.maxInputsPerSweep).enumerated() { + var chunkTxid: Data? do { let builder = try CoreTransactionBuilder(network: network) try builder.addInputs( @@ -309,22 +340,35 @@ final class SwiftDashSDKTransactionSender: NSObject { accountIndex: Self.coinJoinAccountIndex) // Serialize BEFORE broadcast — broadcasting consumes the handle. let txData = try tx.serializedData() - let outcome = try core.broadcastTransactionWithOutcome(tx) - _ = try Self.requireAccepted(outcome) // Wire (internal) byte order to match `Transaction.txHashData` / // `CoinJoinWithdrawalStore`: `computeTxHash` yields display order, // so reverse it back to wire order. - txids.append(Data(Self.computeTxHash(from: txData).reversed())) + let txid = Data(Self.computeTxHash(from: txData).reversed()) + chunkTxid = txid + let outcome = try core.broadcastTransactionWithOutcome(tx) + _ = try Self.requireAccepted(outcome) + txids.append(txid) } catch { failedChunkCount += 1 - firstError = firstError ?? error + if case SendError.transactionStatusUnknown = error { + firstUnknown = firstUnknown ?? error + if let chunkTxid { unknownTxids.append(chunkTxid) } + } else { + firstOther = firstOther ?? error + } Self.logger.error( "💸 TXSEND :: coinjoin sweep chunk \(index + 1, privacy: .public) failed to broadcast, continuing: \(String(describing: error), privacy: .public)") } } - if txids.isEmpty, let error = firstError { throw error } + if txids.isEmpty, let firstUnknown { + throw CoinJoinSweepUnknownError( + unknownTxids: unknownTxids, underlying: firstUnknown, + failedChunkCount: failedChunkCount, otherFailure: firstOther) + } + if txids.isEmpty, let firstOther { throw firstOther } return CoinJoinSweepOutcome( - txids: txids, failedChunkCount: failedChunkCount, firstFailure: firstError) + txids: txids, failedChunkCount: failedChunkCount, firstFailure: firstOther ?? firstUnknown, + unknownTxids: unknownTxids) } let outcome: CoinJoinSweepOutcome @@ -346,6 +390,226 @@ final class SwiftDashSDKTransactionSender: NSObject { return outcome } + // MARK: - CoinJoin consolidation (CoinJoin → Shielded over the asset-lock input cap) + + /// The CoinJoin account-0 balance descriptor (typeTag 1, index 0 — mirrors + /// `SwiftDashSDKCoinJoinBalanceReader`) among a wallet's `accountBalances`, + /// which addresses the account for UTXO and address-pool enumeration. Nil + /// when the wallet has no CoinJoin account. + private static func coinJoinAccountBalance( + in balances: [PlatformWalletManager.AccountBalance] + ) -> PlatformWalletManager.AccountBalance? { + balances.first(where: { + $0.typeTag == Self.coinJoinTypeTag && $0.index == Self.coinJoinAccountIndex + }) + } + + /// The CoinJoin rows a sweep spends: the unlocked ones, only those in + /// `outpoints` when it is set. None when there is nothing worth sweeping: + /// no CoinJoin account, or fewer than two of the planned rows left. + @MainActor + private static func sweepUtxos( + manager: PlatformWalletManager, walletId: Data, restrictedTo outpoints: Set? + ) -> [PlatformWalletManager.AccountUtxo] { + // CoinJoin account-0 balance descriptor (mirrors + // SwiftDashSDKCoinJoinBalanceReader: typeTag 1, index 0). Used only to + // address the account for UTXO enumeration. + guard let cjBalance = coinJoinAccountBalance(in: manager.accountBalances(for: walletId)) else { return [] } + // Snapshot the account's spendable UTXOs (after the recovery scan has + // materialized deep `/0/` + `/1/` addresses). `isLocked` rows are + // left out, matching `coinJoinUtxoState(expecting:)`: coin + // selection never spends them. + let utxos = sweepInputs( + manager.accountUtxos(for: walletId, balance: cjBalance).filter { !$0.isLocked }, + restrictedTo: outpoints + ) { CoinJoinOutpoint(txid: $0.outpointTxid, vout: $0.outpointVout) } + if let outpoints, utxos.count < 2 { + logger.info( + "💸 TXSEND :: coinjoin sweep — \(utxos.count, privacy: .public) of \(outpoints.count, privacy: .public) planned UTXO(s) still spendable, not sweeping") + return [] + } + return utxos + } + + /// The CoinJoin account's descriptor and UTXO rows (locked ones included), + /// or nil when the read can't be told apart from a failed one (see + /// `CoinJoinShieldPlanner.utxoReadIsUsable`). An account that does not + /// exist reads as no descriptor and no rows. + @MainActor + private static func coinJoinUtxoRows( + manager: PlatformWalletManager, walletId: Data + ) -> (balance: PlatformWalletManager.AccountBalance?, utxos: [PlatformWalletManager.AccountUtxo])? { + let balances = manager.accountBalances(for: walletId) + let cjBalance = coinJoinAccountBalance(in: balances) + let utxos = cjBalance.map { manager.accountUtxos(for: walletId, balance: $0) } ?? [] + let balanceIsZero = cjBalance.map { + $0.confirmed == 0 && $0.unconfirmed == 0 && $0.immature == 0 && $0.locked == 0 + } + guard CoinJoinShieldPlanner.utxoReadIsUsable( + accountCount: balances.count, coinJoinBalanceIsZero: balanceIsZero, utxoCount: utxos.count) + else { return nil } + return (cjBalance, utxos) + } + + /// The wallet and network a CoinJoin → Shielded move was authorized for. + /// Each step of the move re-checks it, so a wallet or network switch while + /// it runs stops the move instead of carrying it over to another wallet. + struct CoinJoinWalletBinding: Equatable { + let walletId: Data + let network: Network + + /// The host's active wallet and network; nil when none is bound. + @MainActor + static func current() -> CoinJoinWalletBinding? { + let host = SwiftDashSDKHost.shared + guard let wallet = host.wallet, let network = host.runningNetwork else { return nil } + return CoinJoinWalletBinding(walletId: wallet.walletId, network: network) + } + } + + /// A CoinJoin UTXO's outpoint; the txid is in wire order. + struct CoinJoinOutpoint: Hashable { + let txid: Data + let vout: UInt32 + } + + /// The `rows` a sweep spends: those whose outpoint is in `outpoints`, or + /// all of them when it is nil. + static func sweepInputs( + _ rows: [Row], restrictedTo outpoints: Set?, outpoint: (Row) -> CoinJoinOutpoint + ) -> [Row] { + guard let outpoints else { return rows } + return rows.filter { outpoints.contains(outpoint($0)) } + } + + /// The CoinJoin account's spendable UTXO set, as `CoinJoinShieldPlanner` + /// reads it. + struct CoinJoinUtxoState { + struct Entry { + /// Wire-order txid (`AccountUtxo.outpointTxid`, the same order as + /// `CoinJoinSweepOutcome.txids`). + let txid: Data + let vout: UInt32 + let valueDuffs: UInt64 + /// Confirmed or InstantSend-locked — what the drain builder + /// accepts as an input (see `CoinJoinShieldPlanner.isFinal`). + let isFinal: Bool + + var outpoint: CoinJoinOutpoint { CoinJoinOutpoint(txid: txid, vout: vout) } + } + + let binding: CoinJoinWalletBinding + let entries: [Entry] + + var count: Int { entries.count } + var finalCount: Int { entries.reduce(0) { $0 + ($1.isFinal ? 1 : 0) } } + var totalDuffs: UInt64 { entries.reduce(0) { $0 + $1.valueDuffs } } + var txidFinality: [(txid: Data, isFinal: Bool)] { entries.map { ($0.txid, $0.isFinal) } } + var finalOutpoints: Set { + Set(entries.lazy.filter(\.isFinal).map(\.outpoint)) + } + } + + /// Snapshot of the CoinJoin account's spendable UTXOs with their finality. + /// Nil when it can't be read: the host has no wallet or manager bound, the + /// active wallet is not `binding`, or the SDK read looks failed (see + /// `coinJoinUtxoRows`). An account that does not exist reads as empty. + /// + /// `isLocked` rows are left out: coin selection never spends them, so + /// counting them would ask for a consolidation that has nothing to + /// consolidate. + @MainActor + static func coinJoinUtxoState(expecting binding: CoinJoinWalletBinding) -> CoinJoinUtxoState? { + let host = SwiftDashSDKHost.shared + guard let manager = host.manager, CoinJoinWalletBinding.current() == binding else { return nil } + let walletId = binding.walletId + guard let rows = coinJoinUtxoRows(manager: manager, walletId: walletId) else { return nil } + let instantLocked = Set(manager.instantSendLockTxids(for: walletId)) + let entries = rows.utxos + .filter { !$0.isLocked } + .map { utxo in + CoinJoinUtxoState.Entry( + txid: utxo.outpointTxid, + vout: utxo.outpointVout, + valueDuffs: utxo.valueDuffs, + isFinal: CoinJoinShieldPlanner.isFinal( + height: utxo.height, + txid: utxo.outpointTxid, + instantLockedTxids: instantLocked)) + } + return CoinJoinUtxoState(binding: binding, entries: entries) + } + + /// A fresh receive address of this wallet's own CoinJoin account — the + /// consolidation destination, so the mixed coins stay in the CoinJoin + /// account until the drain asset lock spends them. + /// + /// Picked from the account's external (`.../0/index`) address pool: the + /// lowest-index address the pool has not seen used and that holds no UTXO + /// right now. Pool addresses are exactly what the SPV client watches — + /// `monitored_script_pubkeys` walks every account's pool — so an output + /// paid here is detected and lands back in the CoinJoin account, and its + /// use moves the pool's gap forward like any other receive. + @MainActor + static func unusedCoinJoinAddress(for binding: CoinJoinWalletBinding) -> String? { + let host = SwiftDashSDKHost.shared + guard let manager = host.manager, CoinJoinWalletBinding.current() == binding else { return nil } + let walletId = binding.walletId + // A failed UTXO read would leave funded addresses looking unused. + guard let rows = coinJoinUtxoRows(manager: manager, walletId: walletId), + let cjBalance = rows.balance, + let network = try? PaymentNetworkResolver.current() + else { return nil } + // Pool type 0 = External (see `AccountAddressPoolSnapshot.pool_type`). + guard let external = manager.accountAddressPools(for: walletId, balance: cjBalance) + .first(where: { $0.poolType == 0 }) + else { return nil } + let fundedScripts = Set(rows.utxos.map(\.scriptPubkey)) + let candidates = external.addresses + .filter { !$0.isUsed && !$0.address.isEmpty } + .sorted { $0.addressIndex < $1.addressIndex } + for candidate in candidates { + guard let script = ScriptAddressCodec.scriptPubKey(forAddress: candidate.address, network: network), + !fundedScripts.contains(script) + else { continue } + let watched = external.addresses.count, gap = external.gapLimit + logger.info( + "💸 TXSEND :: coinjoin consolidation address index=\(candidate.addressIndex, privacy: .public) of \(watched, privacy: .public) watched (gap \(gap, privacy: .public))") + return candidate.address + } + return nil + } + + /// Poll `binding`'s CoinJoin UTXO state until `isDone` holds or `timeout` + /// elapses. Returns the last snapshot and whether `isDone` held for it; + /// nil when the active wallet is no longer `binding`, or when the last + /// poll before the deadline could not read the state (a read that looks + /// failed is retried, never taken as the answer, and an older snapshot is + /// never returned in its place). Sleeps off the main actor between polls. + /// + /// - Throws: `CancellationError` when the calling task is cancelled, even + /// if the last snapshot satisfied `isDone`. + static func waitForCoinJoinUtxoState( + binding: CoinJoinWalletBinding, + timeout: TimeInterval, + pollInterval: TimeInterval = 1, + until isDone: @escaping (CoinJoinUtxoState) -> Bool + ) async throws -> (state: CoinJoinUtxoState, satisfied: Bool)? { + let deadline = Date().addingTimeInterval(timeout) + while true { + try Task.checkCancellation() + let read = await MainActor.run { () -> (bound: Bool, state: CoinJoinUtxoState?) in + if let state = coinJoinUtxoState(expecting: binding) { return (true, state) } + return (CoinJoinWalletBinding.current() == binding, nil) + } + try Task.checkCancellation() + guard read.bound else { return nil } + if let state = read.state, isDone(state) { return (state, true) } + if Date() >= deadline { return read.state.map { ($0, false) } } + try await Task.sleep(nanoseconds: UInt64(pollInterval * 1_000_000_000)) + } + } + // MARK: - Selected-input send (CrowdNode signal txs) /// Build, sign, and broadcast a transaction funded ONLY from UTXOs sitting @@ -622,18 +886,17 @@ final class SwiftDashSDKTransactionSender: NSObject { // MARK: - Helpers - /// Partition `utxos` into balanced chunks each ≤ `maxInputsPerSweep`, - /// preserving order — app-side chunking (no upstream key-wallet counterpart): - /// `ceil(n / 500)` near-equal chunks, so no chunk is a lone sub-fee input. + /// Partition `utxos` into balanced chunks each ≤ `maxPerChunk` + /// (`maxInputsPerSweep` in production), preserving order — app-side + /// chunking (no upstream key-wallet counterpart): `ceil(n / 500)` + /// near-equal chunks, so no chunk is a lone sub-fee input. /// Examples: 500 → [500]; 501 → [251, 250]; 1000 → [500, 500]. - private static func balancedChunks( - _ utxos: [PlatformWalletManager.AccountUtxo] - ) -> [[PlatformWalletManager.AccountUtxo]] { + static func balancedChunks(_ utxos: [T], maxPerChunk: Int) -> [[T]] { let n = utxos.count - guard n > 0 else { return [] } - let numChunks = (n + maxInputsPerSweep - 1) / maxInputsPerSweep // ceil(n / 500) - let chunkSize = (n + numChunks - 1) / numChunks // ceil(n / numChunks) - var chunks: [[PlatformWalletManager.AccountUtxo]] = [] + guard n > 0, maxPerChunk > 0 else { return [] } + let numChunks = (n + maxPerChunk - 1) / maxPerChunk // ceil(n / max) + let chunkSize = (n + numChunks - 1) / numChunks // ceil(n / numChunks) + var chunks: [[T]] = [] var start = 0 while start < n { let end = min(start + chunkSize, n) diff --git a/DashWallet/Sources/Models/Transactions/WalletSendService.swift b/DashWallet/Sources/Models/Transactions/WalletSendService.swift index 4bd290a219..751650d6a3 100644 --- a/DashWallet/Sources/Models/Transactions/WalletSendService.swift +++ b/DashWallet/Sources/Models/Transactions/WalletSendService.swift @@ -419,14 +419,31 @@ final class WalletSendService: NSObject { /// A heavy mixer's account is swept across several independent chunk /// transactions, so the sweep can end up partly done. In that case the /// accepted chunks are recorded and the balance re-tallied exactly as on a - /// full sweep, and only then does this throw `.coinJoinSweepPartial` — the - /// caller must not show "moved" over coins that are still in the account. + /// full sweep, and only then does this throw the error + /// `coinJoinSweepFailure` picks (`.coinJoinSweepPartial` or + /// `.broadcastUnknown`) — the caller must not show "moved" over coins that + /// are still in the account or not yet confirmed. /// /// - Returns: the CoinJoin balance (duffs) that was swept, for the success /// message; the on-chain amount delivered is this minus the network fee. + /// - Parameter binding: the wallet and network to sweep; the sweep refuses + /// to run unless it is still the active one. Nil pins the wallet active + /// on entry. @discardableResult - func sweepCoinJoin() async throws -> UInt64 { - let amount = await MainActor.run { SwiftDashSDKWalletState.shared.coinJoinBalanceDuffs } + func sweepCoinJoin( + expecting binding: SwiftDashSDKTransactionSender.CoinJoinWalletBinding? = nil + ) async throws -> UInt64 { + // The pin and the amount are read in one hop. The amount is the + // published CoinJoin balance, which can lag a wallet switch; the + // sweep itself spends only the pinned wallet's UTXOs. + let (pinned, amount) = try await MainActor.run { + () throws -> (SwiftDashSDKTransactionSender.CoinJoinWalletBinding, UInt64) in + guard let current = SwiftDashSDKTransactionSender.CoinJoinWalletBinding.current(), + binding == nil || binding == current else { + throw SwiftDashSDKTransactionSender.SendError.walletNotReady("the active wallet changed") + } + return (current, SwiftDashSDKWalletState.shared.coinJoinBalanceDuffs) + } guard amount > 0 else { throw Self.makeError( code: .coinJoinSweepUnavailable, @@ -437,15 +454,35 @@ final class WalletSendService: NSObject { Self.logger.info("💸 TXSEND :: preparing CoinJoin sweep — balance \(amount, privacy: .public) duffs (\(Double(amount) / 1e8, privacy: .public) DASH)") try await sendAuthorizer.authorizeSend(spendAmount: amount) - guard let destination = SwiftDashSDKReceiveAddressReader.receiveAddress() else { + guard let resolved = SwiftDashSDKReceiveAddressReader.receiveDestination() else { throw Self.makeError( code: .coinJoinSweepUnavailable, description: "Could not resolve a destination address for the CoinJoin sweep" ) } + // The address must be the pinned wallet's own; the sweep itself + // re-checks that wallet is still the active one. + if resolved.walletId != pinned.walletId { + throw SwiftDashSDKTransactionSender.SendError.walletNotReady("the active wallet changed") + } + let destination = resolved.address Self.logger.info("💸 TXSEND :: CoinJoin sweep destination resolved \(destination, privacy: .public)") - let outcome = try SwiftDashSDKTransactionSender.sweepCoinJoin(to: destination) + let outcome: SwiftDashSDKTransactionSender.CoinJoinSweepOutcome + do { + outcome = try SwiftDashSDKTransactionSender.sweepCoinJoin(to: destination, expecting: pinned) + } catch let error as SwiftDashSDKTransactionSender.CoinJoinSweepUnknownError { + // These may still land: tag them like accepted ones. + Self.recordSweepTxids(error.unknownTxids) + // The wallet applied them locally; re-tally so the balance shows it. + await MainActor.run { SwiftDashSDKWalletState.shared.refreshCoinJoinBalance() } + let counts = "\(error.failedChunkCount) failed (\(error.unknownTxids.count) unknown)" + Self.logger.error("💸 TXSEND :: CoinJoin sweep incomplete — nothing accepted, \(counts, privacy: .public)") + throw Self.coinJoinSweepFailure( + acceptedCount: 0, failedChunkCount: error.failedChunkCount, + unknownChunkCount: error.unknownTxids.count, + reason: Self.sweepChunkFailureReason(error.otherFailure ?? error.underlying)) ?? error + } let txids = outcome.txids guard !txids.isEmpty else { // A reported-success sweep that produced no transaction is treated @@ -461,14 +498,9 @@ final class WalletSendService: NSObject { // single "CoinJoin Withdrawals" cell. A large UTXO set is swept across // multiple transactions (chunks); the sender returns wire-order txids // (matching PersistentTransaction.txid / Transaction.txHashData), so - // record each directly. - for txid in txids { - CoinJoinWithdrawalStore.shared.record(txid: txid) - } - let recordedHexes: [String] = txids.map { (txid: Data) in - txid.reversed().map { String(format: "%02x", $0) }.joined() - } - Self.logger.info("💸 TXSEND :: recorded \(txids.count, privacy: .public) sweep txid(s) in CoinJoinWithdrawalStore: \(recordedHexes.joined(separator: ","), privacy: .public)") + // record each directly — the unknown-outcome chunks too, which may + // still land. + Self.recordSweepTxids(txids + outcome.unknownTxids) await MainActor.run { SwiftDashSDKWalletState.shared.refreshCoinJoinBalance() @@ -484,16 +516,16 @@ final class WalletSendService: NSObject { // Everything above ran for the accepted chunks — the txids are in the // withdrawal store and the balance is re-tallied — so it is safe to fail - // here. Reported as a failure because the coins the failed chunks hold - // are still in the CoinJoin account: a re-run sweeps the remainder, and - // a success screen would tell the user there is nothing left to move. - if outcome.isPartial { - Self.logger.error( - "💸 TXSEND :: CoinJoin sweep partial — \(txids.count, privacy: .public) chunk(s) broadcast, \(outcome.failedChunkCount, privacy: .public) failed: \(String(describing: outcome.firstFailure), privacy: .public)") - throw Self.makeError( - code: .coinJoinSweepPartial, - description: "CoinJoin sweep moved \(txids.count) of \(txids.count + outcome.failedChunkCount) transactions" - ) + // here. Reported as a failure because a success screen would say every + // coin moved: a rejected chunk's coins are still in the account, and an + // unknown chunk's are not confirmed yet. + if let failure = Self.coinJoinSweepFailure( + acceptedCount: txids.count, failedChunkCount: outcome.failedChunkCount, + unknownChunkCount: outcome.unknownTxids.count, + reason: outcome.firstFailure.map(Self.sweepChunkFailureReason)) { + let diagnostic = failure.userInfo[Self.diagnosticKey] as? String ?? "-" + Self.logger.error("💸 TXSEND :: CoinJoin sweep incomplete (code \(failure.code, privacy: .public)) — \(diagnostic, privacy: .public)") + throw failure } return amount } @@ -623,16 +655,111 @@ final class WalletSendService: NSObject { } } + /// Tag sweep txids (wire order) so the home screen groups them into the + /// single "CoinJoin Withdrawals" cell — the unknown-outcome chunks too, + /// which may still land. + private static func recordSweepTxids(_ txids: [Data]) { + for txid in txids { + CoinJoinWithdrawalStore.shared.record(txid: txid) + } + let hexes = txids.map { Data($0.reversed()).map { String(format: "%02x", $0) }.joined() } + logger.info("💸 TXSEND :: recorded \(txids.count, privacy: .public) sweep txid(s) in CoinJoinWithdrawalStore: \(hexes.joined(separator: ","), privacy: .public)") + } + + /// An error's type and code for the exported log. Not its description: + /// send and builder errors quote txids, outpoints and addresses, which + /// lead to the wallet's own addresses (the sender's os.Logger keeps the + /// detail, outside the export). + static func logSummary(of error: Error) -> String { + let nsError = error as NSError + return "\(type(of: error)) \(nsError.domain) #\(nsError.code)" + } + + /// A failed sweep for the exported log: `logSummary(of:)` plus what it + /// says without a txid — the diagnostic `coinJoinSweepFailure` attached, + /// a send error's reason, or this service's own description. + static func coinJoinSweepLogLine(for error: Error) -> String { + let nsError = error as NSError + let detail: String? + if let diagnostic = nsError.userInfo[diagnosticKey] as? String { + detail = diagnostic + } else if error is SwiftDashSDKTransactionSender.SendError { + detail = sweepChunkFailureReason(error) + } else if nsError.domain == errorDomain { + detail = nsError.localizedDescription + } else { + detail = nil + } + return logSummary(of: error) + (detail.map { " (\($0))" } ?? "") + } + + /// A chunk's broadcast error for the diagnostic: the SDK's reason for a + /// rejected or unknown outcome, without the txid it also carries, or for + /// a wallet that is not ready; anything else (a builder error may quote + /// an outpoint) as `logSummary(of:)`. + static func sweepChunkFailureReason(_ error: Error) -> String { + switch error { + case SwiftDashSDKTransactionSender.SendError.transactionStatusUnknown(_, let reason): + return "unknown: \(reason)" + case SwiftDashSDKTransactionSender.SendError.transactionRejected(_, let reason): + return "rejected: \(reason)" + case SwiftDashSDKTransactionSender.SendError.walletNotReady(let reason): + return "wallet not ready: \(reason)" + default: + return logSummary(of: error) + } + } + + /// The error a sweep with failed chunks surfaces; nil when none failed, + /// or when none was accepted or unknown (the sender throws that case's + /// chunk error itself and never gets here). + /// + /// - Every failed chunk ended unknown: `.broadcastUnknown`, not offered + /// again. The wallet applies a transaction before it waits for peers, so + /// those coins already read as spent and a re-run has nothing to sweep. + /// - Otherwise, when a chunk was accepted or may still land: partial. The + /// other failed chunks' coins are still in the CoinJoin account, and a + /// re-run sweeps only them. An unknown chunk counts as moved here, as + /// the re-tallied balance and the withdrawal history already show it. + /// + /// The diagnostic carries the chunk counts and `reason` (one failed + /// chunk's error). + static func coinJoinSweepFailure( + acceptedCount: Int, failedChunkCount: Int, unknownChunkCount: Int, reason: String? = nil + ) -> NSError? { + guard failedChunkCount > 0 else { return nil } + let diagnostic = "CoinJoin sweep: \(acceptedCount) accepted, \(unknownChunkCount) unknown, " + + "\(failedChunkCount - unknownChunkCount) failed otherwise" + (reason.map { "; \($0)" } ?? "") + if unknownChunkCount == failedChunkCount { + return makeError( + code: .broadcastUnknown, + description: BroadcastOutcomeCopy.coinJoinSweepUnknown, + diagnostic: diagnostic) + } + guard acceptedCount > 0 || unknownChunkCount > 0 else { return nil } + return makeError(code: .coinJoinSweepPartial, description: "CoinJoin sweep incomplete", diagnostic: diagnostic) + } + + /// Whether a failed CoinJoin sweep may be offered again right away: not + /// when its transactions may all still land. + static func isCoinJoinSweepRetryable(_ error: Error) -> Bool { + !isBroadcastUnknownError(error as NSError) + } + /// User-facing message for a CoinJoin sweep failure, or nil if the user /// simply cancelled authentication (callers stay silent). Centralizes the /// cancel predicate + copy so every sweep entry point behaves identically. /// /// A partial sweep gets its own copy: "try again" is still the right /// action, but telling the user nothing moved would contradict the - /// transactions already in their history. + /// transactions already in their history. An unknown outcome keeps its + /// own "don't send it again" copy. static func coinJoinSweepUserMessage(for error: Error) -> String? { let nsError = error as NSError guard !isAuthenticationCancelledError(nsError) else { return nil } + if isBroadcastUnknownError(nsError) { + return nsError.localizedDescription + } if nsError.domain == errorDomain, nsError.code == ErrorCode.coinJoinSweepPartial.rawValue { return NSLocalizedString( "Some of your CoinJoin funds were moved. Please try again to move the rest.", @@ -872,6 +999,14 @@ private extension WalletSendService { "We couldn't confirm the transaction reached the network. Don't send it again — the wallet keeps trying while it's open, and your balance will update as soon as it goes through.", comment: "Send dispatched but no network acceptance signal arrived") } + + /// `unknown` for a CoinJoin sweep, whose chunks were not all + /// confirmed. Same "while it's open" qualifier, for the same reason. + static var coinJoinSweepUnknown: String { + NSLocalizedString( + "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through.", + comment: "CoinJoin sweep dispatched but no network acceptance signal arrived for some of it") + } } static func makeError( diff --git a/DashWallet/Sources/UI/Home/Views/CoinJoinMoveFunds/CoinJoinMoveDestinationPolicy.swift b/DashWallet/Sources/UI/Home/Views/CoinJoinMoveFunds/CoinJoinMoveDestinationPolicy.swift index e767d5cdb5..7591ba9dbe 100644 --- a/DashWallet/Sources/UI/Home/Views/CoinJoinMoveFunds/CoinJoinMoveDestinationPolicy.swift +++ b/DashWallet/Sources/UI/Home/Views/CoinJoinMoveFunds/CoinJoinMoveDestinationPolicy.swift @@ -101,3 +101,133 @@ enum CoinJoinMoveDestinationPolicy { return shieldedAvailable ? .destinationChoice : .transparentConfirmation } } + +// MARK: - CoinJoin → Shielded input planning + +/// Decides how a "move mixed coins to Shielded" attempt gets from the CoinJoin +/// account's current UTXO set to a single CoinJoin-drain asset lock. +/// +/// The drain spends every final CoinJoin UTXO as an input of ONE asset lock, +/// and an asset lock may carry at most `maxAssetLockInputs` inputs: Dash Core +/// v24 refuses more as non-standard (`assetlocktx-too-many-inputs`, +/// `MAX_STANDARD_ASSET_LOCK_INPUTS`) and peers drop it silently, and Platform +/// consensus applies the same cap (`max_asset_lock_transaction_inputs`). +/// That is the hard limit, but not the binding one: the drain is shielded by +/// a ShieldFromAssetLock transition whose InstantSend proof embeds the whole +/// asset-lock transaction, and Platform caps a transition at 20 480 bytes. +/// That cap is exceeded from about 65 inputs (dashpay/platform#4460: 83 inputs +/// gave a 23 KB transition), so a 65–100-input drain is accepted by Core and +/// then stuck as an asset lock Platform cannot consume until the ChainLock +/// fallback (dashpay/platform#5460) ships in the SDK. An account above +/// `consolidationThreshold` is therefore first consolidated — its final UTXOs +/// swept to one fresh address of its own CoinJoin account in ≤500-input +/// regular transactions, one round per attempt — and drained once few enough +/// UTXOs are left and final; with 50 or more not final, nothing is +/// consolidated until fewer are (`Step.blockedByPending`). The +/// coins never leave the CoinJoin account until the drain, so an interrupted +/// attempt leaves them in it, on fewer UTXOs, for the next attempt to plan +/// from. +/// +/// Pure: the inputs come from `SwiftDashSDKTransactionSender.coinJoinUtxoState(expecting:)` +/// so `CoinJoinShieldPlannerTests` can pin every branch without a wallet. +enum CoinJoinShieldPlanner { + + /// Most inputs a single asset lock may carry (Dash Core v24 policy and + /// Platform consensus agree on 100). The hard limit — never drain above it. + static let maxAssetLockInputs = 100 + + /// Most UTXOs drained directly; above this the account is consolidated + /// first. Tighter than `maxAssetLockInputs` because the ShieldFromAssetLock + /// transition carrying an InstantSend proof outgrows Platform's 20 480-byte + /// transition limit at about 65 inputs (see the type doc); 50 leaves + /// headroom for input size variance. Revisit once the ChainLock-proof + /// fallback (dashpay/platform#5460) is in the SDK the app builds against. + static let consolidationThreshold = 50 + + /// What the next step towards the drain is. + enum Step: Equatable { + /// The account holds no spendable UTXO — there is nothing to shield. + case nothingToMove + /// More UTXOs than one drain may safely spend + /// (`consolidationThreshold`): consolidate the final ones first. + case consolidate + /// Few enough UTXOs, but `pending` of them are not final yet. The + /// drain builder spends only final inputs (confirmed or + /// InstantSend-locked), so draining now would leave them behind. + case awaitFinality(pending: Int) + /// More UTXOs than one drain may safely spend, and so many of them + /// (`pending`) are not final that consolidating the final ones could + /// never get the account under the threshold. + case blockedByPending(pending: Int) + /// Every UTXO is final and one asset lock can spend them all. + case drain + + var isBlockedByPending: Bool { + if case .blockedByPending = self { return true } + return false + } + } + + /// The next step for an account with `utxoCount` spendable UTXOs of which + /// `finalCount` are final. + /// + /// The consolidation spends final UTXOs only — an unconfirmed input that + /// never locks would leave every coin swept with it behind a transaction + /// that cannot confirm. An attempt runs one round, which turns the final + /// UTXOs into one output per ≤500 of them, and the next attempt plans + /// from those outputs, so it can take more than one round. Every round + /// leaves fewer final UTXOs, and the account gets under the threshold + /// once the pending UTXOs plus one output fit — reachable only while + /// fewer than `consolidationThreshold` are pending, so a round is planned + /// only then. The threshold counts pending + /// UTXOs as well: one that locks before the drain is built becomes one of + /// its inputs. + static func nextStep(utxoCount: Int, finalCount: Int) -> Step { + guard utxoCount > 0 else { return .nothingToMove } + let pending = utxoCount - min(finalCount, utxoCount) + if utxoCount > consolidationThreshold { + return pending < consolidationThreshold ? .consolidate : .blockedByPending(pending: pending) + } + return pending > 0 ? .awaitFinality(pending: pending) : .drain + } + + /// The finality the drain builder applies (`is_confirmed || + /// is_instantlocked`), recovered from what the SDK exposes per UTXO: a + /// mined UTXO carries its block height, and an InstantSend-locked one has + /// its txid in the wallet's IS-lock set. Both txid forms are wire order. + static func isFinal(height: UInt32, txid: Data, instantLockedTxids: Set) -> Bool { + height > 0 || instantLockedTxids.contains(txid) + } + + /// Whether a CoinJoin UTXO read can be planned from. The SDK's account + /// readers return `[]` both for "none" and for a failed read, so a failure + /// is told apart here: every wallet has at least its BIP44 account, and a + /// CoinJoin account whose balance is not zero has UTXOs. A cached balance + /// that outlived its coins reads as a failure too, which stops the move + /// rather than drain on a guess. + /// + /// - Parameters: + /// - accountCount: rows `accountBalances` returned. + /// - coinJoinBalanceIsZero: nil when the wallet has no CoinJoin account. + /// - utxoCount: rows `accountUtxos` returned for it, locked ones included. + static func utxoReadIsUsable(accountCount: Int, coinJoinBalanceIsZero: Bool?, utxoCount: Int) -> Bool { + guard accountCount > 0 else { return false } + guard let coinJoinBalanceIsZero else { return true } + return utxoCount > 0 || coinJoinBalanceIsZero + } + + /// Whether every consolidation transaction in `consolidationTxids` (wire + /// order) has produced a final output back in the CoinJoin account. + /// `utxos` is the account's current (txid, isFinal) snapshot. An empty + /// txid list is trivially settled. + static func consolidationSettled( + consolidationTxids: [Data], + utxos: [(txid: Data, isFinal: Bool)] + ) -> Bool { + // Polled every second: skip building the set when there is nothing + // to look up. + guard !consolidationTxids.isEmpty else { return true } + let finalTxids = Set(utxos.lazy.filter { $0.isFinal }.map { $0.txid }) + return consolidationTxids.allSatisfy { finalTxids.contains($0) } + } +} diff --git a/DashWallet/Sources/UI/Home/Views/CoinJoinMoveFunds/CoinJoinMoveFundsSheet.swift b/DashWallet/Sources/UI/Home/Views/CoinJoinMoveFunds/CoinJoinMoveFundsSheet.swift index f272cdb9b4..edcfd5dbdd 100644 --- a/DashWallet/Sources/UI/Home/Views/CoinJoinMoveFunds/CoinJoinMoveFundsSheet.swift +++ b/DashWallet/Sources/UI/Home/Views/CoinJoinMoveFunds/CoinJoinMoveFundsSheet.swift @@ -164,16 +164,30 @@ struct CoinJoinMoveFundsSheet: View { private var shieldInFlightBody: some View { VStack(alignment: .leading, spacing: 16) { - // Same steps as the internal transfer's Core → Shielded route — - // the drain is one asset lock, driven by the same coordinator. - ShieldedTransferStepList( - currentPhase: viewModel.coordinator.phase, - steps: [ - .init(label: NSLocalizedString("Authorizing", comment: ""), phase: .signing), - .init(label: NSLocalizedString("Locking funds", comment: ""), phase: .locking), - .init(label: NSLocalizedString("Generating proof", comment: ""), phase: .proving), - .init(label: NSLocalizedString("Broadcasting", comment: ""), phase: .broadcasting), - ]) + if viewModel.preparation != nil { + // More mixed coins than one drain can safely spend: they are + // consolidated first, which adds a step ahead of the lock. + ShieldedTransferStepList( + labels: [ + NSLocalizedString("Authorizing", comment: ""), + NSLocalizedString("Preparing your coins", comment: "CoinJoin"), + NSLocalizedString("Locking funds", comment: ""), + NSLocalizedString("Generating proof", comment: ""), + NSLocalizedString("Broadcasting", comment: ""), + ], + currentIndex: viewModel.preparedChecklistIndex) + } else { + // Same steps as the internal transfer's Core → Shielded route — + // the drain is one asset lock, driven by the same coordinator. + ShieldedTransferStepList( + currentPhase: viewModel.coordinator.phase, + steps: [ + .init(label: NSLocalizedString("Authorizing", comment: ""), phase: .signing), + .init(label: NSLocalizedString("Locking funds", comment: ""), phase: .locking), + .init(label: NSLocalizedString("Generating proof", comment: ""), phase: .proving), + .init(label: NSLocalizedString("Broadcasting", comment: ""), phase: .broadcasting), + ]) + } Text(NSLocalizedString( "Building the privacy proof can take up to a minute. Keep the app open.", @@ -229,7 +243,19 @@ struct CoinJoinMoveFundsSheet: View { } } - private func failedBody(message: String, destination: CoinJoinMoveFundsViewModel.Destination) -> some View { + private func retry(_ destination: CoinJoinMoveFundsViewModel.Destination) { + Task { + switch destination { + case .wallet: + await viewModel.moveToWallet() + case .shielded: + await viewModel.retryShielded() + } + } + } + + /// A nil `destination` offers no retry, only Close. + private func failedBody(message: String, destination: CoinJoinMoveFundsViewModel.Destination?) -> some View { VStack(spacing: 0) { Image(systemName: "exclamationmark.triangle.fill") .resizable() @@ -247,24 +273,25 @@ struct CoinJoinMoveFundsSheet: View { Spacer(minLength: 12) - ButtonsGroup( - orientation: .horizontal, - size: .large, - positiveButtonText: NSLocalizedString("Try again", comment: ""), - positiveButtonAction: { - Task { - switch destination { - case .wallet: - await viewModel.moveToWallet() - case .shielded: - await viewModel.retryShielded() - } - } - }, - negativeButtonText: NSLocalizedString("Close", comment: ""), - negativeButtonAction: onDismiss) - .padding(.horizontal, 16) - .padding(.bottom, 16) + if let destination { + ButtonsGroup( + orientation: .horizontal, + size: .large, + positiveButtonText: NSLocalizedString("Try again", comment: ""), + positiveButtonAction: { retry(destination) }, + negativeButtonText: NSLocalizedString("Close", comment: ""), + negativeButtonAction: onDismiss) + .padding(.horizontal, 16) + .padding(.bottom, 16) + } else { + DashButton( + text: NSLocalizedString("Close", comment: ""), + style: .filled, + stretch: true, + action: onDismiss) + .padding(.horizontal, 16) + .padding(.bottom, 16) + } } } } @@ -309,6 +336,14 @@ extension CoinJoinMoveFundsSheet { previewViewModel: .preview(amountDuffs: 99_000_000, stage: .submittedUnconfirmed)) } +#Preview("Failed — wallet, no retry") { + CoinJoinMoveFundsSheet( + previewViewModel: .preview( + amountDuffs: 99_000_000, + stage: .failed(message: "We couldn't confirm all of your CoinJoin funds reached the network.", + destination: nil))) +} + #Preview("Failed — shielded") { CoinJoinMoveFundsSheet( previewViewModel: .preview( diff --git a/DashWallet/Sources/UI/Home/Views/CoinJoinMoveFunds/CoinJoinMoveFundsViewModel.swift b/DashWallet/Sources/UI/Home/Views/CoinJoinMoveFunds/CoinJoinMoveFundsViewModel.swift index ad1cecf9c4..8ae0830383 100644 --- a/DashWallet/Sources/UI/Home/Views/CoinJoinMoveFunds/CoinJoinMoveFundsViewModel.swift +++ b/DashWallet/Sources/UI/Home/Views/CoinJoinMoveFunds/CoinJoinMoveFundsViewModel.swift @@ -11,6 +11,13 @@ // (`ShieldedTransferCoordinator.performAssetLock(funding: .coinJoinDrain)`): // every mixed-coin UTXO funds the Type 18 lock directly and the shielded // pool receives `lock_value - pool_fee` — no transparent intermediate hop. +// An asset lock may spend at most 100 inputs (Core / Platform), and its +// shield transition with an InstantSend proof outgrows Platform's size +// limit from about 65, so an account holding more than 50 first has its +// final UTXOs consolidated onto one fresh address of its own CoinJoin +// account (`CoinJoinShieldPlanner`), one round per attempt, and the drain +// runs once few enough UTXOs are left and final. Over 50 with 50 or more +// not final yet stops the move until fewer than 50 are pending. // // Failure posture of the shielded flow: a committed asset lock is resumed on // its exact outpoint via `resumeAssetLock` (mirroring the internal transfer @@ -18,7 +25,10 @@ // picked up by the home tx list's `ShieldedRecoverySheet` on the next // launch. A pre-broadcast failure moves nothing — the coins stay in the // CoinJoin account and the popup / Settings / Tools surfaces keep offering -// the move. +// the move. The consolidation never leaves the CoinJoin account either: if +// the app dies, or the drain fails, after a consolidation broadcast, the +// coins sit on fewer CoinJoin UTXOs and the next attempt plans from them — +// a drain once few enough are left, another round otherwise. // import Combine @@ -46,18 +56,82 @@ final class CoinJoinMoveFundsViewModel: ObservableObject { case submittedUnconfirmed /// `destination` picks the retry path: a failed wallet sweep retries /// the sweep, a failed shielded flow retries (or resumes) the drain - /// asset lock. - case failed(message: String, destination: Destination) + /// asset lock. Nil offers no retry: a wallet sweep whose outcome is + /// unknown may still land. + case failed(message: String, destination: Destination?) } @Published private(set) var stage: Stage = .choice + /// Progress of the steps that run before the coordinator's asset lock + /// when the CoinJoin account cannot be drained as it stands (more than + /// `CoinJoinShieldPlanner.consolidationThreshold` UTXOs, or some not final + /// yet). Nil on the direct path, whose checklist is unchanged. + enum Preparation: Equatable { + case authorizing + case preparingCoins + /// Preparation finished; the coordinator's phase drives the rest. + case done + } + + @Published private(set) var preparation: Preparation? + + /// Active row of the prepared path's five-step checklist (Authorizing, + /// Preparing your coins, Locking funds, Generating proof, Broadcasting); + /// nil renders every row pending. + var preparedChecklistIndex: Int? { + Self.preparedChecklistIndex(preparation: preparation, phase: coordinator.phase) + } + + nonisolated static func preparedChecklistIndex( + preparation: Preparation?, phase: ShieldedTransferCoordinator.Phase + ) -> Int? { + switch preparation { + case nil: return nil + case .authorizing?: return 0 + case .preparingCoins?: return 1 + case .done?: + switch phase { + // `.signing` is the coordinator's preauthorized pass-through. + case .idle, .signing, .locking: return 2 + case .proving: return 3 + case .broadcasting: return 4 + case .success: return 5 + case .failed, .submittedUnconfirmed: return nil + } + } + } + /// CoinJoin balance snapshot at presentation time — the sweep zeroes the /// live balance mid-flow, but the sheet keeps showing what's being moved. let amountDuffs: UInt64 let coordinator = ShieldedTransferCoordinator() + /// The wallet and network the sheet was opened for (its `amountDuffs` + /// is that wallet's CoinJoin balance). Every Shielded attempt and retry + /// is pinned to it: a switch while the sheet is up stops the move. + private let binding = SwiftDashSDKTransactionSender.CoinJoinWalletBinding.current() + + /// Whether this attempt broadcast (or may have broadcast) a + /// consolidation, so the coins can sit mid-preparation when it stops. + private var consolidationSent = false + + /// The committed asset lock a retry must resume, kept here because + /// `coordinator.reset()` clears the coordinator's copy. A failed resume + /// does not prove the lock consumed, so only `.success` or + /// `.submittedUnconfirmed` (the shield was submitted) clears it; until + /// then every retry resumes it, never a fresh drain. + private var unresumedLock: (txidWire: Data, vout: UInt32)? + + /// Wire-order txids of this sheet's consolidations whose broadcast outcome + /// was unknown (they may have reached peers). No new attempt plans until + /// each one's output is in the CoinJoin account — evidence the wallet + /// applied it and so shows its inputs as spent. The output stays until a + /// drain spends it, unlike the transaction record, which the SDK drops + /// once it is chainlocked. + private var unobservedConsolidationTxids: [Data] = [] + private var cancellables = Set() init(amountDuffs: UInt64) { @@ -69,6 +143,35 @@ final class CoinJoinMoveFundsViewModel: ObservableObject { .store(in: &cancellables) } + /// The committed asset lock a retry resumes: the coordinator's, or the + /// one kept across its resets. After a terminal `.success` it still names + /// the lock that was spent; only the stages before it read this. + private var committedLock: (txidWire: Data, vout: UInt32)? { + coordinator.lastAssetLockOutPoint ?? unresumedLock + } + + private var hasCommittedLock: Bool { committedLock != nil } + + /// `coordinator.reset()` that keeps a committed lock for the retry: the + /// reset clears the coordinator's copy of the outpoint. + private func resetCoordinator() { + unresumedLock = committedLock + coordinator.reset() + } + + /// Where a cancelled PIN prompt leaves the sheet: the destination choice, + /// or — while a committed lock waits for its resume — the Shielded retry, + /// which resumes it. + nonisolated static func stageAfterAuthCancel(committedLock: Bool) -> Stage { + committedLock ? unresumedLockStage : .choice + } + + /// The Shielded retry offered while a committed lock waits for its + /// resume; its Try again resumes the lock. + nonisolated static var unresumedLockStage: Stage { + .failed(message: unresumedLockMessage, destination: .shielded) + } + var isInFlight: Bool { switch stage { case .movingToWallet, .shielding: @@ -81,16 +184,28 @@ final class CoinJoinMoveFundsViewModel: ObservableObject { // MARK: Actions /// Destination 1: the existing one-hop sweep into the spendable BIP44 - /// balance. Auth-cancel returns to the choice screen silently. + /// balance. Auth-cancel returns to the choice screen silently. Refused + /// while this sheet holds a committed Shielded lock: that transfer is + /// finished by resuming it, not by a sweep of what is left. func moveToWallet() async { guard !isInFlight else { return } + guard !hasCommittedLock else { + Self.log("move to wallet — refused, a committed Shielded lock is not resumed yet") + stage = Self.unresumedLockStage + return + } stage = .movingToWallet do { - _ = try await WalletSendService.shared.sweepCoinJoin() + guard let binding else { + throw SwiftDashSDKTransactionSender.SendError.walletNotReady("no wallet when the sheet opened") + } + _ = try await WalletSendService.shared.sweepCoinJoin(expecting: binding) stage = .success(.wallet) } catch { if let message = WalletSendService.coinJoinSweepUserMessage(for: error) { - stage = .failed(message: message, destination: .wallet) + Self.log("move to wallet — sweep failed: \(WalletSendService.coinJoinSweepLogLine(for: error))") + let retryable = WalletSendService.isCoinJoinSweepRetryable(error) + stage = .failed(message: message, destination: retryable ? .wallet : nil) } else { stage = .choice } @@ -99,20 +214,511 @@ final class CoinJoinMoveFundsViewModel: ObservableObject { /// Destination 2: one CoinJoin-drain asset lock — every mixed-coin UTXO /// funds the Type 18 lock directly (no transparent hop) and the shielded - /// pool receives the drained value minus the pool fee. The coordinator - /// runs its own PIN/biometric gate, so this is the flow's single prompt. + /// pool receives the drained value minus the pool fee. + /// + /// When the account holds more UTXOs than one drain may safely spend + /// (`CoinJoinShieldPlanner.consolidationThreshold`), the final ones are + /// first consolidated onto one fresh CoinJoin address, which can take + /// more than one attempt (see `prepareCoinJoinInputs`). Either way the user is asked once, up front; + /// the plan is made from the UTXO set read after the prompt, so coins that + /// arrive while it is open are planned for, and the drain runs + /// `preauthorized`. The move is pinned to `binding`: a wallet or network + /// switch since the sheet opened stops it. func moveToShielded() async { guard !isInFlight else { return } + // A committed lock is resumed, never followed by a second drain. + if hasCommittedLock { + preparation = nil + await retryShielded() + return + } stage = .shielding + preparation = nil + consolidationSent = false + if let message = unobservedConsolidationRefusal() { + stage = .failed(message: message, destination: .shielded) + return + } // A prior failed attempt leaves the coordinator terminal; reset so // `beginTransfer()` doesn't silently bail. if coordinator.phase != .idle { - coordinator.reset() + resetCoordinator() + } + + // Read before the prompt only to choose the checklist, and to stop + // without asking for the PIN when the move can't run anyway. + let initial = Self.plan(expecting: binding) + Self.log("move to Shielded — before authorization: \(initial.description)") + guard initial.state != nil else { + Self.log("move to Shielded — CoinJoin UTXOs could not be read, or the active wallet changed; stopping") + stage = .failed(message: Self.genericFailureMessage, destination: .shielded) + return + } + if initial.needsPreparation { + preparation = .authorizing + } + + guard await authorizeShieldedMove() else { return } + + let current = Self.plan(expecting: binding) + Self.log("move to Shielded — after authorization: \(current.description)") + // An unreadable account must not fall through to the drain: the SDK + // drain enumerates the account itself and could spend more inputs + // than one asset lock may carry. + guard let state = current.state else { + Self.log("move to Shielded — CoinJoin UTXOs could not be read, or the active wallet changed; stopping") + preparation = nil + stage = .failed(message: Self.genericFailureMessage, destination: .shielded) + return + } + guard await prepareForDrain(needed: current.needsPreparation, from: state) else { return } + await drainToShielded(expecting: state.binding) + } + + /// Runs the preparation when `needed`, then marks a shown checklist done. + /// False when the preparation stopped the move (the failure is shown). + private func prepareForDrain( + needed: Bool, + from state: SwiftDashSDKTransactionSender.CoinJoinUtxoState + ) async -> Bool { + if needed { + preparation = .preparingCoins + if let message = await prepareCoinJoinInputs(state) { + preparation = nil + SwiftDashSDKWalletState.shared.refreshCoinJoinBalance() + stage = .failed(message: message, destination: .shielded) + return false + } + } + if preparation != nil { + preparation = .done + } + return true + } + + /// The drain, once any preparation is done, and how it ended. + private func drainToShielded(expecting pinned: SwiftDashSDKTransactionSender.CoinJoinWalletBinding) async { + guard !Task.isCancelled else { + Self.log("move to Shielded — cancelled before the drain") + let message = consolidationSent ? Self.preparingMessage : Self.genericFailureMessage + preparation = nil + stage = .failed(message: message, destination: .shielded) + return + } + // An empty account is reported by the coordinator / SDK preflight + // exactly as before. + await DWIdentityAuthorizer.preauthorized { [self] in + await coordinator.performAssetLock(funding: .coinJoinDrain, expecting: pinned) + } + // The coordinator's own cancel check (before any lock is built) after + // a consolidation: the coins may sit mid-preparation, so say so + // instead of returning to the choice. Any other failure is reported + // as usual. + if Task.isCancelled, consolidationSent, + case .failed(let message) = coordinator.phase, + message == ShieldedTransferCoordinator.CoordinatorError.authCancelled.errorDescription { + Self.log("move to Shielded — cancelled before the drain") + resetCoordinator() + preparation = nil + SwiftDashSDKWalletState.shared.refreshCoinJoinBalance() + stage = .failed(message: Self.preparingMessage, destination: .shielded) + return } - await coordinator.performAssetLock(funding: .coinJoinDrain) finishFromCoordinatorPhase() } + /// Why an earlier consolidation whose outcome was unknown blocks a new + /// plan, or nil once each of its transactions has an output in the + /// account (and then it is forgotten). + private func unobservedConsolidationRefusal() -> String? { + guard !unobservedConsolidationTxids.isEmpty else { return nil } + guard let state = binding.flatMap({ SwiftDashSDKTransactionSender.coinJoinUtxoState(expecting: $0) }) else { + Self.log("move to Shielded — the active wallet changed, or its CoinJoin UTXOs can't be read; stopping") + return Self.genericFailureMessage + } + // Any output counts, final or not: it shows the wallet applied it. + guard Set(state.entries.map(\.txid)).isSuperset(of: unobservedConsolidationTxids) else { + Self.log("move to Shielded — an earlier consolidation is not in the wallet yet, not replanning") + return Self.preparingMessage + } + unobservedConsolidationTxids = [] + return nil + } + + /// Asks for the PIN once for the whole move. False when it was cancelled + /// (back to the choice) or failed (the failure is shown). + private func authorizeShieldedMove() async -> Bool { + do { + try await DWIdentityAuthorizer().authorize() + return true + } catch DWIdentityAuthorizer.AuthError.cancelled { + Self.log("move to Shielded — authorization cancelled") + preparation = nil + stage = .choice + return false + } catch { + Self.log("move to Shielded — authorization failed") + preparation = nil + stage = .failed( + message: ShieldedTransferCoordinator.CoordinatorError.authFailed.errorDescription + ?? Self.genericFailureMessage, + destination: .shielded) + return false + } + } + + /// The CoinJoin account's UTXO snapshot and the planner's verdict on it. + private struct Plan { + let state: SwiftDashSDKTransactionSender.CoinJoinUtxoState? + let step: CoinJoinShieldPlanner.Step? + + var needsPreparation: Bool { + switch step { + case .consolidate?, .awaitFinality?, .blockedByPending?: return true + case .drain?, .nothingToMove?, nil: return false + } + } + + var description: String { + "CoinJoin UTXOs n=\(state?.count ?? -1) final=\(state?.finalCount ?? -1) total=\(state?.totalDuffs ?? 0) duffs, " + + "plan=\(step.map { String(describing: $0) } ?? "unknown")" + } + } + + /// - Parameter binding: nil state unless it is the active wallet and + /// network (also when it is nil: no wallet was bound). + private static func plan(expecting binding: SwiftDashSDKTransactionSender.CoinJoinWalletBinding?) -> Plan { + guard let binding else { return Plan(state: nil, step: nil) } + let state = SwiftDashSDKTransactionSender.coinJoinUtxoState(expecting: binding) + return Plan( + state: state, + step: state.map(Self.step(for:))) + } + + // MARK: Preparation (more than 50 mixed coins, or coins not yet final) + + /// How long each finality wait lasts — for a consolidation's outputs, or + /// for not-yet-final CoinJoin UTXOs. InstantSend normally locks within + /// seconds; past this the attempt stops with a retryable message, or + /// drains what is final, rather than hold the sheet open. An attempt + /// waits at most twice: until the pending UTXOs no longer block a + /// consolidation, and after it. + static let finalityTimeout: TimeInterval = 180 + + /// Consolidate (when over the threshold) and wait for finality. Returns nil when + /// the account is ready to drain, or the message to show otherwise. Every + /// step is pinned to `state.binding`, and a cancelled task never returns + /// nil, so it never reaches the drain. + /// + /// One consolidation per attempt: a partial one stops the attempt with a + /// retryable message, and the next attempt consolidates what is left + /// together with the outputs already made. The consolidation spends final + /// UTXOs only; pending ones get the finality window alongside its + /// outputs, or before it when there are too many to consolidate around. + /// + /// - Parameter initial: the UTXO set read after authorization. + private func prepareCoinJoinInputs(_ initial: SwiftDashSDKTransactionSender.CoinJoinUtxoState) async -> String? { + do throws(PreparationStop) { + let state = try await Self.coinJoinStateToPlan(from: initial) + let consolidationTxids = try await consolidateIfDue(state) + try await Self.awaitDrainableCoinJoinState(state.binding, consolidationTxids: consolidationTxids) + return nil + } catch { + return error.message + } + } + + /// Ends a preparation attempt with the message to show. + private struct PreparationStop: Error { + let message: String + } + + /// The UTXO set to plan from: `initial`, or — when too many UTXOs are + /// pending to consolidate around — a read made after they no longer block + /// it, or after `finalityTimeout`. They normally lock within seconds; the + /// state returned after a timeout is still blocked, and `consolidateIfDue` + /// stops the attempt on it. + private static func coinJoinStateToPlan( + from initial: SwiftDashSDKTransactionSender.CoinJoinUtxoState + ) async throws(PreparationStop) -> SwiftDashSDKTransactionSender.CoinJoinUtxoState { + if let refusal = await Self.preparationRefusal(for: initial) { throw PreparationStop(message: refusal) } + guard Self.step(for: initial).isBlockedByPending else { return initial } + guard let waited = await Self.waitForCoinJoinUtxos(initial.binding, until: { !Self.step(for: $0).isBlockedByPending }) + else { throw PreparationStop(message: Self.genericFailureMessage) } + guard !Self.step(for: waited.state).isBlockedByPending else { return waited.state } + // The wait can outlast the checks above: let sync settle, then plan + // from, and check, a read made after it. + if let refusal = await Self.syncRefusal(waitingUpTo: Self.syncSettleTimeout) { throw PreparationStop(message: refusal) } + guard let fresh = SwiftDashSDKTransactionSender.coinJoinUtxoState(expecting: waited.state.binding) else { + Self.log("move to Shielded — the active wallet changed, or CoinJoin UTXOs could not be read") + throw PreparationStop(message: Self.genericFailureMessage) + } + if let refusal = Self.onlineRefusal(for: fresh) { throw PreparationStop(message: refusal) } + return fresh + } + + /// The consolidation's txids when `state` calls for one, else empty. + private func consolidateIfDue(_ state: SwiftDashSDKTransactionSender.CoinJoinUtxoState) async throws(PreparationStop) -> [Data] { + switch Self.step(for: state) { + case .blockedByPending(let pending): + Self.log("move to Shielded — n=\(state.count) with \(pending) not final, too many to consolidate around; stopping") + throw PreparationStop(message: Self.unconfirmedMessage) + case .consolidate: + return try await consolidate(state) + case .awaitFinality, .drain, .nothingToMove: + return [] + } + } + + /// Sweeps the final UTXOs of `state` onto a fresh CoinJoin address and + /// returns the txids. Stops the attempt unless every chunk was accepted. + private func consolidate(_ state: SwiftDashSDKTransactionSender.CoinJoinUtxoState) async throws(PreparationStop) -> [Data] { + guard let address = SwiftDashSDKTransactionSender.unusedCoinJoinAddress(for: state.binding) else { + Self.log("move to Shielded — no unused CoinJoin address for the consolidation") + throw PreparationStop(message: Self.genericFailureMessage) + } + let chunks = SwiftDashSDKTransactionSender.balancedChunks( + Array(repeating: 0, count: state.finalCount), + maxPerChunk: SwiftDashSDKTransactionSender.maxInputsPerSweep + ).map(\.count) + Self.log("move to Shielded — consolidating \(state.finalCount) final of n=\(state.count) CoinJoin UTXOs into \(chunks.count) tx(s) \(chunks)") + guard !Task.isCancelled else { + Self.log("move to Shielded — cancelled before the consolidation") + throw PreparationStop(message: Self.genericFailureMessage) + } + let outcome: SwiftDashSDKTransactionSender.CoinJoinSweepOutcome + do { + // Off the main actor so the checklist renders first; the + // sender hops back to main for the SDK calls themselves. + let binding = state.binding + let outpoints = state.finalOutpoints + outcome = try await Task.detached(priority: .userInitiated) { + try SwiftDashSDKTransactionSender.sweepCoinJoin( + to: address, expecting: binding, outpoints: outpoints) + }.value + } catch let error as SwiftDashSDKTransactionSender.CoinJoinSweepUnknownError { + // The broadcasts may have reached peers. The wallet applies a + // transaction before waiting for them, which spends its inputs + // locally; the next attempt waits until their outputs show. + consolidationSent = true + unobservedConsolidationTxids = error.unknownTxids + Self.log("move to Shielded — consolidation outcome unknown") + throw PreparationStop(message: Self.preparingMessage) + } catch { + Self.log("move to Shielded — consolidation failed, nothing accepted: \(WalletSendService.logSummary(of: error))") + throw PreparationStop(message: Self.genericFailureMessage) + } + unobservedConsolidationTxids = outcome.unknownTxids + consolidationSent = !outcome.txids.isEmpty + // Counts only: a txid leads to the consolidation address. + let failure = outcome.firstFailure.map { ", one: \(WalletSendService.logSummary(of: $0))" } ?? "" + Self.log("move to Shielded — consolidation broadcast \(outcome.txids.count) tx(s), \(outcome.failedChunkCount) failed\(failure)") + // A chunk that failed may still have reached peers (an unconfirmed + // broadcast), and the wallet may not show its inputs as spent yet; a + // drain now could spend them a second time. Stop here; the next + // attempt plans from the UTXO set as the wallet reads it then. + if outcome.isPartial { + Self.log("move to Shielded — partial consolidation, stopping before the drain") + throw PreparationStop(message: Self.partialPreparationMessage) + } + guard !outcome.txids.isEmpty else { + Self.log("move to Shielded — consolidation produced no transaction") + throw PreparationStop(message: Self.genericFailureMessage) + } + return outcome.txids + } + + /// Waits until every CoinJoin UTXO is final — the drain builder spends + /// final inputs only — and, after a consolidation, at least until its + /// outputs are back in the account and final. Returns when the account + /// is ready to drain. + private static func awaitDrainableCoinJoinState( + _ binding: SwiftDashSDKTransactionSender.CoinJoinWalletBinding, + consolidationTxids txids: [Data] + ) async throws(PreparationStop) { + // Once a consolidation is out, its coins are mid-preparation. + let stop = { (message: String) in PreparationStop(message: txids.isEmpty ? message : Self.preparingMessage) } + guard await Self.waitForCoinJoinUtxos(binding, until: { Self.isDrainable($0, consolidationTxids: txids) }) != nil + else { throw stop(Self.genericFailureMessage) } + // The coordinator refuses the drain off .syncDone, and the block that + // ended the wait can briefly take the monitor out of it. Plan from a + // read made after that settles. + if let refusal = await Self.syncRefusal(waitingUpTo: Self.syncSettleTimeout) { throw stop(refusal) } + guard let after = SwiftDashSDKTransactionSender.coinJoinUtxoState(expecting: binding) else { + Self.log("move to Shielded — the active wallet changed, or CoinJoin UTXOs could not be read") + throw stop(Self.genericFailureMessage) + } + // Not through `stop`: `drainRefusal` picks its message from the + // consolidation's txids itself. + if let refusal = Self.drainRefusal(after, consolidationTxids: txids) { + throw PreparationStop(message: refusal) + } + guard !Task.isCancelled else { + Self.log("move to Shielded — cancelled before the drain") + throw stop(Self.genericFailureMessage) + } + } + + /// What ends the finality wait: the consolidation settled, and every + /// UTXO final — or over the threshold, where another round is due + /// whatever the pending ones do. + nonisolated private static func isDrainable( + _ state: SwiftDashSDKTransactionSender.CoinJoinUtxoState, consolidationTxids txids: [Data] + ) -> Bool { + // An output not in the account yet is not counted as pending. + CoinJoinShieldPlanner.consolidationSettled(consolidationTxids: txids, utxos: state.txidFinality) + && (state.count > CoinJoinShieldPlanner.consolidationThreshold || state.finalCount == state.count) + } + + /// Why `after`, the read made after the finality wait, can't be drained + /// now, or nil. + private static func drainRefusal( + _ after: SwiftDashSDKTransactionSender.CoinJoinUtxoState, + consolidationTxids txids: [Data] + ) -> String? { + if !Self.isDrainable(after, consolidationTxids: txids) { + if !CoinJoinShieldPlanner.consolidationSettled(consolidationTxids: txids, utxos: after.txidFinality) { + // The consolidated coins are safe on their CoinJoin address; + // a later attempt drains them once they are final. + return Self.preparingMessage + } + // A settled consolidation output is final, so only the direct + // path can have none. + if after.finalCount == 0 { + return Self.unconfirmedMessage + } + // Some coins still unconfirmed: drain what is final, exactly as + // before this preparation existed. The rest stays in the CoinJoin + // account for a later move. + } + let afterStep = Self.step(for: after) + switch afterStep { + case .consolidate, .blockedByPending: + // Another consolidation round is due (its outputs plus the pending + // UTXOs are still over the threshold), or coins arrived during the + // wait. A consolidated attempt resumes from its outputs next time. + Self.log("move to Shielded — n=\(after.count) final=\(after.finalCount) after the wait, over the threshold; stopping") + // The next round can run at once unless pending coins block it. + if txids.isEmpty { + return afterStep.isBlockedByPending ? Self.unconfirmedMessage : Self.genericFailureMessage + } + return afterStep.isBlockedByPending ? Self.preparingMessage : Self.partialPreparationMessage + case .nothingToMove: + return Self.genericFailureMessage + case .drain, .awaitFinality: + return nil + } + } + + /// How long a wait that just ended gives the sync monitor to settle back + /// to `.syncDone`. + static let syncSettleTimeout: TimeInterval = 30 + + /// Nil once the sync monitor reads `.syncDone` (polled for up to + /// `timeout`), else the not-synced message, or the generic one when the + /// task is cancelled. + private static func syncRefusal(waitingUpTo timeout: TimeInterval) async -> String? { + let deadline = Date().addingTimeInterval(timeout) + while SyncingActivityMonitor.shared.state != .syncDone { + if Task.isCancelled { + log("move to Shielded — cancelled while waiting for sync") + return genericFailureMessage + } + guard Date() < deadline else { + log("move to Shielded — preparation refused, chain not synced") + return ShieldedTransferCoordinator.CoordinatorError.coinJoinDrainRequiresSync.errorDescription + ?? genericFailureMessage + } + try? await Task.sleep(nanoseconds: 1_000_000_000) + } + return nil + } + + nonisolated private static func step( + for state: SwiftDashSDKTransactionSender.CoinJoinUtxoState + ) -> CoinJoinShieldPlanner.Step { + CoinJoinShieldPlanner.nextStep(utxoCount: state.count, finalCount: state.finalCount) + } + + /// Why the preparation can't run now, or nil. The sync check is the one + /// the coordinator makes for the drain: a scan that restarted while the + /// prompt was open could still be discovering UTXOs, so the plan could + /// miss some. A consolidation also needs the network. + private static func preparationRefusal(for state: SwiftDashSDKTransactionSender.CoinJoinUtxoState) async -> String? { + if let refusal = await syncRefusal(waitingUpTo: 0) { return refusal } + return onlineRefusal(for: state) + } + + private static func onlineRefusal(for state: SwiftDashSDKTransactionSender.CoinJoinUtxoState) -> String? { + guard state.count > CoinJoinShieldPlanner.consolidationThreshold else { return nil } + do { + try WalletSendService.ensureOnline() + return nil + } catch { + return error.localizedDescription + } + } + + /// Polls the CoinJoin UTXO set until `isDone` holds or `finalityTimeout` + /// passes, and logs how it ended. Nil when cancelled, or when the active + /// wallet changed or its UTXOs could not be read. + private static func waitForCoinJoinUtxos( + _ binding: SwiftDashSDKTransactionSender.CoinJoinWalletBinding, + until isDone: @escaping (SwiftDashSDKTransactionSender.CoinJoinUtxoState) -> Bool + ) async -> (state: SwiftDashSDKTransactionSender.CoinJoinUtxoState, satisfied: Bool)? { + let waitStart = Date() + let result: (state: SwiftDashSDKTransactionSender.CoinJoinUtxoState, satisfied: Bool)? + do { + result = try await SwiftDashSDKTransactionSender.waitForCoinJoinUtxoState( + binding: binding, timeout: finalityTimeout, until: isDone) + } catch { + log("move to Shielded — cancelled while waiting for finality") + return nil + } + guard let result else { + Self.log("move to Shielded — the active wallet changed, or CoinJoin UTXOs could not be read") + return nil + } + let waitedSeconds = Int(Date().timeIntervalSince(waitStart).rounded()) + Self.log( + "move to Shielded — finality wait \(result.satisfied ? "settled" : "timed out") after \(waitedSeconds)s " + + "(cap \(Int(Self.finalityTimeout))s): n=\(result.state.count) final=\(result.state.finalCount)") + return result + } + + private static var partialPreparationMessage: String { + NSLocalizedString( + "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance.", + comment: "CoinJoin") + } + + private static var preparingMessage: String { + NSLocalizedString( + "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes.", + comment: "CoinJoin") + } + + nonisolated private static var unresumedLockMessage: String { + NSLocalizedString( + "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them.", + comment: "CoinJoin") + } + + private static var unconfirmedMessage: String { + NSLocalizedString( + "Not all of your mixed coins are confirmed yet. Please try again in a few minutes.", + comment: "CoinJoin") + } + + private static var genericFailureMessage: String { + NSLocalizedString("Couldn't move your CoinJoin funds. Please try again.", comment: "CoinJoin") + } + + /// Exported-log line (DWLogger reaches "Share logs"; os.Logger does not). + private static func log(_ message: String) { + DWLogger.log("🛡️ COINJOIN-SHIELD :: \(message)", className: "CoinJoinMoveFundsViewModel") + } + /// "Try again" from a failed shielded attempt. Mirrors /// `InternalTransferConfirmSheet.tryAgain`: a committed asset lock is /// RESUMED on its exact outpoint (building a second lock would strand the @@ -120,15 +726,29 @@ final class CoinJoinMoveFundsViewModel: ObservableObject { /// left the CoinJoin account untouched. func retryShielded() async { guard !isInFlight else { return } - if let op = coordinator.lastAssetLockOutPoint { + if let op = committedLock { + guard let binding, binding == SwiftDashSDKTransactionSender.CoinJoinWalletBinding.current() else { + Self.log("move to Shielded — resume refused, the active wallet changed") + stage = .failed(message: Self.genericFailureMessage, destination: .shielded) + return + } stage = .shielding - coordinator.reset() + resetCoordinator() // Resume re-authorizes on its own (fresh user action). - await coordinator.resumeAssetLock(outPointTxidWire: op.txidWire, outPointVout: op.vout) + await coordinator.resumeAssetLock( + outPointTxidWire: op.txidWire, outPointVout: op.vout, expecting: binding) + switch coordinator.phase { + case .success, .submittedUnconfirmed: + unresumedLock = nil + default: + break + } finishFromCoordinatorPhase() return } - coordinator.reset() + // No committed lock to resume: plan afresh from the UTXO set as it is + // now, a consolidation that already landed included. + resetCoordinator() await moveToShielded() } @@ -148,19 +768,18 @@ final class CoinJoinMoveFundsViewModel: ObservableObject { // return to the destination choice (mirrors the wallet leg's // auth-cancel handling). Message-compare against the same // localized source the coordinator maps the cancel to. + // A committed lock still waits for its resume, so the sheet + // stays on the retry instead of offering the destinations again. if message == ShieldedTransferCoordinator.CoordinatorError.authCancelled.errorDescription { - coordinator.reset() - stage = .choice + resetCoordinator() + stage = Self.stageAfterAuthCancel(committedLock: hasCommittedLock) } else { stage = .failed(message: message, destination: .shielded) } default: // The coordinator's single-flight gate refused the call (phase // wasn't idle). Surface a retryable failure rather than hang. - stage = .failed( - message: NSLocalizedString( - "Couldn't move your CoinJoin funds. Please try again.", comment: "CoinJoin"), - destination: .shielded) + stage = .failed(message: Self.genericFailureMessage, destination: .shielded) } } } diff --git a/DashWallet/Sources/UI/Home/Views/HomeViewModel.swift b/DashWallet/Sources/UI/Home/Views/HomeViewModel.swift index 8a05dcee24..cad368b94c 100644 --- a/DashWallet/Sources/UI/Home/Views/HomeViewModel.swift +++ b/DashWallet/Sources/UI/Home/Views/HomeViewModel.swift @@ -1418,7 +1418,7 @@ extension HomeViewModel { _ = try await WalletSendService.shared.sweepCoinJoin() return nil } catch { - DWLogger.log("HomeViewModel: sweep (home popup) failed: \(error)") + DWLogger.log("HomeViewModel: sweep (home popup) failed: \(WalletSendService.coinJoinSweepLogLine(for: error))") // nil when the user cancelled auth; a message on real failures. return WalletSendService.coinJoinSweepUserMessage(for: error) } diff --git a/DashWallet/Sources/UI/Menu/Settings/SettingsMenuViewModel.swift b/DashWallet/Sources/UI/Menu/Settings/SettingsMenuViewModel.swift index eaf24e9df6..aded2106db 100644 --- a/DashWallet/Sources/UI/Menu/Settings/SettingsMenuViewModel.swift +++ b/DashWallet/Sources/UI/Menu/Settings/SettingsMenuViewModel.swift @@ -344,7 +344,7 @@ class SettingsMenuViewModel: ObservableObject { do { _ = try await WalletSendService.shared.sweepCoinJoin() } catch { - DWLogger.log("SettingsMenuViewModel: sweep failed: \(error)") + DWLogger.log("SettingsMenuViewModel: sweep failed: \(WalletSendService.coinJoinSweepLogLine(for: error))") // Auth-cancel is an expected no-op (nil message); a real failure // surfaces an alert. The row stays visible so the user can retry. coinJoinSweepErrorMessage = WalletSendService.coinJoinSweepUserMessage(for: error) diff --git a/DashWallet/Sources/UI/Menu/Tools/ToolsMenuViewModel.swift b/DashWallet/Sources/UI/Menu/Tools/ToolsMenuViewModel.swift index 6e4d88ed89..409c0ddb02 100644 --- a/DashWallet/Sources/UI/Menu/Tools/ToolsMenuViewModel.swift +++ b/DashWallet/Sources/UI/Menu/Tools/ToolsMenuViewModel.swift @@ -215,7 +215,7 @@ class ToolsMenuViewModel: ObservableObject { do { _ = try await WalletSendService.shared.sweepCoinJoin() } catch { - DWLogger.log("ToolsMenuViewModel: sweep failed: \(error)") + DWLogger.log("ToolsMenuViewModel: sweep failed: \(WalletSendService.coinJoinSweepLogLine(for: error))") // Auth-cancel is an expected no-op (nil message); a real failure // surfaces an alert. The row stays visible so the user can retry. coinJoinSweepErrorMessage = WalletSendService.coinJoinSweepUserMessage(for: error) diff --git a/DashWallet/Sources/UI/Payments/InternalTransfer/Shielded/ShieldedTransferCoordinator.swift b/DashWallet/Sources/UI/Payments/InternalTransfer/Shielded/ShieldedTransferCoordinator.swift index ff0fc8493e..60d9c45dc8 100644 --- a/DashWallet/Sources/UI/Payments/InternalTransfer/Shielded/ShieldedTransferCoordinator.swift +++ b/DashWallet/Sources/UI/Payments/InternalTransfer/Shielded/ShieldedTransferCoordinator.swift @@ -570,6 +570,41 @@ final class ShieldedTransferCoordinator: ObservableObject { case coinJoinDrain } + /// Why the transfer must stop after the prompt, before anything is built + /// or broadcast, or nil. + private func executionRefusal( + funding: AssetLockFundingSource, + expecting binding: SwiftDashSDKTransactionSender.CoinJoinWalletBinding?, + env: Environment + ) -> Error? { + // After the prompt, so a switch while it was open is caught too; the + // sync gate below then reads the pinned wallet's state. + guard isStillBound(binding, env: env) else { + Self.logger.error("🛡️ SHIELD-TX :: asset lock refused — the active wallet changed") + return CoordinatorError.noWallet + } + + // A cancelled task stops here, before anything is built or broadcast. + // Reported as a cancel: the caller went away, nothing failed. + if Task.isCancelled { + Self.logger.error("🛡️ SHIELD-TX :: asset lock refused — task cancelled") + return CoordinatorError.authCancelled + } + + // Re-check at the execution boundary, not only where the surface was + // offered. The drain is whole-account and its value is computed + // SDK-side, so a scan that restarted while the sheet or the PIN prompt + // was open would lock a UTXO set the user never saw. The BIP44 route + // carries an explicit amount and its own screens gate on + // `isChainSynced`, so this is the drain's check alone. + if case .coinJoinDrain = funding, + SyncingActivityMonitor.shared.state != .syncDone { + Self.logger.error("🛡️ SHIELD-TX :: coinjoin drain refused — chain not synced") + return CoordinatorError.coinJoinDrainRequiresSync + } + return nil + } + /// `recipientRaw43` nil = the wallet's own default Orchard address (the /// internal transfer); an external Send passes the recipient's raw /// 43-byte payload. The recipient receives exactly `recipientAmountDuffs`: @@ -584,7 +619,14 @@ final class ShieldedTransferCoordinator: ObservableObject { /// Funding-parameterized form of `performAssetLock(recipientAmountDuffs:)` /// — same stages, polling, and resume semantics for both funding sources /// (a stuck lock resumes by outpoint regardless of what funded it). - func performAssetLock(funding: AssetLockFundingSource, recipientRaw43 recipientOverride: Data? = nil) async { + /// - Parameter binding: When set, the transfer fails unless this is still + /// the active wallet and network (the CoinJoin move pins the wallet it + /// was authorized for). + func performAssetLock( + funding: AssetLockFundingSource, + recipientRaw43 recipientOverride: Data? = nil, + expecting binding: SwiftDashSDKTransactionSender.CoinJoinWalletBinding? = nil + ) async { guard beginTransfer() else { return } lastAssetLockOutPoint = nil Self.logger.info("🛡️ SHIELD-TX :: asset-lock route funding=\(String(describing: funding), privacy: .public) external=\(recipientOverride != nil)") @@ -628,16 +670,8 @@ final class ShieldedTransferCoordinator: ObservableObject { return } - // Re-check at the execution boundary, not only where the surface was - // offered. The drain is whole-account and its value is computed - // SDK-side, so a scan that restarted while the sheet or the PIN prompt - // was open would lock a UTXO set the user never saw. The BIP44 route - // carries an explicit amount and its own screens gate on - // `isChainSynced`, so this is the drain's check alone. - if case .coinJoinDrain = funding, - SyncingActivityMonitor.shared.state != .syncDone { - Self.logger.error("🛡️ SHIELD-TX :: coinjoin drain refused — chain not synced") - handleFailure(CoordinatorError.coinJoinDrainRequiresSync) + if let refusal = executionRefusal(funding: funding, expecting: binding, env: env) { + handleFailure(refusal) return } @@ -702,7 +736,14 @@ final class ShieldedTransferCoordinator: ObservableObject { /// /// Used by both confirm sheets' "Try again" (in-session) and the /// home-screen recovery sheet (after relaunch). - func resumeAssetLock(outPointTxidWire: Data, outPointVout: UInt32, recipientRaw43 recipientOverride: Data? = nil, expectedDrainContext: CoreShieldedDrainContext? = nil) async { + /// - Parameter binding: as for `performAssetLock(funding:recipientRaw43:expecting:)`. + func resumeAssetLock( + outPointTxidWire: Data, + outPointVout: UInt32, + recipientRaw43 recipientOverride: Data? = nil, + expecting binding: SwiftDashSDKTransactionSender.CoinJoinWalletBinding? = nil, + expectedDrainContext: CoreShieldedDrainContext? = nil + ) async { guard beginTransfer() else { return } Self.logger.info("🛡️ SHIELD-TX :: resume asset-lock vout=\(outPointVout) external=\(recipientOverride != nil)") @@ -721,6 +762,12 @@ final class ShieldedTransferCoordinator: ObservableObject { return } + guard isStillBound(binding, env: env) else { + Self.logger.error("🛡️ SHIELD-TX :: resume refused — the active wallet changed") + handleFailure(CoordinatorError.noWallet) + return + } + if let expectedDrainContext { do { _ = try CoreShieldedDrainService().manager(for: expectedDrainContext) @@ -1495,6 +1542,16 @@ final class ShieldedTransferCoordinator: ObservableObject { shieldedRecipient: recipient) } + /// Whether a pinned transfer may still run: `binding` (when set) is both + /// the environment resolved for it and the host's active wallet now. + private func isStillBound( + _ binding: SwiftDashSDKTransactionSender.CoinJoinWalletBinding?, env: Environment + ) -> Bool { + guard let binding else { return true } + return binding == SwiftDashSDKTransactionSender.CoinJoinWalletBinding(walletId: env.walletId, network: env.network) + && binding == SwiftDashSDKTransactionSender.CoinJoinWalletBinding.current() + } + /// Synchronous single-flight gate. Returns `false` when a transfer is /// already in progress (or finished and not yet `reset()`), so a fast /// double-tap on Confirm can't queue a second transfer. Because the diff --git a/DashWallet/ar.lproj/Localizable.strings b/DashWallet/ar.lproj/Localizable.strings index 609aa680a8..a199f5e0cc 100644 --- a/DashWallet/ar.lproj/Localizable.strings +++ b/DashWallet/ar.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "لا توجد أسماء مستخدمين على هذه الهوية بعد. ابحث عن اسم لشرائه أو تسجيله في تبويب «البحث عن الأسماء»."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "الأموال غير كافية في هذا الرصيد: المطلوب %@ DASH، والمتاح %@ DASH."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/bg.lproj/Localizable.strings b/DashWallet/bg.lproj/Localizable.strings index 773d99498e..7d25f9d2c7 100644 --- a/DashWallet/bg.lproj/Localizable.strings +++ b/DashWallet/bg.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Тази самоличност още няма потребителски имена. Намерете име за купуване или регистриране в раздела „Търсене на имена“."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Недостатъчно средства в този баланс: нужни са %@ DASH, налични са %@ DASH."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/ca.lproj/Localizable.strings b/DashWallet/ca.lproj/Localizable.strings index 3537755bd0..7030185727 100644 --- a/DashWallet/ca.lproj/Localizable.strings +++ b/DashWallet/ca.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Aquesta identitat encara no té noms d'usuari. Cerca'n un per comprar o registrar a la pestanya «Cerca noms»."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Fons insuficients en aquest saldo: calen %@ DASH, n'hi ha %@ DASH disponibles."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/cs.lproj/Localizable.strings b/DashWallet/cs.lproj/Localizable.strings index 28d3f299f1..0b95d1e9e0 100644 --- a/DashWallet/cs.lproj/Localizable.strings +++ b/DashWallet/cs.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Na této identitě zatím nejsou žádná uživatelská jména. Najděte si nějaké ke koupi nebo registraci na kartě „Najít jména“."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Na tomto zůstatku není dost prostředků: potřeba %@ DASH, dostupné %@ DASH."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/da.lproj/Localizable.strings b/DashWallet/da.lproj/Localizable.strings index 0ebbdc5785..7ff932953a 100644 --- a/DashWallet/da.lproj/Localizable.strings +++ b/DashWallet/da.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Der er endnu ingen brugernavne på denne identitet. Find et at købe eller registrere under fanen “Find navne”."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Utilstrækkelige midler på denne saldo: %@ DASH kræves, %@ DASH tilgængelig."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/de.lproj/Localizable.strings b/DashWallet/de.lproj/Localizable.strings index dc5fda04ff..db89e251b6 100644 --- a/DashWallet/de.lproj/Localizable.strings +++ b/DashWallet/de.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Auf dieser Identität sind noch keine Nutzernamen vorhanden. Finde unter „Namen finden“ einen zum Kaufen oder Registrieren."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Nicht genug Mittel in diesem Guthaben: %@ DASH benötigt, %@ DASH verfügbar."; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/el.lproj/Localizable.strings b/DashWallet/el.lproj/Localizable.strings index 22aa813cf0..4343825533 100644 --- a/DashWallet/el.lproj/Localizable.strings +++ b/DashWallet/el.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Δεν υπάρχουν ακόμη ονόματα χρήστη σε αυτή την ταυτότητα. Βρείτε ένα για αγορά ή καταχώρηση στην καρτέλα «Εύρεση ονομάτων»."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Ανεπαρκή κεφάλαια σε αυτό το υπόλοιπο: απαιτούνται %@ DASH, διαθέσιμα %@ DASH."; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/en.lproj/Localizable.strings b/DashWallet/en.lproj/Localizable.strings index 870fd034cb..d8b9dd448e 100644 --- a/DashWallet/en.lproj/Localizable.strings +++ b/DashWallet/en.lproj/Localizable.strings @@ -1089,6 +1089,9 @@ /* Username marketplace: purchases feed row — price paid, date, then seller → buyer short ids */ "Sold for %1$@ DASH · %2$@ · %3$@ → %4$@" = "Sold for %1$@ DASH · %2$@ · %3$@ → %4$@"; +/* CoinJoin */ +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Username marketplace: browse row whose name is no longer listed */ "Not for sale now" = "Not for sale now"; @@ -3061,6 +3064,9 @@ /* Send dispatched but no network acceptance signal arrived */ "We couldn't confirm the transaction reached the network. Don't send it again — the wallet keeps trying while it's open, and your balance will update as soon as it goes through." = "We couldn't confirm the transaction reached the network. Don't send it again — the wallet keeps trying while it's open, and your balance will update as soon as it goes through."; +/* CoinJoin sweep dispatched but no network acceptance signal arrived for some of it */ +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; + /* DashPay FAQ */ "What about Unstoppable Domains and similar name services?" = "What about Unstoppable Domains and similar name services?"; @@ -6409,6 +6415,16 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; + +/* CoinJoin */ +"Preparing your coins" = "Preparing your coins"; + +/* CoinJoin */ +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; + +/* CoinJoin */ +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Still calculating the withdrawable amount. Tap Max again in a moment." = "Still calculating the withdrawable amount. Tap Max again in a moment."; diff --git a/DashWallet/eo.lproj/Localizable.strings b/DashWallet/eo.lproj/Localizable.strings index 37fe10c3d6..374d3a1af1 100644 --- a/DashWallet/eo.lproj/Localizable.strings +++ b/DashWallet/eo.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Ĉi tiu identeco ankoraŭ havas neniujn uzantnomojn. Trovu iun por aĉeti aŭ registri en la langeto „Trovi nomojn“."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Nesufiĉaj rimedoj sur ĉi tiu saldo: necesas %@ DASH, disponeblas %@ DASH."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/es.lproj/Localizable.strings b/DashWallet/es.lproj/Localizable.strings index 3a772b11a5..3e96b8ccca 100644 --- a/DashWallet/es.lproj/Localizable.strings +++ b/DashWallet/es.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Aún no hay nombres de usuario en esta identidad. Encuentra uno para comprar o registrar en la pestaña «Buscar nombres»."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Fondos insuficientes en este saldo: se necesitan %@ DASH, hay %@ DASH disponibles."; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/et.lproj/Localizable.strings b/DashWallet/et.lproj/Localizable.strings index 8ce0b5f318..e4484421ff 100644 --- a/DashWallet/et.lproj/Localizable.strings +++ b/DashWallet/et.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Sellel identiteedil pole veel kasutajanimesid. Leia vahekaardilt „Otsi nimesid“ mõni ostmiseks või registreerimiseks."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Sellel jäägil pole piisavalt vahendeid: vaja on %@ DASH, saadaval on %@ DASH."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/fa.lproj/Localizable.strings b/DashWallet/fa.lproj/Localizable.strings index 6be1625ea9..57a0df64cd 100644 --- a/DashWallet/fa.lproj/Localizable.strings +++ b/DashWallet/fa.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "هنوز نام کاربری‌ای روی این هویت نیست. در زبانه «یافتن نام‌ها» نامی برای خرید یا ثبت پیدا کنید."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "موجودی این حساب کافی نیست: %@ DASH لازم است، %@ DASH در دسترس است."; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/fi.lproj/Localizable.strings b/DashWallet/fi.lproj/Localizable.strings index 00f153ddd7..b78cdfa9ad 100644 --- a/DashWallet/fi.lproj/Localizable.strings +++ b/DashWallet/fi.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Tällä identiteetillä ei ole vielä käyttäjänimiä. Etsi ostettava tai rekisteröitävä nimi ”Etsi nimiä” -välilehdeltä."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Tällä saldolla ei ole tarpeeksi varoja: tarvitaan %@ DASH, käytettävissä %@ DASH."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/fil.lproj/Localizable.strings b/DashWallet/fil.lproj/Localizable.strings index e6b202b583..e908d6fb14 100644 --- a/DashWallet/fil.lproj/Localizable.strings +++ b/DashWallet/fil.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Wala pang username sa pagkakakilanlang ito. Maghanap ng bibilhin o irerehistro sa tab na “Maghanap ng Pangalan”."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Kulang ang pondo sa balanseng ito: %@ DASH ang kailangan, %@ DASH ang available."; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/fr.lproj/Localizable.strings b/DashWallet/fr.lproj/Localizable.strings index 43e9adb216..f96c60c8aa 100644 --- a/DashWallet/fr.lproj/Localizable.strings +++ b/DashWallet/fr.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Aucun nom d'utilisateur sur cette identité pour l'instant. Trouvez-en un à acheter ou à enregistrer dans l'onglet « Trouver des noms »."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Fonds insuffisants sur ce solde : %@ DASH nécessaires, %@ DASH disponibles."; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/hr.lproj/Localizable.strings b/DashWallet/hr.lproj/Localizable.strings index c0456bfd88..d37232d0b5 100644 --- a/DashWallet/hr.lproj/Localizable.strings +++ b/DashWallet/hr.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Na ovom identitetu još nema korisničkih imena. Pronađite neko za kupnju ili registraciju na kartici „Pronađi imena“."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Nema dovoljno sredstava na ovom stanju: potrebno %@ DASH, dostupno %@ DASH."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/hu.lproj/Localizable.strings b/DashWallet/hu.lproj/Localizable.strings index e3b567469c..9b683628ec 100644 --- a/DashWallet/hu.lproj/Localizable.strings +++ b/DashWallet/hu.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Ezen az identitáson még nincs felhasználónév. Keress egyet vásárlásra vagy regisztrálásra a „Nevek keresése” fülön."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Nincs elég fedezet ezen az egyenlegen: %@ DASH szükséges, %@ DASH áll rendelkezésre."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/id.lproj/Localizable.strings b/DashWallet/id.lproj/Localizable.strings index d9dc87648c..de023f66f9 100644 --- a/DashWallet/id.lproj/Localizable.strings +++ b/DashWallet/id.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Belum ada nama pengguna pada identitas ini. Temukan satu untuk dibeli atau didaftarkan di tab “Cari Nama”."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Dana pada saldo ini tidak cukup: dibutuhkan %@ DASH, tersedia %@ DASH."; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/it.lproj/Localizable.strings b/DashWallet/it.lproj/Localizable.strings index 70d51744a6..1b42d3bb7b 100644 --- a/DashWallet/it.lproj/Localizable.strings +++ b/DashWallet/it.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Ancora nessun nome utente su questa identità. Trovane uno da comprare o registrare nella scheda «Trova nomi»."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Fondi insufficienti su questo saldo: servono %@ DASH, disponibili %@ DASH."; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/ja.lproj/Localizable.strings b/DashWallet/ja.lproj/Localizable.strings index edfdc57149..d399ccac87 100644 --- a/DashWallet/ja.lproj/Localizable.strings +++ b/DashWallet/ja.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "このアイデンティティにはまだユーザー名がありません。「名前を探す」タブで購入または登録する名前を見つけてください。"; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "この残高では資金が不足しています: %@ DASH 必要、%@ DASH 利用可能。"; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/ko.lproj/Localizable.strings b/DashWallet/ko.lproj/Localizable.strings index 89189b1c6f..500f25be7f 100644 --- a/DashWallet/ko.lproj/Localizable.strings +++ b/DashWallet/ko.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "이 아이덴티티에는 아직 사용자 이름이 없습니다. ‘이름 찾기’ 탭에서 구매하거나 등록할 이름을 찾아보세요."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "이 잔액으로는 자금이 부족합니다: %@ DASH 필요, %@ DASH 사용 가능."; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/mk.lproj/Localizable.strings b/DashWallet/mk.lproj/Localizable.strings index 9ad20516fb..2599ef486e 100644 --- a/DashWallet/mk.lproj/Localizable.strings +++ b/DashWallet/mk.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "На овој идентитет сè уште нема кориснички имиња. Најдете некое за купување или регистрација во картичката „Најди имиња“."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Нема доволно средства на ова салдо: потребни се %@ DASH, достапни се %@ DASH."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/ms.lproj/Localizable.strings b/DashWallet/ms.lproj/Localizable.strings index bb195e349f..327b382c86 100644 --- a/DashWallet/ms.lproj/Localizable.strings +++ b/DashWallet/ms.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Belum ada nama pengguna pada identiti ini. Cari satu untuk dibeli atau didaftarkan dalam tab “Cari Nama”."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Dana tidak mencukupi dalam baki ini: %@ DASH diperlukan, %@ DASH tersedia."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/nb.lproj/Localizable.strings b/DashWallet/nb.lproj/Localizable.strings index 32157461d9..a68303af04 100644 --- a/DashWallet/nb.lproj/Localizable.strings +++ b/DashWallet/nb.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Ingen brukernavn på denne identiteten ennå. Finn ett å kjøpe eller registrere under fanen «Finn navn»."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Ikke nok midler på denne saldoen: %@ DASH kreves, %@ DASH tilgjengelig."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/nl.lproj/Localizable.strings b/DashWallet/nl.lproj/Localizable.strings index f67e23ac5d..ce8d6cb7b0 100644 --- a/DashWallet/nl.lproj/Localizable.strings +++ b/DashWallet/nl.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Nog geen gebruikersnamen op deze identiteit. Zoek er een om te kopen of te registreren op het tabblad ‘Namen zoeken’."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Onvoldoende saldo hier: %@ DASH nodig, %@ DASH beschikbaar."; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/pl.lproj/Localizable.strings b/DashWallet/pl.lproj/Localizable.strings index b786daf5e3..5265c4aa9a 100644 --- a/DashWallet/pl.lproj/Localizable.strings +++ b/DashWallet/pl.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Ta tożsamość nie ma jeszcze żadnych nazw użytkownika. Znajdź nazwę do kupienia lub zarejestrowania w zakładce „Znajdź nazwy”."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Za mało środków na tym saldzie: potrzeba %@ DASH, dostępne %@ DASH."; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/pt.lproj/Localizable.strings b/DashWallet/pt.lproj/Localizable.strings index 1bb0e9363c..81ca30020a 100644 --- a/DashWallet/pt.lproj/Localizable.strings +++ b/DashWallet/pt.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Ainda não há nomes de usuário nesta identidade. Encontre um para comprar ou registrar na aba “Encontrar nomes”."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Fundos insuficientes neste saldo: são necessários %@ DASH, há %@ DASH disponíveis."; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/ro.lproj/Localizable.strings b/DashWallet/ro.lproj/Localizable.strings index 581450ee4c..6f95bdab4f 100644 --- a/DashWallet/ro.lproj/Localizable.strings +++ b/DashWallet/ro.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Această identitate nu are încă nume de utilizator. Găsește unul de cumpărat sau de înregistrat în fila „Caută nume”."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Fonduri insuficiente în acest sold: sunt necesari %@ DASH, disponibili %@ DASH."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/ru.lproj/Localizable.strings b/DashWallet/ru.lproj/Localizable.strings index ebbc655de9..64484a0b61 100644 --- a/DashWallet/ru.lproj/Localizable.strings +++ b/DashWallet/ru.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "На этом идентификаторе пока нет имён пользователя. Найдите имя для покупки или регистрации на вкладке «Найти имена»."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Недостаточно средств на этом балансе: нужно %@ DASH, доступно %@ DASH."; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/sk.lproj/Localizable.strings b/DashWallet/sk.lproj/Localizable.strings index 6043b5c79c..6c15dee608 100644 --- a/DashWallet/sk.lproj/Localizable.strings +++ b/DashWallet/sk.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Na tejto identite zatiaľ nie sú žiadne používateľské mená. Nájdite si nejaké na kúpu alebo registráciu na karte „Nájsť mená“."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Na tomto zostatku nie je dosť prostriedkov: potrebných %@ DASH, dostupných %@ DASH."; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/sl.lproj/Localizable.strings b/DashWallet/sl.lproj/Localizable.strings index cb503c14d7..dbfc273f7b 100644 --- a/DashWallet/sl.lproj/Localizable.strings +++ b/DashWallet/sl.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Na tej identiteti še ni uporabniških imen. Poiščite ime za nakup ali registracijo na zavihku „Poišči imena“."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Na tem stanju ni dovolj sredstev: potrebnih %@ DASH, na voljo %@ DASH."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/sl_SI.lproj/Localizable.strings b/DashWallet/sl_SI.lproj/Localizable.strings index 7d1d7acb20..db46a645c4 100644 --- a/DashWallet/sl_SI.lproj/Localizable.strings +++ b/DashWallet/sl_SI.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Na tej identiteti še ni uporabniških imen. Poiščite ime za nakup ali registracijo na zavihku „Poišči imena“."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Na tem stanju ni dovolj sredstev: potrebnih %@ DASH, na voljo %@ DASH."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/sq.lproj/Localizable.strings b/DashWallet/sq.lproj/Localizable.strings index a59eea07d7..dcef0b90bc 100644 --- a/DashWallet/sq.lproj/Localizable.strings +++ b/DashWallet/sq.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Ky identitet ende nuk ka emra përdoruesi. Gjej një për ta blerë ose regjistruar te skeda „Gjej emra“."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Fonde të pamjaftueshme në këtë balancë: duhen %@ DASH, në dispozicion %@ DASH."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/sr.lproj/Localizable.strings b/DashWallet/sr.lproj/Localizable.strings index 6e557b9c42..bc7d9cd38a 100644 --- a/DashWallet/sr.lproj/Localizable.strings +++ b/DashWallet/sr.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Na ovom identitetu još nema korisničkih imena. Pronađite neko za kupovinu ili registraciju na kartici „Pronađi imena“."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Nema dovoljno sredstava na ovom stanju: potrebno %@ DASH, dostupno %@ DASH."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/sv.lproj/Localizable.strings b/DashWallet/sv.lproj/Localizable.strings index 2e05aacf04..4dc58fc661 100644 --- a/DashWallet/sv.lproj/Localizable.strings +++ b/DashWallet/sv.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Inga användarnamn på den här identiteten ännu. Hitta ett att köpa eller registrera under fliken ”Hitta namn”."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Otillräckliga medel på det här saldot: %@ DASH krävs, %@ DASH tillgängligt."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/th.lproj/Localizable.strings b/DashWallet/th.lproj/Localizable.strings index cce7770a8e..fb0bb674b0 100644 --- a/DashWallet/th.lproj/Localizable.strings +++ b/DashWallet/th.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "ตัวตนนี้ยังไม่มีชื่อผู้ใช้ หาชื่อเพื่อซื้อหรือลงทะเบียนได้ในแท็บ “ค้นหาชื่อ”"; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "ยอดคงเหลือนี้ไม่พอ: ต้องใช้ %@ DASH มีอยู่ %@ DASH"; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/tr.lproj/Localizable.strings b/DashWallet/tr.lproj/Localizable.strings index 1e35111cb5..863bef9a2f 100644 --- a/DashWallet/tr.lproj/Localizable.strings +++ b/DashWallet/tr.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Bu kimlikte henüz kullanıcı adı yok. “Ad Bul” sekmesinden satın alacak veya kaydedecek bir ad bulun."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Bu bakiyede yeterli tutar yok: %@ DASH gerekli, %@ DASH mevcut."; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/uk.lproj/Localizable.strings b/DashWallet/uk.lproj/Localizable.strings index f7ed3f1070..09e70a44b2 100644 --- a/DashWallet/uk.lproj/Localizable.strings +++ b/DashWallet/uk.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "На цьому ідентифікаторі поки немає імен користувача. Знайдіть ім'я для купівлі чи реєстрації на вкладці «Знайти імена»."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Недостатньо коштів на цьому балансі: потрібно %@ DASH, доступно %@ DASH."; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/vi.lproj/Localizable.strings b/DashWallet/vi.lproj/Localizable.strings index 3ecd978713..f91edf3ac2 100644 --- a/DashWallet/vi.lproj/Localizable.strings +++ b/DashWallet/vi.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "Danh tính này chưa có tên người dùng nào. Hãy tìm một tên để mua hoặc đăng ký trong tab “Tìm tên”."; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "Số dư này không đủ: cần %@ DASH, hiện có %@ DASH."; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/zh-Hans.lproj/Localizable.strings b/DashWallet/zh-Hans.lproj/Localizable.strings index ddf10c127c..676354642d 100644 --- a/DashWallet/zh-Hans.lproj/Localizable.strings +++ b/DashWallet/zh-Hans.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "该身份尚无用户名。请在“查找名称”标签页中找一个购买或注册。"; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "该余额资金不足:需要 %@ DASH,可用 %@ DASH。"; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/zh-Hant-TW.lproj/Localizable.strings b/DashWallet/zh-Hant-TW.lproj/Localizable.strings index 68eed18cef..62c3bbd2e8 100644 --- a/DashWallet/zh-Hant-TW.lproj/Localizable.strings +++ b/DashWallet/zh-Hant-TW.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "該身分尚無用戶名稱。請在「尋找名稱」分頁中找一個購買或註冊。"; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "該餘額資金不足:需要 %@ DASH,可用 %@ DASH。"; @@ -6604,6 +6606,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/zh.lproj/Localizable.strings b/DashWallet/zh.lproj/Localizable.strings index c1a51b6020..dfe6bb37be 100644 --- a/DashWallet/zh.lproj/Localizable.strings +++ b/DashWallet/zh.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "该身份尚无用户名。请在“查找名称”标签页中找一个购买或注册。"; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "该余额资金不足:需要 %@ DASH,可用 %@ DASH。"; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWallet/zh_TW.lproj/Localizable.strings b/DashWallet/zh_TW.lproj/Localizable.strings index d73d189f13..9eacb90a04 100644 --- a/DashWallet/zh_TW.lproj/Localizable.strings +++ b/DashWallet/zh_TW.lproj/Localizable.strings @@ -2367,6 +2367,8 @@ /* Username marketplace: empty owned list */ "No usernames on this identity yet. Find one to buy or register on the Find Names tab." = "該身分尚無用戶名稱。請在「尋找名稱」分頁中找一個購買或註冊。"; +"Not all of your mixed coins are confirmed yet. Please try again in a few minutes." = "Not all of your mixed coins are confirmed yet. Please try again in a few minutes."; + /* Identity top-up sheet — insufficient funding source */ "Not enough funds in this balance: %@ DASH needed, %@ DASH available." = "該餘額資金不足:需要 %@ DASH,可用 %@ DASH。"; @@ -6602,6 +6604,11 @@ "Sign in to %@ again?" = "Sign in to %@ again?"; "Sole Requester" = "Sole Requester"; "Some of your CoinJoin funds were moved. Please try again to move the rest." = "Some of your CoinJoin funds were moved. Please try again to move the rest."; +"Preparing your coins" = "Preparing your coins"; +"Some of your mixed coins were prepared. Please try again to move them to your Shielded balance." = "Some of your mixed coins were prepared. Please try again to move them to your Shielded balance."; +"We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through." = "We couldn't confirm all of your CoinJoin funds reached the network. Don't move them again — the wallet keeps trying while it's open, and your balance will update as soon as they go through."; +"Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes." = "Your mixed coins are being prepared for the Shielded balance. Please try again in a few minutes."; +"Your mixed coins are locked for the Shielded balance. Please try again to finish moving them." = "Your mixed coins are locked for the Shielded balance. Please try again to finish moving them."; "Some votes already cast" = "Some votes already cast"; "Special Purpose Account" = "Special Purpose Account"; "Start Platform sync before clearing its local state" = "Start Platform sync before clearing its local state"; diff --git a/DashWalletTests/CoinJoinMoveDestinationPolicyTests.swift b/DashWalletTests/CoinJoinMoveDestinationPolicyTests.swift index cc3a90a5ef..3ea1d4dfbd 100644 --- a/DashWalletTests/CoinJoinMoveDestinationPolicyTests.swift +++ b/DashWalletTests/CoinJoinMoveDestinationPolicyTests.swift @@ -19,6 +19,7 @@ import XCTest @testable import dashpay +import SwiftDashSDK /// Pins the one policy that decides what all three "move mixed coins" surfaces /// offer — the post-sync popup and the durable Settings / Tools rows. The @@ -109,3 +110,272 @@ final class CoinJoinMoveDestinationPolicyTests: XCTestCase { XCTAssertNil(CoinJoinMoveDestinationPolicy.menuRoute(isChainSynced: false, shieldedAvailable: true)) } } + +/// Pins the CoinJoin → Shielded input planning (ticket 32500): an asset lock +/// may spend at most 100 inputs, and its shield transition with an InstantSend +/// proof outgrows Platform's 20 480-byte limit from about 65, so an account +/// above 50 is consolidated onto one of its own addresses first, and the drain +/// waits for final inputs. +final class CoinJoinShieldPlannerTests: XCTestCase { + + // MARK: utxoReadIsUsable + + func testNoAccountsAtAllIsAFailedRead() { + XCTAssertFalse(CoinJoinShieldPlanner.utxoReadIsUsable(accountCount: 0, coinJoinBalanceIsZero: nil, utxoCount: 0)) + } + + func testWalletWithoutACoinJoinAccountReadsAsEmpty() { + XCTAssertTrue(CoinJoinShieldPlanner.utxoReadIsUsable(accountCount: 3, coinJoinBalanceIsZero: nil, utxoCount: 0)) + } + + func testNoUtxosBehindANonZeroBalanceIsAFailedRead() { + XCTAssertFalse(CoinJoinShieldPlanner.utxoReadIsUsable(accountCount: 3, coinJoinBalanceIsZero: false, utxoCount: 0)) + } + + func testEmptyAccountWithZeroBalanceIsUsable() { + XCTAssertTrue(CoinJoinShieldPlanner.utxoReadIsUsable(accountCount: 3, coinJoinBalanceIsZero: true, utxoCount: 0)) + } + + func testUtxosBehindABalanceAreUsable() { + XCTAssertTrue(CoinJoinShieldPlanner.utxoReadIsUsable(accountCount: 3, coinJoinBalanceIsZero: false, utxoCount: 104)) + } + + // MARK: nextStep + + func testEmptyAccountHasNothingToMove() { + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 0, finalCount: 0), .nothingToMove) + } + + func testThresholdIsBelowBothLimits() { + XCTAssertEqual(CoinJoinShieldPlanner.maxAssetLockInputs, 100) + XCTAssertEqual(CoinJoinShieldPlanner.consolidationThreshold, 50) + // Below ~65 inputs, where an IS-proof transition passes 20 480 bytes. + XCTAssertLessThan(CoinJoinShieldPlanner.consolidationThreshold, 65) + } + + func testAtTheThresholdDrainsDirectly() { + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 50, finalCount: 50), .drain) + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 1, finalCount: 1), .drain) + } + + func testJustOverTheThresholdConsolidates() { + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 51, finalCount: 51), .consolidate) + } + + /// 65–100 coins: Core would accept the asset lock, but its shield + /// transition with an InstantSend proof is too large for Platform. + func testCoreAcceptableButTransitionTooLargeConsolidates() { + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 65, finalCount: 65), .consolidate) + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 100, finalCount: 100), .consolidate) + } + + /// The ticket's wallet: 104 mixed coins, one over-cap drain refused by + /// Core as `assetlocktx-too-many-inputs`. + func testOverTheCapConsolidates() { + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 101, finalCount: 101), .consolidate) + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 104, finalCount: 104), .consolidate) + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 2_000, finalCount: 2_000), .consolidate) + // More than one round: 51 outputs, consolidated again next time. + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 25_100, finalCount: 25_100), .consolidate) + } + + /// The consolidation spends final UTXOs only; it runs around up to 49 + /// pending ones, which plus one output fit under the threshold. + func testOverTheThresholdConsolidatesAroundFewPendingCoins() { + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 104, finalCount: 55), .consolidate) + // The smallest round: 2 final inputs into 1 output, 49 + 1 = 50. + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 51, finalCount: 2), .consolidate) + // 600 final make 2 outputs, 49 + 2 = 51: the next attempt's round is + // the smallest one above. + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 649, finalCount: 600), .consolidate) + // A single pending coin does not block a multi-round consolidation. + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 25_001, finalCount: 25_000), .consolidate) + } + + /// The outpoint set the consolidation hands the sweep holds only final + /// rows, and the sweep's filter keeps exactly those. + func testSweepInputsKeepOnlyTheFinalOutpoints() { + typealias Sender = SwiftDashSDKTransactionSender + let final = Sender.CoinJoinUtxoState.Entry(txid: Data([0xaa]), vout: 0, valueDuffs: 1_000, isFinal: true) + let pending = Sender.CoinJoinUtxoState.Entry(txid: Data([0xaa]), vout: 1, valueDuffs: 1_000, isFinal: false) + let state = Sender.CoinJoinUtxoState( + binding: Sender.CoinJoinWalletBinding(walletId: Data([1]), network: .testnet), + entries: [final, pending]) + let late = Sender.CoinJoinOutpoint(txid: Data([0xbb]), vout: 0) + let rows = [final.outpoint, pending.outpoint, late] + + XCTAssertEqual(Sender.sweepInputs(rows, restrictedTo: state.finalOutpoints) { $0 }, [final.outpoint]) + XCTAssertEqual(Sender.sweepInputs(rows, restrictedTo: nil) { $0 }, rows) + } + + func testOverTheThresholdWithTooManyPendingCoinsIsBlocked() { + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 104, finalCount: 54), .blockedByPending(pending: 50)) + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 2_000, finalCount: 0), .blockedByPending(pending: 2_000)) + XCTAssertTrue(CoinJoinShieldPlanner.Step.blockedByPending(pending: 50).isBlockedByPending) + XCTAssertFalse(CoinJoinShieldPlanner.Step.awaitFinality(pending: 50).isBlockedByPending) + } + + /// After a consolidation the output is not final until InstantSend locks + /// it; draining then would lock nothing (or only the final remainder). + func testUnderTheCapWithPendingCoinsWaits() { + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 1, finalCount: 0), .awaitFinality(pending: 1)) + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 3, finalCount: 1), .awaitFinality(pending: 2)) + } + + func testFinalCountAboveCountIsClamped() { + XCTAssertEqual(CoinJoinShieldPlanner.nextStep(utxoCount: 2, finalCount: 5), .drain) + } + + // MARK: isFinal + + func testMinedUtxoIsFinal() { + XCTAssertTrue(CoinJoinShieldPlanner.isFinal(height: 2_556_386, txid: Data([1]), instantLockedTxids: [])) + } + + func testInstantLockedUtxoIsFinal() { + XCTAssertTrue(CoinJoinShieldPlanner.isFinal(height: 0, txid: Data([1]), instantLockedTxids: [Data([1])])) + } + + func testMempoolUtxoIsNotFinal() { + XCTAssertFalse(CoinJoinShieldPlanner.isFinal(height: 0, txid: Data([1]), instantLockedTxids: [Data([2])])) + } + + // MARK: consolidationSettled + + func testConsolidationSettledNeedsAFinalOutputPerTransaction() { + let a = Data([0xaa]), b = Data([0xbb]), other = Data([0xcc]) + XCTAssertFalse(CoinJoinShieldPlanner.consolidationSettled( + consolidationTxids: [a, b], + utxos: [(a, true), (other, true)])) + XCTAssertFalse(CoinJoinShieldPlanner.consolidationSettled( + consolidationTxids: [a, b], + utxos: [(a, true), (b, false)])) + XCTAssertTrue(CoinJoinShieldPlanner.consolidationSettled( + consolidationTxids: [a, b], + utxos: [(a, true), (b, true), (other, false)])) + } + + func testNoConsolidationIsTriviallySettled() { + XCTAssertTrue(CoinJoinShieldPlanner.consolidationSettled(consolidationTxids: [], utxos: [])) + } + + // MARK: Chunk planning (the consolidation reuses the sweep's chunking) + + private func chunkSizes(_ n: Int) -> [Int] { + SwiftDashSDKTransactionSender.balancedChunks( + Array(0.. NSError? { + WalletSendService.coinJoinSweepFailure( + acceptedCount: accepted, failedChunkCount: failed, unknownChunkCount: unknown) + } + + private func isPartial(_ error: NSError?) -> Bool { + guard let error else { return false } + return WalletSendService.isCoinJoinSweepRetryable(error) + && WalletSendService.coinJoinSweepUserMessage(for: error) + == WalletSendService.coinJoinSweepUserMessage(for: failure(accepted: 1, failed: 1, unknown: 0)!) + } + + func testNoFailedChunkIsNoFailure() { + XCTAssertNil(failure(accepted: 3, failed: 0, unknown: 0)) + } + + /// Everything that failed may still land: not offered again. + func testEveryFailureUnknownIsBroadcastUnknown() throws { + for error in [failure(accepted: 0, failed: 2, unknown: 2), failure(accepted: 1, failed: 1, unknown: 1)] { + let error = try XCTUnwrap(error) + XCTAssertTrue(WalletSendService.isBroadcastUnknownError(error)) + XCTAssertFalse(WalletSendService.isCoinJoinSweepRetryable(error)) + XCTAssertEqual(WalletSendService.coinJoinSweepUserMessage(for: error), error.localizedDescription) + } + } + + /// A plainly rejected chunk left coins to sweep again. + func testRejectedNextToMovedIsPartial() throws { + XCTAssertTrue(isPartial(failure(accepted: 1, failed: 2, unknown: 1))) + XCTAssertTrue(isPartial(failure(accepted: 0, failed: 2, unknown: 1))) + XCTAssertFalse(WalletSendService.isBroadcastUnknownError(try XCTUnwrap(failure(accepted: 0, failed: 2, unknown: 1)))) + } + + /// The diagnostic keeps the SDK's reason and drops the txid. + func testDiagnosticCarriesTheReasonWithoutTheTxid() throws { + let txid = String(repeating: "ab", count: 32) + let reason = WalletSendService.sweepChunkFailureReason( + SwiftDashSDKTransactionSender.SendError.transactionStatusUnknown(txid: txid, reason: "no peer echo")) + XCTAssertEqual(reason, "unknown: no peer echo") + let error = try XCTUnwrap(WalletSendService.coinJoinSweepFailure( + acceptedCount: 0, failedChunkCount: 1, unknownChunkCount: 1, reason: reason)) + let diagnostic = try XCTUnwrap(error.userInfo[WalletSendService.diagnosticKey] as? String) + XCTAssertTrue(diagnostic.contains("unknown: no peer echo")) + XCTAssertFalse(diagnostic.contains(txid)) + XCTAssertFalse(error.localizedDescription.contains("no peer echo")) + } + + /// Nothing left the wallet: the chunk's own error is reported. + func testNothingMovedIsLeftToTheCaller() { + XCTAssertNil(failure(accepted: 0, failed: 2, unknown: 0)) + } +}