Skip to content

Chain take order tx automatically after approval#2466

Open
findolor wants to merge 1 commit intomainfrom
2026-02-15/take-orders-one-click
Open

Chain take order tx automatically after approval#2466
findolor wants to merge 1 commit intomainfrom
2026-02-15/take-orders-one-click

Conversation

@findolor
Copy link
Collaborator

Motivation

When a user takes an order that requires token approval, they currently have to:

  1. Click "Take Order" and confirm the approval transaction
  2. See a success toast telling them to click "Take Order" again
  3. Click "Take Order" a second time to actually execute the trade

This two-click flow is cumbersome and confusing for users.

Solution

After the approval transaction is confirmed, the take order transaction is now automatically executed with fresh calldata — making it a single-click experience.

Key changes:

  • Added executeTakeOrderWithFreshCalldata that fetches fresh calldata and executes the take order immediately after approval confirmation
  • Chained the take order call inside the approval's onConfirm callback
  • Removed the addToast dependency and the "click again" success toast
  • Simplified onSubmit to return void instead of boolean since the modal now always closes after submission

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

@findolor findolor self-assigned this Feb 17, 2026
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