useBlinkTransfer hook wraps the Transfer class with reactive React state. It manages the instance lifecycle and cleans up on unmount.
The React entry point requires
react >= 18 as a peer dependency.Usage
Parameters
The hook accepts a singleTransferConfig object. See Transfer Class for the full config reference.
Transfer instance is created once on first render and destroyed on unmount. The config is read during initialization only — changing config props after mount does not reconfigure the instance.
Return value
| Property | Type | Description |
|---|---|---|
status | TransferStatus | Current phase: 'idle', 'signer-loading', 'iframe-active', 'completed', or 'error'. |
result | DepositResult | null | Last successful deposit result. Reset to null when a new deposit starts. |
error | TransferError | null | Last transfer error. Reset to null on successful completion. |
displayMessage | string | null | User-friendly error message derived from error via getDisplayMessage(), or null when there is no error. |
isActive | boolean | true when status is 'signer-loading' or 'iframe-active'. |
requestDeposit | (request: DepositRequest) => Promise<DepositResult> | Start a transfer flow. Opens the modal iframe with the hosted transfer. |
focus | () => void | No-op. Retained for API compatibility. |
close | () => void | Close the transfer iframe and reset to idle. |