Skip to content

update api#433

Open
ex-peter-parker wants to merge 2 commits intoEdgeApp:masterfrom
ex-peter-parker:exolix/update-new-api
Open

update api#433
ex-peter-parker wants to merge 2 commits intoEdgeApp:masterfrom
ex-peter-parker:exolix/update-new-api

Conversation

@ex-peter-parker
Copy link

@ex-peter-parker ex-peter-parker commented Feb 4, 2026

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

none

Note

Medium Risk
Changes request/response shapes and limit validation for a live swap provider, so mismatches with Exolix API expectations could break quoting or cause incorrect limit errors, especially for EVM/token swaps.

Overview
Updates the Exolix swap integration to use Exolix’s newer network/address-based API parameters: requests now send networkFrom/networkTo (including an evmGeneric path with evmChainId) plus optional token coinAddressFrom/coinAddressTo, and the /rate response now requires a rateId that is passed through to /transactions.

Replaces the previous currency-code transcription path and the hardcoded $70k USD cap with min/max enforcement directly from Exolix (minAmount/maxAmount and withdrawMin/withdrawMax), throwing SwapBelowLimitError/SwapAboveLimitError accordingly.

Written by Cursor Bugbot for commit f4ddc64. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

minAmount: asNumber,
maxAmount: asNumber,
withdrawMin: asOptional(asNumber, 0),
withdrawMax: asOptional(asNumber, 0),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zero default for withdrawMax breaks 'to' quotes

Medium Severity

The withdrawMax field defaults to 0 when not provided by the API via asOptional(asNumber, 0). When performing a 'to' quote, the code checks if request.nativeAmount is greater than nativeMax (derived from withdrawMax). If withdrawMax is 0, any positive withdrawal amount will trigger a SwapAboveLimitError with a max of '0', effectively breaking all 'to' quotes for trading pairs where Exolix doesn't return this field.

Additional Locations (1)

Fix in Cursor Fix in Web

refundAddress: fromAddress,
refundExtraId: '',
withdrawalExtraId: '',
...amount
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undefined values sent as strings in API request

High Severity

When constructing quoteParams for the GET request to /rate, optional fields like coinAddressFrom, coinAddressTo, networkFromChainId, and networkToChainId can be undefined. When this object is passed to new URLSearchParams(params), JavaScript converts undefined values to the literal string "undefined". This results in the API receiving malformed query parameters like coinAddressFrom=undefined instead of omitting the parameter, which will likely cause API errors or incorrect behavior when swapping native coins (non-token assets) or non-EVM chains.

Fix in Cursor Fix in Web

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

Comments