-
Notifications
You must be signed in to change notification settings - Fork 43
Add n.exchange centralized swap integration #426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
0f22bf7 to
663b859
Compare
f895046 to
082583a
Compare
082583a to
1d42f05
Compare
Integrate n.exchange as a centralized swap provider supporting multiple networks and tokens. The implementation uses contract addresses for token identification, eliminating the need for currency code mapping. This approach provides better support for tokens and aligns with API requirements. The integration includes support for native currencies and ERC20 tokens across major networks including Ethereum, Polygon, Base, Arbitrum, Optimism, BSC, and others. The plugin handles rate queries, order creation, and payment processing through the n.exchange API v2. Additional changes include mapctl tooling for automatic provider mappings and updates to existing swap plugins to use the new mapping system.
1d42f05 to
1166816
Compare
| async fetchSwapQuote( | ||
| req: EdgeSwapRequest, | ||
| userSettings: Object | undefined, | ||
| opts: { promoCode?: string } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Promo code parameter silently ignored in swap
Medium Severity
The opts parameter containing promoCode is declared in fetchSwapQuote but is never used anywhere in the plugin. Other swap plugins like changenow and godex extract and pass this parameter to their respective APIs. In nexchange, if a user provides a promo code expecting a discount or special rate, it gets silently ignored. The promo code is not passed to getFixedQuote or included in the order body sent to the n.exchange API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
promoCode support can be added at some point
Add n.exchange centralized swap integration
Description
Integrate n.exchange as a centralized swap provider supporting multiple networks and tokens. The implementation uses contract addresses for token identification, eliminating the need for currency code mapping. This approach provides better support for tokens and aligns with API requirements.
The integration includes support for native currencies and ERC20 tokens across major networks including Ethereum, Polygon, Base, Arbitrum, Optimism, BSC, and others. The plugin handles rate queries, order creation, and payment processing through the n.exchange API v2.
Additional changes include mapctl tooling for automatic provider mappings and updates to existing swap plugins to use the new mapping system.
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Changes
Testing
Checklist
Note
Adds a new centralized swap provider with contract address-based token support and API v2 rate/order flows.
swap/central/nexchange.tsplugin (pluginId: nexchange) using contract-address formatting, mainnet code transcription, min/max checks, and fixed-rate order creationnexchangeinsrc/index.tstest/partnerJson/nexchangeMap.jsonand tests intest/partnerJson/partnerJson.test.tsNEXCHANGE_INITintest/testconfig.tsWritten by Cursor Bugbot for commit 1166816. This will update automatically on new commits. Configure here.