@blend-money/sdk is the public SDK package for Blend neobank integrations. It exports one class, BlendClient, with flat domain namespaces:
The Blend SDK and API must be called from your backend server. Never expose your API key in frontend code. Embedding the SDK in a browser or mobile client leaks your credentials and compromises your integration.
Install
pnpm add @blend-money/sdk
Initialize
import { BlendClient } from "@blend-money/sdk";
import { http } from "viem";
const client = new BlendClient({
baseUrl: "https://api.portal.blend.money",
apiKey: "blend_xxx",
neobankId: "acme-bank",
accountTypeId: "uuid-xxx",
fiatCurrency: "EUR",
transports: {
8453: http("https://base-mainnet.g.alchemy.com/v2/MY_KEY"),
},
paymasterTransport: http("https://api.pimlico.io/v2/8453/rpc?apikey=MY_KEY"),
});
Create one client per neobank plus account type. Per-user values like the EOA, accountId, and Safe address are passed as method arguments, never stored in config.
Configuration fields
| Field | Type | Required | Description |
|---|
baseUrl | string | No | Blend API base URL (default: https://api.portal.blend.money) |
apiKey | string | Yes | Sent as X-API-Key header on every request |
neobankId | string | Yes | Your neobank slug. Used in the /extern/:neobankId/ path segment |
accountTypeId | string | Yes | Account type UUID. Used in /extern/:neobankId/:accountTypeId/ |
fiatCurrency | string | No | ISO 4217 currency code (e.g. "EUR"). When set, all monetary response fields include an additional currency key alongside USD |
transports | Record<number, Transport> | Yes | Viem transports keyed by chain ID. Your RPC infrastructure |
paymasterTransport | Transport | Yes | Viem transport for the paymaster / bundler (e.g. Pimlico) |
timeoutMs | number | No | Request timeout in milliseconds (default: 15000) |
retries | number | No | Max retry attempts for retryable errors (default: 3) |
The SDK automatically retries on 429, 500, 502, 503, and 504 responses with exponential backoff up to retries attempts. You do not need to implement retry logic on top of the client.
Error handling
import { SdkError } from "@blend-money/sdk";
try {
const account = await client.safe.account(userEoa);
} catch (error) {
const sdkError =
error instanceof SdkError ? error : SdkError.fromAxiosError(error);
if (sdkError.isRetryable()) {
// retry with backoff
} else {
console.error(sdkError.getUserMessage());
}
}
Types
All major config, domain, and integration types are exported directly from @blend-money/sdk, including:
BlendClientConfig, Hex, ChainId
FiatAmount, FiatAmountString
SafeAccountResponse, ResolvedAccountResponse, SafeResolution
BalanceResponse, BalancePerChain, BalanceHistoryParams, HeldAsset
PositionsResponse, PositionEvent, VaultEvent, RebalanceEvent
PositionBalanceRecord
ReturnsResponse
YieldResponse, ChainYieldBreakdown, YieldBreakdownSummary
SupportedChain, DepositToken, DepositQuoteParams, DepositQuoteResult
ActionPlan, Txn, QuoteFees
WithdrawDestination, WithdrawCalldataParams, WithdrawCalldataResult
SdkError
Advanced utilities
The SDK also exports TransactionHandler, SafeMultisendManager, SafeOperationOptions, and combineActionPlans for on-chain Safe operations.
combineActionPlans merges multiple ActionPlan objects into a single plan for batch execution. TransactionHandler.submitActionPlan() is the standard way to execute any ActionPlan returned by the SDK.