The server SDK (Documentation Index
Fetch the complete documentation index at: https://docs.blend.money/llms.txt
Use this file to discover all available pages before exploring further.
@blend-money/node) manages accounts and sessions from your backend. It can’t execute transactions directly.
Quick-start flow
- Install
@blend-money/node - Create a
BlendServerSdkinstance with your API key - Look up or create an account with
sdk.lookupAccount(address) - Scope operations with
sdk.forAccount(accountId) - Create a session, quote, and manage the lifecycle manually
Install
- Frontend
- Server
- pnpm
- npm
- yarn
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | Server secret (sk_live_). Never expose in client code. |
accountTypeId | string | Yes | The account type (product) to operate on |
baseUrl | string | No | Blend API base URL. Defaults to production. |
fiatCurrency | string | No | ISO 4217 code (e.g. "EUR"). Adds this currency to monetary responses. |
timeoutMs | number | No | Request timeout in milliseconds. Default: 15000. |
retries | number | No | Max retries for 429 and 5xx. Default: 3. |
Account management
lookupAccount
Finds an account by wallet address. Returns the account ID, Safe address, and deployed chains.SafeAccountResponse:
| Field | Type | Description |
|---|---|---|
accountId | string | Blend account ID |
safeAddress | string | Deterministic Safe address |
chainsDeployed | number[] | Chains where the Safe is live |
createAccount
Creates an account and deploys a Safe on a specific chain.forAccount
Returns a scopedBlendClient for a specific account. The client has discover, account, and sessions modules.
Session lifecycle
createSession
Creates or retrieves an active session for the scoped account.quoteDeposit
Quotes a deposit on an open session. UsesinputAssetAddress (not tokenAddress).
| Parameter | Type | Required | Description |
|---|---|---|---|
chainId | number | Yes | Origin chain ID |
inputAssetAddress | string | Yes | Token contract on the origin chain |
eoa | string | Yes | The wallet address holding the tokens |
amount | string | Yes | Smallest unit, non-negative integer string |
quoteWithdraw
Quotes a withdrawal on an open session.lock
Locks the session with a signer address. Transitions fromOPEN to LOCKED.
submit
Submits transaction hashes after on-chain execution. Transitions fromLOCKED to SUBMITTED.
cancel
Cancels a session from any non-terminal state.get / list
Retrieve a session by ID or list sessions.execute
High-level orchestrator that handles lock, on-chain execution, submit, and polling. You provide thesubmitActionPlan callback.
| Parameter | Type | Required | Description |
|---|---|---|---|
signerAddress | string | Yes | EOA hex address |
submitActionPlan | (plan: ActionPlan) => Promise<Array<{ hash: string; chainId: number }>> | Yes | Your on-chain execution callback |
onStatusChange | (status: SessionStatus) => void | No | Called on each status transition |
pollIntervalMs | number | No | Polling interval. Default: 3000. |
pollTimeoutMs | number | No | Max polling time. Default: 300000 (5 min). |
Action plans
Action plans bridge quotes and on-chain execution. Use these utilities to convert API responses into executable plans.depositQuoteToActionPlan
Converts a raw deposit API response to a singleActionPlan with deployType: "direct".
withdrawCalldataToActionPlans
Converts a raw withdrawal API response to anActionPlan[] (one per source chain) with deployType: "multisend".
combineActionPlans
Merges plans on the samechainId. "multisend" takes priority over "direct".
Discovery
Available on the SDK instance without account scoping.Account data
Available on the scoped client afterforAccount().
What to watch out for
Don’t try to callsdk.execute() on the BlendServerSdk instance. The server SDK has no built-in transaction execution. Use client.sessions.execute() with a submitActionPlan callback, or manage the lock/submit lifecycle manually.
Don’t expose your API key (sk_live_) in client code, logs, or version control. It grants full access to your organization’s accounts.
Don’t skip forAccount(). Account-scoped operations like sessions and balances require a scoped client. Calling them on the root SDK will fail.
Don’t forget that quoteDeposit uses inputAssetAddress on the server, not tokenAddress. The frontend SDK uses tokenAddress - the signatures differ.
Deposits & Withdrawals
Full deposit and withdrawal flows with cross-chain routing.
SDK Reference
Auth, accounts, balances, error codes, and types.