Skip to content

swap: align plan previews with authorization and execution - #244

Closed
Makyl wants to merge 2 commits into
mainfrom
swap/align-plan-preview-execution
Closed

swap: align plan previews with authorization and execution#244
Makyl wants to merge 2 commits into
mainfrom
swap/align-plan-preview-execution

Conversation

@Makyl

@Makyl Makyl commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Align swap plan previews with runtime execution order and expose EOA token authorization as a first-class swap step. Plans now identify whether an allowance uses an approval or permit and whether source batches are EOA-submitted or sponsored.

Changes

  • Use one canonical source ordering for planning and execution: ascending chain ID with native-value legs first within each chain.
  • Add the public allowance swap step with method: 'approval' | 'permit' for source, destination, composed bridge, and direct EOA bridge authorization.
  • Resolve allowance and permit capability before emitting plan previews, including refreshed previews, and omit authorization steps when existing allowance is sufficient.
  • Add allowance progress events for wallet prompts, permit signatures, approval submission and confirmation, and failures.
  • Mark native-value source batches with submissionMode: 'eoa', keep native bridge value at the EOA, and align bridge step ordering with actual Nexus and Mayan execution.
  • Defer destination permit signing until its allowance step executes and update public exports, analytics, documentation, and characterization coverage.

Testing

  • npm run lint
  • npm run typecheck
  • npm test

Risk / Impact

Medium. This adds fields and a new member to the public swap plan/progress unions, changes source and bridge step ordering, and moves read-only authorization resolution before plan preview. Wallet writes remain gated behind intent acceptance. The primary risks are incorrect allowance classification, progress-to-step mapping, and ordering regressions across native, sponsored, direct-bridge, and composed-bridge paths; these are covered by unit, type-surface, lifecycle, execution-contract, and characterization tests.

@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nexus-sdk Ready Ready Preview Aug 19, 2026 11:18am

Request Review

@Makyl Makyl closed this Aug 19, 2026
@Makyl
Makyl deleted the swap/align-plan-preview-execution branch August 19, 2026 12:11
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