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

@revibase/core

v0.1.0

Published

Core types and helpers for Revibase multi-wallet: transfer intents and custom vault-paid transactions (sync or Jito bundles).

Readme

@revibase/core

Core types and helpers for Revibase multi-wallet: transfer intents and custom vault-paid transactions (sync or Jito bundles).

Contents: Create userCreate walletTransfer intents (SOL / SPL) → Custom transactions (sync or Jito).


Create a user account

Create one or more user accounts. Each user is identified by a member key (e.g. an Ed25519 signer) and a role. The helper returns an instruction—send it in a transaction with your Solana client.

import { createUserAccounts, UserRole } from "@revibase/core";
import type { TransactionSigner } from "gill";

declare const payer: TransactionSigner;
declare const memberSigner: TransactionSigner;

const createUserIx = await createUserAccounts({
  payer,
  createUserArgs: [{ member: memberSigner, role: UserRole.Member }],
});
// Build a tx with createUserIx; sign with payer + memberSigner, then send.

Create a wallet

Create a wallet (settings + vault) with an existing user as the initial member. The user must exist first (see Create a user account). Use the global counter for the next wallet index, then optionally set this wallet as the user’s delegate.

import {
  createWallet,
  editUserDelegate,
  fetchGlobalCounter,
  getGlobalCounterAddress,
  getSolanaRpc,
} from "@revibase/core";
import type { TransactionSigner } from "gill";

declare const payer: TransactionSigner;
declare const memberSigner: TransactionSigner;

const globalCounter = await fetchGlobalCounter(
  getSolanaRpc(),
  await getGlobalCounterAddress(),
);

const createWalletIx = await createWallet({
  index: globalCounter.data.index,
  payer,
  initialMember: memberSigner,
});

// Build a tx with createWalletIx; sign with payer + memberSigner, then send.

const setWalletAsDelegateIx = await editUserDelegate({
  payer,
  user: memberSigner,
  newDelegate: {
    index: globalCounter.data.index,
    settingsAddressTreeIndex: 0,
  },
});

// Build a tx with setWalletAsDelegateIx; sign with payer + memberSigner, then send.

After confirmation, use Resolve settings and compressed flag with this index to get settings, compressed, and walletAddress for transfers or custom transactions.


Transfer intents

Move SOL or SPL tokens from a multi-wallet via on-chain intent instructions.

1. Resolve settings and compressed flag

Using the member signer, get the delegated wallet’s settings and compression flag:

import {
  fetchUserAccountData,
  fetchSettingsAccountData,
  getSettingsFromIndex,
  getWalletAddressFromSettings,
} from "@revibase/core";
import type { TransactionSigner } from "gill";

declare const memberSigner: TransactionSigner;

const user = await fetchUserAccountData(memberSigner.address);
const delegatedWallet = user.wallets.find((w) => w.isDelegate);
if (!delegatedWallet)
  throw new Error("memberSigner is not delegated to any wallet");

const settingsIndex = delegatedWallet.index;
const settings = await getSettingsFromIndex(settingsIndex);
const settingsAccount = await fetchSettingsAccountData(settings);
const compressed = settingsAccount.isCompressed;
const walletAddress = await getWalletAddressFromSettings(settings);

Use settings, compressed, and (optionally) walletAddress in the following steps.

2. Native SOL transfer

import {
  nativeTransferIntent,
  retrieveTransactionManager,
  getSignedTransactionManager,
} from "@revibase/core";
import type { TransactionSigner } from "gill";

declare const payer: TransactionSigner;
declare const memberSigner: TransactionSigner;
declare const destination: string;

// For wallets with a transaction manager, add its signer. See Custom transactions for full flow.
const tmResult = retrieveTransactionManager(
  memberSigner.address.toString(),
  settingsAccount,
);
const transactionManagerSigner =
  "transactionManagerAddress" in tmResult
    ? await getSignedTransactionManager({
        transactionManagerAddress: tmResult.transactionManagerAddress,
        userAddressTreeIndex: tmResult.userAddressTreeIndex,
      })
    : null;

const instructions = await nativeTransferIntent({
  settings,
  destination,
  amount: 100_000n, // lamports
  signers: [
    memberSigner,
    ...(transactionManagerSigner ? [transactionManagerSigner] : []),
  ],
  payer,
  compressed,
});
// Build tx from instructions with prepareTransactionMessage (or similar), then send.

3. SPL / Token-2022 transfer

import {
  tokenTransferIntent,
  retrieveTransactionManager,
  getSignedTransactionManager,
} from "@revibase/core";
import type { Address, TransactionSigner } from "gill";
import { TOKEN_2022_PROGRAM_ADDRESS } from "gill/programs";

declare const payer: TransactionSigner;
declare const memberSigner: TransactionSigner;
declare const destinationWallet: Address;
declare const mint: Address;

const tmResult = retrieveTransactionManager(
  memberSigner.address.toString(),
  settingsAccount,
);
const transactionManagerSigner =
  "transactionManagerAddress" in tmResult
    ? await getSignedTransactionManager({
        transactionManagerAddress: tmResult.transactionManagerAddress,
        userAddressTreeIndex: tmResult.userAddressTreeIndex,
      })
    : null;

const instructions = await tokenTransferIntent({
  settings,
  payer,
  signers: [
    memberSigner,
    ...(transactionManagerSigner ? [transactionManagerSigner] : []),
  ],
  destination: destinationWallet,
  amount: 1_000_000n,
  mint,
  tokenProgram: TOKEN_2022_PROGRAM_ADDRESS,
  compressed,
});
// Build tx from instructions, then send. Same signer pattern as native transfer if using a transaction manager.

Custom transactions (sync vs bundle)

  • Small tx sizesync: prepareTransactionMessageprepareTransactionSyncsignAndSendTransaction
  • Larger tx sizeJito bundle: prepareTransactionMessageprepareTransactionBundlesignAndSendBundledTransactions

Prerequisite: settings, compressed, walletAddress, and settingsAccount from Resolve settings and compressed flag.

Sync: prepareTransactionSync

import {
  prepareTransactionMessage,
  prepareTransactionSync,
  signAndSendTransaction,
  retrieveTransactionManager,
  getSignedTransactionManager,
} from "@revibase/core";
import {
  createNoopSigner,
  type Address,
  type AddressesByLookupTableAddress,
  type TransactionSigner,
} from "gill";
import { getTransferSolInstruction } from "gill/programs";

declare const destination: Address;
declare const payer: TransactionSigner;
declare const memberSigner: TransactionSigner;
declare const addressLookups: AddressesByLookupTableAddress | undefined;

const transferIx = getTransferSolInstruction({
  source: createNoopSigner(walletAddress),
  destination,
  amount: 1_000_000n,
});

const transactionMessageBytes = prepareTransactionMessage({
  payer: walletAddress,
  instructions: [transferIx],
  addressesByLookupTableAddress: addressLookups,
});

const { transactionManagerAddress, userAddressTreeIndex } =
  retrieveTransactionManager(memberSigner.address.toString(), settingsAccount);
const transactionManagerSigner = await getSignedTransactionManager({
  transactionMessageBytes,
  transactionManagerAddress,
  userAddressTreeIndex,
});

const details = await prepareTransactionSync({
  compressed,
  payer,
  settings,
  transactionMessageBytes,
  signers: [
    memberSigner,
    ...(transactionManagerSigner ? [transactionManagerSigner] : []),
  ],
  addressesByLookupTableAddress: addressLookups,
});

const signature = await signAndSendTransaction(details);

Jito bundle

import {
  prepareTransactionMessage,
  prepareTransactionBundle,
  signAndSendBundledTransactions,
  pollJitoBundleConfirmation,
  retrieveTransactionManager,
  getSignedTransactionManager,
} from "@revibase/core";
import {
  createNoopSigner,
  type Address,
  type AddressesByLookupTableAddress,
  type TransactionSigner,
} from "gill";
import { getTransferSolInstruction } from "gill/programs";

declare const destination: Address;
declare const payer: TransactionSigner;
declare const memberSigner: TransactionSigner;
declare const addressLookups: AddressesByLookupTableAddress | undefined;

const transferIx = getTransferSolInstruction({
  source: createNoopSigner(walletAddress),
  destination,
  amount: 1_000_000n,
});
const transactionMessageBytes = prepareTransactionMessage({
  payer: walletAddress,
  instructions: [transferIx],
  addressesByLookupTableAddress: addressLookups,
});

const { transactionManagerAddress, userAddressTreeIndex } =
  retrieveTransactionManager(memberSigner.address.toString(), settingsAccount);
const transactionManagerSigner = await getSignedTransactionManager({
  transactionMessageBytes,
  transactionManagerAddress,
  userAddressTreeIndex,
});

const bundle = await prepareTransactionBundle({
  payer,
  settings,
  transactionMessageBytes,
  creator: transactionManagerSigner ?? memberSigner,
  executor: transactionManagerSigner ? memberSigner : undefined,
  compressed,
  addressesByLookupTableAddress: addressLookups,
  jitoBundlesTipAmount: 10_000, // optional, lamports
});

const bundleId = await signAndSendBundledTransactions(bundle);
const signature = await pollJitoBundleConfirmation(bundleId);