What happens
Picking most tokens on the swap screen fails with "Failed to get quote from Dexie. Please try again later.", and a TypeError reaches the console:
api.dexie.space/v1/swap/quote?from=XCH&to=fcfdda5d…&from_amount=1000000000
Failed to load resource: the server responded with a status of 400 ()
TypeError: Cannot read properties of undefined (reading 'to_amount')
The message suggests an outage, so it invites a retry that can never succeed.
Why
Dexie publishes two different token lists, and the swap screen reads the wrong one:
| Endpoint |
Tokens (mainnet, today) |
/v1/assets?type=cat — what CatQueue records |
943 |
/v1/swap/tokens — what /v1/swap/quote accepts |
328 |
Swap.tsx renders its receive selector with showAllCats={true}, so TokenSelector calls get_all_cats, which returns every asset the catalog holds. Roughly two thirds of those cannot be swapped, and the quote request answers:
HTTP/1.1 400 Bad Request
{"success":false,"error_message":"Unknown from or to assets."}
Reproducible outside the app:
curl -i "https://api.dexie.space/v1/swap/quote?from=XCH&to=fcfdda5dbdbda19ca7fe0ad8ced1afca935cc59810bdb5bec30ef6b058e77fac&from_amount=1000000000"
The selector also offers tokens the wallet itself discovered, which Dexie may not list at all — the asset above is one of those, absent from both listings.
getDexieQuote never checks response.ok, so a 400 falls through to data.quote.to_amount on an undefined quote. The TypeError is caught by the surrounding try, which is why the user sees the generic retry message rather than the reason.
Steps to reproduce
- Let the CAT queue fill the catalog.
- Open the swap screen.
- In the receive selector, pick a token that is not in
/v1/swap/tokens — most of the list.
- Enter an amount.
Suggested fix
Offer only what Dexie can swap: fetch /v1/swap/tokens and restrict both selectors on the swap screen to that set. Separately, having getDexieQuote check response.ok and surface error_message would turn the remaining failures into something a user can act on.
Happy to open a PR if the approach sounds right.
What happens
Picking most tokens on the swap screen fails with "Failed to get quote from Dexie. Please try again later.", and a
TypeErrorreaches the console:The message suggests an outage, so it invites a retry that can never succeed.
Why
Dexie publishes two different token lists, and the swap screen reads the wrong one:
/v1/assets?type=cat— whatCatQueuerecords/v1/swap/tokens— what/v1/swap/quoteacceptsSwap.tsxrenders its receive selector withshowAllCats={true}, soTokenSelectorcallsget_all_cats, which returns every asset the catalog holds. Roughly two thirds of those cannot be swapped, and the quote request answers:Reproducible outside the app:
The selector also offers tokens the wallet itself discovered, which Dexie may not list at all — the asset above is one of those, absent from both listings.
getDexieQuotenever checksresponse.ok, so a 400 falls through todata.quote.to_amounton an undefinedquote. TheTypeErroris caught by the surroundingtry, which is why the user sees the generic retry message rather than the reason.Steps to reproduce
/v1/swap/tokens— most of the list.Suggested fix
Offer only what Dexie can swap: fetch
/v1/swap/tokensand restrict both selectors on the swap screen to that set. Separately, havinggetDexieQuotecheckresponse.okand surfaceerror_messagewould turn the remaining failures into something a user can act on.Happy to open a PR if the approach sounds right.