Add StealthEX swap plugin - #485
Open
j0ntz wants to merge 1 commit into
Open
Conversation
6 tasks
Contributor
Author
j0ntz
marked this pull request as ready for review
August 14, 2026 23:58
j0ntz
force-pushed
the
jon/integrate-stealthex-swap
branch
from
August 14, 2026 23:58
adc61e1 to
b442b38
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
j0ntz
force-pushed
the
jon/integrate-stealthex-swap
branch
from
August 15, 2026 00:05
b442b38 to
5a63ddd
Compare
StealthEX identifies assets by a symbol plus a network, so the chain mapping spells out both halves for a chain's native asset and the network its tokens live on. Token symbols are not unique across listings, so each side of a quote is confirmed against StealthEX's own currency record before quoting. Quotes use fixed rates when the route offers them, which also covers quoting by the amount the user wants to receive, and fall back to floating rates otherwise.
j0ntz
force-pushed
the
jon/integrate-stealthex-swap
branch
from
August 15, 2026 00:13
5a63ddd to
8ae9a4d
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8ae9a4d. Configure here.
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
Adds StealthEX as a centralized swap provider, on the v4 API.
Asana: https://app.asana.com/0/1215088146871429/1217498055202092
Asset identity. StealthEX names every asset by a
symbolplus anetwork, sosrc/mappings/stealthex.tsrecords both halves per chain: the symbol and network of the chain's native asset, plus the network its tokens live on. A chain's native asset usually sits onmainnet, but plenty do not (BNB onbsc, AVAX onavax-c, WAXP onwax, OSMO oncosmos, ETH on each L2's own network), which is why the mapping spells out both rather than deriving one from the other.Token symbols are not unique across listings, so quoting on a symbol alone could point a deposit at the wrong token. Each side of a quote is confirmed against StealthEX's own currency record (
GET /v4/currencies/{symbol}/{network}) before any order is created: a token requires a present, matchingcontract_address, and a native asset requires StealthEX to have no contract address either, so a token listing can never be resolved for a native swap. StealthEX omits the contract address on some token listings (USDC on Tron among them); those tokens stay unsupported rather than quoted on an unverified symbol match. Resolved currencies are cached for the lifetime of the plugin; failed lookups are not, so newly listed assets work without an app restart.Rate type. Quotes use a fixed rate when both assets support one, which is also what makes "quote by the amount I want to receive" work (StealthEX only offers reversed estimation on fixed rates). Both assets advertising fixed support does not guarantee the pair has a fixed route, so a missing route falls back to a floating quote with
isEstimate: true.fetchSwapQuoterunscheckInvalidTokenIdsfirst, so the shared same-asset guard and the default invalid-token list apply here as they do in the sibling central plugins.Other notes. Requests go through
io.fetchCors: StealthEX blocks browser-origin requests, and swap plugins run inside a WebView. Limits come fromPOST /v4/rates/rangeand map toSwapBelowLimitError/SwapAboveLimitError;NoPair/NoExchangeRoute/RouteIsDisabled/MarketUnavailablemap toSwapCurrencyErrorandNotAllowedto a reasonlessSwapPermissionError: StealthEX returnsNotAllowedfor causes it does not name (it was observed refusing a route minutes after the identical call succeeded), so claiming a geographic restriction would be a guess.Telos and Monad are listed by StealthEX but mapped to
null: neither listing carries an address format, so which address space they expect cannot be confirmed, and a wrong guess loses funds.Companion GUI PR wires the plugin up: EdgeApp/edge-react-gui#6160