Deposit lifecycle
- The modal initializes and fires
onReady - The user connects a wallet (or is connected via embedded wallet). The modal creates a smart account and fires
onConnectedwith the EOAaddressandsmartAccountaddress. - The user selects a source chain, token, and amount, then confirms the deposit
- The modal submits the transaction on the source chain and fires
onDepositSubmitted - The bridge routes funds to the target chain. When
waitForFinalTxistrue(default), the modal waits for destination chain confirmation before firingonDepositComplete
onDepositFailed fires instead of onDepositComplete.
Event callbacks
onReady
Fires when the modal is initialized and ready for interaction. No payload.onConnected
Fires when a smart account has been created for the deposit.| Field | Type | Description |
|---|---|---|
address | Address | The user’s EOA or owner address |
smartAccount | Address | The smart account address that receives deposits |
onDepositSubmitted
Fires when the user signs and submits the deposit transaction on the source chain.| Field | Type | Description |
|---|---|---|
txHash | string | Source chain transaction hash |
sourceChain | number | "solana" | Source chain ID |
amount | string | Deposit amount in the token’s smallest unit |
onDepositComplete
Fires when tokens arrive on the target chain (or when the bridge is submitted, ifwaitForFinalTx is false).
| Field | Type | Description |
|---|---|---|
txHash | string | Source chain transaction hash |
destinationTxHash | string | undefined | Target chain transaction hash. Absent when waitForFinalTx is false. |
amount | string | Amount transferred |
sourceChain | number | "solana" | Source chain ID |
sourceToken | string | Source token address |
targetChain | number | Target chain ID |
targetToken | string | Target token address |
onDepositFailed
Fires when the bridge fails after the deposit was submitted.| Field | Type | Description |
|---|---|---|
txHash | string | Source chain transaction hash |
error | string | undefined | Error message, if available |
onError
Fires on errors at any stage — wallet connection, transaction signing, bridge setup, etc.| Field | Type | Description |
|---|---|---|
message | string | Error description |
code | string | undefined | Error code, if available |
Error handling
Errors can occur at different stages:| Stage | Callback | Typical causes |
|---|---|---|
| Wallet connection | onError | User rejected connection, network error |
| Transaction signing | onError | User rejected transaction, insufficient gas |
| After submission | onDepositFailed | Bridge failure, timeout, price deviation |
| Any stage | onError | Unexpected errors |
onError fires for errors that prevent the deposit from being submitted. onDepositFailed fires for failures that happen after the source chain transaction is confirmed — at that point, the deposit service may retry automatically.
Analytics
TheonEvent callback fires on granular user interactions for integration with your analytics pipeline.
*_open) and CTA clicks (*_cta_click) at each step of the flow, with contextual properties like selected token, chain, and amount.