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 🙏

© 2024 – Pkg Stats / Ryan Hefner

vice-aa

v1.0.22

Published

made account abstraction easy to understand and use.

Downloads

46

Readme

Installation

npm install vice-aa

Supported Networks

Paymaster URL's

Simple Paymaster -> https://vice-aa-api.vercel.app/paymaster

ERC20 Token Paymaster -> https://vice-aa-api.vercel.app/tokenpaymaster

ERC20 Token For TokenPaymaster

  • Token Name: CORE TOKEN
  • Token Address: 0x4613246FF4F29FaE8a6a70aceaF11670259F9A41

You can get this token from Uniswap

⚠️ WARNING: MAKE SURE TO APPROVE THE ERC20PAYMASTER CONTRACT FOR CORE TOKEN TO USE ERC20PAYMASTER URL.

Usage

This package provides four main functions:

  • getUserOperation
  • getSignedUserOp
  • CustomJsonRpcProvider
  • waitForReceipt

Follow the steps below to use these functions in your project.

Step 1: Create a Provider and Contract Instance

First, set up your provider and create an instance of the contract with which you wish to interact.

import { ethers } from "ethers";
import { YourContractAddress, YourContractABI } from "<your-contract-data-location>";

const provider = new ethers.providers.Web3Provider(window.ethereum);
const contract = new ethers.Contract(YourContractAddress, YourContractABI, provider);

Step 2: Populate Your Transaction

Next, populate the transaction you intend to execute.

const populatedTx = await contract.populateTransaction.<YourContractMethod>(
  // Method parameters go here
);

Step 3: Get User Operation

Use getUserOperation with your contract wallet address, contract address, populated transaction, paymaster URL, and your chosen RPC URL.

import { getUserOperation } from "vice-aa";

const userOperation = await getUserOperation(
  yourContractWalletAddress,
  YourContractAddress,
  populatedTx,
  "https://<your-paymaster-url>",
  "<your-rpc-url>"
);

Step 4: Get Signed User Operation

Then, call getSignedUserOp with the userOperation , paymaster URL, and a boolean to indicate the type of paymaster.

import { getSignedUserOp } from "vice-aa";

const signedUserOp = await getSignedUserOp(
  userOperation,
  "https://<your-paymaster-url>",
  true // Set to false for ERC20 paymaster
);

Step 5: Send User Operation

Create a custom provider and send the user operation.

import { CustomJsonRpcProvider } from "vice-aa";

const customProvider = new CustomJsonRpcProvider("<your-rpc-url>");
const userOpHash = await customProvider.sendUserOperation(signedUserOp);

Step 6: Wait for Transaction Receipt

Finally, wait for the transaction hash using waitForReceipt.

import { waitForReceipt } from "vice-aa";
const txHash = await waitForReceipt(customProvider, userOpHash);

Example

Support

For additional support or queries, feel free to reach out or open an issue on the vice-aa repository.