Catalog npm
PACKAGE EXPLORERView in registry

@0xsodium/sdk4337

npm

This package provides 2 APIs for using UserOperations:

Versions collected42
Direct dependencies20From release 1.17.0
Last observed21 Oct, 11:33 UTC

README

Current package documentation

SDK to create and send UserOperation

This package provides 2 APIs for using UserOperations:

  • Low-level "walletAPI"
  • High-level Provider

LowLevel API:

BaseWalletAPI

An abstract base-class to create UserOperation for a contract wallet.

SimpleWalletAPI

An implementation of the BaseWalletAPi, for the SimpleWallet sample of account-abstraction.

owner = provider.getSigner()
const walletAPI = new SimpleWalletAPI({
    provider, 
    entryPointAddress,
    owner,
    factoryAddress
})
const op = await walletAPi.createSignedUserOp({
  target: recipient.address,
  data: recipient.interface.encodeFunctionData('something', ['hello'])
})

High-Level Provider API

A simplified mode that doesn't require a different wallet extension. Instead, the current provider's account is used as wallet owner by calling its "Sign Message" operation.

This can only work for wallets that use an EIP-191 ("Ethereum Signed Message") signatures (like our sample SimpleWallet) Also, the UX is not great (the user is asked to sign a hash, and even the wallet address is not mentioned, only the signer)

import { wrapProvider } from '@account-abstraction/sdk'

//use this account as wallet-owner (which will be used to sign the requests)
const signer = provider.getSigner()
const config = {
  chainId: await provider.getNetwork().then(net => net.chainId),
  entryPointAddress,
  bundlerUrl: 'http://localhost:3000/rpc'
} 
const aaProvider = await wrapProvider(provider, config, aasigner)
const walletAddress = await aaProvider.getSigner().getAddress()

// send some eth to the wallet Address: wallet should have some balance to pay for its own creation, and for calling methods.

const myContract = new Contract(abi, aaProvider)

// this method will get called from the wallet address, through account-abstraction EntryPoint
await myContract.someMethod()

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 42

Collected releases
VersionPublishedDirect dependenciesOpen version
1.17.0Registry latest6 May 202320
1.16.05 May 202320
1.15.04 May 202320
1.14.018 Apr 202320
1.13.025 Mar 202320
1.12.015 Mar 202320
1.11.015 Mar 202320
1.10.06 Mar 202320
1.9.02 Mar 202320
1.8.02 Mar 202320
1.7.02 Mar 202320
1.6.028 Feb 202320
1.5.027 Feb 202320
1.4.027 Feb 202320
1.3.027 Feb 202320
1.2.024 Feb 202320
1.1.024 Feb 202320
1.0.022 Feb 202320
0.0.022 Feb 202320
0.0.0-2023021822593719 Feb 202320

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 11:33 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:ce4ed610ca5d3c3e4134d1c30ff5445757b192aadb47363086e01876c33e4ec4