npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@blend-money/node

v1.1.4

Published

[![npm version](https://img.shields.io/npm/v/@blend-money/node.svg)](https://www.npmjs.com/package/@blend-money/node) [![npm downloads per week](https://img.shields.io/npm/dw/@blend-money/node.svg)](https://www.npmjs.com/package/@blend-money/node) [![npm

Readme

@blend-money/node

npm version npm downloads per week npm downloads per month

Server-side SDK for the Blend Protocol. API key authenticated for server-to-server integration.

Install

pnpm add @blend-money/node

Quick Start

import { BlendServerSdk } from "@blend-money/node";

const sdk = new BlendServerSdk({
  apiKey: "sk_live_...",
  accountTypeId: "your-account-type",
});

// 1. Discover what's available
const chains = await sdk.discover.depositChains();
const tokens = await sdk.discover.depositTokens(8453);

// 2. Look up an account by EOA address
const account = await sdk.lookupAccount("0x...");
// { accountId, safeAddress, chainsDeployed }

// 3. Or create one if it doesn't exist
const newAccount = await sdk.createAccount("0x...", 8453);

// 4. Get a scoped client for the account
const client = sdk.forAccount(account.accountId);

// 5. Use account data and session lifecycle
const balance = await client.account.balance();
const sessions = await client.sessions.list();

Configuration

const sdk = new BlendServerSdk({
  // Required
  apiKey: "sk_live_...", // Server-side API key (X-API-Key header)
  accountTypeId: "your-account-type", // Product identifier for URL routing

  // Optional
  baseUrl: "https://...", // API base URL override
  fiatCurrency: "EUR", // ISO 4217 code for multi-currency
  timeoutMs: 15000, // Request timeout (default: 15000)
  retries: 3, // Max retries for 429/5xx (default: 3)
});

API Reference

Discovery

No account scoping required.

const chains = await sdk.discover.depositChains();
// [{ chainId, name, displayName, iconUrl }]

const tokens = await sdk.discover.depositTokens(8453);
// [{ chainId, address, symbol, name, decimals, logoURI, price }]

const destinations = await sdk.discover.withdrawDestinations();
// [{ chainId, name, loanTokenAddress }]

const yieldData = await sdk.discover.yield();
// { accountTypeId, yieldBreakdown: [{ chainId, vaultAddress, breakdown, summary }] }

Account Lookup

const account = await sdk.lookupAccount("0x...");
// { accountId, safeAddress, chainsDeployed }

Account Creation

const account = await sdk.createAccount("0x...", 8453);
// { accountId, safeAddress, chainsDeployed }

Scoped Client

forAccount() returns a full BlendClient scoped to a specific account, with access to discovery, account data, and session lifecycle.

const client = sdk.forAccount(account.accountId);

// Account data
const balance = await client.account.balance();
const positions = await client.account.positions();
const returns = await client.account.returns();

// Safe management
const resolution = await client.account.safe.resolve(8453);
await client.account.safe.request(8453);

// Session lifecycle
const session = await client.sessions.createSession({ forceReset: true });
const quoted = await client.sessions.quoteDeposit(session.intentId, { ... });
const locked = await client.sessions.lock(session.intentId, { signerAddress: "0x..." });
const submitted = await client.sessions.submit(session.intentId, { txHashes: [...] });
const result = await client.sessions.execute(session.intentId, { ... });
const sessions = await client.sessions.list();
await client.sessions.cancel(session.intentId);

See the @blend-money/fe README for full documentation on account data, session lifecycle, amount helpers, and error handling — the scoped client API is identical.

Amount Helpers

Re-exported from @blend-money/core:

import { parseAmount, formatAmount } from "@blend-money/node";

const smallest = parseAmount("100.50", 6); // "100500000"
const human = formatAmount("100500000", 6); // "100.5"

Error Handling

All error types are re-exported from @blend-money/core:

import { SdkError, SESSION_ERROR_CODES } from "@blend-money/node";

try {
  await client.account.balance();
} catch (err) {
  if (err instanceof SdkError) {
    console.log(err.code); // e.g. "INTENT_NOT_FOUND"
    console.log(err.status); // HTTP status
    console.log(err.getUserMessage()); // human-readable message
    console.log(err.isRetryable()); // true for 429, 5xx, network errors
  }
}

Development

From the monorepo root:

pnpm install                                # Install all dependencies
pnpm --filter @blend-money/node build       # Build this package
pnpm --filter @blend-money/node dev         # Watch mode
pnpm --filter @blend-money/node test        # Run tests (interactive)
pnpm --filter @blend-money/node test:run    # Run tests (CI)
pnpm --filter @blend-money/node check-types # Type check

Or run pnpm build, pnpm test:run, etc. from the monorepo root to run across all packages.

License

MIT