Update Exolix swap to network/address-based API#458
Open
j0ntz wants to merge 1 commit into
Open
Conversation
3577595 to
12b3b22
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 12b3b22. Configure here.
Mirror Exolix partner PR #433. Switch the Exolix integration to the newer network-based API: send networkFrom/ networkTo (with an evmGeneric path carrying evmChainId) plus optional token coinAddressFrom/coinAddressTo, and thread the /rate rateId through to /transactions. Replace the hardcoded $70k USD cap and the rates fetch with min/max enforcement from Exolix (minAmount/maxAmount and withdrawMin/ withdrawMax), throwing SwapBelowLimitError/SwapAboveLimitError. Add unit tests covering the new request shaping and limit handling.
12b3b22 to
2ce37ad
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Description
Internal mirror of Exolix partner PR #433 ("update api"), re-authored on an Edge-owned branch rather than merging the partner branch directly.
Asana: https://app.asana.com/0/1215088146871429/1213596310518725
What changed
networkFrom/networkTo, including anevmGenericpath that carriesevmChainId(networkFromChainId/networkToChainId), plus optional tokencoinAddressFrom/coinAddressToresolved viagetContractAddresses./rateresponse now carries arateIdthat is threaded through to/transactions.$70kUSD cap (and the associatedfetchRateslookup) with min/max limits taken directly from Exolix:minAmount/maxAmountforfromquotes andwithdrawMin/withdrawMaxfortoquotes, throwingSwapBelowLimitError/SwapAboveLimitErroraccordingly.test/exolix.test.ts(mocked Exolix API) covering the new request shaping, EVM/token paths, and min/max limit handling.API requirements review (per API_REQUIREMENTS.md; non-blocking)
networkFrom/networkTo,evmGeneric+evmChainId) and the token (coinAddressFrom/coinAddressTocontract address) directly.from(amount) andto(withdrawalAmount) directions are supported./rateresponse (minAmount/maxAmount,withdrawMin/withdrawMax), single-sided per quote direction, rather than the spec's structurederrors[]array carrying bothsourceAmountLimitanddestinationAmountLimitin one response. The 422 handling also reflects inconsistent provider error behavior on under-minimumfromquotes. Non-blocking; flagged for the provider.nativeToDenomination/denominationToNative. The doc states native units "should" be used (soft), so this is a note, not a violation.Testing
tscclean; full mocha suite passes (39 tests, including the new Exolix tests, ~94.8% line coverage onexolix.ts); eslint clean on changed files;verify-repoPASSED.Note
Medium Risk
Changes live Exolix quote/order request shape and swap size limits for a centralized exchange; behavior is covered by new tests but staging QA with real API is still advised.
Overview
The Exolix swap plugin now uses Exolix’s network/address-based
/rateand/transactionsAPI instead of coin/network currency fields. Quotes sendnetworkFrom/networkTo, optionalcoinAddressFrom/coinAddressTo, and for EVM walletsevmGenericplusnetworkFromChainId/networkToChainId; therateIdfrom/rateis required on order creation.Limits no longer use the hardcoded $70k USD cap and info-server
fetchRatescheck. Min/max come from Exolix (minAmount/maxAmountforquoteFor: 'from',withdrawMin/withdrawMaxforto), with ceil/floor when converting limits and quote amounts to native atomic units. HTTP 422 responses that still parse as rate payloads continue to driveSwapBelowLimitError/SwapAboveLimitError.Adds
test/exolix.test.ts(mocked API) for request shaping, EVM path,rateId, and limit errors. CHANGELOG updated under Unreleased.Reviewed by Cursor Bugbot for commit 2ce37ad. Bugbot is set up for automated code reviews on this repo. Configure here.