Skip to main content
The Deposit class is the main entry point for the SDK. It manages the signer call, iframe lifecycle, and completion handling.

Constructor

Creates a new Deposit instance. Throws a DepositError with code INVALID_REQUEST if config.signer is missing or not a string/function.

DepositConfig

appearance is read when the instance builds its hosted-flow URLs, including the warm-up iframe created at construction. To change the theme, call destroy() and construct a new Deposit.

Methods

preload

Warm the hosted flow before the user starts a deposit. The SDK calls this automatically after construction unless preload: false. Call it manually when you want to control the timing, such as when a payment widget opens or the user hovers the Blink option. It is a no-op when a warm iframe already exists or a deposit flow is active.

requestDeposit

Opens the hosted deposit flow for the given deposit. The returned Promise resolves when the user completes the payment and rejects with a DepositError on failure. If a flow is already active, calling requestDeposit again cancels the previous flow and starts a new one. Throws DepositError with code INVALID_REQUEST if the instance has been destroyed. See Types for DepositRequest and DepositResult definitions.

on

Register an event listener. Returns this for chaining. See Events.

off

Remove a previously registered event listener. Returns this for chaining.

close

Close the transfer iframe without waiting for completion. If a flow is active, its requestDeposit() promise rejects with DEPOSIT_DISMISSED. The method resets status to idle and fires the close event.

destroy

Tear down the instance and release all resources. Closes the iframe, removes all event listeners, and marks the instance as destroyed. Subsequent calls to requestDeposit will reject with INVALID_REQUEST. Call this on component unmount or page unload.

focus

No-op. Retained for API compatibility.

Properties

presentation

The resolved presentation for this instance. It can differ from the requested config because embedded presentation resolves to the overlay on mobile. No resize event fires when this value is 'overlay'.

status

Current phase of the deposit flow. One of 'idle', 'signer-loading', 'iframe-active', 'completed', or 'error'.

result

Last successful DepositResult, available when status === 'completed'.

error

Last DepositError, available when status === 'error'.

isActive

true when a deposit flow is in progress (status is 'signer-loading' or 'iframe-active').