Use this file to discover all available pages before exploring further.
With Rhinestone intents, you can deposit into any ERC-4626 vault on a destination chain using tokens from any supported chain. This is powered by destinationExecutions — arbitrary calls that run on the destination chain as part of the intent settlement.The flow works as follows:
For EOAs, destination executions run in an intermediary contract — not in the user’s account context. The requested tokens are automatically swept to the user after execution, but any tokens received as a result of the execution (such as vault shares) are not automatically swept.You must include an explicit transfer call to send the vault shares back to the user’s address.
import { encodeFunctionData, erc20Abi, parseUnits } from "viem";const VAULT_ADDRESS = "0x..."; // ERC-4626 vaultconst DEPOSIT_TOKEN = "0x..."; // Vault's underlying assetconst depositAmount = parseUnits("100", 6); // e.g. 100 USDCconst vaultAbi = [ { name: "deposit", type: "function", stateMutability: "nonpayable", inputs: [ { name: "assets", type: "uint256" }, { name: "receiver", type: "address" }, ], outputs: [{ name: "shares", type: "uint256" }], },] as const;const destinationExecutions = [ // 1. Deposit into the vault { to: VAULT_ADDRESS, value: 0n, data: encodeFunctionData({ abi: vaultAbi, functionName: "deposit", args: [depositAmount, VAULT_ADDRESS], // receiver is the intermediary }), }, // 2. Transfer vault shares back to the user { to: VAULT_ADDRESS, // ERC-4626 vaults are also ERC-20 share tokens value: 0n, data: encodeFunctionData({ abi: erc20Abi, functionName: "transfer", args: [USER_ADDRESS, depositAmount], // approximate share amount }), },];
Since executions run outside the user’s account, you need the second transfer call to move vault shares to the user. This limitation will be addressed in a future API update with a new field for specifying expected output tokens.
For Smart Accounts, the IntentExecutor runs destination executions within the account’s own context. Vault shares are minted directly to the account — no extra transfer needed.
Before submitting, EOAs must fulfill the token requirements returned in the quote. There are two types:ERC-20 Approvals — approve tokens to the Permit2 contract:
Approvals are only ever to the Permit2 contract. We recommend using max approvals for the best UX. Alternatively, inspect cost.input for the exact amount needed.
Smart Accounts handle token approvals and wrapping automatically via pre-claim ops — no manual steps are needed. You can proceed directly to signing.
Smart account signing wraps the signature with the installed validator’s encoding. The Rhinestone SDK handles this automatically — use it for smart account flows rather than driving the raw API by hand.
Smart Wallet quickstart
Send a crosschain intent from a smart account using the SDK