Skip to main content
Blend’s SDKs include first‑class cross‑chain support. You can request routes directly through the API without integrating bridge/DEX SDKs yourself. The core library ships with adapters for:
  • LiFi: EVM chains (swaps/bridges)
  • Garden: Botanix and native BTC routes

How it works

  • The Actions module selects the appropriate adapter based on origin/destination chain.
  • If tokens match and are on the same chain, a direct transfer plan is produced.
  • Otherwise, a cross‑chain ActionPlan is returned with approval + initiate calls.

Discover supported cross‑chain assets

You can list all supported chains/tokens from each adapter. Merge them if you want a unified catalog.
import { LiFiAdapter, GardenAdapter } from "@blend-money/sdk-core";

const lifi = new LiFiAdapter({ baseUrl: "https://li.quest", chainTypesFilter: "EVM" });
const garden = new GardenAdapter({ baseUrl: "https://api.garden.finance/v2", gardenAppId: "YOUR_GARDEN_APP_ID" });

const lifiCatalog = await lifi.getTokenCatalog(); // { chains, tokens }
const gardenCatalog = await garden.getTokenCatalog(); // { chains, tokens }

// Optional: merge/dedupe by chainId+address
const key = (t: { chainId: number; address: `0x${string}` }) => `${t.chainId}:${t.address.toLowerCase()}`;
const tokenMap = new Map<string, any>();
[...lifiCatalog.tokens, ...gardenCatalog.tokens].forEach((t) => tokenMap.set(key(t), t));
const allTokens = [...tokenMap.values()];

Direct usage with adapters (advanced)

import { LiFiAdapter, GardenAdapter } from "@blend-money/sdk-core";

const lifi = new LiFiAdapter({ baseUrl: "https://li.quest", chainTypesFilter: "EVM" });
const garden = new GardenAdapter({ baseUrl: "https://api.garden.finance/v2", gardenAppId: "YOUR_GARDEN_APP_ID" });

const plan = await lifi.getActionPlan({
  fromToken: { address: "0x0000000000000000000000000000000000000000", symbol: "ETH", decimals: 18, chainId: 1 },
  toToken:   { address: "0x0000000000000000000000000000000000000000", symbol: "ETH", decimals: 18, chainId: 137 },
  amount: 1_000_000_000_000_000_000n,
  fromAddress: "0x1234567890abcdef1234567890abcdef12345678",
  toAddress: "0x1234567890abcdef1234567890abcdef12345678",
  slippageBps: 50,
});

Using Actions for deposits/withdrawals

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.

Execution

ActionPlan returns the approvals and transactions you need. For Safe multisend/UserOps you can use the TransactionHandler helper from @blend-money/sdk-actions or submit the transactions using your own wallet flow.

Notes

  • LiFi adapter filters to EVM chains; Garden is used automatically for Botanix/native BTC routes.
  • You can call getTokenCatalog() on adapters to discover supported chains/tokens.
  • All examples use a generic test address 0x1234567890abcdef1234567890abcdef12345678.
I