@blend-money/sdk.
The important split is:
- Deposits: use
client.depositto discover chains and assets, check wallet holdings, and request a quote - Withdrawals: use
client.withdraw.getCalldata()to receive ordered execution payloads
Prerequisites
Deposit flow
1. Get the Blend account
accountId and Safe address required by the rest of the flow.
2. Discover depositable assets
getTokens(chainId) to populate the asset picker. Pass the eoa parameter to filter to tokens the user holds, enriched with balance and amountUsd fields.
When you pass
eoa, the Blend backend fetches wallet balances for you. Your app does not need an RPC connection or wallet provider to check balances.3. Request a deposit quote
accountId is mandatory. Blend resolves the destination Safe from account context before generating the quote.4. Execute the deposit
The public SDK does not expose a client-builtdeposit() action. Your application should use the returned quote payload to drive deposit execution in your wallet, relay, or orchestration layer.
Withdrawal flow
Withdrawals are exposed through server-built calldata, not local action-plan construction.1. Request withdrawal payloads
WithdrawCalldataParams:
| Field | Type | Description |
|---|---|---|
accountId | string | Blend account UUID (from safe.account()) |
destinationChainId | number | Chain where the user wants to receive the withdrawn funds |
amount | string | Total amount in underlying units as an integer string |
isMaxWithdraw | boolean? | When true, redeems all shares on every chain regardless of amount |
2. Execute each payload in order
Each payload inresult.payloads represents one source chain. Fields:
| Field | Type | Description |
|---|---|---|
chainId | number | Source chain for this payload |
vaultAddress | string | ERC-4626 vault being exited |
amount | string | Amount allocated from this chain |
timeEstimate | number | Settlement time in seconds. 0 when same chain |
fees | QuoteFees | null | Bridge fee breakdown. null when no bridge needed |
steps | WithdrawStep[] | Ordered steps by kind: liquidityReset, approve, withdraw, approveReset, bridge |
3. Handle edge cases
Max withdrawals When you passisMaxWithdraw: true, Blend redeems all shares across the selected chains.
For max withdrawals, the final redeemed amount is not known pre-settlement. Because of that, the response may omit the pre-built
bridge quote. If you need to bridge the withdrawn funds afterward, fetch or build that bridge step after settlement using the actual amount received.client.withdraw.getCalldata() returns a 409 response when a rebalance flow plan is already active for the user’s account. This is a normal transient state, not a permanent error.
Error handling
Common pitfalls
- Do not call
client.deposit.getQuote()withoutaccountId - Do not assume the public SDK exposes client-built deposit or withdrawal action helpers
- Do not assume a
bridgestep is always present in withdrawal payloads, especially whenisMaxWithdrawis true
Next steps
Blend SDK
Review the current SDK surface.
Cross-chain Deposits
See the detailed quote-generation flow.
Integrations Overview
Understand how account types, accounts, and Safes fit together.