Skip to content

Conversation

@kaladinlight
Copy link
Contributor

@kaladinlight kaladinlight commented Dec 5, 2025

Description

Support for zcash on mayachain

Issue (if applicable)

N/A

Risk

High Risk PRs Require 2 approvals

Low

What protocols, transaction types, wallets or contract interactions might be affected by this PR?

Testing

  • Ensure trading from zcash -> asset and asset -> zcash works on mayachain

Engineering

☝️

Operations

  • 🏁 My feature is behind a flag and doesn't require operations testing (yet)

☝️

Screenshots (if applicable)

Summary by CodeRabbit

  • New Features
    • Added support for Zcash (ZEC) asset mapping so ZEC assets and pools are recognized.
    • Enhanced swapper-specific inbound address selection and trading-status checks, improving how inbound addresses and trading availability are determined for Thorchain-related flows.

✏️ Tip: You can customize this high-level summary in your review settings.

@kaladinlight kaladinlight requested a review from a team as a code owner December 5, 2025 16:44
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 5, 2025

Important

Review skipped

Draft detected.

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.

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

📝 Walkthrough

Walkthrough

Adds swapper-specific inbound-address and trading-status handling across selectors and callers by introducing a SwapperName parameter (used as SwapperName.Thorchain) and branching logic; also adds ZEC chain mapping in the asset map utility. Multiple call sites updated to pass the new argument.

Changes

Cohort / File(s) Summary
Selector signatures & logic
src/react-queries/selectors/index.ts
selectInboundAddressData and selectIsTradingActive now accept swapperName: SwapperName, switch pool-id derivation by swapper (Thorchain vs Mayachain), and add swapper-specific trading-halt logic and error handling.
Callers — hooks & UI using inboundAddress selection
src/lib/utils/thorchain/hooks/useSendThorTx.tsx, src/pages/Lending/Pool/components/Repay/RepayConfirm.tsx, src/pages/Lending/Pool/components/Repay/RepayInput.tsx, src/pages/ThorChainLP/components/ReusableLpStatus/TransactionRow.tsx, src/pages/ThorChainLP/queries/hooks/usePools.ts, src/react-queries/hooks/useIsTradingActive.ts, src/state/apis/swapper/helpers/swapperApiHelpers.ts
Updated call sites to pass an additional swapperName argument (typically SwapperName.Thorchain) into selectInboundAddressData (and related selectors) to enable swapper-specific inbound-address selection and trading checks.
Asset mapping utility (ZEC)
scripts/generateTradableAssetMap/utils.ts
Adds ZEC support: imports zecChainId, adds Chain.ZEC enum value, and maps [Chain.ZEC]: zecChainId in chainToChainId.
Manifest / deps
package.json
Referenced in summaries — dependency surface updated implicitly due to imports (SwapperName) — callers updated accordingly.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Reason: changes touch selector core logic (signature + branching), many heterogeneous callers across hooks and UI, and a separate small asset-map addition.
  • Pay extra attention to:
    • selectInboundAddressData / selectIsTradingActive branching and error paths in src/react-queries/selectors/index.ts
    • All updated call sites to ensure correct SwapperName import and value (e.g., SwapperName.Thorchain)
    • Potential runtime impacts where callers previously relied on default behavior when swapperName was absent

Possibly related PRs

Suggested reviewers

  • 0xApotheosis
  • NeOMakinG
  • gomesalexandre

Poem

🐰 I hopped through code with nimble feet,
Passing swapper names where paths meet,
ZEC joined the map, a joyful bump,
Thorchain routes now know which jump,
Carrots, commits, and much delight 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: mayachain zcash support' directly and clearly describes the main change: adding Zcash support to MayaChain. It aligns with the PR's primary objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

Base automatically changed from zcash-support to develop December 5, 2025 17:07
@kaladinlight kaladinlight marked this pull request as draft December 5, 2025 17:23
@kaladinlight
Copy link
Contributor Author

Zebra has a bug surrounding op_return data outputs being flagged as invalid preventing us from broadcasting successfully: ZcashFoundation/zebra#10143. Checking if we have another upstream node version (non zebra), or we can potentially proxy to another public node in the meantime.

@kaladinlight kaladinlight linked an issue Dec 5, 2025 that may be closed by this pull request
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.

Zcash on Mayachain

3 participants