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

@suilend/sui-core

v2.2.0

Published

Isomorphic Sui core: coin types, coin metadata, transactions, pricing, and formatting shared across Suilend frontends, SDKs, and backend

Readme

@suilend/sui-core

The canonical, isomorphic Sui core for the Suilend ecosystem. It holds the pieces that must be identical everywhere they run — on the frontend, inside the protocol SDKs, and in the backend indexer/workflows:

  • Coin types — normalized coin-type constants, grouped sets (stablecoins, BTC, ETH, points, mSEND), Pyth price-feed metadata, and the coin-type registry (COINTYPE_LOGO_MAP, COINTYPE_SYMBOL_MAP, …) plus guards (isSui, isStablecoin, isSendPoints, extractCTokenCoinType, …).
  • Coin metadata — getCoinMetadataMap and the Token type.
  • Transactions — spendable-coin construction, coin/object enumeration, balance-change helpers.
  • Pricing — getPrice / getHistoryPrice.
  • Formatting — number / token / USD / id formatters.
  • Constants — API_URL, MAX_U64, MS_PER_YEAR, RPC/explorer config.

This package is the source of truth. @suilend/sui-fe re-exports it and layers the browser/React-only surface on top; the protocol SDKs and the backend depend on it directly.

Isomorphic by design

Every module runs unchanged in Node and the browser. The only browser-specific code path — the IndexedDB metadata cache used by getCoinMetadataMap — is feature-detected (typeof indexedDB === "undefined") and becomes a no-op outside the browser, so metadata still resolves from the API in Node.

API host

API_URL is PROD_API_URL unless SUILEND_API_URL is set, with any trailing slash dropped. The helpers here and in @suilend/sdk build every request from API_URL, so the variable moves all of them, for example to STAGING_API_URL.

No bundler passes SUILEND_API_URL into a browser bundle by itself. Define process.env.SUILEND_API_URL explicitly, for example with Vite's define or the env key in next.config.js. Next.js inlines only NEXT_PUBLIC_* keys on its own, so a plain environment variable leaves the browser on prod.

A relative value such as /_proxy/mainnet/lending works only in a browser bundle. In Node, use an absolute URL.

The API answers browsers only from Suilend's own https:// origins. A frontend dev server on http://localhost sets SUILEND_API_URL to a path that it proxies to the API.

Peer dependency

@mysten/sui is a peer dependency (>=2.17.0 <3) — the consumer pins the exact version so there is a single copy in the tree.

Build

yarn build     # tsc -> ./dist, then rewrite relative imports to .js (ESM)
yarn typecheck # tsc --noEmit

Releasing

Publishing is automated by .github/workflows/sui_core_publish.yaml via npm OIDC Trusted Publishing — there is no npm token to manage or rotate, and provenance is attached automatically.

To cut a release:

  1. Bump version in package.json and merge it.

  2. Push a tag whose version matches:

    • release-sui-core-v<version> → published to the latest dist-tag.
    • release-sui-core-prerelease-<version> → published to the next dist-tag.
    git tag release-sui-core-v0.1.0 && git push origin release-sui-core-v0.1.0

    The workflow fails loudly if the tag version and package.json version disagree.

One-time bootstrap (first publish of this package name only): Trusted Publishing attaches to a package that already exists on npm, so publish once manually — yarn release locally (npm publish with 2FA), or a short-lived 90-day granular token — then on npmjs.com set @suilend/sui-core → Settings → Trusted Publisher → GitHub Actions (org fireflyprotocol, repo lending-mono, workflow sui_core_publish.yaml). Every release after that is token-free.