Every SDK operation that touches a specific user requires anDocumentation Index
Fetch the complete documentation index at: https://docs.blend.money/llms.txt
Use this file to discover all available pages before exploring further.
accountId. You get that by calling client.safe.account() first. This is the entry point for your integration.
Bootstrap the account
client.safe.account(address)
This is the first call you make for every user session. It fetches or creates the Blend account for a user EOA and returns everything you need to drive the rest of the SDK.
SafeAccountResponse:
| Field | Type | Description |
|---|---|---|
accountId | string | Blend account UUID. Required by balance, positions, returns, and deposit APIs |
safeAddress | Hex | Deterministic Safe address |
chainsDeployed | number[] | Chain IDs where the Safe is already deployed |
How accountId flows through the SDK
Once you have the accountId, it unlocks every other call:
Chain-specific Safe operations
client.safe.resolve(accountId, chainId)
Checks Safe deployment state for a specific chain. Returns a discriminated union keyed on status:
| Status | Meaning |
|---|---|
"validated" | Safe is deployed and live. Includes accountId, userAddress, safeAddress, chainId |
"not-deployed" | Safe address is known but not yet deployed on this chain |
"invalid" | Safe address does not match expected derivation |
"disconnected" | Safe exists but the role-modifier module is not enabled |
client.safe.request(accountId, chainId)
Requests Safe deployment on a specific chain.
Account-scoped reads
All reads in this section are routed through the Blend backend API. The client does not need an RPC connection, a viem provider, or a connected wallet to fetch these values.
client.balance.get(accountId, params?)
client.balance.getHistory(accountId, params?)
client.positions.get(accountId)
client.returns.get(accountId)
client.yield.get()
Next steps
- Deposit APIs - discover chains, tokens, and request deposit quotes
- Withdrawal API - server-built withdrawal calldata
- Best Practices - backend-only requirement and other integration guidelines