What Are Action Delegates?
Action delegates are callback functions you pass toKeystoneProvider that handle on-chain operations. When the widget needs to deposit tokens or approve a token transfer, it calls your delegate instead of interacting with the blockchain directly.
This is how Tier 2 (Interactive + Custody) integration works - your frontend collects the user’s intent, and your backend executes it through Fireblocks, BitGo, or any signing infrastructure.
The Deposit Flow
When a user clicks “Deposit” in the widget:Setting Up Delegates
Deposit Info Object
ThedepositInfo parameter passed to onDepositRequired contains everything needed to execute the deposit:
| Field | Type | Description |
|---|---|---|
calldata | string | ABI-encoded depositLeg() calldata (0x-prefixed) |
escrowAddress | string | The escrow contract address to send the transaction to |
chainId | number | The blockchain network (e.g., 11155111 for Sepolia) |
tokenAddress | string | The ERC-20 token contract address |
depositAmount | string | Amount in token smallest units |
approvalCalldata | string | ABI-encoded approve() calldata |
calldata directly to escrowAddress on the specified chainId. No ABI knowledge needed.
Approval Info Object
TheapprovalInfo parameter passed to onApprovalRequired:
| Field | Type | Description |
|---|---|---|
tokenAddress | string | The ERC-20 token to approve |
escrowAddress | string | The spender (escrow contract) |
amount | string | Amount to approve |
approvalCalldata | string | Pre-encoded approve() calldata |