Skip to content

feat(dex): rename swapkit to Dash DEX and improve - #1493

Merged
HashEngineering merged 49 commits into
feat/dash-dexfrom
feat/dash-dex-swapkit
Jun 29, 2026
Merged

HashEngineering merged 49 commits into
feat/dash-dexfrom
feat/dash-dex-swapkit

Conversation

@HashEngineering

@HashEngineering HashEngineering commented Jun 16, 2026 •

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

Related PR's and Dependencies

Screenshots / Videos

How Has This Been Tested?

  • QA (Mobile Team)

Checklist:

  • I have performed a self-review of my own code and added comments where necessary
  • I have added or updated relevant unit/integration/functional/e2e tests

Summary by CodeRabbit

  • New Features

    • Added a refreshed coin selection screen with search, clearer network labels, halted coin badges, and better loading/empty/offline states.
    • Added a new search field component and clearer coin icon fallbacks.
    • Improved convert and preview flows with route/network display and progress handling.
  • Bug Fixes

    • Improved coin icon lookup and address validation for more supported assets.
    • Added safer handling for long swap memos and clearer route/provider behavior.
    • Updated buy/sell availability so unsupported services are hidden.

@HashEngineering HashEngineering self-assigned this Jun 16, 2026
@coderabbitai

coderabbitai Bot commented Jun 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Introduces NEAR as a second swap route provider alongside Maya in the Dash Wallet. SwapKitApiAggregator classifies assets as Maya-only, NEAR-only, or dual-provider via token-list intersection, resolves preferred routes asynchronously with TTL caching, persists snapshots for cold-start, and routes transaction building to either MayaBlockchainApi (OP_RETURN) or SendPaymentService (plain deposit). The coin-picker fragment migrates from XML/RecyclerView to a Compose screen backed by refactored MayaViewModel state. New CoinSelect and SearchField design-system components are added, along with feature flags gating Maya/SwapKit cards and integration reference documentation.

Changes

Maya/NEAR Swap Routing and Coin Picker

Layer / File(s) Summary
Core data contracts
integrations/maya/.../api/RouteProvider.kt, integrations/maya/.../api/SwapProvider.kt, integrations/maya/.../model/PoolInfo.kt, integrations/maya/.../model/SwapTradeResponse.kt, integrations/maya/.../swapkit/SwapKitConstants.kt, integrations/maya/.../utils/MayaConfig.kt, integrations/maya/.../utils/SwapBackend.kt, integrations/maya/.../di/MayaModule.kt
Introduces RouteProvider enum (MAYA/NEAR), adds mayaOnly/nearOnly/mayaHalted flags to PoolInfo, extends SwapProvider with a preferredRouteProviders: StateFlow property, adds NEAR/MAYACHAIN provider-name constants and reduces default slippage to 2%, resets routeName default to "", and registers the SWAPKIT_POOL_SNAPSHOT preference key.
SwapKitApiAggregator: classification, routing, persistence, execution
integrations/maya/.../swapkit/SwapKitApiAggregator.kt, integrations/maya/.../swapkit/SwapKitAuth*.kt, integrations/maya/.../swapkit/SwapKitWebApi.kt, integrations/maya/.../swapkit/SwapKitEndpoint.kt, integrations/maya/.../swapkit/model/SwapKitModels.kt
Injects MayaWebApi, MayaConfig, and SendPaymentService; classifies assets as Maya-only or NEAR-only via token-list intersection with TTL caching; stamps each PoolInfo via markMayaInfo; resolves preferred routes asynchronously and emits incremental updates through preferredRouteProviders; persists/hydrates SwapKitSnapshot; changes sourceAddress to currentReceiveAddress; routes commit to blockchainApi.buildAndSendSwapTx for Maya or a new memo-free buildAndSendDepositTx for NEAR; adds expectedOutputAmount to SwapTradeUIModel.
DispatchingSwapProvider async init + MayaBlockchainApi memo guard
integrations/maya/.../api/DispatchingSwapProvider.kt, integrations/maya/.../api/MayaBlockchainApi.kt, integrations/maya/.../api/MayaApi.kt
DispatchingSwapProvider replaces blocking runBlocking backend init with a coroutine and delegates preferredRouteProviders to the active backend. MayaBlockchainApi adds an 80-byte MAX_OP_RETURN_BYTES preflight guard returning ResponseResource.Failure on oversize memos, and broadens exception handling from InsufficientMoneyException to all Exceptions.
MayaViewModel: dual-provider picker state
integrations/maya/.../ui/MayaViewModel.kt
Introduces CoinPickerItem and CurrencyPickerUIState data classes, injects NetworkStateInt, replaces the previous picker state flow with a combine of pool list, inbound addresses, search query, preferred route providers, and connectivity, computing per-coin halt/enable/price/route labels. Adds getRouteLabelResId helper and updates hasHaltedCoins to include pool-level mayaHalted flags.
Compose coin-picker screen and fragment migration
integrations/maya/.../ui/MayaCryptoCurrencyPickerFragment.kt, integrations/maya/.../ui/MayaCryptoCurrencyPickerScreen.kt, integrations/maya/src/main/res/navigation/nav_maya.xml, integrations/maya/src/main/res/layout/fragment_currency_picker.xml
Removes the XML/RecyclerView layout and migrates MayaCryptoCurrencyPickerFragment to a ComposeView host rendering MayaCryptoCurrencyPickerScreen. The screen implements lazy coin list with in-composition search filtering, loading/empty/offline states, dismissible toasts, CoinSelectState mapping per row, cascading icon URL loading, and mayaHalted defense in onCoinSelected.
CoinSelect, SearchField components and getCoinIconUrls
common/.../ui/components/CoinSelect.kt, common/.../ui/components/SearchField.kt, common/.../util/GenericUtils.kt, common/src/main/res/values/strings.xml, integrations/maya/src/main/res/drawable/ic_coin_placeholder.xml, integrations/maya/build.gradle
Adds CoinSelect composable (Active/HaltedChain/Disabled states, saturation-0 desaturation, halted badge, placeholder icon), SearchField composable with clear/cancel/IME support, getCoinIconUrls returning ordered SwapKit+CoinCap+jsupa URL candidates, button_clear string, ic_coin_placeholder drawable, and coil-compose dependency.
Swap convert and preview UI improvements
integrations/maya/.../ui/MayaConvertCryptoFragment.kt, integrations/maya/.../ui/MayaConvertCryptoViewModel.kt, integrations/maya/.../ui/MayaConversionPreviewFragment.kt, integrations/maya/.../ui/MayaAddressInputViewModel.kt, integrations/maya/.../ui/convert_currency/ConvertViewFragment.kt, integrations/maya/src/main/res/layout/*, integrations/maya/src/main/res/values/strings-maya.xml
MayaConvertCryptoFragment adds loading-state propagation to setProcessing, network label tied to entered amount, and asset-aware coin icon loading. MayaConversionPreviewFragment adds prettyRouteName, immediate UI update on new order, debug-gated route diagnostics, and network row display. ConvertViewFragment gates keypad/max/continue on isProcessing. Layouts add network info row, continue progress bar, and using_network label. Strings update service name to "Dash DEX", rename fee label, and add route/toast/empty-state strings.
Feature flags and MayaCryptoCurrency fixes
wallet/.../Constants.java, wallet/.../data/BuyAndSellDashServicesModel.kt, wallet/.../ui/buy_sell/BuyAndSellScreen.kt, integrations/maya/.../payments/MayaCryptoCurrency.kt
Adds SUPPORTS_MAYA_NATIVE=false and SUPPORTS_SWAPKIT=true constants, removes the MAYA entry from the buy/sell services list, gates Buy/Sell screen cards on those flags, corrects MayaStarknetCryptoCurrency's example address, and fixes the WIF Solana token code to $WIF.
Address parser and currency list tests
common/.../payments/parsers/AddressParserTest.kt, integrations/maya/.../payments/MayaCryptoCurrencyTest.kt, integrations/maya/.../payments/parsers/AddressParserTest.kt
Extends Bitcoin address test with bech32m coverage; adds MayaCryptoCurrencyTest verifying every MayaCurrencyList entry's exampleAddress/addressParser consistency and asset resolvability; adds AddressParserTest covering TRON, TON, Cardano, NEAR, Solana, Starknet, SUI, XRP, and Zcash parsers.
Integration reference documentation
integrations/maya/NEAR_INTENTS_PROTOCOL.md, integrations/maya/MAYA_LIQUIDITY_PROVIDERS.md, integrations/maya/SWAPKIT_PROTOCOL.md
Adds NEAR Intents 1Click API doc (quote→deposit→track flow, token list, status polling, offline detection); adds Maya LP feasibility doc (single-sided DASH LP memo formats, reuse analysis, APY via Midgard, gaps/open questions); extends SwapKit protocol doc with verified Maya-only asset detection method.

Sequence Diagram(s)

sequenceDiagram
  participant Fragment as MayaCryptoCurrencyPickerFragment
  participant Screen as MayaCryptoCurrencyPickerScreen
  participant VM as MayaViewModel
  participant Aggregator as SwapKitApiAggregator
  participant SwapKitWebApi
  participant MayaWebApi

  Aggregator->>SwapKitWebApi: GET /tokens (NEAR provider)
  Aggregator->>SwapKitWebApi: GET /tokens (MAYA provider)
  Aggregator->>MayaWebApi: getInboundAddresses()
  Aggregator->>Aggregator: markMayaInfo → stamp mayaOnly/nearOnly/mayaHalted
  Aggregator->>Aggregator: resolvePreferredRouteProviders (async, TTL-gated)
  Aggregator-->>VM: preferredRouteProviders StateFlow update
  VM->>VM: combine(poolList, inboundAddresses, searchQuery, preferredRouteProviders, networkState)
  VM-->>Screen: CurrencyPickerUIState (coins, isLoading, isOnline)
  Screen->>Screen: filter by searchQuery, map CoinSelectState
  Screen-->>Fragment: onCoinClick(asset)
  Fragment->>VM: poolList lookup + mayaHalted check
  Fragment->>Fragment: navigate to swap
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Suggested reviewers

  • abaranouski

Poem

🐇 Two roads through the crypto maze,
Maya's memo or NEAR's clear ways.
The picker now sings in Compose delight,
Each coin row desaturates just right.
Snapshot cached for the cold-start hare —
Swap smarter, little wallet, with flair! 🚀

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 26.32% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main theme of the PR by renaming SwapKit to Dash DEX and broadly capturing related improvements.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/dash-dex-swapkit

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@HashEngineering

Copy link
Copy Markdown
Collaborator Author

@coderabbitai - review please

@coderabbitai

coderabbitai Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

@HashEngineering I'll review the changes now.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 14

🧹 Nitpick comments (7)
integrations/maya/NEAR_INTENTS_PROTOCOL.md (1)

82-87: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add language specifier to fenced code block.

The blockchain enum list lacks a language tag.

- ```
+ ```text
  near, eth, base, arb, btc, sol, ton, dash, doge, xrp, zec, gnosis, bera,
  bsc, pol, tron, sui, op, avax, cardano, ltc, xlayer, monad, bch, adi,
  plasma, scroll, starknet, aleo
- ```
+ ```
🤖 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/NEAR_INTENTS_PROTOCOL.md` around lines 82 - 87, Add the
missing language specifier to the fenced code block in the NEAR intents protocol
markdown so the blockchain enum list is rendered as a text block; update the
fence around the enum list to use a text tag, keeping the existing content
unchanged.
integrations/maya/MAYA_LIQUIDITY_PROVIDERS.md (2)

209-215: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add language specifier to fenced code block.

The sample data block lacks a language tag. Use text or yaml for consistent formatting.

- ```
+ ```text
  annualPercentageRate / poolAPY : 0.1581   (~15.8%, default/all-time window)
    same with ?period=30d        : 0.0797   (~8.0%, trailing 30 days)
  earningsAnnualAsPercentOfDepth : 0.147    (~14.7%)
  saversAPR                      : 0
- ```
+ ```
🤖 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/MAYA_LIQUIDITY_PROVIDERS.md` around lines 209 - 215, The
fenced sample block in MAYA_LIQUIDITY_PROVIDERS.md is missing a language
specifier, so update the markdown fence around the example data to use a
consistent tag such as text or yaml. Locate the sample block containing
annualPercentageRate / poolAPY and keep the content unchanged while only
adjusting the opening code fence in that section.

54-56: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add language specifier to fenced code block.

The formula block lacks a language tag. For consistency with the rest of the document and to satisfy markdownlint, specify text or math.

- ```
+ ```text
  LUVI = sqrt(AssetDepth × CacaoDepth) / PoolUnits
- ```
+ ```
🤖 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/MAYA_LIQUIDITY_PROVIDERS.md` around lines 54 - 56, The
fenced formula block in MAYA_LIQUIDITY_PROVIDERS.md is missing a language
specifier, so update the Markdown fence for the LUVI formula to use a consistent
tag such as text or math. Locate the standalone code block containing the LUVI
expression and adjust only the opening fence so it remains a valid fenced block
while satisfying markdownlint and matching the rest of the document’s style.
integrations/maya/SWAPKIT_PROTOCOL.md (2)

486-490: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add language specifier to fenced code block.

The verified coin list lacks a language tag.

- ```
+ ```text
  MAYA.CACAO, MAYA.MAYA, THOR.RUNE,
  ETH.MOCA, ETH.WSTETH,
  ARB.GLD, ARB.LEO, ARB.USDT, ARB.WBTC, ARB.WSTETH, ARB.YUM
- ```
+ ```
🤖 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/SWAPKIT_PROTOCOL.md` around lines 486 - 490, Add the
missing language specifier to the fenced code block in SWAPKIT_PROTOCOL.md by
updating the verified coin list fence to use the same markdown block with a text
tag; locate the fenced list near the MAYA.CACAO/ETH.MOCA/ARB.YUM entries and
change the opening fence so the block is explicitly marked as text while leaving
the list contents unchanged.

476-478: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Add language specifier to fenced code block.

The set formula lacks a language tag.

- ```
+ ```text
  maya_only  =  reachable  AND  (id ∈ MAYA list)  AND  (id ∉ NEAR list)
- ```
+ ```
🤖 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/SWAPKIT_PROTOCOL.md` around lines 476 - 478, The fenced
formula block in SWAPKIT_PROTOCOL.md is missing a language tag, so update the
markdown fence around the maya_only set expression to use a text specifier. Keep
the content unchanged and ensure the code fence is explicitly labeled in the
section containing the maya_only formula.
integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaViewModel.kt (2)

144-150: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Fold hasHaltedCoins into the picker UIState.

hasHaltedCoins is a new separate StateFlow derived from inboundAddresses + poolList — both already feed currencyPickerUIState. Computing it as a field of CurrencyPickerUIState keeps the picker on a single state object (and the screen reads it from uiState instead of collecting a second flow).

As per coding guidelines: "ViewModels should use a single UIState data class rather than multiple separate flows".

🤖 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/MayaViewModel.kt`
around lines 144 - 150, Move the hasHaltedCoins derivation into
CurrencyPickerUIState and expose it through the existing uiState stream instead
of as a separate StateFlow on MayaViewModel. Update the combine logic that
builds currencyPickerUIState to compute the halted flag from inboundAddresses
and poolList, then have the picker screen read that value from uiState rather
than collecting a second flow. Keep the change centered around MayaViewModel,
currencyPickerUIState, and CurrencyPickerUIState.

Source: Coding guidelines


165-256: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

_searchQuery triggers a full coin-list rebuild on every keystroke.

coins does not depend on query, yet _searchQuery is a source of this combine, so each keystroke re-runs the entire filter → map (formatFiat + getCoinIconUrls per coin) → sort pipeline and emits a fresh CurrencyPickerUIState. Build the coin list from the non-query sources and combine with _searchQuery separately.

♻️ Proposed restructure
     val currencyPickerUIState: StateFlow<CurrencyPickerUIState> =
         combine(
             poolList,
             inboundAddresses,
-            _searchQuery,
             swapProvider.preferredRouteProviders,
             networkState.isConnected
-        ) { pools, addresses, query, preferredRoutes, isOnline ->
+        ) { pools, addresses, preferredRoutes, isOnline ->
             val coins = if (!isOnline) {
                 emptyList()
             } else {
                 // ... unchanged coin-building pipeline ...
             }
-            CurrencyPickerUIState(
-                coins = coins,
-                searchQuery = query,
-                isLoading = pools.isEmpty() && isOnline,
-                isOnline = isOnline
-            )
-        }.stateIn(viewModelScope, SharingStarted.Eagerly, CurrencyPickerUIState())
+            Triple(coins, pools.isEmpty() && isOnline, isOnline)
+        }.combine(_searchQuery) { (coins, isLoading, isOnline), query ->
+            CurrencyPickerUIState(coins, query, isLoading, isOnline)
+        }.stateIn(viewModelScope, SharingStarted.Eagerly, CurrencyPickerUIState())
🤖 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/MayaViewModel.kt`
around lines 165 - 256, `currencyPickerUIState` is rebuilding the entire coin
pipeline on every `_searchQuery` change even though `query` is only needed in
the final state. Refactor `MayaViewModel` so the expensive `pools -> coins`
filter/map/sort logic is derived from `poolList`, `inboundAddresses`,
`swapProvider.preferredRouteProviders`, and `networkState.isConnected` only,
then combine that precomputed coin list with `_searchQuery` afterward when
creating `CurrencyPickerUIState`. Keep the search text in the state, but avoid
rerunning `formatFiat`, `getCoinIconUrls`, and sorting on each keystroke.
🤖 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/util/GenericUtils.kt`:
- Around line 135-136: getCoinIcon() is collapsing the fallback chain by
returning only the first URL, which prevents downstream callers from ever using
the later CoinCap/jsupa candidates when the primary bucket misses. Update
getCoinIcon in GenericUtils so it preserves and exposes the ordered list of icon
URLs from getCoinIconUrls instead of reducing it to a single string, and then
adjust any callers like MayaConversionPreviewFragment to consume the fallback
sequence appropriately.

In `@integrations/maya/NEAR_INTENTS_PROTOCOL.md`:
- Line 1: The document heading has a stray leading character before the main
title, so update the opening heading in NEAR_INTENTS_PROTOCOL.md to remove the
extra prefix and leave the heading marker as the first character on the line.
This is a simple documentation cleanup in the top-level title only; adjust the
heading text itself so it starts cleanly and remains a valid Markdown H1.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/api/DispatchingSwapProvider.kt`:
- Around line 67-80: The startup path in DispatchingSwapProvider still defaults
to MAYA before the persisted backend is loaded, so early callers can bind to the
wrong swap implementation. Update the initialization and backend selection logic
in DispatchingSwapProvider (including activeBackend, persistScope.launch, and
the effective()/flow delegation path around effectiveBackend/currentBackend) so
the persisted SWAPKIT choice is resolved before any exposed Flow/StateFlow is
created or returned, preventing callers from ever seeing Maya when SwapKit was
previously selected.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/MayaCryptoCurrency.kt`:
- Line 468: The STRK example address in MayaCryptoCurrency is using the token
contract instead of a Starknet account address, which makes the default swap
quote destination incorrect. Update the exampleAddress value used by
MayaWebApi.getDefaultSwapQuote() for the STRK.STRK path to a sample Starknet
account/wallet address, keeping it clearly distinct from the mainnet STRK
contract address. Use the existing exampleAddress constant in MayaCryptoCurrency
to locate and replace the value.
- Around line 1122-1125: The $WIF token rename is only partially applied: the
constructor for SolanaPaymentIntentParser still uses the old shortAsset value,
creating conflicting identifiers for the same asset. Update the shortAsset
argument in MayaCryptoCurrency so it matches the new $WIF identifier used
alongside symbol/assetId, keeping the values consistent within the same
constructor call.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/swapkit/SwapKitApiAggregator.kt`:
- Around line 419-425: The cold-start fallback in
SwapKitApiAggregator.markMayaInfo is publishing optimistic tradable flags when
token or halt data is missing, which can make MayaViewModel treat unknown pools
as selectable. Update the classification flow to preserve the previous
snapshot-backed state or emit an explicit unknown/disabled state instead of
setting mayaOnly=false, nearOnly=false, and mayaHalted=false when mayaIds or
nearIds are empty. Apply the same behavior in the related classification paths
around the other affected branches so the cache never advertises tradability
until real /tokens and /inbound_addresses data is available.
- Around line 318-323: The provider detection in the route selection logic is
using route.providers, which can contain multiple providers and misclassify
mixed routes. Update the logic in the provider-mapping helper that returns
RouteProvider (near the bestRoute() lookup) to read the per-leg provider field
instead of aggregating route.providers, or explicitly reject routes with mixed
providers before choosing MAYA or NEAR. Keep the change localized to the
route/provider selection path so the correct builder is chosen.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConversionPreviewFragment.kt`:
- Around line 214-220: The route preview is incorrectly defaulting unknown or
blank routes to the MAYA label in prettyRouteName(), which can misrepresent an
unresolved provider. Update MayaConversionPreviewFragment.prettyRouteName() so
null/blank or otherwise unknown route names return no label instead of
getString(R.string.maya_route_label_maya), and adjust the UI binding that uses
this value to hide the network row when no known route is available, matching
the enter-amount screen behavior.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConvertCryptoFragment.kt`:
- Around line 130-134: The `showLoading` observer in `MayaConvertCryptoFragment`
is replaying into `fragment.setProcessing(...)` before `ConvertViewFragment` has
a ready view, which can dereference its binding too early after rotation. Change
the wiring so processing updates are delivered only after the child view exists,
ideally by observing with the child’s `viewLifecycleOwner` or by buffering the
loading state inside `ConvertViewFragment` before calling `setProcessing`. Keep
the fix centered on `showLoading` and `setProcessing` so the child fragment is
never touched before its view is created.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaCryptoCurrencyPickerScreen.kt`:
- Around line 152-215: The empty-state logic in MayaCryptoCurrencyPickerScreen
should check the rendered list source, not the full dataset, because the current
items.isEmpty() branch misses search-filtered empty results and falls through to
an empty LazyColumn. Update the when branch in this screen to use
displayItems.isEmpty() so the no-results state appears whenever filtering
removes all visible coins. If searchQuery is non-empty, consider routing this
branch to a dedicated “no results” message instead of the generic
maya_no_available_coins text.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaViewModel.kt`:
- Around line 89-97: The KDoc on CurrencyPickerUIState.isOnline currently
describes offline rendering of a cached, disabled coin list, but
currencyPickerUIState in MayaViewModel does not do that and returns an empty
list when offline. Update the comment to match the actual behavior in
CurrencyPickerUIState so it describes the empty-state/offline graphic path
instead of implying cached rows are shown disabled.

In
`@integrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/MayaCryptoCurrencyTest.kt`:
- Around line 45-58: The test in MayaCryptoCurrencyTest
everyExampleAddressIsFoundByItsOwnAddressParser is too weak because it only
checks that addressParser.findAll() returns something. Update the assertion to
verify the returned match actually equals currency.exampleAddress (not just any
non-empty substring) so the test catches overbroad parser regexes and accidental
matches from the wrapper text.
- Around line 67-78: The test in
MayaCryptoCurrencyTest.everyAssetResolvesViaLookup only checks that each asset
can be looked up, so it will miss duplicate asset keys that get collapsed by
MayaCurrencyList’s underlying associateBy behavior. Update this test to
explicitly verify asset uniqueness for MayaCurrencyList.all by asserting there
are no duplicate asset values, and keep the existing lookup coverage only if
needed for reachability. Use the existing MayaCurrencyList and
everyAssetResolvesViaLookup symbols to locate the test.

In
`@integrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/AddressParserTest.kt`:
- Around line 43-51: The AddressParserTest checks only parser.findAll(...).size,
so regressions that return the wrong substrings can still pass. Update the
affected assertions in AddressParserTest to verify the actual matched contents
from parser.findAll(...) against the expected fixture addresses, using the
parser and the existing test cases listed in the comment, so the tests fail if
the extracted values change incorrectly.

---

Nitpick comments:
In `@integrations/maya/MAYA_LIQUIDITY_PROVIDERS.md`:
- Around line 209-215: The fenced sample block in MAYA_LIQUIDITY_PROVIDERS.md is
missing a language specifier, so update the markdown fence around the example
data to use a consistent tag such as text or yaml. Locate the sample block
containing annualPercentageRate / poolAPY and keep the content unchanged while
only adjusting the opening code fence in that section.
- Around line 54-56: The fenced formula block in MAYA_LIQUIDITY_PROVIDERS.md is
missing a language specifier, so update the Markdown fence for the LUVI formula
to use a consistent tag such as text or math. Locate the standalone code block
containing the LUVI expression and adjust only the opening fence so it remains a
valid fenced block while satisfying markdownlint and matching the rest of the
document’s style.

In `@integrations/maya/NEAR_INTENTS_PROTOCOL.md`:
- Around line 82-87: Add the missing language specifier to the fenced code block
in the NEAR intents protocol markdown so the blockchain enum list is rendered as
a text block; update the fence around the enum list to use a text tag, keeping
the existing content unchanged.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaViewModel.kt`:
- Around line 144-150: Move the hasHaltedCoins derivation into
CurrencyPickerUIState and expose it through the existing uiState stream instead
of as a separate StateFlow on MayaViewModel. Update the combine logic that
builds currencyPickerUIState to compute the halted flag from inboundAddresses
and poolList, then have the picker screen read that value from uiState rather
than collecting a second flow. Keep the change centered around MayaViewModel,
currencyPickerUIState, and CurrencyPickerUIState.
- Around line 165-256: `currencyPickerUIState` is rebuilding the entire coin
pipeline on every `_searchQuery` change even though `query` is only needed in
the final state. Refactor `MayaViewModel` so the expensive `pools -> coins`
filter/map/sort logic is derived from `poolList`, `inboundAddresses`,
`swapProvider.preferredRouteProviders`, and `networkState.isConnected` only,
then combine that precomputed coin list with `_searchQuery` afterward when
creating `CurrencyPickerUIState`. Keep the search text in the state, but avoid
rerunning `formatFiat`, `getCoinIconUrls`, and sorting on each keystroke.

In `@integrations/maya/SWAPKIT_PROTOCOL.md`:
- Around line 486-490: Add the missing language specifier to the fenced code
block in SWAPKIT_PROTOCOL.md by updating the verified coin list fence to use the
same markdown block with a text tag; locate the fenced list near the
MAYA.CACAO/ETH.MOCA/ARB.YUM entries and change the opening fence so the block is
explicitly marked as text while leaving the list contents unchanged.
- Around line 476-478: The fenced formula block in SWAPKIT_PROTOCOL.md is
missing a language tag, so update the markdown fence around the maya_only set
expression to use a text specifier. Keep the content unchanged and ensure the
code fence is explicitly labeled in the section containing the maya_only
formula.
🪄 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

Run ID: eab6ed26-5128-4c35-a940-60d7cb0fe89f

📥 Commits

Reviewing files that changed from the base of the PR and between bb86dea and 2e75d5d.

📒 Files selected for processing (46)
  • common/src/main/java/org/dash/wallet/common/ui/components/CoinSelect.kt
  • common/src/main/java/org/dash/wallet/common/ui/components/SearchField.kt
  • common/src/main/java/org/dash/wallet/common/util/GenericUtils.kt
  • common/src/main/res/values/strings.xml
  • common/src/test/java/org/dash/wallet/common/payments/parsers/AddressParserTest.kt
  • integrations/maya/MAYA_LIQUIDITY_PROVIDERS.md
  • integrations/maya/NEAR_INTENTS_PROTOCOL.md
  • integrations/maya/SWAPKIT_PROTOCOL.md
  • integrations/maya/build.gradle
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/api/DispatchingSwapProvider.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/api/MayaApi.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/api/MayaBlockchainApi.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/api/RouteProvider.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/api/SwapProvider.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/di/MayaModule.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/model/PoolInfo.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/model/SwapTradeResponse.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/MayaCryptoCurrency.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/swapkit/SwapKitApiAggregator.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/swapkit/SwapKitAuthInterceptor.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/swapkit/SwapKitConstants.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/swapkit/SwapKitEndpoint.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/swapkit/SwapKitWebApi.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/swapkit/model/SwapKitModels.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaAddressInputViewModel.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConversionPreviewFragment.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConvertCryptoFragment.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConvertCryptoViewModel.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaCryptoCurrencyPickerFragment.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaCryptoCurrencyPickerScreen.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaViewModel.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/convert_currency/ConvertViewFragment.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/utils/MayaConfig.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/utils/SwapBackend.kt
  • integrations/maya/src/main/res/drawable/ic_coin_placeholder.xml
  • integrations/maya/src/main/res/layout/content_conversion_preview_maya.xml
  • integrations/maya/src/main/res/layout/fragment_convert_currency_view.xml
  • integrations/maya/src/main/res/layout/fragment_currency_picker.xml
  • integrations/maya/src/main/res/layout/fragment_maya_convert_crypto.xml
  • integrations/maya/src/main/res/navigation/nav_maya.xml
  • integrations/maya/src/main/res/values/strings-maya.xml
  • integrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/MayaCryptoCurrencyTest.kt
  • integrations/maya/src/test/java/org/dash/wallet/integrations/maya/payments/parsers/AddressParserTest.kt
  • wallet/src/de/schildbach/wallet/Constants.java
  • wallet/src/de/schildbach/wallet/data/BuyAndSellDashServicesModel.kt
  • wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellScreen.kt
💤 Files with no reviewable changes (2)
  • integrations/maya/src/main/res/layout/fragment_currency_picker.xml
  • wallet/src/de/schildbach/wallet/data/BuyAndSellDashServicesModel.kt

@HashEngineering
HashEngineering merged commit c1baf29 into feat/dash-dex Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants