Repository navigation
fix: Dash DEX sell-swap fixes (MO-983, MO-984, MO-969) - #1519
Conversation
BIP-173 allows a bech32 string to be all-lowercase or all-uppercase (QR codes use upper for the denser alphanumeric mode), but the parser regexes were lowercase-only, so scanned all-caps addresses (BTC bc1..., kujira/maya/thor, Zcash shielded, Cardano Shelley, Radix) were considered invalid. - AddressParser: optional ignoreCase flag for the match regex - Bech32AddressParser: match case-insensitively and reject mixed case (needed for chains without params, which never reach a decoder) - CardanoAddressParser: case-insensitive Shelley alternative only; Byron Base58 stays case-sensitive - Intent parsers normalize matched bech32 addresses to their canonical lowercase form before building the swap memo (Base58 forms untouched) - Add all-caps and mixed-case vectors to both AddressParserTests, including the BIP-173 uppercase test vector Co-Authored-By: Claude Fable 5 <[email protected]>
Bech32PaymentIntentParser and EthereumPaymentIntentParser stripped only uriPrefix.length / currency.length characters from "scheme:address" inputs, leaving the ":" on the address that goes into the swap memo (e.g. "=:THOR.RUNE::thor1..."). Skip the colon too, and fix Ethereum's currency branch which matched startsWith(currency) without the colon. Bech32 URI payloads are also normalized to canonical lowercase when they are a valid bech32 match, same as bare scanned addresses. Adds Bech32PaymentIntentParserTest covering the memo built from bare, URI-prefixed, and all-uppercase inputs. Co-Authored-By: Claude Fable 5 <[email protected]>
…O-983) commitSwapTransaction refreshes the SwapKit route before broadcasting (routeIds expire after 60s), and on NEAR Intents routes the refreshed quote creates a new intent with a fresh one-time deposit address — the address the transaction actually pays. The success params, the stored SwapOrder and the marked address were still built from the pre-refresh preview model, so swap tracking and the NEAR Intents explorer link followed the abandoned first intent, which stays "Pending Deposit" forever. Persist the model returned by commitSwapTransaction instead, and log when the deposit address changed across the refresh. Co-Authored-By: Claude Fable 5 <[email protected]>
The buy flow converts the selected asset into DASH, but dex_enter_amount_title read "Convert Dash to %s". Now reads "Convert %s to Dash". Co-Authored-By: Claude Fable 5 <[email protected]>
A max ("empty wallet") sell sweeps the balance and bitcoinj deducts the
miner fee from the sweep's single output, so the deposit delivers
balance − fee. The SwapKit quote, however, was requested for the full
balance, and NEAR Intents refuses any deposit below the quoted amount
("Deposited amount is less than quoted amount"), auto-refunding it
about an hour later minus a 0.001 DASH refund fee — every max sell on
a NEAR Intents route was doomed. Maya vault routes execute on whatever
arrives and were unaffected.
Quote the post-fee sweep output instead, estimated with
estimateNetworkFee(emptyWallet = true) from the current balance so the
preview quote and the pre-broadcast refresh in commitSwapTransaction
stay idempotent (the refresh passes the already-reduced amount back
in). NEAR accepts deposits above the quoted amount, so a balance that
grows before broadcast stays safe; a balance that shrinks is caught by
a new guard in buildAndSendDepositTx that aborts with a recoverable
error instead of broadcasting a deposit that can only refund.
Co-Authored-By: Claude Fable 5 <[email protected]>
QR codes carry bech32 addresses uppercase (alphanumeric mode); the address fields now display and store the canonical lowercase form. - AddressParser.normalizeCase(): lowercases an all-uppercase input only when its lowercase form is a valid address, so case-significant forms (Base58, EIP-55, mixed case, URIs) pass through unchanged - Applied at the scan / paste / clipboard-row / source-row entry points of MayaAddressInputFragment and DEXRefundAddressFragment; typed input is untouched - Fix AddressInputResult.addressInputWithoutPrefix keeping the leading colon when stripping a URI scheme (same off-by-one as the intent parsers fixed earlier); it feeds the sell-flow quote request Co-Authored-By: Claude Fable 5 <[email protected]>
A Dash P2PKH address could be entered as the destination of a sell swap and only fail later with a generic "Conversion failed": several target chains validate with permissive lexical patterns that a Dash address also satisfies. Solana was the worst offender — its parser accepted any 32-44 char Base58 string, and a Dash address is 34 Base58 chars. Three layers: - SolanaAddressParser now requires the Base58 payload to decode to exactly 32 bytes (a raw ed25519 key), rejecting Base58Check addresses like Dash/Bitcoin (25-byte payload) in both exactMatch and findAll. - SolanaPaymentIntentParser validates the address in its URI-prefixed branch too — createPaymentIntent encodes whatever it is given, so "solana:<dash address>" previously bypassed validation entirely. - MayaAddressInputFragment.onContinue explicitly rejects any checksum-valid DASH address (on the wallet's network) as a sell destination before quoting, covering every target asset's parser at once — a Dash address is never a valid sell-swap destination. Co-Authored-By: Claude Fable 5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAddress parsing now supports controlled Bech32 case normalization and validation. Maya payment and address-input flows strip URI delimiters, canonicalize addresses, reject invalid Dash inputs, validate Solana addresses, and improve swap amount, committed-trade, and fragment lifecycle handling. ChangesAddress and swap consistency
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Wallet
participant SwapKitApiAggregator
participant SwapTradeUIModel
participant MayaConversionPreviewViewModel
Wallet->>SwapKitApiAggregator: provide balance and fee estimate
SwapKitApiAggregator->>SwapTradeUIModel: publish effective maximum-sell amount
MayaConversionPreviewViewModel->>SwapKitApiAggregator: commit trade
SwapKitApiAggregator->>MayaConversionPreviewViewModel: return committed trade
MayaConversionPreviewViewModel->>SwapTradeUIModel: persist committed trade fields
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
integrations/maya/src/main/java/org/dash/wallet/integrations/maya/swapkit/SwapKitApiAggregator.kt (1)
991-1018: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftMake the max-sell balance check atomic with broadcasting.
The sweep is estimated before
sendCoins(). A concurrent outgoing transaction can consume UTXOs after Line 992 but before the empty-wallet send, causing a smaller deposit thanamountdespite this check. Validate the minimum deliverable amount inside the send/input-selection critical section, or reserve the inputs across estimate and broadcast.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/swapkit/SwapKitApiAggregator.kt` around lines 991 - 1018, Make the maximum-sell validation in the swap deposit flow atomic with input selection and broadcasting: move the minimum-deliverable check from the pre-send sweep estimation into the critical section used by sendPaymentService.sendCoins, or reserve the selected inputs across both operations. Ensure concurrent outgoing transactions cannot reduce the empty-wallet deposit below amount, while preserving the existing failure response and logging.
🧹 Nitpick comments (1)
integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConversionPreviewViewModel.kt (1)
159-165: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftPublish committed-swap results through the single
uiState.This adds another independently updated success channel instead of representing loading, failure, and committed transaction details in one immutable
UIStateexposed asStateFlow. As per coding guidelines, “ViewModels should use a singleUIStatedata class rather than multiple separate flows” and use a private mutable_uiStatewith public immutableuiState.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConversionPreviewViewModel.kt` around lines 159 - 165, Replace the independently updated commitSwapTradeSuccessState flow in the committed-swap success path with the ViewModel’s single private mutable _uiState and public immutable uiState StateFlow. Extend the existing UIState to represent the committed transaction details while preserving its loading and failure states, and update it atomically when constructing SendTransactionToWalletParams.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@common/src/main/java/org/dash/wallet/common/payments/parsers/AddressParser.kt`:
- Line 24: Retain the ignoreCase setting in AddressParser and update
normalizeCase to lowercase only when the parser is case-insensitive; preserve
the original value for case-sensitive formats even if its lowercase form passes
exactMatch. Add regression tests in AddressParserTest covering uppercase Bech32
normalization and unchanged uppercase Base58 values.
In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/Bech32PaymentIntentParser.kt`:
- Around line 46-47: Validate every URI payload with the relevant
addressParser.exactMatch before canonicalizing or creating a payment intent:
update Bech32PaymentIntentParser.kt at lines 46-47 and 60-61, remove
pass-through normalization as validation at lines 102-103, and update
CardanoPaymentIntentParser.kt lines 54-57 and XrdPaymentIntentParser.kt lines
49-50 to validate and lowercase their Shelley and radix payloads respectively.
In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/ZcashPaymentIntentParser.kt`:
- Around line 52-55: Update ZcashPaymentIntentParser’s URI handling to pass the
stripped payload through the same validated address-normalization logic used by
the bare-input branch, preserving transparent t-address casing while lowercasing
shielded/unified addresses. Reuse the existing normalization helper or extract
one shared by both branches, and add coverage for uppercase URI payloads.
---
Outside diff comments:
In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/swapkit/SwapKitApiAggregator.kt`:
- Around line 991-1018: Make the maximum-sell validation in the swap deposit
flow atomic with input selection and broadcasting: move the minimum-deliverable
check from the pre-send sweep estimation into the critical section used by
sendPaymentService.sendCoins, or reserve the selected inputs across both
operations. Ensure concurrent outgoing transactions cannot reduce the
empty-wallet deposit below amount, while preserving the existing failure
response and logging.
---
Nitpick comments:
In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConversionPreviewViewModel.kt`:
- Around line 159-165: Replace the independently updated
commitSwapTradeSuccessState flow in the committed-swap success path with the
ViewModel’s single private mutable _uiState and public immutable uiState
StateFlow. Extend the existing UIState to represent the committed transaction
details while preserving its loading and failure states, and update it
atomically when constructing SendTransactionToWalletParams.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 3ef326bf-aeca-45dc-b474-5aeb4ab9b74e
📒 Files selected for processing (21)
common/src/main/java/org/dash/wallet/common/payments/parsers/AddressParser.ktcommon/src/main/java/org/dash/wallet/common/payments/parsers/Bech32AddressParser.ktcommon/src/main/java/org/dash/wallet/common/ui/address_input/AddressInputViewModel.ktcommon/src/test/java/org/dash/wallet/common/payments/parsers/AddressParserTest.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/Bech32PaymentIntentParser.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/CardanoAddressParser.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/CardanoPaymentIntentParser.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/EthereumPaymentIntentParser.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/SolanaAddressParser.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/SolanaPaymentIntentParser.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/XrdPaymentIntentParser.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/ZcashPaymentIntentParser.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/swapkit/SwapKitApiAggregator.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/DEXRefundAddressFragment.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/DEXRefundAddressViewModel.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaAddressInputFragment.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaAddressInputViewModel.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConversionPreviewViewModel.ktintegrations/maya/src/main/res/values/strings-maya.xmlintegrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/AddressParserTest.ktintegrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/Bech32PaymentIntentParserTest.kt
… to Home
When a completed sell swap pops the whole nav_maya graph back to the
wallet home, back-stack fragments are destroyed after the graph entry
is already gone. A restored instance whose view was never recreated
then resolves its navGraphViewModels lazy for the first time in
onDestroy and NavController.getBackStackEntry throws
IllegalArgumentException ("No destination with ID ... on the back
stack").
Capture the ViewModel in onCreateView (while the graph is guaranteed
present) and use that instance in onDestroy — the pattern
DEXEnterAmountFragment already uses. Fixes the crash in
MayaCryptoCurrencyPickerFragment and the same latent bug in
MayaConvertCryptoFragment.
Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConvertCryptoFragment.kt`:
- Line 114: The nav-graph ViewModel references are captured only in
onCreateView, so cleanup can be skipped when a restored fragment is destroyed
before view recreation. Update MayaConvertCryptoFragment and
MayaCryptoCurrencyPickerFragment to capture their ViewModels at an earlier
guaranteed lifecycle point or centralize reset logic, ensuring the convert state
and picker search query are always cleared when removed; apply the corresponding
changes at both cited files and sites.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 3a3625ab-d8d7-4884-9fcd-20bdb632a515
📒 Files selected for processing (2)
integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConvertCryptoFragment.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaCryptoCurrencyPickerFragment.kt
…rmat CodeRabbit review follow-ups on the DEX sell-swap fixes: - AddressParser.normalizeCase now only rewrites inputs the parser reports as case-insensitive (bech32). Case-sensitive Base58 forms validated by pattern only (Solana, Zcash t-addresses) could otherwise have an all-caps corrupt address "repaired" into a different, plausible-looking one instead of being rejected. Composite parsers (Bitcoin, Zcash, Cardano) report case-insensitivity per input form. - URI payloads (thor:/zcash:/cardano:/radix: etc.) now get the same exactMatch validation and lowercase canonicalization as bare addresses before reaching the swap memo; a valid scheme prefix no longer bypasses address validation, and an all-caps bech32 payload after the prefix is lowercased to canonical form. Co-Authored-By: Claude Fable 5 <[email protected]>
The graph-scoped ViewModel was cached in onCreateView, so a restored back-stack fragment destroyed before its view was recreated skipped the onDestroy cleanup (stale search query / entered amount on the next visit). Resolve the navGraphViewModels lazy directly in onDestroy under runCatching instead: it throws only when the whole flow was already popped to Home, where the graph scope - and the state to clear - is gone anyway. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConvertCryptoFragment.kt`:
- Around line 718-721: Update the cleanup in
MayaConvertCryptoFragment.onDestroy() to call convertViewModel.clear() only when
isRemoving is true. Preserve the existing runCatching protection for cases where
the navigation graph scope has already been removed, and leave
configuration-teardown state intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: aacb3528-3c2f-443c-831c-9db2359a9ac6
📒 Files selected for processing (17)
common/src/main/java/org/dash/wallet/common/payments/parsers/AddressParser.ktcommon/src/main/java/org/dash/wallet/common/payments/parsers/BitcoinAddressParser.ktcommon/src/test/java/org/dash/wallet/common/payments/parsers/AddressParserTest.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/Bech32PaymentIntentParser.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/CardanoAddressParser.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/CardanoPaymentIntentParser.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/XrdPaymentIntentParser.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/ZcashAddressParser.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/ZcashPaymentIntentParser.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/DEXEnterAmountFragment.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConvertCryptoFragment.ktintegrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaCryptoCurrencyPickerFragment.ktintegrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/AddressParserTest.ktintegrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/Bech32PaymentIntentParserTest.ktintegrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/CardanoPaymentIntentParserTest.ktintegrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/XrdPaymentIntentParserTest.ktintegrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/ZcashPaymentIntentParserTest.kt
🚧 Files skipped from review as they are similar to previous changes (6)
- integrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/Bech32PaymentIntentParserTest.kt
- integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/ZcashPaymentIntentParser.kt
- integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/CardanoAddressParser.kt
- common/src/main/java/org/dash/wallet/common/payments/parsers/AddressParser.kt
- integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/XrdPaymentIntentParser.kt
- common/src/test/java/org/dash/wallet/common/payments/parsers/AddressParserTest.kt
|
@coderabbitai review |
✅ Action performedReview finished.
|
MayaConvertCryptoFragment.onDestroy() called convertViewModel.clear() unconditionally, which also runs on a configuration change (isRemoving false) and erased the entered amounts plus the saved-state amount the recreated fragment was about to restore. Gate the cleanup on isRemoving, matching MayaCryptoCurrencyPickerFragment and DEXEnterAmountFragment, and keep the runCatching protection for the popped-to-Home case. Co-Authored-By: Claude Fable 5 <[email protected]>
Brings in dark mode support (#1480) and the Dash DEX sell-swap fixes (#1519). Conflicts (both in Tools, where DashConnect added its menu entry): - ToolsFragment: keep our onConnectionsClick wiring inside master's new DashWalletTheme wrapper. - ToolsScreen: keep the Connections MenuItem in the first Menu block, which master now closes before the username-gated Credits Menu. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…dk-master Brings in the Dash DEX master line (dashpay#1504, dashpay#1511, dashpay#1519 sell-swap fixes, about-me redesign) and re-expresses its dashj/bitcoinj-based additions on the branch's neutral (dashj-free) APIs: - SwapOrder/SwapOrderDao keyed by TxId instead of Sha256Hash - example-address generation (AddressGenerator, MayaCryptoCurrency) on a random SessionExampleKey + vendored Base58/SHA-256, no ECKey - foreign-chain parsers on vendored Base58/AddressFormatException - MayaBlockchainApi stays interface-only; master's CancellationException rethrow ported to the wallet-side impl - SwapKit aggregator: master's max-sell sweep quote + pre-broadcast re-check adapted to the neutral SendPaymentService/WalletDataProvider - ContactsFragment keeps the per-view ContactsIdentityGate; master's onDestroyView flag-reset workaround dropped as redundant Co-Authored-By: Claude Fable 5 <[email protected]>
Summary
A batch of Dash DEX (SwapKit / NEAR Intents) sell-swap fixes, driven by a field report of a DASH → SOL swap whose funds went to a "different address than intended" (MO-983). Investigating that report surfaced two more defects (MO-984, MO-969).
MO-983 — persist the committed swap route, not the stale preview quote
commitSwapTransactionrefreshes the SwapKit route before broadcasting (routeIds expire after 60s); on NEAR Intents routes the refreshed quote creates a new intent with a fresh one-time deposit address, which the transaction pays. The storedSwapOrder, the success-screen params and the marked address were still built from the pre-refresh preview model, so swap tracking and the in-app NEAR Intents explorer link followed the abandoned first intent — stuck on "Pending Deposit" forever even when the swap settled.commitSwapTradenow persists the model returned by the commit, and logs when the deposit address changed across the refresh.MO-984 — max sells always refunded on NEAR Intents routes
A max ("empty wallet") sell sweeps the balance and the miner fee comes out of the sweep's single output, so the deposit delivers
balance − fee— but the quote was requested for the full balance, and NEAR Intents refuses any deposit below the quoted amount, auto-refunding ~1h later minus a 0.001 DASH fee. Every max sell on a NEAR route was doomed.getSwapInfonow quotes the post-fee sweep output (viaestimateNetworkFee(emptyWallet = true), derived from the current balance so preview and the pre-broadcast refresh stay idempotent), andbuildAndSendDepositTxgains a pre-broadcast guard that aborts with a recoverable error if the balance dropped below the quoted amount. Maya vault routes execute on whatever arrives and are unchanged.MO-969 — Dash address accepted as sell destination → "Conversion failed"
Several target chains validate destinations with permissive lexical patterns that a Dash address also satisfies — Solana accepted any 32–44 char Base58 string, and a Dash address is 34 Base58 chars. Three layers:
SolanaAddressParsernow requires the Base58 payload to decode to a raw 32-byte ed25519 key (rejecting 25-byte Base58Check addresses inexactMatchandfindAll, including the clipboard row);SolanaPaymentIntentParservalidates the address in its URI-prefixed branch, which previously bypassed validation entirely; and the address-input continue gate explicitly rejects any checksum-valid DASH address as a sell destination, covering every target chain's parser at once.Also included: buy enter-amount title direction fix, all-caps bech32 scan handling and lowercase display, and the URI-prefix memo colon fix.
Test plan
:integrations:mayaunit tests pass;AddressParserTestextended with the field-report Dash addresses and a Bitcoin address as Solana-rejection regression casesa050e551…, refund63857302…) documented in the Jira tickets🤖 Generated with Claude Code
Summary by CodeRabbit