TheDocumentation Index
Fetch the complete documentation index at: https://docs.blink.cash/llms.txt
Use this file to discover all available pages before exploring further.
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.
Status transitions
| Status | Meaning |
|---|---|
idle | No active flow. Initial state and state after close() or destroy(). |
signer-loading | The SDK is calling the merchant signer endpoint. |
iframe-active | The hosted flow iframe is open. Waiting for the user to complete payment. |
completed | Transfer succeeded. result is available. |
error | Something failed. error is available. |
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.
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.