{"_id":"@account-abstraction-phuoc/sdk","name":"@account-abstraction-phuoc/sdk","dist-tags":{"latest":"0.7.0"},"versions":{"0.7.0":{"name":"@account-abstraction-phuoc/sdk","version":"0.7.0","main":"./dist/src/index.js","license":"ISC","publishConfig":{"access":"public"},"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-phuoc/utils":"^0.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.17.0"},"_id":"@account-abstraction-phuoc/sdk@0.7.0","types":"./dist/src/index.d.ts","description":"This package provides 2 APIs for using UserOperations:","_nodeVersion":"20.11.1","_npmVersion":"10.8.0","dist":{"integrity":"sha512-ssWbyc12qw2X1+XI4Wi5gDmlq90wDjwBW+VwHTMO7YujUuA33g7OKZaEvyhLIF8V6Mc1ZnaZHXDVRgLRuexeVw==","shasum":"e693c688856948b5f58e6512a68e1c2e27e66576","tarball":"https://registry.npmjs.org/@account-abstraction-phuoc/sdk/-/sdk-0.7.0.tgz","fileCount":50,"unpackedSize":123167,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOEiMXl5/d7rDe9dm2wsRlNhpjNFpYffpYDFTblzPBwQIhAMjWQ9Y7PFubDF2rQMQUe3XbJX1Xh/OZFJ9oWc+zpt7d"}]},"_npmUser":{"name":"anonydev3","email":"anonymousbigtits102@gmail.com"},"directories":{},"maintainers":[{"name":"anonydev3","email":"anonymousbigtits102@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_0.7.0_1716439003723_0.25564508599315294"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-23T04:36:43.620Z","0.7.0":"2024-05-23T04:36:43.911Z","modified":"2024-05-23T04:36:44.159Z"},"maintainers":[{"name":"anonydev3","email":"anonymousbigtits102@gmail.com"}],"description":"This package provides 2 APIs for using UserOperations:","license":"ISC","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-phuoc/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"}