Skip to content

Add n.exchange DeFi swap plugin (nexchangedefi)#447

Open
MMrj9 wants to merge 1 commit intoEdgeApp:masterfrom
onitsoft:feature/nexchange-defi-swap-plugin
Open

Add n.exchange DeFi swap plugin (nexchangedefi)#447
MMrj9 wants to merge 1 commit intoEdgeApp:masterfrom
onitsoft:feature/nexchange-defi-swap-plugin

Conversation

@MMrj9
Copy link
Contributor

@MMrj9 MMrj9 commented Mar 26, 2026

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

Adds a second Edge swap plugin for n.exchange DeFi routing (NC-Bridge), alongside the existing centralized nexchange plugin.

  • Plugin id: nexchangedefi (isDex: true, display name n.exchange DeFi).
  • API: Same authenticated API v2 base as CeFi (/en/api/v2), with:
    • is_defi=true on the fixed-rate quote request (GET .../rate/?...).
    • is_defi: true on POST .../orders/ (per server-side V2 + DeFi order handling).
  • Implementation: Shared logic in makeNexchangePluginInner with explicit mode constants (NEXCHANGE_MODE_CEFI / NEXCHANGE_MODE_DEFI); thin barrel src/swap/defi/nexchangeDefi.ts re-exports the DeFi factory and metadata.
  • Tests: partnerJson coverage for nexchangedefi (same chain/token expectations as CeFi n.exchange).

Referral and API key behavior matches the existing n.exchange plugin; DeFi availability depends on n.exchange account/referral configuration for NC-Bridge pairs.

Register nexchangedefi with API v2 is_defi on rate and order requests;
share implementation with CeFi nexchange via mode constants. Update
partnerJson tests and CHANGELOG.

Made-with: Cursor
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.

1 participant