Deposit class emits events during the deposit flow. Use on() and off() to subscribe and unsubscribe.
Events
complete
Fired when the payment completes successfully. The handler receives aDepositResult.
error
Fired when the deposit flow fails. The handler receives aDepositError.
close
Fired when the transfer iframe is dismissed (user tapped backdrop, pressed Escape, or the flow was closed programmatically).status-change
Fired on every status transition. The handler receives the newDepositStatus.
resize
Fired only when the resolved presentation isembedded. Blink reports the rendered content height and its width design envelope. The SDK has already resized the inline iframe; use this event when your outer panel should follow it.
No
resize event fires for the overlay presentation, including when an embedded request resolves to the overlay on mobile. See Embed Blink in an aggregator.
Status transitions
Subscribing and unsubscribing
on() and off() return this for chaining:
Lifecycle management
close()
Closes the transfer iframe and resets status toidle. Fires the close event. Does not destroy the instance. You can call requestDeposit() again.
If a flow is active, close() also rejects its pending requestDeposit() promise with DEPOSIT_DISMISSED. This lets an embedded host handle its own back button and Blink’s dismissal through one error branch.
destroy()
Closes the iframe, removes all event listeners, and marks the instance as destroyed. Subsequent calls torequestDeposit() will reject with INVALID_REQUEST.
Call this when the component unmounts or the page unloads.
React lifecycle
TheuseBlinkDeposit hook manages the Deposit instance lifecycle automatically:
- Creates the instance on first render.
- Subscribes to
status-change,complete, anderrorevents. - Cleans up all subscriptions and calls
destroy()on unmount.
destroy() manually when using the React hook.