Catalog npm
Back to packageRELEASE DETAILS

0.6.0

npm

@0xepoch/sdk

This package provides 2 APIs for using UserOperations:

Published20 Jun 2023
Direct dependencies15
Transitive dependenciesNot calculated

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.

SimpleAccountAPI

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

owner = provider.getSigner()
const walletAPI = new SimpleAccountAPI({
    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") signature (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 aaSigner = 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.

Declared dependencies 15

Native requirements
15 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@account-abstraction/contracts
Environment
{
  "local_name": "@account-abstraction/contracts",
  "alias": false,
  "peer_metadata": null
}
^0.6.0runtime
@account-abstraction/utils
Environment
{
  "local_name": "@account-abstraction/utils",
  "alias": false,
  "peer_metadata": null
}
^0.6.0runtime
@ethersproject/abstract-provider
Environment
{
  "local_name": "@ethersproject/abstract-provider",
  "alias": false,
  "peer_metadata": null
}
^5.7.0runtime
@ethersproject/abstract-signer
Environment
{
  "local_name": "@ethersproject/abstract-signer",
  "alias": false,
  "peer_metadata": null
}
^5.7.0runtime
@ethersproject/networks
Environment
{
  "local_name": "@ethersproject/networks",
  "alias": false,
  "peer_metadata": null
}
^5.7.0runtime
@ethersproject/properties
Environment
{
  "local_name": "@ethersproject/properties",
  "alias": false,
  "peer_metadata": null
}
^5.7.0runtime
@ethersproject/providers
Environment
{
  "local_name": "@ethersproject/providers",
  "alias": false,
  "peer_metadata": null
}
^5.7.0runtime
@types/debug
Environment
{
  "local_name": "@types/debug",
  "alias": false,
  "peer_metadata": null
}
^4.1.7runtime
debug
Environment
{
  "local_name": "debug",
  "alias": false,
  "peer_metadata": null
}
^4.3.4runtime
ethers
Environment
{
  "local_name": "ethers",
  "alias": false,
  "peer_metadata": null
}
^5.7.0runtime
@nomicfoundation/hardhat-chai-matchers
Environment
{
  "local_name": "@nomicfoundation/hardhat-chai-matchers",
  "alias": false,
  "peer_metadata": null
}
^1.0.3development
@nomicfoundation/hardhat-toolbox
Environment
{
  "local_name": "@nomicfoundation/hardhat-toolbox",
  "alias": false,
  "peer_metadata": null
}
^1.0.2development
@nomiclabs/hardhat-ethers
Environment
{
  "local_name": "@nomiclabs/hardhat-ethers",
  "alias": false,
  "peer_metadata": null
}
^2.0.0development
chai
Environment
{
  "local_name": "chai",
  "alias": false,
  "peer_metadata": null
}
^4.3.6development
hardhat
Environment
{
  "local_name": "hardhat",
  "alias": false,
  "peer_metadata": null
}
^2.11.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-kJhFS4J80GStfAvRerghmYZ409TK+PrPkaExQBvqtOUF0RQAT+CDqYNmrfB9pbFwW6LSzXt1He8Ptfecpsi4RA==",
  "shasum": "c376763863b5588657a0e81318b8e41f4beb094c",
  "tarball": "https://registry.npmjs.org/@0xepoch/sdk/-/sdk-0.6.0.tgz",
  "fileCount": 62,
  "unpackedSize": 138366,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIQCRUrlR0opaDIH69V2YE/SePG/9uZe2M4Z9X9kGf2RlkgIgWlBqdMbJk+Y1ORu0oG8bNArdm4hZA0ztuZ6ztVRV4Oo="
    }
  ]
}

Repository

PENDING
abhimanyu121/bundler

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:07 UTC

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

Record identity

package_version:47a98dee63a3ca04d800efb5d4d44e19f4abbd13653e9dcc4583d569854fe697

Other collected versions

View all collected versions →