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

@utexo/rgb-sdk-core

v1.0.0-beta.9

Published

Shared core for RGB SDK — platform-agnostic interfaces, types, and business logic

Readme

@utexo/rgb-sdk-core

Shared core for RGB SDK — platform-agnostic interfaces, types, and business logic.

Overview

This package provides the common foundation used by the RGB SDK client libraries (@utexo/rgb-sdk, @utexo/rgb-sdk-rn, @utexo/rgb-sdk-web). It includes:

  • Protocol contract — IUTEXOProtocol and its domain groups (ILightningNode, ILightningPayments, IAsyncPayments, IOnchainTransfers, IRgbAssets, IBitcoinWallet) plus the optional carriers (IPsbtSigning, IBeginEndFlows)
  • Bindings & signing — IRgbLibBinding, ISigner, and the RLN model/interfaces
  • LSP flows — UtexoLsp, UtexoLSPClient and their types (see below)
  • Crypto utilities — key derivation, PSBT helpers, message signing, VSS
  • Types & validation — wallet models, network constants, input validation
  • Error handling — standardized error classes

Installation

npm install @utexo/rgb-sdk-core

Usage

import { generateKeys, type IUTEXOProtocol } from '@utexo/rgb-sdk-core';

LSP flows

UtexoLsp composes the utexo-lsp HTTP API with a wallet into the flows apps actually use — channel setup, receiving RGB over Lightning, Lightning Addresses, and paying them. It depends on ILspWallet, a narrow structural interface, so it lives here rather than in a platform package; every platform wallet satisfies it by implementing IUTEXOProtocol.

Most apps reach it through their platform SDK (wallet.createLsp()) rather than constructing it directly.

| Method | What it does | |--------|--------------| | connect() / waitForChannel() | Peer with the LSP and wait until it has provisioned a usable asset channel | | receiveAsset() / awaitReceiveSettlement() | Be paid on-chain in RGB and delivered over Lightning | | sendAsset() | The reverse: pay over Lightning, LSP sends RGB on-chain | | enableLightningAddress() / refillHashPool() | Register an APay hash batch and get an LSP-hosted Lightning Address | | payAddress() / quoteAddress() | Pay a Lightning Address, or just quote the invoice | | discoverAddress() / listPayableAssets() | What an address can be paid in, from LNURL discovery | | requestExternalInvoice() | Quote a hosted BOLT11 for a payer that is not this wallet | | payExternalInvoice() / externalPaymentStatus() | Pay a third party's plain BOLT11 out of an asset this wallet does not hold |

Two assets

An LSP can serve one asset over Lightning while accepting another that it converts to it 1:1 — typically an LNUSDT-shaped asset it provisions, and a canonical on-chain USDT its users already hold. The two are unrelated RGB contracts; the pairing is an LSP operator setting, and the rate is the operator's word rather than anything the protocol enforces.

Where that applies:

  • Receiving — receiveAsset() names only the Lightning-side asset. The LSP resolves the on-chain counterpart, so its contract id is never configured client-side and comes back as onchainAssetId.
  • Paying an address — omit asset.assetId and selectPaymentAsset() reads the address's payout and accepted assets off discovery, then picks by local liquidity. Conversion is the fallback, not the default: quoting the payout asset trusts the LSP for delivery only, converting also trusts it for the second leg's amount.
  • Relaying — payExternalInvoice() pays an ordinary third-party invoice out of a different asset. Both legs share that invoice's payment hash, and the SDK decodes the LSP's HODL invoice locally and refuses the quote unless the hash, the assets and the amounts match what the LSP reported.

Worked examples, one file per flow: rgb-sdk-rn/examples/lsp-two-assets.

License

MIT