PHANTOM
🇮🇳 IN
Skip to content

feat(swap): add Cardano and Zcash support for Near Intents#161

Merged
onyb merged 2 commits intomasterfrom
f/swap/support-cardano-zcash
Jan 6, 2026
Merged

feat(swap): add Cardano and Zcash support for Near Intents#161
onyb merged 2 commits intomasterfrom
f/swap/support-cardano-zcash

Conversation

@onyb
Copy link
Member

@onyb onyb commented Jan 6, 2026

Add Cardano (ADA) and Zcash (ZEC) as source and destination assets in Near Intents swap provider. Includes transaction param models, transaction building logic, and comprehensive tests.

Add Cardano (ADA) and Zcash (ZEC) as source and destination assets
in Near Intents swap provider. Includes transaction param models,
transaction building logic, and comprehensive tests.
@onyb onyb requested a review from a team January 6, 2026 18:05
@onyb onyb self-assigned this Jan 6, 2026
Copilot AI review requested due to automatic review settings January 6, 2026 18:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for Cardano (ADA) and Zcash (ZEC) as source and destination assets in the Near Intents swap provider, expanding the supported UTXO-based blockchains beyond Bitcoin.

Key Changes:

  • Introduced UtxoChainTransactionParams base class to handle shared transaction parameters for UTXO-based chains (Bitcoin, Cardano, Zcash)
  • Added Cardano and Zcash transaction building logic following the same pattern as Bitcoin
  • Comprehensive test coverage for both new chains with proper validation of transaction parameters

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
app/api/swap/models.py Added UtxoChainTransactionParams base class and specific CardanoTransactionParams and ZcashTransactionParams classes; updated TransactionParams model to include cardano and zcash fields
app/api/swap/providers/near_intents/transformations.py Imported new transaction param models and added Cardano/Zcash handling in _build_transaction_params function; updated documentation to reflect new supported chains
app/api/swap/providers/near_intents/utils.py Added fee estimation handling for Cardano and Zcash UTXO chains (returns None, similar to Bitcoin)
app/api/swap/providers/near_intents/test_client.py Added comprehensive tests for Cardano and Zcash swap routes; refactored unsupported chain test to use Filecoin instead of Zcash
app/api/swap/providers/near_intents/mocks.py Added ADA_TOKEN_INFO and FIL_TOKEN_INFO mock data for testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +305 to 310
class UtxoChainTransactionParams(SwapBaseModel):
chain: ChainSpec
to: str
value: str
refund_to: str

Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

Consider adding a docstring to the UtxoChainTransactionParams base class to document that it serves as a shared parameter model for UTXO-based chains (Bitcoin, Cardano, Zcash) that all share the same transaction structure. This would improve code documentation and help future developers understand the design pattern.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@onyb onyb enabled auto-merge (squash) January 6, 2026 18:13
@onyb onyb merged commit a581590 into master Jan 6, 2026
5 checks passed
@onyb onyb deleted the f/swap/support-cardano-zcash branch January 6, 2026 18:40
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.

3 participants