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

@charterlabs/rhinestone-sdk

v0.4.8

Published

Rhinestone SDK for Charter Labs

Readme

Rhinestone SDK

End-to-end chain abstraction and modularity toolkit

Rhinestone is a vertically integrated smart wallet and crosschain liquidity platform. The SDK provides a unified interface for deploying and managing self-custodial smart accounts, powered by an intent-based transaction infrastructure that enables seamless crosschain execution without bridging or gas tokens.

The platform combines modular smart account tooling with an intent engine (Warp) that aggregates settlement layers through a unified relayer market. This handles routing, token liquidity, and crosschain orchestration across all supported chains.

Documentation

Features

  • Crosschain Transactions - Execute transactions on any target chain using assets from any source chain. The orchestrator handles routing and settlement. Learn more

  • Swaps - Token exchanges via solver-based swaps or injected DEX aggregator swaps, integrated into crosschain transaction execution. Learn more

  • Passkeys - WebAuthn-based authentication for smart accounts, replacing seed phrases with device biometrics. Learn more

  • Smart Sessions - Onchain permissions system for scoped transaction automation, enabling one-click UX and server-side execution with granular policies. Learn more

  • Gas Sponsorship - Subsidize gas, bridge, and swap fees for users by depositing USDC on Base. Applies across all supported chains. Learn more

Installation

npm install viem @rhinestone/sdk
bun install viem @rhinestone/sdk

Authentication

The SDK supports two authentication modes: API key and JWT.

API Key

Pass the API key from the Rhinestone dashboard:

const rhinestone = new RhinestoneSDK({
  auth: {
    mode: 'apiKey',
    apiKey: 'your-api-key',
  },
})

JWT (Experimental)

JWT authentication uses RS256-signed tokens for fine-grained access control. There are two integration patterns depending on your architecture:

Client-server (SDK runs in browser/client)

When the SDK runs on the client and a separate backend holds the signing key, fetch tokens via HTTP:

const rhinestone = new RhinestoneSDK({
  auth: {
    mode: 'experimental_jwt',
    accessToken: async () => {
      const res = await fetch('/api/auth/token')
      const { token } = await res.json()
      return token
    },
    // Only needed for sponsored intents:
    getIntentExtensionToken: async (intentInput) => {
      const res = await fetch('/api/auth/extension-token', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ intentInput }),
      })
      const { token } = await res.json()
      return token
    },
  },
})

Your backend is responsible for signing JWTs with the correct claims. See the JWT documentation for the required token format.

Same-host (SDK and signing key on the same server)

When the SDK runs server-side with access to the private key, use createJwtSigner to sign tokens in-process without an HTTP round-trip:

import { createJwtSigner } from '@rhinestone/sdk/jwt-server'

const signer = createJwtSigner({
  jwt: {
    privateKey: myJwk, // RS256 private key in JWK format
    integratorId: 'int_abc',
    projectId: 'proj_xyz',
    appId: 'app_prod',
    keyId: 'key_1',
  },
})

const rhinestone = new RhinestoneSDK({
  auth: { mode: 'experimental_jwt', ...signer },
})

createJwtSigner returns { accessToken, getIntentExtensionToken } — the same shape as the auth config, so you can spread it directly. It handles all claim structure, key caching, and intent digest computation internally.

To control which intents your backend sponsors, pass shouldSponsor filters. The signer checks them before signing — denied requests throw a SponsorshipDeniedError:

import { createJwtSigner } from '@rhinestone/sdk/jwt-server'

const signer = createJwtSigner({
  // ...
  shouldSponsor: {
    chain: ({ id }) => [1, 8453, 10].includes(id),
    account: async (address) => isUser(address),
  },
})

Quickstart

Create a smart account:

import { RhinestoneSDK } from '@rhinestone/sdk'

const rhinestone = new RhinestoneSDK({ apiKey: 'your-api-key' })
const account = await rhinestone.createAccount({
  owners: {
    type: 'ecdsa',
    accounts: [signer],
  },
})

Send a crosschain transaction:

const transaction = await account.sendTransaction({
  sourceChains: [baseSepolia],
  targetChain: arbitrumSepolia,
  calls: [
    {
      to: 'USDC',
      value: 0n,
      data: encodeFunctionData({
        abi: erc20Abi,
        functionName: 'transfer',
        args: [recipient, amount],
      }),
    },
  ],
  tokenRequests: [{ address: 'USDC', amount }],
})

const result = await account.waitForExecution(transaction)

For a complete walkthrough, see the Quickstart guide.

Migrating from Orchestrator SDK

To migrate from the Orchestrator SDK, replace all imports of @rhinestone/orchestrator-sdk with @rhinestone/sdk/orchestrator.

Let us know if you encounter any issues!

Contributing

For feature or change requests, feel free to open a PR, start a discussion or get in touch with us.