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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@arbius/aa-wallet

v0.1.3

Published

A secure and flexible Account Abstraction wallet implementation for Arbitrum One chain applications.

Readme

AA Wallet

A secure and flexible Account Abstraction wallet implementation for Arbitrum One chain applications, specifically designed for the Arbius ecosystem.

Installation

npm install @arbius/aa-wallet

Ethers v5 Compatibility

If you're using ethers v5, you'll need to patch the ethers object to ensure compatibility with the library's v6-style API. Here's how to do it:

import { ethers } from 'ethers';

// Patch the ethers object for v5 compatibility with v6-style API
const ethersPatched = {
  ...ethers,
  formatEther: ethers.utils.formatEther,
  formatUnits: ethers.utils.formatUnits,
  parseEther: ethers.utils.parseEther,
  parseUnits: ethers.utils.parseUnits,
  // Add any other utils your library needs
};

// Now use ethersPatched instead of ethers in all library calls
const balances = await getDeterministicWalletBalances(ethersPatched, wallet);

Features

  • Create deterministic wallets derived from a user's main wallet
  • Deposit ETH and ERC20 tokens to the deterministic wallet
  • Withdraw ETH and ERC20 tokens from the deterministic wallet
  • Send contract transactions using the deterministic wallet
  • Get ETH and AIUS token balances
  • Automatic gas estimation and management
  • TypeScript support
  • Optimized for Arbitrum One chain

Usage

Initialize a Deterministic Wallet

import { ethers } from 'ethers';
import { initDeterministicWallet } from '@arbius/aa-wallet';

// Get the user's signer from their wallet
const provider = new ethers.BrowserProvider(window.ethereum);
const signer = await provider.getSigner();

// Initialize the deterministic wallet
const wallet = await initDeterministicWallet(
  ethers,
  signer.address,
  async (message: string) => signer.signMessage(message),
  provider
);

Get Wallet Balances

import { getDeterministicWalletBalances } from '@arbius/aa-wallet';

// Get both ETH and AIUS balances
const balances = await getDeterministicWalletBalances(ethers, wallet);
console.log('ETH Balance:', balances.eth);
console.log('AIUS Balance:', balances.aius);

Get Deposit Address

import { getDeterministicWalletAddressForDeposit } from '@arbius/aa-wallet';

const depositAddress = await getDeterministicWalletAddressForDeposit(
  ethers,
  signer.address,
  async (message: string) => signer.signMessage(message),
  provider
);

Withdraw Funds

import { withdrawFromDeterministicWallet } from '@arbius/aa-wallet';

// Withdraw ETH
const txHash = await withdrawFromDeterministicWallet(
  ethers,
  wallet,
  recipientAddress,
  {
    amount: '0.1', // Optional: specific amount to withdraw
    token: 'ETH'
  }
);

// Withdraw AIUS tokens
const txHash = await withdrawFromDeterministicWallet(
  ethers,
  wallet,
  recipientAddress,
  {
    amount: '100', // Optional: specific amount to withdraw
    token: 'AIUS'
  }
);

Send Contract Transactions

import { sendContractTransaction } from '@arbius/aa-wallet';

// Create contract interface
const contractInterface = new ethers.Interface(contractABI);

// Encode function data
const data = contractInterface.encodeFunctionData(
  'functionName',
  [param1, param2]
);

// Send transaction
const txHash = await sendContractTransaction(
  ethers,
  wallet,
  contractAddress,
  data,
  '0' // Optional: ETH value to send
);

API Reference

initDeterministicWallet

Creates or retrieves a cached deterministic wallet.

function initDeterministicWallet(
  appEthers: typeof ethers,
  ownerAddress: string,
  signMessage: (message: string) => Promise<string>,
  provider: ethers.BrowserProvider
): Promise<ethers.Wallet>

getDeterministicWalletBalances

Gets the ETH and AIUS token balances of the deterministic wallet.

function getDeterministicWalletBalances(
  appEthers: typeof ethers,
  wallet: ethers.Wallet
): Promise<{ eth: string; aius: string }>

getDeterministicWalletAddressForDeposit

Gets the address of the deterministic wallet for deposit purposes.

function getDeterministicWalletAddressForDeposit(
  appEthers: typeof ethers,
  ownerAddress: string,
  signMessage: (message: string) => Promise<string>,
  provider: ethers.BrowserProvider
): Promise<string>

withdrawFromDeterministicWallet

Withdraws funds from the deterministic wallet.

function withdrawFromDeterministicWallet(
  appEthers: typeof ethers,
  wallet: ethers.Wallet,
  recipientAddress: string,
  options: {
    amount?: string;
    token: 'ETH' | 'AIUS';
  }
): Promise<string | null>

sendContractTransaction

Sends a transaction to a contract using the deterministic wallet.

function sendContractTransaction(
  appEthers: typeof ethers,
  wallet: ethers.Wallet,
  to: string,
  data: string,
  value: string = '0'
): Promise<string | null>

License

MIT