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

@usearete/adapter-web3js

v0.22.4

Published

@solana/web3.js wallet adapter for the Arete SDK instruction boundary

Readme

@usearete/adapter-web3js

An Arete WalletAdapter backed by @solana/web3.js.

The adapter compiles static-key v0 transactions, signs once, submits once, and confirms without rebuilding or resubmitting. It also supports unsigned fee estimation and simulation for Arete operation inspection.

See the transaction guide for complete application setup, scopes, failure handling, and troubleshooting.

transport: 'auto' uses the connected Arete client's authenticated transaction transport per invocation. Standalone auto mode uses connection when provided. Use transport: 'direct' to require direct Solana RPC, or pass a TransactionTransport object. A resolved Arete operation never falls back to direct RPC after an error.

const wallet = createWalletAdapter({ signer, transport: 'auto' })
const client = await Arete.connect(stack, { wallet })
await client.transaction(instructions)

Install

npm install @usearete/adapter-web3js @solana/web3.js @usearete/sdk

Node.js 18 or newer is supported. ESM and CommonJS entry points are included. Browser builds do not require an ambient Buffer global; the package imports its browser-compatible implementation explicitly.

Node Signer

import { Connection, Keypair } from '@solana/web3.js';
import { Arete } from '@usearete/sdk';
import { createKeypairWalletAdapter } from '@usearete/adapter-web3js';
import { MY_STACK } from './generated/my-stack';

const connection = new Connection('https://api.devnet.solana.com', 'confirmed');
const keypair = Keypair.fromSecretKey(/* secret key bytes */);
const wallet = createKeypairWalletAdapter({ connection, keypair });
const client = await Arete.connect(MY_STACK, { wallet });

const { signature, slot } = await client.instructions.buy({
  amount: 1_000_000n,
  maxSolCost: 100_000_000n,
  mint: 'So11111111111111111111111111111111111111112',
});

Configured additionalSigners are used when their addresses are required and are all published through wallet.signerAddresses. Per-send signers can be supplied through send.signers or send.additionalSigners.

Browser Wallets

createWalletAdapter accepts a wallet-adapter-style signer whose signTransaction method receives and returns a web3.js VersionedTransaction:

const wallet = createWalletAdapter({
  connection,
  signer: {
    publicKey,
    signTransaction,
    supportedTransactionVersions: walletAdapter.supportedTransactionVersions,
  },
});

In a React app using @solana/wallet-adapter-react, the ./react subpath does this bridging for you:

import { useSolanaWalletAdapter } from '@usearete/adapter-web3js/react';
import { AreteProvider } from '@usearete/react';
import { APP_STREAM_STACK } from './generated/app-stack';

const publishableKey = import.meta.env.VITE_ARETE_PUBLISHABLE_KEY;
if (!publishableKey) throw new Error('VITE_ARETE_PUBLISHABLE_KEY is required');

function Shell({ children }) {
  const wallet = useSolanaWalletAdapter(); // undefined until a wallet connects
  return (
    <AreteProvider
      stack={APP_STREAM_STACK}
      auth={{ publishableKey }}
      wallet={wallet}
    >
      {children}
    </AreteProvider>
  );
}

Hosted browser access requires the publishable key even when the app is only reading data. A wallet is required for signed operations, not for read-only viewing. autoConnect is omitted because its default is true; it controls only the initial connection, while autoReconnect independently defaults to true for recovery after an established connection is lost.

The wallet must be connected, expose a non-null PublicKey, and support transaction version 0. If supportedTransactionVersions is null or excludes 0, the adapter rejects before prompting or sending. If that property is omitted, the supplied signTransaction implementation is responsible for accepting v0 transactions.

Raw Wallet Standard solana:signTransaction features operate on byte-array request and response objects; they do not directly satisfy this interface. Bridge those feature calls to web3.js VersionedTransaction serialization/deserialization, or use a wallet-adapter integration that already exposes signTransaction.

Address lookup tables are not currently accepted by this adapter. Transactions use a v0 message with static account keys.

Inspection

Arete can inspect a prepared instruction or single-transaction operation without signing, submission, or a wallet prompt:

const prepared = await client.operations.deploy.prepare(params);
const inspection = await client.inspectOperation(prepared, {
  commitment: 'confirmed',
  minContextSlot,
});

console.log(inspection.transaction.feeLamports);
console.log(inspection.transaction.logs);
console.log(inspection.transaction.computeUnitsConsumed);
console.log(inspection.transaction.contextSlot);
console.log(inspection.programError);

Inspection compiles an unsigned v0 transaction, calls getFeeForMessage, and simulates with signature verification disabled. Arete core enriches simulation failures with the prepared operation's IDL error metadata. Multi-transaction flows are rejected by core rather than partially simulated.

Failure Outcomes

Adapter failures expose the structured outcome consumed by getTransactionFailureOutcome:

  • not-submitted: build, missing signer, wallet rejection, unsupported v0 wallet, or definite preflight rejection.
  • submitted-unknown: a signed transaction may have been submitted, but one status lookup could not prove the requested commitment.
  • chain-failed: confirmation or the status lookup reports an on-chain error.

Known signatures and landed slots are preserved. After an uncertain send or confirmation error, the adapter performs one signature-status lookup and never sends the transaction again.