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

spraay-agent-wallet

v1.0.0

Published

Smart contract wallet provisioning for AI agents on Base. Session keys, spending limits, and time-bound permissions. Forked from Abstract Global Wallet.

Readme

spraay-agent-wallet 💧

Smart contract wallet provisioning for AI agents on Base. Forked from Abstract Global Wallet.

Factory-deployed minimal proxies with session keys, spending limits, and time-bound permissions — accessed via the Spraay x402 Gateway.

Install

npm install spraay-agent-wallet

Quick Start

import { SpraayWallet } from 'spraay-agent-wallet';

const sw = new SpraayWallet({
  privateKey: process.env.EVM_PRIVATE_KEY,  // Wallet with USDC on Base
});

// 1. Provision a wallet for your agent ($0.05 USDC)
const result = await sw.provision({
  agentId: 'trading-bot-007',
  agentType: 'langchain',
  mode: 'managed',
});
console.log('Wallet:', result.wallet.walletAddress);

// 2. Add a session key with spending limits ($0.02 USDC)
const session = await sw.addSessionKey({
  walletAddress: result.wallet.walletAddress,
  sessionKeyAddress: '0xYourSignerAddress',
  spendLimitEth: '0.5',
  durationHours: 24,
  allowedTargets: ['0xBatchContract'],
});
console.log('Expires:', session.session.expiresAt);

// 3. Query wallet info ($0.005 USDC)
const info = await sw.info(result.wallet.walletAddress);
console.log('Balance:', info.wallet.balanceEth, 'ETH');

// 4. Revoke a session key ($0.02 USDC)
await sw.revokeSessionKey(result.wallet.walletAddress, '0xOldSessionKey');

// 5. Predict address before deploying ($0.001 USDC)
const predicted = await sw.predictAddress('0xOwner', 'my-agent');
console.log('Will deploy to:', predicted.predictedAddress);

API

new SpraayWallet(config)

| Option | Type | Default | Description | |--------|------|---------|-------------| | privateKey | string | — | EVM private key (wallet with USDC on Base) | | x402PaymentHeader | string | — | Pre-built x402 payment header | | gatewayUrl | string | https://gateway.spraay.app | Gateway URL | | chainId | number | 8453 | Chain ID |

Methods

| Method | Price | Description | |--------|-------|-------------| | provision(options) | $0.05 | Deploy a smart contract wallet for an agent | | addSessionKey(options) | $0.02 | Add a session key with spend limits + expiry | | info(address) | $0.005 | Get wallet balance, metadata, session keys | | revokeSessionKey(wallet, key) | $0.02 | Revoke a session key immediately | | predictAddress(owner, agentId) | $0.001 | Predict wallet address before deployment |

Convenience

import { createSpraayWallet } from 'spraay-agent-wallet';
const sw = createSpraayWallet(process.env.EVM_PRIVATE_KEY);

Contracts

Deployed on Base mainnet:

| Contract | Address | |----------|---------| | Factory | 0xFBD832Db6D9a05A0434cd497707a1bDC43389CfD | | Implementation | 0x61818Ae8bC161D1884Fd8823985B80e6733C34E7 |

Also on Base Sepolia testnet:

| Contract | Address | |----------|---------| | Factory | 0xe483F189af41FB5479cd8695DbbA16cc5CF1071D | | Implementation | 0xb6843955D914aD61dc6A4C819E0734d96467a391 |

How It Works

  1. Agent pays $0.05 USDC via x402 to the Spraay Gateway
  2. Gateway calls the factory contract on Base
  3. Factory deploys a minimal proxy (EIP-1167) via CREATE2
  4. Agent receives a smart contract wallet with:
    • Session keys — temporary signers with spending caps
    • Time bounds — automatic expiry
    • Target restrictions — whitelist specific contracts
    • Agent metadata — identity for trust scoring

Exports

The package also exports contract ABIs and addresses for direct interaction:

import { FACTORY_ABI, WALLET_ABI, ADDRESSES } from 'spraay-agent-wallet';

Links

License

GPL-3.0 — same as the Abstract Global Wallet contracts this was forked from.