How to reliably detect On-Ramp completion status via AppKit events? #6268
Unanswered
nizzy91
asked this question in
Developer Support
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I try integrating the On-Ramp feature into our React application using @reown/appkit/react and the Wagmi adapter.
The process is initiated correctly using open({ view: 'OnRampProviders' }) from the useAppKit hook.
My goal:
After the user interacts with the Coinbase Pay UI (which opens within the AppKit modal) and potentially completes a fiat-to-crypto purchase, I want my application to reliably detect when this process concludes (either successfully, with failure, or cancellation) so I can take appropriate next steps (like starting to monitor the user's wallet balance for the purchased crypto).
The Challenge:
I understand that the final crypto delivery to the user's wallet happens asynchronously on the blockchain after the Coinbase Pay UI interaction. However, I need a signal within our React app to know when the user has finished interacting with the On-Ramp UI presented by AppKit.
On demo app modal I can see info "We’ll notify you once your Buy is processed", which suggests some notification mechanism might exist.
My question:
Is there a specific event emitted by AppKit (available via useAppKitEvents or preferably useAppKitEventSubscription) that signals the completion status of the On-Ramp flow initiated via open({ view: 'OnRampProviders' })?
Specifically, I'm looking for events like:
ONRAMP_SUCCESS (if the fiat payment was likely successful)
ONRAMP_FAILURE (if the fiat payment failed)
ONRAMP_CANCELLED (if the user cancelled the process)
ONRAMP_COMPLETED (a general event indicating the UI flow finished, regardless of outcome)
Or perhaps a more generic event like MODAL_VIEW_CLOSED that includes information about which view was closed (e.g., OnRampProviders)?
Current Workaround Considered:
My current plan, if no specific event exists, is to:
Set a flag when open({ view: 'OnRampProviders' }) is called.
Monitor the open state of the main AppKit modal using useAppKitState.
When the modal closes (open becomes false) and our flag is set, assume the On-Ramp interaction finished and start polling the user's crypto balance.
This workaround feels indirect. A dedicated event would be much cleaner and more reliable.
Could you please clarify:
Are there specific AppKit events for On-Ramp completion status?
If so, what are their names and what data do they provide?
If not, is the workaround using useAppKitState the recommended approach?
Beta Was this translation helpful? Give feedback.
All reactions