Skip to content

swap execute path ignores balance and simulationIncomplete issues #823

Description

@prasanthkuna

Summary

sendSwapTransaction / sendSwapOperation guard on allowance issues but not on issues.balance or simulationIncomplete, so doomed swaps can still be broadcast.

Expected behavior

If the Swaps API returns balance issues or simulationIncomplete: true, the SDK should refuse to call sendTransaction (same fail-closed posture as the allowance guard).

Repro

  1. Obtain a swap quote where issues.balance.currentBalance < requiredBalance (or simulationIncomplete: true) but allowance is OK.
  2. Call sendSwapTransaction(client, { address, swapQuote }) or swapQuote.execute().
  3. Observe transaction broadcast instead of a thrown error.

Suggested fix

Mirror the existing allowance check for balance and simulationIncomplete before broadcast.

Context

Official TS examples validate issues manually before execute; the execute path does not enforce.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions