{"_id":"@0xepoch/sdk","name":"@0xepoch/sdk","dist-tags":{"latest":"0.6.0"},"versions":{"0.6.0":{"name":"@0xepoch/sdk","version":"0.6.0","main":"./dist/src/index.js","license":"MIT","repository":{"type":"git","url":"git://github.com/Abhimanyu121/bundler.git"},"scripts":{"clear":"rm -rf dist artifacts cache","lint":"eslint -f unix .","lint-fix":"eslint -f unix . --fix","test":"hardhat test","hardhat-test":"hardhat test","tsc":"tsc","watch-tsc":"tsc -w --preserveWatchOutput"},"dependencies":{"@account-abstraction/contracts":"^0.6.0","@account-abstraction/utils":"^0.6.0","@ethersproject/abstract-provider":"^5.7.0","@ethersproject/abstract-signer":"^5.7.0","@ethersproject/networks":"^5.7.0","@ethersproject/properties":"^5.7.0","@ethersproject/providers":"^5.7.0","@types/debug":"^4.1.7","debug":"^4.3.4","ethers":"^5.7.0"},"devDependencies":{"@nomicfoundation/hardhat-chai-matchers":"^1.0.3","@nomicfoundation/hardhat-toolbox":"^1.0.2","@nomiclabs/hardhat-ethers":"^2.0.0","chai":"^4.3.6","hardhat":"^2.11.0"},"types":"./dist/src/index.d.ts","gitHead":"a6d0b06068232b27348106bea09ff05b9cda7e95","description":"This package provides 2 APIs for using UserOperations:","bugs":{"url":"https://github.com/Abhimanyu121/bundler/issues"},"homepage":"https://github.com/Abhimanyu121/bundler#readme","_id":"@0xepoch/sdk@0.6.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"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="}]},"_npmUser":{"name":"abhimanyu121","email":"abhimanyushekhawat17.as@gmail.com"},"directories":{},"maintainers":[{"name":"abhimanyu121","email":"abhimanyushekhawat17.as@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.6.0_1687255879508_0.9508682373962889"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-20T10:11:19.421Z","0.6.0":"2023-06-20T10:11:19.710Z","modified":"2023-06-20T10:11:19.891Z"},"maintainers":[{"name":"abhimanyu121","email":"abhimanyushekhawat17.as@gmail.com"}],"description":"This package provides 2 APIs for using UserOperations:","homepage":"https://github.com/Abhimanyu121/bundler#readme","repository":{"type":"git","url":"git://github.com/Abhimanyu121/bundler.git"},"bugs":{"url":"https://github.com/Abhimanyu121/bundler/issues"},"license":"MIT","readme":"# SDK to create and send UserOperation \n\nThis package provides 2 APIs for using UserOperations:\n\n- Low-level \"walletAPI\"\n- High-level Provider\n\n\n## LowLevel API:\n\n### BaseWalletAPI\n\nAn abstract base-class to create UserOperation for a contract wallet.\n\n### SimpleAccountAPI\n\nAn implementation of the BaseWalletAPI, for the SimpleWallet sample of account-abstraction.\n\n```typescript\nowner = provider.getSigner()\nconst walletAPI = new SimpleAccountAPI({\n    provider, \n    entryPointAddress,\n    owner,\n    factoryAddress\n})\nconst op = await walletAPI.createSignedUserOp({\n  target: recipient.address,\n  data: recipient.interface.encodeFunctionData('something', ['hello'])\n})\n```\n\n## High-Level Provider API\n\nA simplified mode that doesn't require a different wallet extension. \nInstead, the current provider's account is used as wallet owner by calling its \"Sign Message\" operation.\n\nThis can only work for wallets that use an EIP-191 (\"Ethereum Signed Message\") signature (like our sample SimpleWallet)\nAlso, the UX is not great (the user is asked to sign a hash, and even the wallet address is not mentioned, only the signer)\n\n```typescript\nimport { wrapProvider } from '@account-abstraction/sdk'\n\n//use this account as wallet-owner (which will be used to sign the requests)\nconst aaSigner = provider.getSigner()\nconst config = {\n  chainId: await provider.getNetwork().then(net => net.chainId),\n  entryPointAddress,\n  bundlerUrl: 'http://localhost:3000/rpc'\n} \nconst aaProvider = await wrapProvider(provider, config, aaSigner)\nconst walletAddress = await aaProvider.getSigner().getAddress()\n\n// send some eth to the wallet Address: wallet should have some balance to pay for its own creation, and for calling methods.\n\nconst myContract = new Contract(abi, aaProvider)\n\n// this method will get called from the wallet address, through account-abstraction EntryPoint\nawait myContract.someMethod()\n```\n\n","readmeFilename":"README.md"}