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

@tuaregsand/guardian-aa-sdk

v0.1.0

Published

Guardian-AA SDK - Zero-Knowledge AI Wallet Copilot SDK

Downloads

10

Readme

Guardian-AA SDK

Zero-Knowledge AI Wallet Copilot SDK for TypeScript/JavaScript

npm version License: Custom TypeScript Build Status Tests Coverage

The Guardian-AA SDK provides a comprehensive TypeScript/JavaScript interface for building applications with Guardian-AA's zero-knowledge proof system, ERC-4337 account abstraction, and gasless transaction capabilities.

🎉 Status: Production Ready (Phase 3 Complete)

✨ Features

  • 🔐 Zero-Knowledge Proofs: Generate and verify SHA256 ZK proofs using Halo2
  • Account Abstraction: ERC-4337 compliant smart contract wallets
  • 🚫 Gasless Transactions: Meta-transaction support with paymaster integration
  • 🔗 Multi-Signature: Advanced multi-sig wallet functionality
  • 🛠️ Developer-Friendly: Full TypeScript support with comprehensive documentation
  • 🧪 Production-Ready: Robust error handling and validation
  • 📦 Tree-Shakable: Optimized bundle sizes with ESM support
  • 🔄 Cross-Platform: CommonJS, ESM, and TypeScript definitions included

📦 Installation

# npm
npm install @tuaregsand/guardian-aa-sdk

# yarn
yarn add @tuaregsand/guardian-aa-sdk

# pnpm
pnpm add @tuaregsand/guardian-aa-sdk

Peer Dependencies

npm install @noble/hashes @noble/curves

🚀 Quick Start

Basic Setup

import { createSepoliaGuardianAA } from '@tuaregsand/guardian-aa-sdk';
import { ethers } from 'ethers';

// Create SDK instance for Sepolia testnet
const guardian = createSepoliaGuardianAA();

// Initialize with a signer
const privateKey = 'your-private-key';
const signer = new ethers.Wallet(privateKey);

await guardian.initialize(signer);

Generate Zero-Knowledge Proofs

// Get ZK client
const zkClient = guardian.getZkClient();

// Generate proof for sensitive data
const data = new TextEncoder().encode('sensitive transaction data');
const proof = await zkClient.generateProof(data);

console.log('Proof generated:', {
  hash: proof.hash,
  generationTime: proof.generationTime,
  proofSize: proof.proof.length
});

// Verify the proof
const verification = await zkClient.verifyProof(data, proof.proof, proof.hash);
console.log('Proof valid:', verification.status === 'VALID');

Deploy Smart Contract Wallets

// Get contracts client
const contracts = guardian.getContractsClient();

// Deploy a simple account
const simpleAccount = await contracts.deploySimpleAccount(
  signer.address, // owner
  0n // salt
);

console.log('Simple account deployed at:', simpleAccount.getAddress());

// Deploy a multi-sig account
const multiSigAccount = await contracts.deployMultiSigAccount(
  [signer.address, '0x...'], // owners
  2, // threshold
  0n // salt
);

console.log('Multi-sig account deployed at:', multiSigAccount.getAddress());

Execute Gasless Transactions

// Create a transaction
const transaction = {
  to: '0x...' as Address,
  value: ethers.parseEther('0.1'),
  data: '0x',
  operation: 0
};

// Sign the transaction
const signature = await signer.signMessage('transaction-hash');

// Execute with paymaster (gasless)
const txHash = await contracts.executeTransaction(
  simpleAccount,
  transaction,
  signature,
  true // use paymaster
);

console.log('Gasless transaction executed:', txHash);

📚 API Reference

Main SDK Class

GuardianAA

The main SDK client that provides unified access to all Guardian-AA functionality.

import { GuardianAA, createGuardianAA } from '@tuaregsand/guardian-aa-sdk';

const config = {
  network: {
    chainId: 11155111,
    name: 'Ethereum Sepolia',
    rpcUrl: 'https://sepolia.infura.io/v3/your-key',
    currency: 'ETH',
    isTestnet: true
  },
  zkConfig: {
    circuitK: 14,
    useCachedKeys: true,
    timeout: 30000
  },
  debug: true
};

const guardian = new GuardianAA(config);
await guardian.initialize(signer);

Methods:

  • initialize(signer?: ethers.Wallet): Initialize the SDK
  • getZkClient(): Get ZK proof client
  • getContractsClient(): Get contracts client
  • getProvider(): Get Ethereum provider
  • getSigner(): Get current signer
  • updateSigner(signer): Update the signer
  • isReady(): Check if SDK is ready
  • cleanup(): Cleanup resources

ZK Proof Client

ZkClient

Handles zero-knowledge proof generation and verification.

const zkClient = guardian.getZkClient();

// Generate single proof
const proof = await zkClient.generateProof(data);

// Generate batch proofs
const batchResult = await zkClient.generateBatchProofs({
  inputs: [data1, data2, data3],
  parallelization: true
});

// Verify proof
const verification = await zkClient.verifyProof(data, proof.proof, proof.hash);

// Combined prove and verify
const { proof, verification } = await zkClient.proveAndVerify(data);

Contracts Client

ContractsClient

Manages smart contract interactions and account operations.

const contracts = guardian.getContractsClient();

// Account deployment
const simpleAccount = await contracts.deploySimpleAccount(owner, salt);
const multiSigAccount = await contracts.deployMultiSigAccount(owners, threshold, salt);

// Transaction execution
const txHash = await contracts.executeTransaction(account, transaction, signature);
const batchTxHash = await contracts.executeBatchTransaction(account, batch, signature);

// Gas estimation
const gasEstimate = await contracts.estimateUserOpGas(userOp);

// Account management
const balance = await contracts.getAccountBalance(accountAddress);
await contracts.depositForAccount(accountAddress, amount);

Account Classes

SimpleAccount

ERC-4337 account with ECDSA signature verification.

// Get account instance
const account = contracts.getSimpleAccount(accountAddress);

// Build user operation
const userOp = await account.buildUserOperation(transaction);

// Execute transaction
const result = await account.execute(transaction, signature);

// Execute batch
const batchResult = await account.executeBatch(batch, signature);

MultiSigAccount

Multi-signature account with threshold-based execution.

// Get multi-sig account
const multiSig = contracts.getMultiSigAccount(address, threshold, signers);

// Signer management
await multiSig.addSigner(newSigner, signatures);
await multiSig.removeSigner(oldSigner, signatures);
await multiSig.changeThreshold(newThreshold, signatures);

// Get signer info
const { signers, threshold } = await multiSig.getSignerInfo();

Utility Functions

Validation

import { 
  isValidAddress, 
  isValidSignature, 
  isValidUserOperation,
  validateAccountDeployment 
} from '@tuaregsand/guardian-aa-sdk';

const isValid = isValidAddress('0x...');
const isValidSig = isValidSignature('0x...');
const { isValid, errors } = validateAccountDeployment({ owner, threshold });

Formatting

import { 
  formatAddress, 
  formatEther, 
  formatGwei,
  truncateAddress 
} from '@tuaregsand/guardian-aa-sdk';

const checksummed = formatAddress(address);
const ethAmount = formatEther(weiAmount);
const gasPrice = formatGwei(weiGasPrice);
const short = truncateAddress(address);

Cryptography

import { 
  generatePrivateKey,
  signMessage,
  verifySignature,
  hashSHA256,
  getUserOpHash 
} from '@tuaregsand/guardian-aa-sdk';

const privateKey = generatePrivateKey();
const signature = await signMessage(message, privateKey);
const isValid = verifySignature(message, signature, address);
const hash = hashSHA256(data);

🏗️ Advanced Usage

Custom Network Configuration

import { createGuardianAA } from '@guardian-aa/sdk';

const customNetwork = {
  chainId: 31337,
  name: 'Local Network',
  rpcUrl: 'http://localhost:8545',
  currency: 'ETH',
  isTestnet: true
};

const guardian = createGuardianAA(customNetwork, {
  zkConfig: {
    circuitK: 16, // Higher for better security
    useCachedKeys: true,
    enableBenchmarking: true
  },
  debug: true
});

Batch Operations

// Batch ZK proof generation
const batchProofs = await zkClient.generateBatchProofs({
  inputs: [data1, data2, data3],
  parallelization: true,
  batchId: 'batch-001'
});

// Batch verification
const verifications = await zkClient.verifyBatchProofs([
  { input: data1, proof: proof1, expectedHash: hash1 },
  { input: data2, proof: proof2, expectedHash: hash2 }
]);

// Batch transactions
const batchTx = {
  transactions: [
    { to: address1, value: amount1, data: '0x' },
    { to: address2, value: amount2, data: callData }
  ],
  failOnError: true
};

const result = await account.executeBatch(batchTx, signature);

Error Handling

import { 
  GuardianAAError, 
  ZkProofError, 
  ContractError, 
  ValidationError 
} from '@tuaregsand/guardian-aa-sdk';

try {
  await zkClient.generateProof(data);
} catch (error) {
  if (error instanceof ZkProofError) {
    console.error('ZK proof failed:', error.message, error.details);
  } else if (error instanceof ContractError) {
    console.error('Contract interaction failed:', error.message);
  } else if (error instanceof ValidationError) {
    console.error('Validation failed:', error.message);
  }
}

🧪 Testing

# Run all tests
npm test

# Run with coverage
npm run test:ci

# Run in watch mode
npm run test:dev

🔧 Development

Building

# Build the SDK
npm run build

# Build in watch mode
npm run dev

# Type check
npm run typecheck

# Lint
npm run lint
npm run lint:fix

Documentation

# Generate API documentation
npm run docs

📄 License

Guardian-AA Custom License © Guardian-AA Team

Free for non-commercial use. Commercial use requires permission. See LICENSE for full terms.

🤝 Contributing

Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.

🆘 Support


Built with ❤️ by the Guardian-AA team