Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: onSuccess callback prop #10

Closed

Conversation

SamueleA
Copy link

Added an onSuccess prop that triggers a callback once a swap is successful

@vercel
Copy link

vercel bot commented May 11, 2022

@SamueleA is attempting to deploy a commit to the Uniswap Team on Vercel.

A member of the Team first needs to authorize it.

@SamueleA SamueleA changed the title added onSuccess callback to widget feat: onSuccess callback prop May 11, 2022
@zzmp
Copy link
Contributor

zzmp commented May 12, 2022

Thanks, @SamueleA! Because the SwapWidget is capable of performing multiple transactions (including token permits and approvals), I think that the onSuccess callback needs to convey some information on the successful transaction. Could you open an issue to discuss this (and link this PR!) so that we can iron that out and move forward with transaction callbacks?

@SamueleA
Copy link
Author

@zzmp Thanks for replying! I've opened an issue as requested #11

@SamueleA
Copy link
Author

Made the onSuccess callback only trigger for SWAP and WRAP calls
1eb9f9b

@zzmp
Copy link
Contributor

zzmp commented Aug 25, 2022

I'm not sure if we've documented it yet, but we now support onTxSuccess callbacks.
See https://github.com/Uniswap/widgets/blob/main/src/hooks/transactions/index.tsx#L64-L72.

@zzmp zzmp closed this Aug 25, 2022
tinaszheng added a commit that referenced this pull request Feb 25, 2023
chore: Rebase with main 2-8-2023
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.

None yet

2 participants