Catalog npm
Back to packageRELEASE DETAILS

1.7.0

npm

@0xsodium/sdk4337

This package provides 2 APIs for using UserOperations:

Published2 Mar 2023
Direct dependencies20
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.

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.

Declared dependencies 20

Native requirements
20 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@0xsodium/config
Environment
{
  "local_name": "@0xsodium/config",
  "alias": false,
  "peer_metadata": null
}
^1.7.0runtime
@0xsodium/estimator
Environment
{
  "local_name": "@0xsodium/estimator",
  "alias": false,
  "peer_metadata": null
}
^1.7.0runtime
@0xsodium/network
Environment
{
  "local_name": "@0xsodium/network",
  "alias": false,
  "peer_metadata": null
}
^1.7.0runtime
@0xsodium/transactions
Environment
{
  "local_name": "@0xsodium/transactions",
  "alias": false,
  "peer_metadata": null
}
^1.7.0runtime
@0xsodium/utils
Environment
{
  "local_name": "@0xsodium/utils",
  "alias": false,
  "peer_metadata": null
}
^1.7.0runtime
@0xsodium/wallet-contracts
Environment
{
  "local_name": "@0xsodium/wallet-contracts",
  "alias": false,
  "peer_metadata": null
}
^0.0.5-betaruntime
@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
buffer
Environment
{
  "local_name": "buffer",
  "alias": false,
  "peer_metadata": null
}
^6.0.3runtime
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-zx4m9akLLgAvCV2XBAShjksIg7gnb20a0TpFpHHsVZ+iFuRDGLSny2ndJ9Cr3DQaSil1vJNBd5iXftOaJtHmeg==",
  "shasum": "2aa425d2b7813501e490d5674986775093ef1bb4",
  "tarball": "https://registry.npmjs.org/@0xsodium/sdk4337/-/sdk4337-1.7.0.tgz",
  "fileCount": 28,
  "unpackedSize": 137273,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCICseZVVRq+PhHUxsawxTV9BHtqoQ3d2soxU+JSttpRwwAiEA2qnl6eBBrZQE8YQlemWFt/h8M7l7Y5ySsZU0de5vKsU="
    }
  ],
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAHmPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqE6A//YMGd01BIeWr2Bgz35X9RbnlYI3ON7mW9/nBdoYpbo8tSEuoU\r\n+EC6UB848IgnbrHuGYlTd9tL37pnxw5ptgxrTlZwJWgDi4qWnIBtLZboQotQ\r\nLBWuTVr2V5uOAE5jNNUlJtbFMKMuG24ak5cD2CM84wiLxhqazEaPSX1l1FV3\r\nEFxLbEYRdZ/Pieh7kKhUHCEsGYD8j5Hjv0mpjnqjH4yWoD4WdemVmymyamOM\r\nU+uu5fIZsah2vXgl0RE/d42Hbunz/TR0Ogx9h70qkAWrahWvYRsJHvcfBhEy\r\nuIFrm774IXIhZHK6IZBQ+yS0JbQdwJaxcD2laQgqVnORCWWReqC41NkhsyWn\r\n2jkH9ChMq1x7HrD2moj6LcDXhgsh1Yj/EPiL5dnBJLXWw30Fu0EjqM5iKgVr\r\nLzZgdyLbU98pojI1fnLbCdaaKphDndxdeoDHkxrdgrltm451+lcDTlBMbAlY\r\n9adup5fQcYyACqq+oNKyv5Fkfdao2/fHUYmJbQp8iQaXP1/FgFcb9u1bsNGE\r\n+kNN2jGCRxt0GbI+IotoCKyT0Fih4DVvOiggpejNcMp2RvBne3Wx5lxmwUxq\r\n4a5UFYlFloRA+5Ax6VpbZOCUSufCXymg9VBzD/jJXyE7I0VXTsHjazs+8VHM\r\niMNe3bW8Bsy1lcb2TVLNjJcwmshGgoqFkbY=\r\n=ouxh\r\n-----END PGP SIGNATURE-----\r\n"
}

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_version:b957bb404077fb15530d2fae59db1863b1cc4478fd9dee708ffe62b51d3e009f

Other collected versions

1.17.06 May1.16.05 May1.15.04 May1.14.018 Apr1.13.025 Mar1.12.015 MarView all collected versions →