New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

abstractionkit

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abstractionkit

Account Abstraction 4337 SDK by Candidelabs

  • 0.0.9
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15K
increased by27.94%
Maintainers
1
Weekly downloads
 
Created
Source

Supported by Safe Grants

A Typescript Library to easily build and send ERC-4337 UserOperations, with first class support for Safe Accounts.

Abstraction Kit is agnostic of:

  • Ethereum interface libraries: ethers, web3.js, viem/wagmi
  • Bundler implentation: Plug and play from any bundler provider
  • Paymaster: use any 3rd party paymaster to sponsor gas, or build your own
  • Accounts: Safe Account are supported, but you can use use Bundlers and Paymasters with your own accounts

Docs

For full detailed documentation visit our docs page.

Installation

npm install abstractionkit

Quickstart

Smart Accounts

Abstraction Kit currently features the Candide Account, a compliant EIP-4337 smart contract account based on Safe v1.4.0 contracts.

In the next releases, it will feature Safe Accounts with the new architecture of Safe{Core}Protocol.

import { CandideAccount } from "abstractionkit";

const smartAccount = new CandideAccount();

Then you can consume accout methods:

import { Wallet } from "ethers";

const eoaSigner = new Wallet(privateKey);
const [newAccountAddress, initCode] = smartAccount.createNewAccount([
  eoaSigner.address,
]);

Bundler

Initialize a Bundler with your desired bundler RPC url

import { Bundler } from "abstractionkit";

const bundlerRPC = "https://sepolia.voltaire.candidewallet.com/rpc";
const entrypointAddress = "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789";

const bundler: Bundler = new Bundler(bundlerRPC, entrypointAddress);

Then you can consume Bundler methods:

const entrypointAddresses = await bundler.supportedEntryPoints();

Paymaster

Initialize a Paymaster with your RPC url

import { CandideValidationPaymaster } from "abstractionkit";

const paymasterRpc = "https://api.candide.dev/paymaster/v1/$network/$apikey";
const entrypointAddress = "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789";

const paymaster: CandideValidationPaymaster = new CandideValidationPaymaster(
  entrypointAddress,
  paymasterRPC
);

Then you can consume Paymaster methods:

const supportedGasTokens = await paymaster.getSupportedERC20Tokens();

Guides

TitleDescription
Send your first user operationLearn how to create a smart wallet and to send your first user operation
Send a Gasless TransactionLearn how to send gasless transactions using a paymaster
Pay Gas in ERC-20Learn how to offer the ability for users to pay gas in ERC-20s using a Paymaster

npm package

npm

License

MIT

Keywords

FAQs

Package last updated on 30 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc