Skip to content

fix: maya final polish - #1468

Merged
HashEngineering merged 53 commits into
feature-mayafrom
feat/maya-final-polish
Mar 26, 2026
Merged

HashEngineering merged 53 commits into
feature-mayafrom
feat/maya-final-polish

Conversation

@HashEngineering

@HashEngineering HashEngineering commented Mar 6, 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 support for new currencies (MAYA, ZEC, XRD) and additional token entries (LLD, MOCA, YUM, USDT) in Maya integration
    • Redesigned Maya portal and Buy & Sell screens rebuilt with Compose for improved navigation and visuals
    • Improved address/payment parsing for new networks and a new convert icon
  • Bug Fixes

    • Renamed "Convert" to "Swap" for clearer messaging
    • Updated menu subtitle styling for visual consistency
  • Documentation

    • Added agent guides for Maya currency updates and Figma-to-Compose migration

@HashEngineering HashEngineering self-assigned this Mar 6, 2026
@coderabbitai

coderabbitai Bot commented Mar 6, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 00b776eb-f4ea-4fc9-8d61-9cf0f6561a25

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds Maya integration currency support and parsers (XRD, ZEC, MAYA), Compose UI migrations for Maya portal and Buy & Sell screens, new Compose previews and resources, ViewModel stateflow refactors, documentation for an update-maya-currencies agent, and minor common UI typography tweaks and ProGuard rule change.

Changes

Cohort / File(s) Summary
Maya Agent docs
.claude/agents/update-maya-currencies.md
New agent documentation describing how to fetch Maya Midgard pools and synchronize MayaCurrencyList with live pools, including extraction, categorization, generation, insertion points, naming conventions, and validation checks.
Common UI components
common/src/main/java/org/dash/wallet/common/ui/components/MenuItem.kt, common/src/main/java/org/dash/wallet/common/ui/components/TopIntro.kt
MenuItem subtitle typography/color updated; new TopIntro overload added that accepts an icon and centers heading/text.
Maya build / ProGuard
integrations/maya/build.gradle, integrations/maya/proguard-rules.pro
Minor dependency formatting change and addition of Compose tooling preview dependency; ProGuard rule broadened to keep all constructors for Maya model classes.
Maya currency types & payment parsers
integrations/maya/src/main/java/.../MayaCryptoCurrency.kt, .../parsers/XrdPaymentIntentParser.kt, .../parsers/ZcashPaymentIntentParser.kt, .../parsers/ZcashAddressParser.kt
Adds new currency classes (MAYA token, ZEC, XRD), registers new token entries in MayaCurrencyList, deduplicates payment processor registration, adds getPaymentProcessorForAsset(...), and adds XRD/Zcash parsers and a Zcash address parser handling multiple address formats.
Maya UI Compose migration
integrations/maya/src/main/java/.../MayaPortalFragment.kt, integrations/maya/src/main/java/.../MayaPortalScreen.kt, integrations/maya/src/main/res/drawable/ic_maya_convert.xml, integrations/maya/src/main/res/navigation/nav_maya.xml, integrations/maya/src/main/res/values/strings-maya.xml
Replaces XML-backed fragment with Compose-based MayaPortalFragment using ComposeView; adds MayaPortalScreen composable, vector drawable ic_maya_convert, removes tools:layout from nav entry, and adds multiple Maya-specific string resources (codes/networks and portal subtitle).
Maya address/payment flow & fragments
integrations/maya/src/main/java/.../MayaAddressInputFragment.kt, .../MayaConvertCryptoFragment.kt, .../MayaCryptoCurrencyPickerFragment.kt, .../MayaViewModel.kt
Makes address/payment flows more defensive/asynchronous: resolves payment processor by asset when provided, refreshes inbound addresses asynchronously before building payment intents, replaces halt-check logic with per-chain inbound lookup, and exposes inboundAddresses as read-only StateFlow with new refreshInboundAddresses() suspend API.
Buy & Sell Compose migration
wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellIntegrationsFragment.kt, wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellScreen.kt
Migrates fragment to Compose ComposeView and introduces a full Compose BuyAndSellScreen with service cards (Uphold, Coinbase, Topper, Maya), connectivity/credential state handling, previews, and related composables.
Buy & Sell ViewModel refactor
wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellViewModel.kt
Introduces BuyAndSellUIState data class and consolidates multiple state properties into a single StateFlow<BuyAndSellUIState> (uiState), replacing previous individual state exposures and backing flows.
String resource change
wallet/res/values/strings.xml
Updates convert_no_account_needed text from "Convert Dash · No account needed" to "Swap Dash · No account needed".

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I nibble docs and parsers with delight,
New coins hop in, both ZEC and XRD bright,
Compose paints screens where XML used to be,
ViewModels hum with StateFlow harmony,
A rabbit's twitch — migrations done just right! 🥕✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.13% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'fix: maya final polish' is vague and does not clearly convey the main changes in the changeset, which include UI migrations to Compose, new cryptocurrency support, and documentation additions. Consider using a more descriptive title that specifies the primary change, such as 'feat: migrate Maya and Buy & Sell to Compose with new cryptocurrency support' or similar.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/maya-final-polish

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 and usage tips.

@HashEngineering

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

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: 8

🧹 Nitpick comments (2)
wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellIntegrationsFragment.kt (1)

55-57: launchWhenResumed is deprecated.

lifecycleScope.launchWhenResumed is deprecated. Consider using repeatOnLifecycle(Lifecycle.State.RESUMED) or moving the call to onResume() directly.

♻️ Suggested fix using repeatOnLifecycle
+import androidx.lifecycle.Lifecycle
+import androidx.lifecycle.repeatOnLifecycle
-        lifecycleScope.launchWhenResumed {
-            checkLiquidStatus()
-        }
+        lifecycleScope.launch {
+            viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.RESUMED) {
+                checkLiquidStatus()
+            }
+        }

Alternatively, since checkLiquidStatus() is a one-time check, you could simply call it in onResume().

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellIntegrationsFragment.kt`
around lines 55 - 57, In BuyAndSellIntegrationsFragment replace the deprecated
lifecycleScope.launchWhenResumed usage around checkLiquidStatus(): either (1)
wrap the call in lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.RESUMED) { checkLiquidStatus() } } to run when
RESUMED, or (2) if it’s truly a one-time per-resume check, move the call into
the fragment’s onResume() override and call checkLiquidStatus() there; update
imports to include repeatOnLifecycle/Lifecycle if using option (1) and remove
launchWhenResumed.
wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellScreen.kt (1)

254-262: Consider aligning fiatAmount visibility with dashAmount.

dashAmount is conditionally set only when serviceStatus is CONNECTED or DISCONNECTED, but fiatAmount (line 262) is unconditionally derived from localBalance. If localBalance could be stale or non-null for IDLE states, this might show unexpected data.

♻️ Suggested fix to align visibility
-    val fiatAmount = service.localBalance?.toFormattedString()
+    val fiatAmount = if (service.serviceStatus == ServiceStatus.CONNECTED ||
+        service.serviceStatus == ServiceStatus.DISCONNECTED
+    ) {
+        service.localBalance?.toFormattedString()
+    } else {
+        null
+    }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellScreen.kt` around lines
254 - 262, dashAmount is only set when service.serviceStatus is
ServiceStatus.CONNECTED or DISCONNECTED but fiatAmount is computed
unconditionally from service.localBalance, which can expose stale data; change
fiatAmount to use the same condition as dashAmount by computing it only when
service.serviceStatus == ServiceStatus.CONNECTED || service.serviceStatus ==
ServiceStatus.DISCONNECTED (e.g., wrap service.localBalance?.toFormattedString()
in the same conditional), referencing fiatAmount, dashAmount,
service.serviceStatus, ServiceStatus.CONNECTED, ServiceStatus.DISCONNECTED, and
service.localBalance so both values have identical visibility.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/agents/update-maya-currencies.md:
- Around line 81-89: The "Address format guide by chain" table needs surrounding
blank lines to satisfy markdownlint MD058; update the markdown in the section
containing the table titled "Address format guide by chain" by inserting a blank
line immediately before the table header line ("| Chain | Address format |
Parser class to use |") and a blank line immediately after the table block
(after the final table row or closing separator), ensuring there is one empty
line above and below the entire table.

In `@integrations/maya/build.gradle`:
- Line 75: Replace the hardcoded Compose and lifecycle versions by importing the
shared Compose BOM and using the root version variable: add
implementation(platform("androidx.compose:compose-bom:$composeBom")) in the
dependencies block (same pattern used in wallet/common/coinbase), then change
implementation 'androidx.compose.ui:ui-tooling-preview-android:1.10.4' to either
a version-less dependency resolved by the BOM (implementation
"androidx.compose.ui:ui-tooling-preview-android") or use the shared tooling var
(implementation
"androidx.compose.ui:ui-tooling-preview-android:$composeTooling"), and remove
the hardcoded version from implementation
'androidx.lifecycle:lifecycle-runtime-compose-android:2.10.0' so it is resolved
via the BOM (implementation
"androidx.lifecycle:lifecycle-runtime-compose-android") to ensure centralized
versioning.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/MayaCryptoCurrency.kt`:
- Around line 329-336: The second USDT registration using
MayaEthereumTokenCryptoCurrency ("USDT","Tether", ... ,
EthereumPaymentIntentParser(...)) overwrites the original Ethereum parser
because getPaymentProcessors() stores parsers by currency.name and
currency.code; update the registration so keys are unique (e.g., use
chain-qualified code/name like "USDT-ARB" or "Tether (Arbitrum)") or change the
registration logic to reject duplicates before adding another network variant;
ensure the EthereumPaymentIntentParser instances remain distinguishable
(reference EthereumPaymentIntentParser and MayaEthereumTokenCryptoCurrency) so
plain "USDT" lookups don't get replaced by the ARB.USDT entry.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/XrdPaymentIntentParser.kt`:
- Around line 49-58: The catch for AddressFormatException in the branch that
calls createPaymentIntent(input) is unreachable because createPaymentIntent
doesn't throw AddressFormatException; remove the try/catch that specifically
catches AddressFormatException (the block that logs via log.info and throws
PaymentIntentParserException) or replace it with a relevant exception type if
you intended to handle a different error; specifically update the code around
addressParser.exactMatch(...) that calls createPaymentIntent to either call it
directly or catch the correct exception, and remove the dead catch referencing
AddressFormatException, PaymentIntentParserException, and the log.info call for
that exception.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/ZcashPaymentIntentParser.kt`:
- Around line 45-55: The catch for AddressFormatException in
ZcashPaymentIntentParser is dead code because createPaymentIntent(input) does
not validate or throw that exception; remove the try/catch and directly return
createPaymentIntent(input) inside the addressParser.exactMatch branch. Update
the block that references addressParser.exactMatch(input) to call
MayaPaymentIntentParser.createPaymentIntent (or createPaymentIntent) directly
and delete the unreachable AddressFormatException handling and its
PaymentIntentParserException wrapping.
- Around line 29-31: ZcashPaymentIntentParser currently instantiates
addressParser with AddressParser.getBase58AddressParser(), which only supports
transparent t-addresses; update the parser to either (A) add
Bech32/Shielded/Unified support by replacing or augmenting addressParser with a
Bech32-based parser that recognizes Sapling (zs-), Orchard, and unified (u1-)
prefixes and the associated memo handling (ensure payment parsing code in
ZcashPaymentIntentParser handles shielded memo fields), or (B) make the
limitation explicit by updating ZcashPaymentIntentParser’s constructor/logging
and documentation to state it accepts transparent t-addresses only and reject
shielded/unified addresses with a clear error message; locate and modify the
AddressParser usage and any validation logic within ZcashPaymentIntentParser to
implement the chosen approach.

In `@integrations/maya/src/main/res/navigation/nav_maya.xml`:
- Line 10: The destination in nav_maya.xml uses a hardcoded
android:label="mayaPortalFragment" which is not localized; change the
android:label to a string resource reference (e.g.
android:label="@string/maya_portal_title") and add the corresponding entry to
your strings.xml (and other locale files as needed) using a user-facing title,
ensuring the resource name (maya_portal_title) matches the reference in
nav_maya.xml.

In `@wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellViewModel.kt`:
- Around line 84-88: Consolidate the multiple public state holders
(servicesList, isDeviceConnectedToInternet, isConnectedToInternet,
balanceFormat, isUpholdAuthenticated, isCoinbaseAuthenticated,
hasValidCredentials) into a single UIState data class and expose it from the
ViewModel via a private MutableStateFlow named _uiState and a public uiState
using asStateFlow(); populate UIState fields from existing sources (e.g., remove
the redundant .stateIn wrapper around networkState.isConnected and use its
StateFlow directly when building _uiState), compute derived values like
balanceFormat inside the UIState projection, and update all references/users of
the original properties to read from uiState instead. Ensure viewModelScope is
used only for any coroutine updates to _uiState and keep UIState as the single
source of truth.

---

Nitpick comments:
In
`@wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellIntegrationsFragment.kt`:
- Around line 55-57: In BuyAndSellIntegrationsFragment replace the deprecated
lifecycleScope.launchWhenResumed usage around checkLiquidStatus(): either (1)
wrap the call in lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.RESUMED) { checkLiquidStatus() } } to run when
RESUMED, or (2) if it’s truly a one-time per-resume check, move the call into
the fragment’s onResume() override and call checkLiquidStatus() there; update
imports to include repeatOnLifecycle/Lifecycle if using option (1) and remove
launchWhenResumed.

In `@wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellScreen.kt`:
- Around line 254-262: dashAmount is only set when service.serviceStatus is
ServiceStatus.CONNECTED or DISCONNECTED but fiatAmount is computed
unconditionally from service.localBalance, which can expose stale data; change
fiatAmount to use the same condition as dashAmount by computing it only when
service.serviceStatus == ServiceStatus.CONNECTED || service.serviceStatus ==
ServiceStatus.DISCONNECTED (e.g., wrap service.localBalance?.toFormattedString()
in the same conditional), referencing fiatAmount, dashAmount,
service.serviceStatus, ServiceStatus.CONNECTED, ServiceStatus.DISCONNECTED, and
service.localBalance so both values have identical visibility.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 24b11daa-f514-4530-8b6d-fd9552ea8a88

📥 Commits

Reviewing files that changed from the base of the PR and between 819559b and 2873d58.

📒 Files selected for processing (16)
  • .claude/agents/update-maya-currencies.md
  • common/src/main/java/org/dash/wallet/common/ui/components/MenuItem.kt
  • common/src/main/java/org/dash/wallet/common/ui/components/TopIntro.kt
  • integrations/maya/build.gradle
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/MayaCryptoCurrency.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/XrdPaymentIntentParser.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/ui/MayaPortalFragment.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaPortalScreen.kt
  • integrations/maya/src/main/res/drawable/ic_maya_convert.xml
  • integrations/maya/src/main/res/navigation/nav_maya.xml
  • integrations/maya/src/main/res/values/strings-maya.xml
  • wallet/res/values/strings.xml
  • wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellIntegrationsFragment.kt
  • wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellScreen.kt
  • wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellViewModel.kt

Comment thread integrations/maya/build.gradle Resolved
@HashEngineering

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review again please

@coderabbitai

coderabbitai Bot commented Mar 7, 2026

Copy link
Copy Markdown
Contributor

@HashEngineering Sure! Triggering a full review of the PR now.

✅ Actions performed

Full review triggered.

@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: 5

♻️ Duplicate comments (1)
integrations/maya/src/main/res/navigation/nav_maya.xml (1)

10-10: ⚠️ Potential issue | 🟡 Minor

Still using a hardcoded destination label.

android:label="mayaPortalFragment" is still internal, non-localized text and can leak into the app bar/title. Please switch it to a string resource.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@integrations/maya/src/main/res/navigation/nav_maya.xml` at line 10, Replace
the hardcoded android:label="mayaPortalFragment" in nav_maya.xml with a string
resource reference (e.g. android:label="@string/maya_portal_title") and add the
corresponding entry in your strings.xml (name it maya_portal_title with the
localized text), ensuring you update any other locales as needed; this prevents
leaking internal identifiers into the app bar/title and enables localization.
🧹 Nitpick comments (5)
.claude/agents/figma-to-compose.md (1)

37-39: Add language specifiers to fenced code blocks for consistency.

Several code blocks lack language specifiers (Lines 37, 165, 177, 260, 270, 293). While these are path/text blocks rather than executable code, adding text or plaintext improves documentation consistency and suppresses linter warnings.

📝 Example fix for line 37
-```
+```text
 common/src/main/java/org/dash/wallet/common/ui/components/
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/agents/figma-to-compose.md around lines 37 - 39, In
.claude/agents/figma-to-compose.md there are several fenced code blocks that
contain plain path/text (for example the block with
"common/src/main/java/org/dash/wallet/common/ui/components/"); update each of
those fences to include a language specifier such as text or plaintext (e.g.
change ``` to ```text) so the blocks are marked as non-code and satisfy the
linter; ensure you update all instances referenced in the review (the blocks at
the noted locations) consistently.
wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellScreen.kt (2)

121-121: Consider hoisting serviceOf lookup outside the composable.

The serviceOf helper is invoked multiple times during each recomposition. For a small list this is fine, but converting to a map once would be more efficient:

val serviceMap = remember(services) { services.associateBy { it.serviceType } }

Then use serviceMap[ServiceType.UPHOLD] etc.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellScreen.kt` at line 121,
The helper function serviceOf(type: ServiceType) does a linear find on services
every recomposition; hoist this by creating a memoized map once (use
remember(services) { services.associateBy { it.serviceType } }) and replace
repeated serviceOf(...) calls with lookups like serviceMap[ServiceType.UPHOLD];
remove or stop using serviceOf where replaced. Ensure you reference the existing
services collection and ServiceType enum so the new serviceMap keys match the
original logic.

274-274: Consider using a theme color instead of hardcoded hex.

The background color Color(0x1AB0B6BC) appears to be a semi-transparent gray. If this is a design system color, consider adding it to MyTheme.Colors for consistency.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellScreen.kt` at line 274,
Replace the hardcoded Color(0x1AB0B6BC) used in the BuyAndSellScreen background
modifier with a themed color: add a semantic color property (e.g., overlayGray
or semiTransparentSurface) to your theme object (MyTheme.Colors) and then use
MyTheme.colors.overlayGray in the Modifier.background call inside
BuyAndSellScreen to keep colors consistent and allow central control of opacity
and palette.
wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellIntegrationsFragment.kt (1)

55-57: launchWhenResumed is deprecated — prefer repeatOnLifecycle or Lifecycle.launchWhenResumed.

lifecycleScope.launchWhenResumed has been deprecated since Lifecycle 2.4.0 in favor of safer lifecycle-aware collection patterns.

♻️ Suggested refactor
-        lifecycleScope.launchWhenResumed {
-            checkLiquidStatus()
-        }
+        viewLifecycleOwner.lifecycleScope.launch {
+            viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.RESUMED) {
+                checkLiquidStatus()
+            }
+        }

Note: You'll need to import androidx.lifecycle.repeatOnLifecycle and androidx.lifecycle.Lifecycle.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellIntegrationsFragment.kt`
around lines 55 - 57, Replace the deprecated lifecycleScope.launchWhenResumed
usage in BuyAndSellIntegrationsFragment with the repeatOnLifecycle pattern:
start a lifecycleScope.launch and inside call
requireActivity().lifecycle.repeatOnLifecycle(Lifecycle.State.RESUMED) (or
viewLifecycleOwner.lifecycle.repeatOnLifecycle if appropriate) and invoke
checkLiquidStatus() within that block so the call is lifecycle-safe; ensure you
import androidx.lifecycle.repeatOnLifecycle and androidx.lifecycle.Lifecycle and
use the fragment's appropriate lifecycle owner to scope the coroutine.
integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/MayaCryptoCurrency.kt (1)

360-365: Deduplication silently drops duplicate currency codes — first entry wins.

The deduplication logic prevents the duplicate USDT/PEPE/ETH overwrite issue by using registeredCodes.add(currency.code.lowercase()), which returns false for duplicate codes. However, entries with duplicate codes are silently ignored. The first-registered entry wins (e.g., ETH.USDT over ARB.USDT).

If users need to select between chain variants (e.g., USDT on Ethereum vs Arbitrum), consider using chain-qualified codes or a different lookup strategy.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/MayaCryptoCurrency.kt`
around lines 360 - 365, The current deduplication uses
registeredCodes.add(currency.code.lowercase()) which silently drops later
currencies with the same code (so first occurrence wins, e.g., ETH.USDT blocks
ARB.USDT); change the strategy in the loop over all to preserve chain-qualified
uniqueness instead of simple lowercase code — for example derive a unique key
from currency.chain or currency.chainId plus currency.code (use
currency.chain/currency.chainId or a function to produce chainQualifiedCode) and
use that key when checking/adding to registeredCodes, then call
paymentProcessors.add with the original currency.name and currency.code (or
include chain info in display name) so chain variants are not lost; update any
lookup logic to expect chain-qualified keys rather than plain currency.code.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.claude/agents/update-maya-currencies.md:
- Line 40: The heading "#### EVM Tokens (ETH.* and ARB.*)" is parsed incorrectly
because the asterisks are treated as emphasis markers; update that heading to
escape the asterisks or wrap the patterns in backticks (e.g., use `ETH.*` and
`ARB.*` or escape as ETH.\* and ARB.\*) so the asterisks render literally and
MD037 no longer fails.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/ZcashAddressParser.kt`:
- Around line 29-45: The transparent-address matching currently uses
PATTERN_BITCOIN_ADDRESS via super which accepts generic Base58 BTC/DASH
addresses; add a Zcash-specific transparent regex (e.g.
PATTERN_ZCASH_TRANSPARENT matching Base58 addresses that start with "t1" or
"t3") and use that instead of the generic pattern: create a private
transparentParser = AddressParser(PATTERN_ZCASH_TRANSPARENT, null) (or replace
the superclass pattern) and then call transparentParser.exactMatch/inputText and
transparentParser.findAll(inputText) in ZcashAddressParser.exactMatch and
findAll, keeping saplingParser and unifiedParser as-is so only Zcash transparent
prefixes are accepted.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaConvertCryptoFragment.kt`:
- Around line 136-154: The coroutine in lifecycleScope.launch should guard
against failures from mayaViewModel.refreshInboundAddresses() and
Address.fromBase58(...) so transient errors don't crash the flow; wrap the
refreshInboundAddresses call in a try/catch and show an error dialog (same
AdaptiveDialog used below) and return on failure, and when locating dashInbound
validate its address by catching exceptions from Address.fromBase58 (or validate
format first) before calling viewModel.getUpdatedPaymentIntent — if parsing
fails show an error dialog and return; update references:
mayaViewModel.refreshInboundAddresses, mayaViewModel.inboundAddresses,
Address.fromBase58, and viewModel.getUpdatedPaymentIntent to implement these
defensive checks.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaViewModel.kt`:
- Around line 81-82: Remove the separate MutableStateFlow/List pair
(_inboundAddresses and inboundAddresses) and fold the inbound address list into
the existing MayaPortalUIState data class (add an inboundAddresses:
List<InboundAddress> property), update the ViewModel's uiState flow to carry
that list (emit updates to uiState when inbound addresses change instead of
emitting _inboundAddresses), and change hasHaltedCoins to be computed from
uiState (e.g. uiState.value.inboundAddresses) rather than from the removed
inboundAddresses flow; then replace all usages of
_inboundAddresses/inboundAddresses in the ViewModel and consumers to read/update
uiState.inboundAddresses (use uiState.update { it.copy(inboundAddresses = ...) }
in functions that mutate the list).
- Around line 162-169: The code currently sets the halted flag on whatever entry
is first in the list returned by mayaApi.getInboundAddresses(), which can
disable the wrong chain; instead update the specific inbound address entry by
matching a stable identifier (e.g., asset, chain, or symbol) rather than by list
position: fetch mayaApi.getInboundAddresses(), locate the intended entry by
comparing its asset/chain field (the property used by your app to identify
chains) and set halted = true on that matched item (or map the list transforming
only that item), then assign the resulting list back where inboundAddresses is
used; do this in the code around mayaApi.getInboundAddresses(), addresses, and
the copy(halted = true) usage so only the correct asset is modified.

---

Duplicate comments:
In `@integrations/maya/src/main/res/navigation/nav_maya.xml`:
- Line 10: Replace the hardcoded android:label="mayaPortalFragment" in
nav_maya.xml with a string resource reference (e.g.
android:label="@string/maya_portal_title") and add the corresponding entry in
your strings.xml (name it maya_portal_title with the localized text), ensuring
you update any other locales as needed; this prevents leaking internal
identifiers into the app bar/title and enables localization.

---

Nitpick comments:
In @.claude/agents/figma-to-compose.md:
- Around line 37-39: In .claude/agents/figma-to-compose.md there are several
fenced code blocks that contain plain path/text (for example the block with
"common/src/main/java/org/dash/wallet/common/ui/components/"); update each of
those fences to include a language specifier such as text or plaintext (e.g.
change ``` to ```text) so the blocks are marked as non-code and satisfy the
linter; ensure you update all instances referenced in the review (the blocks at
the noted locations) consistently.

In
`@integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/MayaCryptoCurrency.kt`:
- Around line 360-365: The current deduplication uses
registeredCodes.add(currency.code.lowercase()) which silently drops later
currencies with the same code (so first occurrence wins, e.g., ETH.USDT blocks
ARB.USDT); change the strategy in the loop over all to preserve chain-qualified
uniqueness instead of simple lowercase code — for example derive a unique key
from currency.chain or currency.chainId plus currency.code (use
currency.chain/currency.chainId or a function to produce chainQualifiedCode) and
use that key when checking/adding to registeredCodes, then call
paymentProcessors.add with the original currency.name and currency.code (or
include chain info in display name) so chain variants are not lost; update any
lookup logic to expect chain-qualified keys rather than plain currency.code.

In
`@wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellIntegrationsFragment.kt`:
- Around line 55-57: Replace the deprecated lifecycleScope.launchWhenResumed
usage in BuyAndSellIntegrationsFragment with the repeatOnLifecycle pattern:
start a lifecycleScope.launch and inside call
requireActivity().lifecycle.repeatOnLifecycle(Lifecycle.State.RESUMED) (or
viewLifecycleOwner.lifecycle.repeatOnLifecycle if appropriate) and invoke
checkLiquidStatus() within that block so the call is lifecycle-safe; ensure you
import androidx.lifecycle.repeatOnLifecycle and androidx.lifecycle.Lifecycle and
use the fragment's appropriate lifecycle owner to scope the coroutine.

In `@wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellScreen.kt`:
- Line 121: The helper function serviceOf(type: ServiceType) does a linear find
on services every recomposition; hoist this by creating a memoized map once (use
remember(services) { services.associateBy { it.serviceType } }) and replace
repeated serviceOf(...) calls with lookups like serviceMap[ServiceType.UPHOLD];
remove or stop using serviceOf where replaced. Ensure you reference the existing
services collection and ServiceType enum so the new serviceMap keys match the
original logic.
- Line 274: Replace the hardcoded Color(0x1AB0B6BC) used in the BuyAndSellScreen
background modifier with a themed color: add a semantic color property (e.g.,
overlayGray or semiTransparentSurface) to your theme object (MyTheme.Colors) and
then use MyTheme.colors.overlayGray in the Modifier.background call inside
BuyAndSellScreen to keep colors consistent and allow central control of opacity
and palette.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: af4c27de-9e1c-4c1f-b156-42779eec7194

📥 Commits

Reviewing files that changed from the base of the PR and between 6404281 and 819fef6.

📒 Files selected for processing (23)
  • .claude/agents/figma-to-compose.md
  • .claude/agents/update-maya-currencies.md
  • common/src/main/java/org/dash/wallet/common/ui/components/MenuItem.kt
  • common/src/main/java/org/dash/wallet/common/ui/components/TopIntro.kt
  • integrations/maya/build.gradle
  • integrations/maya/proguard-rules.pro
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/MayaCryptoCurrency.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/XrdPaymentIntentParser.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/payments/parsers/ZcashAddressParser.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/ui/MayaAddressInputFragment.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/MayaCryptoCurrencyPickerFragment.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaPortalFragment.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaPortalScreen.kt
  • integrations/maya/src/main/java/org/dash/wallet/integrations/maya/ui/MayaViewModel.kt
  • integrations/maya/src/main/res/drawable/ic_maya_convert.xml
  • integrations/maya/src/main/res/navigation/nav_maya.xml
  • integrations/maya/src/main/res/values/strings-maya.xml
  • wallet/res/values/strings.xml
  • wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellIntegrationsFragment.kt
  • wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellScreen.kt
  • wallet/src/de/schildbach/wallet/ui/buy_sell/BuyAndSellViewModel.kt

@HashEngineering HashEngineering changed the title Feat/maya final polish fix: maya final polish Mar 11, 2026

@andreika-baranouski andreika-baranouski 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.

approved

@HashEngineering
HashEngineering changed the base branch from feat/maya-halted-coins to feature-maya March 26, 2026 16:40
@HashEngineering
HashEngineering merged commit 20c7976 into feature-maya Mar 26, 2026
2 checks passed
@HashEngineering
HashEngineering deleted the feat/maya-final-polish branch March 27, 2026 03:05
@coderabbitai coderabbitai Bot mentioned this pull request Jun 2, 2026
1 of 3 tasks
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