{"_id":"@0xpass/account","_rev":"7-a3dbfa9e1cf4e3fc8e61a0ae5d19faf4","name":"@0xpass/account","dist-tags":{"latest":"0.2.10"},"versions":{"0.2.8":{"name":"@0xpass/account","version":"0.2.8","main":"./dist/src/index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/0xpass/account.git"},"keywords":["solidity","ethereum","smart","contracts","accipt-abstraction","eip-4337","wallets"],"bugs":{"url":"https://github.com/0xpass/account/issues"},"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":"github:cupcakes-3/aa-contracts","@0xpass/sdk":"0.2.1","@0xpass/common":"0.2.1","@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","axios":"^0.27.2","dotenv":"^16.0.2","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"},"gitHead":"4dbece7a70c0463ddc37155b27328e52cbd43047","description":"0xpass allow DAPPs developers access to Smart Contract Wallets. These wallets can be DAPPs specific or User specific. You must read about [Wallets section](#wallets) before using the SDK.","homepage":"https://github.com/0xpass/account#readme","_id":"@0xpass/account@0.2.8","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-KGebLtDgHfz6NTlqBUvnyOjfpCFqfK3FsagPHER313YRCVzkz4ohQV5j9zSBhzmU/iPCdb9UIleNdsFEQnvhlg==","shasum":"0eb1a44eff58b82efe98153263fc34ac73d1380b","tarball":"https://registry.npmjs.org/@0xpass/account/-/account-0.2.8.tgz","fileCount":6,"unpackedSize":18762,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQCgKJZ0LZ4Wr7erBm2j4yaJD5zOsVvqaZ8JLJolXOKedgIfZn4MZybKPNFseeXdzeSYiyhvc1R+JceixNoE+AFemw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhwwRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoHiQ//YWnMJsUuAHfNZ1X8Z5M6Xy/jLehZUp7ILUGm2OKgKM8+iGke\r\nbKK8OxYq6CrDBNBUTifLaWxwEwDLoRsvY77KGNiD1cGDS9dTureIo3a7vTso\r\n43QAulT1dmg7x/yw0PKt0Mde3wq0CYU9G8OKHrjqUh7NAC2D599Box5ljpco\r\nm8vCZUj6wZMtYBH5Z1bChZfYyHm1Wl7lyPHTMVUIxCPpuYhPtRxiGDgeaool\r\nwQqROrI51TZ8PvOEJsVuxqT8JrRnQxSSuslHartEqqjuQ9EXz81Vo3fmif48\r\nWJ+QuyrTFSzqpmwHqj/SVW+uNpxD2/woRq2440XnMs3r78qzi0ymeLQjAcG8\r\noA0NlFoQbDHB24nDlzSyT3kh5qcg7kOP8eI5Hh8OccUtm8A7n9cdJu1pB2ZS\r\nRpSHSJc6wRfrrJhMUXBUshJJbvnfJh5FgBs49vMMZ0FpHe55Xcod6zw67QwM\r\nfmkry62coIvlqhC9Nd50aSitJs0Yp6IN3LGt0igRdV98UKyeEnxnx5nB+nVE\r\nr/9aYfEdmi7GJiR9KXN/bqspdQtkrJsLksbR5GvfJuFtfhdFYI6JJxMIA+Ib\r\n6zzl48mXTayKFLglrEh6/le9+Y//PNjdgIV9re0qaPqgBXMOOkvNkwGt01JI\r\ndhcE+L9/ufHWAXTtX/ocYoTpUIQ0wATx7z4=\r\n=aJpU\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"kwk236","email":"kwk236@gmail.com"},"directories":{},"maintainers":[{"name":"kwk236","email":"kwk236@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/account_0.2.8_1669794833153_0.17749458626596537"},"_hasShrinkwrap":false},"0.2.9":{"name":"@0xpass/account","version":"0.2.9","main":"./dist/src/index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/0xpass/account.git"},"keywords":["solidity","ethereum","smart","contracts","accipt-abstraction","eip-4337","wallets"],"bugs":{"url":"https://github.com/0xpass/account/issues"},"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":"github:cupcakes-3/aa-contracts","@0xpass/sdk":"0.2.1","@0xpass/common":"0.2.1","@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","axios":"^0.27.2","dotenv":"^16.0.2","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"},"gitHead":"4dbece7a70c0463ddc37155b27328e52cbd43047","description":"0xpass allow DAPPs developers access to Smart Contract Wallets. These wallets can be DAPPs specific or User specific. You must read about [Wallets section](#wallets) before using the SDK.","homepage":"https://github.com/0xpass/account#readme","_id":"@0xpass/account@0.2.9","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-FlTgN1gv4rOgoKpvSnAB5gaWo2jCIbvf3QWQW2DeR/M2plx9iXkGRzQWHOgP/mc75JNG/ys5MDdVjOBTQwnpig==","shasum":"17341790c229f9fc7c44e0f484a37a8e4847ef51","tarball":"https://registry.npmjs.org/@0xpass/account/-/account-0.2.9.tgz","fileCount":6,"unpackedSize":18335,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIErPHHCwxK32agKgsTGzImPr8u0bZqztecQVP6DN+dLmAiB/WulQVOD3VlBlcb46YbX7Y+648oRvrB7zESgyK9P3+w=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhw0zACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrUlw//fy3G8D8/THdZ/zWyHKV88YwrC3rvn7pWlwFaGe95NV7aQnx3\r\nFp8xozlPh95MpnQKqm7x7W+adO/4i/fp7LC62o14+u5nQNG+L8LgbUbo4Xym\r\ngVPjRsYG/6Vtjn3Vu73Xrhd5TIdPw5MIcEAlz7qNHZV5goUZMnJoZHbvfb3x\r\nv8pAa6e1PXKxe6AFTbsSkZKQLFCvvGsTHpPAufJQ4uDGM4J6N1XI/O4hCyDN\r\nUJIlT2m6R4EoBiD1QkLNZf2DxtFITwLJahoY/5c1i8bolMYDIahJiIqDa49R\r\njsB2zoAmVvIEEogCKduqnbqx0nAGrNYXG3v/SYUd3KYWd3ChRy4801/3o8EV\r\nhRFh/siQYx0BNon176R4D7Ho27+2ISxTFSh8FQw4Y49MFdK7V/zHC0/Uai7m\r\nZ3K0zXiToT08+IGD7F6cW/qNi3fftYRkhQmiEWzE4KhuVkJJ2WqpCz5JC1s+\r\nEI1raXzeksqzPiY7DeRF2uLoX02ttK5suCtUAeJd+BCdF4nvvES2cpqyRNG/\r\n5s1S61JNHOSn0UKGi48xdMVGm4AV7zDhOZQpB+AuGAj8xWj4PbDxW7VJTtCl\r\nuqaVZhpm2Nl/+TO1wpy+hdbhsbY2Q6c/BYFW9lV91+vqxgk8fABqwgYCJOaE\r\nzLox3fVoUmqkW2RD2CKm7FXB8WQUd0yzH3Q=\r\n=lcO4\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"kwk236","email":"kwk236@gmail.com"},"directories":{},"maintainers":[{"name":"kwk236","email":"kwk236@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/account_0.2.9_1669795123119_0.5237103414962565"},"_hasShrinkwrap":false},"0.2.10":{"name":"@0xpass/account","version":"0.2.10","main":"./dist/src/index.js","license":"MIT","repository":{"type":"git","url":"git+https://github.com/0xpass/account.git"},"keywords":["solidity","ethereum","smart","contracts","accipt-abstraction","eip-4337","wallets"],"bugs":{"url":"https://github.com/0xpass/account/issues"},"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":"github:cupcakes-3/aa-contracts","@0xpass/sdk":"0.2.5","@0xpass/common":"0.2.4","@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","axios":"^0.27.2","dotenv":"^16.0.2","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"},"gitHead":"4dbece7a70c0463ddc37155b27328e52cbd43047","description":"0xpass allow DAPPs developers access to Smart Contract Wallets. These wallets can be DAPPs specific or User specific. You must read about [Wallets section](#wallets) before using the SDK.","homepage":"https://github.com/0xpass/account#readme","_id":"@0xpass/account@0.2.10","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-6AhDLtJXYZqxnwCl3WvoZHDPWt8r0jm0NrT1X5l9JObbmzgcw/nQQQt5+oxcgP22asc7zFgIacs7vkrZIdgwGA==","shasum":"68606971bcbe9151849cde48882ace46d5879196","tarball":"https://registry.npmjs.org/@0xpass/account/-/account-0.2.10.tgz","fileCount":6,"unpackedSize":18356,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHYKt5gT61wRzzv613EGXx/oOYoTW04eS4Q8CK151MyNAiEArrmAcq0S+HQn3En0bEVH/WCwqlIZCUO46PK1Fg6nnXs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhw5bACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpdJg/9FolVaERj1DeTYrGPY7Sfsq6j34nZoXM2S4cCFK6Cu440fXTv\r\nsyNS0r35/XQJowOO1AVRcHLdVsVm4GXO9HJ1EjuoCzLRvrMno/hl3zfZqL92\r\n4FaM+RLME6ANBb0N2DPjLg2YiKTkEbzzE11LrlQzkycbLCuyHdKbKLL3sUet\r\nP5ftn+nwdGxps5bAosnYekXLB+XzWT6eCw7NzNpCIToo444lTOTWrZ/JrNXm\r\np+ijI9Eg7axAOoMTTNHGx5I0zaRK+UvdLY2ldksqythSoLXWTpxHekDB32b4\r\nnkvWE9Ff83IioXPNg0pdnDNA1rzmlZkrw86ICHhjPAgoKvz/TH0YrKRztHGf\r\nwpB4dStwT0Neq+YEXYkfE0OXcPdJ+3quvOLR0uE/wJ5HFVxHVDbwrlS0yGDc\r\nJYwGfpSfYDt2kwdE4QWZ+ehi9rPZb4J8SdQ/LzYE/f73ZNqbWYPBGkKGYGae\r\nUecBKvOVxuUMurOJSUHEj59jmqVnIcAI1x07qnJbdvQBSiu4KdCmniBVsQJH\r\nnm75Rob7odx0wzWDQscAZrAX99EFjx8f+4JtIXxiIFfkQbrhTjSZbvF/qiAx\r\nHxnHyAmjvuF+nh4rivCa5OIKCwHwgnGAXoZBsLlzYeZtyazip/kj4ZTvlTvJ\r\nCzzT1H/TqZIoEiFNmKLQPKKuwweBU3lw1rc=\r\n=txhB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"kwk236","email":"kwk236@gmail.com"},"directories":{},"maintainers":[{"name":"kwk236","email":"kwk236@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/account_0.2.10_1669795419030_0.8545637590800867"},"_hasShrinkwrap":false}},"time":{"created":"2022-11-30T07:53:53.153Z","0.2.8":"2022-11-30T07:53:53.301Z","modified":"2023-07-28T12:20:28.813Z","0.2.9":"2022-11-30T07:58:43.379Z","0.2.10":"2022-11-30T08:03:39.240Z"},"maintainers":[{"email":"alkassimk@gmail.com","name":"k-xo"},{"email":"manasgoel@hotmail.com","name":"whatmanathinks"},{"email":"kwk236@gmail.com","name":"kwk236"}],"description":"0xpass allow DAPPs developers access to Smart Contract Wallets. These wallets can be DAPPs specific or User specific. You must read about [Wallets section](#wallets) before using the SDK.","homepage":"https://github.com/0xpass/account#readme","keywords":["solidity","ethereum","smart","contracts","accipt-abstraction","eip-4337","wallets"],"repository":{"type":"git","url":"git+https://github.com/0xpass/account.git"},"bugs":{"url":"https://github.com/0xpass/account/issues"},"license":"MIT","readme":"# Introduction\n\n0xpass allow DAPPs developers access to Smart Contract Wallets. These wallets can be DAPPs specific or User specific. You must read about [Wallets section](#wallets) before using the SDK.\n\n\n## Getting Started\n\nA guide for adding a 0xpass SDK to your application & start bundling transactions. There are two parts of the documentation, [**bundling transaction**](#bundle-transactions) and [**sponsoring gas**](#gassless-experience).\n\nFor both of them you would need to install our SDK. For sponsoring gas, you will have to first create a paymaster contract. To know more about how to create a paymaster contract, read [here](#gassless-experience).\n\n### What you'll need\n\n- [Node.js](https://nodejs.org/en/download/) version 16.14 or above:\n  - When installing Node.js, you are recommended to check all checkboxes related to dependencies.\n\n## Installing SDK\n\nOur SDK is currently under development, we will be hosting it on NPM soon. The Client SDK will be available in JavaScript with full TypeScript support.\n\n\n```bash\nnpm install @0xpass/account\n```\n```bash\nyarn add @0xpass/account\n```\n\n# Wallets\n\nSmart Contract Wallets (SCW) allows DAPP developer to bundle multiple transaction & pay gas fees for their users. You must create a SCW using our SDK for every user. The final bundled call will initiate from user's SCW. If you want to transfer the final assets to the user's current EOA, then you MUST send the transaction to transfer the assets from SCW to EOA separately.\n\nTo know how to create a SCW for a user see [Dapp specific wallets](#dapp-specific-wallets).\n\n<!-- Now there are two ways to solve for this problem, first that you use our [User Specific Wallet](#user-specific-wallet), second that you create a [Dapp Specific Wallet](#dapp-specific-wallets) for every one of your users. -->\n\n> :warning: **Wallet is not deployed instantly**, it will only be deployed once you do the first transaction, resulting in a higher gas fees in the first transaction. Though the scw address is **deterministic** and funds can be sent to the address.\n\n---\n\n## Dapp specific wallets\n\nInstall our SDK using instructions [here](#installing-sdk).\n\n### Initiate a wallet\n\nCreate a Smart Contract Wallet for a user. You MUST pass a signer while creating the SCW. The signer will have the custody of the SCW.\n\n```typescript\nimport { Signer } from 'ethers'\nimport { AccountProvider } from '@0xpass/account'\n\n/**\n * You can get signer using either the private key\n * const signer: Signer = new ether.Wallet(privateKey);\n * You can get signer if user has an EOA using wagmi.sh\n * const { data: signer } = useSigner();\n */\n\n/* Once you have signer & provider, create user's SCW */\n\n/**\n * @param provder - any BaseProvider from ethers (JSONRpcProvider | window.ethereum | etc)\n * @param signer - this will be the owner of the SCW that will be deployed.\n */\nconst accountProvider: AccountProvider = await AccountProvider.getAccountForOwner(provider, signer)\n```\n\nOnce the SCW has been initiated, you can use it as a normal signer with ethers/web3/etc to connect & send bundled transactions.\n\n### Executing transactions\n\nYou can get `Signer` from the `AccountProvider` we created above & start using it normally as you would use an EOA.\n\n```typescript\nconst accountSigner = accountProvider.getSigner()\nconst greeter = new ethers.Contract(GREETER_ADDR, GreeterArtifact.abi, accountSigner)\n\nconst tx = await greeter.addGreet({\n  value: ethers.utils.parseEther('0.0001'),\n})\nconsole.log(tx)\n```\n\n### Bundling transactions\n\nYou can also send multiple transactions within a single transaction using SCW. Think of approvide `ERC20` tokens & `deposit` them in a single transaction with a single signature from the users.\n\nRead more about how [here](#bundle-transactions).\n\n> :warning: The transactions sent using ethers/web3/etc won't be by default bundled or sponsored. Use `sendTransactions` instead to bundle transactions, see [Bundle Transactions](#bundle-transactions). If you want to sponer, make sure you connect a `paymaster`, see [Gassless Experience](#gassless-experience)\n\n\n# Bundle Transactions\n\nBundling transactions opens up a plathora of possibilities. We have listed a few of them as example:\n\n1. Users won't have to do two transactions for approving an ERC20 token & then depositing it.\n2. You can easily support depositing of any ERC20 in your app. Just add a transaction to swap user's token to your preffered token using any Dex.\n3. Modular Contract designs, deploy only specific contract modules and then join them off-chain using a bundler transactions.\n\n## Single chain bundling\n\nYou must have initialised iSDK & created a `AccountProvider`. We have exposed a function in a `SCWSigner` called `sendTransactions` using which you can send multiple transactions.\n\n```typescript\nconst accountSigner = accountProvider.getSigner()\nconst greeter = new ethers.Contract(GREETER_ADDR, GreeterArtifact.abi, accountSigner)\n\nconst transactionData = greeter.interface.encodeFunctionData('addGreet')\n\nconst tx = await accountProvider.sendTransactions([\n  {\n    to: GREETER_ADDR,\n    value: ethers.utils.parseEther('0.0001'),\n    data: transactionData,\n  },\n  {\n    to: GREETER_ADDR,\n    value: ethers.utils.parseEther('0.0002'),\n    data: transactionData,\n  },\n])\nconsole.log(tx)\n```\n\n```typescript title=\"Getting approval for ERC20 token & depositing together\"\nawait accountProvider.sendTransactions([\n  {\n    to: ERC20_TOKEN_ADDR,\n    value: ethers.utils.parseEther('0.1'),\n    data: TOKEN.interface.encodeFunctionData('approve', [\n      spenderAddress,\n      ethers.utils.parseEther(amount * 10), // getting approval from 10 times the amount to be spent\n    ]),\n  },\n  {\n    to: myContract.address,\n    value: ethers.utils.parseEther('0.1'),\n    data: myContract.interface.encodeFunctionData('stake', [ERC20_TOKEN_ADDR, ethers.utils.parseEther(amount)]),\n  },\n])\n```\n\n## Cross chain bundling\n\n> :warning: **Cross-chain Bundling** will be coming soon, which will enable you to add bridging transactions to your transactions as well.\n\n# Gassless Experience\n\nCupkaes SDK will enable conditional gassless experience, which includes partial gas-sponsoring. This enables you to have complex integrations like: sponsoring of gas on ethereum upto $5 and 100% on L2/sidechain.\n\nBefore you can start sponsoring gas, you must [deploy](#deploy-a-paymaster) a paymaster contract. The paymaster _MUST_ be staked & should have enough deposit to sponsor for gas. If the deposited amount becomes lesser than the gas required then your transactions will start failing.\n\n---\n\n## Paymaster\n\nPaymaster is a contract that sponsors gas fees on behalf of users. To know more about how it works, read in the [architecture section](#overview).\n\nTo enable gas sponsoring these are the steps you must do:\n\n1. [Deploy a paymaster](#deploy-a-paymaster)\n2. [Stake paymaster](#stake--deposit-funds)\n3. [Register a webhook](#register-webhook)\n4. [Integrate with frontend](#integrate-with-frontend)\n\n### Deploy a paymaster\n\nHead to our website [https://comingsoon@0xpass](https://bit.ly/gas_less) and follow the steps shown in the video below to deploy your first paymaster.\n\n```mdx-code-block\n<iframe width=\"720\" height=\"406\" src=\"https://www.youtube-nocookie.com/embed/jreqzJMzR5s\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>\n```\n\n### Stake & deposit funds\n\nOnce you have created your paymaster, you will have to stake your funds. The Minimum stake as of now is `x MATIC` with a lock-in of `7 days`. The stake is to make sure no fraudulant activity can be performed by the paymaster. The staked funds will be deductded if any such fraudulant activity is found.\n\n> :warning: You must have enough deposit left to cover for 100% of the gas fees even if you only want to sponsor a portion of it. If desposit is not enough, the transaction will be reverted.\n\nLearn more about how your stake can be slashed more in detail [here](#overview).\n\n### Register webhook\n\nYou will have to register a webhook, where we will be sending the a `POST` request to verify the sponsoring of the gas.\n\nThe requst will have the following body:\n\n```json\n{\n  \"auth_code\": \"b110a339-ff6c-4456-8adb-b236a3da11d3\",\n  \"timestamp\": 1662805504483,\n  \"userOperation\": {\n    \"sender\": \"0xadb2...asd4\", // Sender's address of the SCW\n    \"maxGasCost\": 123, // you can use this as the total of all the above gas breakup & use this to make decision of sponsoring\n    \"paymasterDeposit\": 123, // the amount of deposit left in your paymaster contract, you can send refill transactions using this if you want to\n    \"paymasterAddress\": \"0x23rr...\", // your paymaster contract address, you should send money to this address if paymasterDeposit is approaching zero\n    \"transactions\": [\n      // this is the array of transactions that your frontend SDK included for bundling\n      {\n        \"to\": \"0x123..\",\n        \"value\": 4, // value in ethers\n        \"data\": \"0xadsf...\" // call data your SDK passed\n      }\n    ],\n    // The following fields are part of the UserOperation that will be used to generate signature, you can ignore these if you are using our paymaster SDK\n    \"nonce\": 123,\n    \"initCode\": \"0xAxvd3r....adfsg4r\", //init code, if not empty means that this wallet doesn't exist and will be deployed in this transaction along with executing the required transaction\n    \"callData\": \"0xsdfdasf...000\", // call data of the execution\n    \"callGas\": 123, // the amount of gas the main execution of transaction will take\n    \"verificationGas\": 123, //the constant amount of gas which is required to verify sender's ownership\n    \"preVerificationGas\": 123, // the constant amount of gas which is required by the bundler for processing the transaction\n    \"maxFeePerGas\": 123, // the maximum gas price, this depends on how busy the network is\n    \"maxPriorityFeePerGas\": 123 // the fee that will be used to tip the miner\n  }\n}\n```\n\nYou must verify `auth_code` to check if the call is from our service or not. You will see the `auth_code` once you register a success webhook.\n\nYou must return with a `200` code if you agree to sponsor the transaction. If you choose not to sponsor, you must return with a `403 - Forbidden` status code response.\n\n### Integrate with frontend\n\nYou will have to connect your paymaster with the SCW you created in [Wallets section](#initiate-a-wallet).\n\n```typescript\nimport { PaymasterAPI } from '@0xpass/account'\n\n// You can get the your API KEY when you create a paymaster, every paymaster has a different API KEY\n\n/* Connect to us to get Paymaster URL & Paymaster API KEY */\nconst paymasterAPI = new PaymasterAPI(process.env.REACT_APP_PAYMASTER_URL, process.env.REACT_APP_PAYMASTER_API_KEY)\n\n/* Connect your paymaster to the provider */\naccountProvider.connectPaymaster(paymasterAPI)\n\n/* Do transaction as normal */\nconst accountSigner = accountProvider.getSigner()\nconst greeter = new ethers.Contract(GREETER_ADDR, GreeterArtifact.abi, accountSigner)\n\nconst tx = await greeter.addGreet({\n  value: ethers.utils.parseEther('0.0001'),\n})\nconsole.log(tx)\n\n/* Disconnect if you don't want to sponsor amny further */\naccountProvider.disconnectPaymaster()\n```\n","readmeFilename":"README.md"}