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

@agentveins/adapter-solana

v0.2.0

Published

Solana wallet adapter for AgentVeins: USDC settlement on devnet, direct or x402.

Downloads

433

Readme

@agentveins/adapter-solana

Solana wallet adapter for AgentVeins. Settles USDC on devnet, either as a direct transfer or over x402.

The adapter moves the money. It does not decide whether the money should move: @agentveins/core does that, before this package is ever called.

npm install @agentveins/core @agentveins/adapter-solana

Usage

import { createGuard, type Policy } from "@agentveins/core";
import { fileAnchorStore, fileAuditSink } from "@agentveins/core/fs";
import { solanaAdapter } from "@agentveins/adapter-solana";

const guard = await createGuard({
  policy,
  agent: "research-agent",
  logId: "research-agent-main",
  adapters: [
    solanaAdapter({
      keypair,                 // webcrypto.CryptoKeyPair: devnet only
      rpcUrl: "https://api.devnet.solana.com",
      mode: "direct",          // or "x402"
    }),
  ],
  audit: fileAuditSink("./audit.jsonl"),
  anchor: fileAnchorStore("./audit.anchor.json"),
  signingKey,
});

The two modes

direct: settles today

Builds an SPL USDC transfer, signs it, submits it, and waits for confirmation by polling getSignatureStatuses, bounded by the transaction's lastValidBlockHeight and by a wall clock (90s) and attempt ceiling (300), both configurable.

Confirmation is not a detail. sendTransaction returns when a node accepts a transaction, which is not the same as it landing: blockhash expiry and congestion drops are ordinary on Solana. Returning success at acceptance would record a settlement for money that never moved and burn budget permanently, with no way to reverse it.

If confirmation times out while the transaction is still plausibly in flight, the guard records an uncertain audit entry carrying the signature and consumes the budget, while returning failed with error.code: "timeout" and error.txSig. Rounding against the agent means the count can never come in low.

⚠️ An agent that retries on a bare status === "failed" without reading error.code will spend budget twice for one uncertain payment. Check the code.

x402: builds valid payloads, not yet settled live

Requests the resource, receives a 402 quote, and pays by attaching a signed transaction in an X-PAYMENT header. The transaction is built the way the exact SVM scheme requires: fee payer taken from the quote's extra.feePayer (the facilitator pays gas), instructions ordered [SetComputeUnitLimit, SetComputeUnitPrice, TransferChecked], and only partially signed so the facilitator can sign slot 0 and broadcast.

Two refusals happen before anything is signed:

  • Price: the vendor declares the price after the guard already approved an amount. A quote asking for more is refused. A cheaper quote pays the cheaper price.
  • Recipient: if policy.recipients is set, a quote naming a destination you did not approve is refused. Without it, a compromised or DNS-hijacked endpoint can redirect the payment and every record still reads as a normal governed payment.

Status, precisely: the transaction is accepted by the shipped ExactSvmSchemeV1.verify() from @x402/svm, run offline as a test. Nothing has been settled against a live facilitator on devnet yet.

Scope

Devnet only. No mainnet configuration exists in this package, and no key controlling real value belongs anywhere near it.

Full documentation, including every guarantee and every limit: docs.agentveins.com

MIT