Skip to main content
Install the SDK, make your first deposit, and verify the balance. Under 30 minutes from zero to working code.
Before you start, you need a portal account with at least one active account type and credentials set up (SIWE domain for frontend, API key for server).
1

Install the SDK

The frontend SDK depends on viem for wallet interactions and chain management.
2

Initialize the SDK

blend.ts
The signMessage function connects your wallet adapter. If you use wagmi, pass signMessageAsync from the useSignMessage hook. Only the frontend SDK needs the paymaster registry. SDK 3.0.1 gets gas pricing from the bundler configured in that registry.
3

Sign in the user

sign-in.ts
This starts a SIWE flow. The user’s wallet signs a challenge message, and Blend returns a session with their account ID and deterministic Safe address. This creates the account record if needed, but it does not deploy the Safe on-chain. Sessions last 1 hour and auto-refresh. If you omit chainId, the SDK uses Ethereum mainnet (1) in the SIWE message.The chainId here is for the SIWE challenge message, not for Safe deployment. Check session.chainsDeployed to see where the Safe is live. If the deposit chain isn’t listed, request deployment first. See Safe deployment.
4

Discover chains and tokens

discover.ts
depositChains() returns all supported deposit chains. depositTokens() returns tokens on that chain. Pass the user’s address to see their balances. Sign in before calling discovery methods. Frontend API operations outside the SIWE challenge and verification calls require the active SIWE session.
5

Quote the deposit

quote.ts
The quote shows input/output amounts, fees, and estimated time. It expires after a few minutes. If you need to change the amount, call quoteDeposit again - the SDK reuses the same session.
Use parseAmount from the installed @blend-money/fe package to convert human-readable amounts to the smallest unit. USDC has 6 decimals, so parseAmount("100", 6) returns "100000000".
6

Execute the deposit

execute.ts
The SDK locks the session, builds the transaction, and submits it. deriveSigner is called once for deposits. Return clients for the requested chain and attach an account whose address matches signerAddress. Add every chain your account type supports to chainsById. For smart wallets such as Coinbase Wallet, set isContractSigner: true.
7

Check the balance

balance.ts
The balance reflects the deposit after settlement. This usually takes under a minute for same-chain deposits.
8

Handle errors

errors.ts
SdkError gives you a machine-readable code, a getUserMessage() for displaying to users, and isRetryable() for handling transient failures like rate limits and server errors.

What just happened

Your deposit followed this path:
  1. The SDK created a session and requested a quote from Blend’s API.
  2. Blend calculated the optimal route, including any bridge steps for cross-chain deposits.
  3. The transaction was submitted on-chain. Gas was sponsored through the configured frontend bundler or paid by your server signer.
  4. Funds landed in the user’s Safe and were allocated to vaults based on your account type’s allocation.
The user’s Safe is a real Gnosis Safe. Only whitelisted modules can move funds. The user retains ownership at all times.

What to watch out for

Don’t create a new session for every quote. Call quoteDeposit again on the same OPEN session to update the amount, token, or chain. Use forceReset: true only when you want to discard the active session, including when switching from a deposit to a withdrawal. Don’t skip error handling. Quotes expire, flow plans can conflict with deposits, and wallets can reject signatures. Check error.isRetryable() before retrying. Don’t hard-code chain IDs or token addresses. Use discover.depositChains() and discover.depositTokens() to build your UI dynamically.

Go-live checklist

1

Verify your SIWE domain

Confirm the domain in Settings > Credentials matches your production URL. Not your staging URL. Not localhost.
2

Rotate credentials

Create fresh API keys for production. Don’t reuse development keys. Deactivate any test keys.
3

Test end-to-end

Make a real deposit and withdrawal on each supported chain. Verify balances update correctly. Test with amounts under $1 to keep costs low.
4

Confirm allocations

Check that your account type’s vault config is Active (not Pending or Provisioning). Deposits to an account type without active infrastructure will fail.
5

Set flow plan mode

Decide whether to auto-approve flow plans or review them manually. Auto-approve is simpler but gives you less control over rebalancing timing.
6

Verify error handling

Test your app’s behavior for expired quotes, rejected wallet signatures, and FLOWPLAN_CONFLICT errors. Users should see helpful messages, not stack traces.
Once you’ve completed the checklist, your integration is production-ready. Deposits, withdrawals, and rebalancing will work end-to-end.

Frontend SDK reference

Full method reference for quoting, execution, and account data.

Server SDK reference

Full method reference for account management and session lifecycle.

Deposits and withdrawals

Cross-chain routing, re-quoting, and withdrawal coordination.

Best practices

Credential security, session management, and error recovery patterns.
Last modified on July 24, 2026