Install
- pnpm
- npm
- yarn
Quick start
What it adds
actions.deposit(...)→ Direct transfer or cross-chain route to the Safeactions.withdraw(...)→ Vault withdrawal with optional cross-chain swapactions.rebalance(...)→ Manual rebalance using/safe/rebalance/manualactions.getManualRebalanceCall(...)→ Low-level rebalance calldata helper
Configuration
The Actions SDK requires configuration for cross-chain adapters:Cross-chain Routing
The Actions SDK automatically selects the appropriate cross-chain adapter:- LiFi: Used for EVM-to-EVM routes (Ethereum, Base, Polygon, etc.)
- Garden: Used for Botanix routes and native Bitcoin operations
API
deposit(inputToken, strategy, amount, slippageBps?)
Returns anActionPlan with approvals and transactions for a deposit. Cross‑chain routes are automatically built via LiFi (EVM) or Garden (Botanix/native BTC).
Parameters:
inputToken: Token to deposit (address, symbol, decimals, chainId)strategy: Target vault configuration fromstrategy.getAvailableStrategies()amount: Amount in smallest units (e.g., 1 USDC = 1_000_000n)slippageBps: Optional slippage tolerance in basis points (default: 50 = 0.5%)
withdraw(rpcClient, strategy, amount, outputToken, isMaxWithdraw?, slippageBps?)
Returns a tuple where the second item may be a function to build a follow‑up cross‑chain plan after on‑chain state updates. Parameters:rpcClient: Viem public client for the vault’s chainstrategy: Vault configuration to withdraw fromamount: Amount to withdraw in smallest units (ignored ifisMaxWithdrawis true)outputToken: Desired output token (address, symbol, decimals, chainId)isMaxWithdraw: Whether to withdraw all available shares (default: false)slippageBps: Optional slippage tolerance for cross-chain swaps (default: 50)
rebalance(strategy, amountVaultToken)
Builds a multisendActionPlan that calls the controller using the manual rebalance calldata.
Parameters:
strategy: Vault configuration to rebalanceamountVaultToken: Amount of vault tokens to rebalance in smallest units
getManualRebalanceCall(userAddress, chainId, vaultId, amount)
Low‑level helper to fetch the target + calldata for manual rebalances. Useful when you need to build custom transaction flows. Parameters:userAddress: User’s EOA addresschainId: Chain ID of the vaultvaultId: Vault contract addressamount: Amount to rebalance (string or bigint)
Execution helpers
TransactionHandler
For executing ActionPlans from a Safe, use theTransactionHandler to submit multisend/UserOps with a paymaster.
Manual Execution
References
- Repo:
https://github.com/BlendMoney/sdks→packages/sdk-actions - Readme:
packages/sdk-actions/README.md