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

@hobba-io/core

v0.1.3

Published

Hobba SDK — shared on-chain logic (deposit/borrow flows, position reads, PDAs, constants, account resolvers) for the Hobba app, the embeddable widget and partner integrations.

Readme

@hobba-io/core

Hobba SDK — the shared on-chain logic behind app.hobba.io: deposit/borrow flows, position reads, projection math, PDAs, constants and account resolvers for the Hobba program on Solana. Consumed by the Hobba app, the embeddable widget and partner integrations.

Install

npm install @hobba-io/core @coral-xyz/anchor @solana/web3.js @solana/spl-token bn.js

The Solana stack is declared as peer dependencies so your bundle holds exactly one copy of @solana/web3.js / bn.js (two copies break instanceof PublicKey checks). @kamino-finance/klend-sdk is an optional peer — only needed if you use the server-side @hobba-io/core/rates subpath.

Bundler required. This package ships ESM with extensionless relative imports and is targeted at bundler consumers (Next.js/webpack, esbuild/tsup, Vite). It is not consumable from bare Node ESM without a bundler or a loader such as tsx.

Quick start

import {
  executeDepositBorrow,
  executeAction,
  getPosition,
  getPositionMetrics,
  getQuote,
  getLimits,
  parseCollateral,
  parseUsdc,
  CBBTC_MINT,
  SOL_MINT,
} from "@hobba-io/core";

// One-call onboarding: routes the lender, initializes first-time users
// (origin id recorded on-chain), wraps SOL, resolves accounts/LUTs, sends
// and confirms with tick-error recovery.
const { depositSig, borrowSig, lender } = await executeDepositBorrow({
  connection,                      // your web3.js Connection
  signer,                          // { publicKey, signTransaction }
  collateralMint: CBBTC_MINT,      // or SOL_MINT
  depositAmount: parseCollateral("0.01", CBBTC_MINT),
  borrowAmount: parseUsdc("250"),
  apiBaseUrl: "https://app.hobba.io", // Hobba backend serving /api/juplend-operate, /api/lut, ...
  onStep: (s) => console.log(s),
});

Follow-up actions on existing positions use executeAction({ action: "deposit" | "borrow" | "repay" | "withdraw", amount, ... }); reads use getPosition / getPositionMetrics / getQuote / getLimits with the same { connection, owner, collateralMint, apiBaseUrl } shape. Pure-math variants (computePositionMetrics, computeQuote) accept pre-fetched inputs for synchronous per-keystroke UI math.

Cluster selection

The program id baked into PROGRAM_ID is selected at build time from environment variables your bundler must define/inline:

| Env | Program | | --- | --- | | NEXT_PUBLIC_MAINNET=true | mainnet Hobbakk1LmW2DhE4nAKnCeU1iK7V7pKHTq3ihaE2i8qG | | NEXT_PUBLIC_STAGING=true | staging | | (neither) | local/surfpool development id |

Next.js inlines NEXT_PUBLIC_* automatically; other bundlers should define process.env.NEXT_PUBLIC_MAINNET accordingly.

Subpath exports

The root barrel carries the high-level flows and browser-safe helpers. Additional modules are importable by subpath (all covered by the ./* export):

  • @hobba-io/core/constants, /pdas, /amountUtils, /marketConfig, /userState, /limits
  • @hobba-io/core/idl (authoritative Anchor IDL as HOBBA_IDL)
  • @hobba-io/core/vault/vaultAccounts, /kamino/obligationParser
  • @hobba-io/core/juplend/tickMath, /juplend/tickUtils, /juplend/vaultConfigParser
  • @hobba-io/core/oracle/scopePrice — server-leaning
  • @hobba-io/core/ratesserver-only (lazily requires the optional @kamino-finance/klend-sdk peer for reserve decoding); keep it out of browser bundles

License

ISC