import { BlendClientWithActions } from "@blend-money/sdk-actions";
const client = new BlendClientWithActions({
baseUrl: "https://api.blend.money",
userAddress: "0x1234567890abcdef1234567890abcdef12345678",
integratorId: "example-app",
}, { gardenAppId: "YOUR_GARDEN_APP_ID" });
// Cross‑chain deposit: destination is implied by the StrategyConfig (vault chain/token)
const depositPlan = await client.actions.deposit(
{ address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", symbol: "USDC", decimals: 6, chainId: 1 },
{ vaultId: "0x0000000000000000000000000000000000000001", chainId: 8453, token: { address: "0x4200000000000000000000000000000000000006", symbol: "USDC", decimals: 6, chainId: 8453 }, name: "USDC Vault", symbol: "vUSDC" },
1_000_000n,
50,
);
// Cross‑chain withdraw: origin is implied by the StrategyConfig (vault chain/token)
// outputToken defines the desired asset and its destination chain
const [withdrawPlan, maybeSwapPlan] = await client.actions.withdraw(
publicClient, // viem client on the vault chain
{ vaultId: "0x0000000000000000000000000000000000000001", chainId: 8453, token: { address: "0x4200000000000000000000000000000000000006", symbol: "USDC", decimals: 6, chainId: 8453 }, name: "USDC Vault", symbol: "vUSDC" },
1_000_000n,
{ address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", symbol: "USDC", decimals: 6, chainId: 1 },
false,
50,
);
// If outputToken differs from vault underlying/chain, the second element is a function
// that builds the cross‑chain swap/bridge plan after onchain state is updated.