New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

abstractionkit

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abstractionkit - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

dist/account/Candide/CandideAccount.d.ts

6

dist/abstractionkit.d.ts
export { SmartAccount } from "./account/SmartAccount";
export { CandideAccount } from "./account/CandideAccount";
export { CandideAccount } from "./account/Candide/CandideAccount";
export { MetaTransaction } from "./account/Candide/types";
export { SimpleAccount } from "./account/SimpleAccount";

@@ -9,5 +10,6 @@ export { SmartAccountFactory } from "./factory/SmartAccountFactory";

export { CandideValidationPaymaster } from "./paymaster/CandideValidationPaymaster";
export { getUserOperationHash } from "./utils";
export { getUserOperationHash, getCallData, getFunctionSelector } from "./utils";
export { UserOperationEmptyValues, UserOperationDummyValues } from "./constants";
export { Operation } from "./types";
export type { UserOperation, AbiInputValue, JsonRpcParam, JsonRpcResponse, JsonRpcResult, JsonRpcError, GasEstimationResult, UserOperationByHashResult, UserOperationReceipt, UserOperationReceiptResult, } from "./types";
//# sourceMappingURL=abstractionkit.d.ts.map

@@ -1,1 +0,1 @@

var e=require("isomorphic-unfetch"),t=require("ethers");function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,t}var n=/*#__PURE__*/r(e),i=function(e,t,r){try{var i=n.default||n,f=JSON.stringify({method:t,params:r,id:1,jsonrpc:"2.0"});return Promise.resolve(i(e,{method:"POST",body:f,redirect:"follow"})).then(function(e){return Promise.resolve(e.json())})}catch(e){return Promise.reject(e)}};function f(e,r,n){var i=t.keccak256(function(e){var r=[e.sender,e.nonce,t.keccak256(e.initCode),t.keccak256(e.callData),e.callGasLimit,e.verificationGasLimit,e.preVerificationGas,e.maxFeePerGas,e.maxPriorityFeePerGas,t.keccak256(e.paymasterAndData)];return t.AbiCoder.defaultAbiCoder().encode(["address","uint256","bytes32","bytes32","uint256","uint256","uint256","uint256","uint256","bytes32"],r)}(e)),f=t.AbiCoder.defaultAbiCoder().encode(["bytes32","address","uint256"],[i,r,n]);return t.keccak256(f)}function c(e,r,n){return e+t.AbiCoder.defaultAbiCoder().encode(r,n).slice(2)}var o=/*#__PURE__*/function(){function e(e,t,r,n,i,f){this.singletonAddress=void 0,this.proxyByteCode=void 0,this.initializerFunctionSelector=void 0,this.initializerFunctionInputAbi=void 0,this.executorFunctionSelector=void 0,this.executorFunctionInputAbi=void 0,this.singletonAddress=e,this.proxyByteCode=t,this.initializerFunctionSelector=r,this.initializerFunctionInputAbi=n,this.executorFunctionSelector=i,this.executorFunctionInputAbi=f}var t=e.prototype;return t.getInitializerCallData=function(e){return c(this.initializerFunctionSelector,this.initializerFunctionInputAbi,e)},t.getExecutorCallData=function(e){return c(this.executorFunctionSelector,this.executorFunctionInputAbi,e)},e}();function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a.apply(this,arguments)}function s(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,d(e,t)}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}var u=/*#__PURE__*/function(){function e(e,t,r){this.address=void 0,this.generatorFunctionSelector=void 0,this.generatorFunctionInputAbi=void 0,this.address=e,this.generatorFunctionSelector=t,this.generatorFunctionInputAbi=r}return e.prototype.getFactoryGeneratorFunctionCallData=function(e){var t=c(this.generatorFunctionSelector,this.generatorFunctionInputAbi,e);return this.address+t.slice(2)},e}(),b=/*#__PURE__*/function(e){function t(t){return void 0===t&&(t="0xb73Eb505Abc30d0e7e15B73A492863235B3F4309"),e.call(this,t,"0x1688f0b9",["address","bytes","uint256"])||this}return s(t,e),t}(u),l=/*#__PURE__*/function(e){function r(t,r,n){var i;return void 0===t&&(t="0x3A0a17Bcc84576b099373ab3Eed9702b07D30402"),void 0===r&&(r="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"),void 0===n&&(n=new b),(i=e.call(this,t,"0x608060405234801561001057600080fd5b5060405161017338038061017383398101604081905261002f916100b9565b6001600160a01b0381166100945760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642073696e676c65746f6e20616464726573732070726f766964604482015261195960f21b606482015260840160405180910390fd5b600080546001600160a01b0319166001600160a01b03929092169190911790556100e9565b6000602082840312156100cb57600080fd5b81516001600160a01b03811681146100e257600080fd5b9392505050565b607c806100f76000396000f3fe6080604052600080546001600160a01b0316813563530ca43760e11b1415602857808252602082f35b3682833781823684845af490503d82833e806041573d82fd5b503d81f3fea2646970667358221220022b6bb97dd1e16cb867add83d4159f7550336cbb5b40514145e43f493c1377664736f6c634300080c0033","0x6a1e9826",["address[]","uint256","address","bytes","address","address","uint256","address","address"],"0xf34308ef",["address","uint256","bytes","uint8","address","address","uint256"])||this).entrypointAddress=void 0,i.candideAccountFactory=void 0,i.entrypointAddress=r,i.candideAccountFactory=n,i}s(r,e);var n=r.prototype;return n.createNewAccount=function(e,r,n,i){void 0===r&&(r=1),void 0===n&&(n=0),void 0===i&&(i="0x2a15DE4410d4c8af0A7b6c12803120f43C42B820");var f=this.getInitializerCallData([e,r,t.ZeroAddress,"0x",i,t.ZeroAddress,0,t.ZeroAddress,this.entrypointAddress]);return[this.getProxyAddress(f,this.candideAccountFactory.address,n),this.candideAccountFactory.getFactoryGeneratorFunctionCallData([this.singletonAddress,f,n])]},n.createSendEthCallData=function(e,r){return this.createCallData(e,r,"0x",0,t.ZeroAddress,t.ZeroAddress,0)},n.createCallData=function(e,t,r,n,i,f,c){return this.getExecutorCallData([e,t,r,n,i,f,c])},n.getProxyAddress=function(e,r,n){var i=t.keccak256(t.solidityPacked(["bytes32","uint256"],[t.keccak256(e),n])),f=t.keccak256(t.solidityPacked(["bytes","uint256"],[this.proxyByteCode,this.singletonAddress]));return"0x"+t.solidityPackedKeccak256(["bytes1","address","bytes32","bytes32"],["0xff",r,i,f]).slice(-40)},r}(o),p=/*#__PURE__*/function(e){function t(t){return void 0===t&&(t="0x9406Cc6185a346906296840746125a0E44976454"),e.call(this,t,"0x5fbfb9cf",["address","uint256"])||this}return s(t,e),t}(u),h=/*#__PURE__*/function(e){function r(t,r,n){var i;return void 0===t&&(t="0x8ABB13360b87Be5EEb1B98647A016adD927a136c"),void 0===r&&(r="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"),void 0===n&&(n=new p),(i=e.call(this,t,"0x60806040526040516107c13803806107c183398101604081905261002291610321565b61002e82826000610035565b505061043e565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161079a602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103ef565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a357825160000361029c576001600160a01b0385163b61029c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102ad565b6102ad83836102b5565b949350505050565b8151156102c55781518083602001fd5b8060405162461bcd60e51b8152600401610148919061040b565b634e487b7160e01b600052604160045260246000fd5b60005b838110156103105781810151838201526020016102f8565b838111156100645750506000910152565b6000806040838503121561033457600080fd5b82516001600160a01b038116811461034b57600080fd5b60208401519092506001600160401b038082111561036857600080fd5b818501915085601f83011261037c57600080fd5b81518181111561038e5761038e6102df565b604051601f8201601f19908116603f011681019083821181831017156103b6576103b66102df565b816040528281528860208487010111156103cf57600080fd5b6103e08360208301602088016102f5565b80955050505050509250929050565b600082516104018184602087016102f5565b9190910192915050565b602081526000825180602084015261042a8160408501602087016102f5565b601f01601f19169190910160400192915050565b61034d8061044d6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102f1602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b60606000808573ffffffffffffffffffffffffffffffffffffffff16856040516101079190610283565b600060405180830381855af49150503d8060008114610142576040519150601f19603f3d011682016040523d82523d6000602084013e610147565b606091505b509150915061015886838387610162565b9695505050505050565b606083156101fd5782516000036101f65773ffffffffffffffffffffffffffffffffffffffff85163b6101f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b5081610207565b610207838361020f565b949350505050565b81511561021f5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101ed919061029f565b60005b8381101561026e578181015183820152602001610256565b8381111561027d576000848401525b50505050565b60008251610295818460208701610253565b9190910192915050565b60208152600082518060208401526102be816040850160208701610253565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201cd78ab6a31213989661cff2d7d05fc9b9c38b1a848e8249e2e398659a9eb7e364736f6c634300080f0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564","0xc4d66de8",["address"],"0xb61d27f6",["address","uint256","bytes"])||this).entrypointAddress=void 0,i.simpleAccountFactory=void 0,i.batchExecutorFunctionSelector=void 0,i.batchExecutorFunctionInputAbi=void 0,i.entrypointAddress=r,i.simpleAccountFactory=n,i.batchExecutorFunctionSelector="0x18dfb3c7",i.batchExecutorFunctionInputAbi=["address[]","bytes[]"],i}s(r,e);var n=r.prototype;return n.createNewAccount=function(e,t){void 0===t&&(t=0);var r=this.getInitializerCallData([e]),n=this.simpleAccountFactory.getFactoryGeneratorFunctionCallData([e,t]);return[this.getProxyAddress(r,this.simpleAccountFactory.address,t),n]},n.getProxyAddress=function(e,r,n){var i=t.AbiCoder.defaultAbiCoder(),f=i.encode(["uint256"],[n]),c=i.encode(["address","bytes"],[this.singletonAddress,e]),o=t.keccak256(t.solidityPacked(["bytes","bytes"],[this.proxyByteCode,c]));return"0x"+t.solidityPackedKeccak256(["bytes1","address","bytes32","bytes32"],["0xff",r,f,o]).slice(-40)},n.createSendEthCallData=function(e,t){return this.createCallData(e,t,"0x")},n.createCallData=function(e,t,r){return this.getExecutorCallData([e,t,r])},n.createBatchCallData=function(e,t){return c(this.batchExecutorFunctionSelector,this.batchExecutorFunctionInputAbi,[e,t])},r}(o),y=/*#__PURE__*/function(){function e(e,t){this.rpcUrl=void 0,this.entrypointAddress=void 0,this.rpcUrl=e,this.entrypointAddress=t}var t=e.prototype;return t.chainId=function(){try{return Promise.resolve(i(this.rpcUrl,"eth_chainId",[])).then(function(e){return"result"in e?{chainId:e.result}:e.error})}catch(e){return Promise.reject(e)}},t.supportedEntryPoints=function(){try{return Promise.resolve(i(this.rpcUrl,"eth_supportedEntryPoints",[])).then(function(e){return"result"in e?{supportedEntryPoints:e.result}:e.error})}catch(e){return Promise.reject(e)}},t.estimateUserOperationGas=function(e){try{return Promise.resolve(i(this.rpcUrl,"eth_estimateUserOperationGas",[e,this.entrypointAddress])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},t.sendUserOperation=function(e){try{return Promise.resolve(i(this.rpcUrl,"eth_sendUserOperation",[e,this.entrypointAddress])).then(function(e){return"result"in e?{userOperationHash:e.result}:e.error})}catch(e){return Promise.reject(e)}},t.getUserOperationReceipt=function(e){try{return Promise.resolve(i(this.rpcUrl,"eth_getUserOperationReceipt",[e])).then(function(e){if("result"in e){var t=e.result,r=a({},t.receipt,{logs:JSON.stringify(t.receipt.logs)});return a({},t,{logs:JSON.stringify(t.logs),receipt:r})}return e.error})}catch(e){return Promise.reject(e)}},t.getUserOperationByHash=function(e){try{return Promise.resolve(i(this.rpcUrl,"eth_getUserOperationByHash",[e])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},e}(),x=/*#__PURE__*/function(e){function t(t,r){var n;return(n=e.call(this)||this).rpcUrl=void 0,n.entrypointAddress=void 0,n.rpcUrl=r,n.entrypointAddress=t,n}s(t,e);var r=t.prototype;return r.getSupportedERC20Tokens=function(){try{return Promise.resolve(i(this.rpcUrl,"pm_supportedERC20Tokens",[])).then(function(e){if("result"in e){var t=e.result;return{tokens:t.tokens,paymasterMetadata:t.paymasterMetadata}}return e.error})}catch(e){return Promise.reject(e)}},r.getSupportedEntrypoint=function(){try{return Promise.resolve(i(this.rpcUrl,"pm_supportedEntryPoint",[])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},r.getPaymasterCallDataForPayingGasWithErc20=function(e,t){try{var r=this;return Promise.resolve(r.getPaymasterCallData(e,[r.rpcUrl,r.entrypointAddress,t]))}catch(e){return Promise.reject(e)}},r.getPaymasterCallData=function(e,t){try{return Promise.resolve(i(t[0],"pm_sponsorUserOperation",[e,t[1],{token:t[2]}])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},t}(function(){}),A={sender:t.ZeroAddress,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0x00",verificationGasLimit:"0x00",preVerificationGas:"0x00",maxFeePerGas:"0x00",maxPriorityFeePerGas:"0x00",paymasterAndData:"0x",signature:"0x"},v={sender:t.ZeroAddress,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0xffffff",verificationGasLimit:"0xffffff",preVerificationGas:"0xffffff",maxFeePerGas:"0xffffff",maxPriorityFeePerGas:"0xfffffff",paymasterAndData:"0x",signature:"0x"},m={__proto__:null,SmartAccount:o,CandideAccount:l,SimpleAccount:h,SmartAccountFactory:u,CandideAccountFactory:b,SimpleAccountFactory:p,Bundler:y,CandideValidationPaymaster:x,getUserOperationHash:f,UserOperationEmptyValues:A,UserOperationDummyValues:v};exports.Bundler=y,exports.CandideAccount=l,exports.CandideAccountFactory=b,exports.CandideValidationPaymaster=x,exports.SimpleAccount=h,exports.SimpleAccountFactory=p,exports.SmartAccount=o,exports.SmartAccountFactory=u,exports.UserOperationDummyValues=v,exports.UserOperationEmptyValues=A,exports.abstractionkit=m,exports.getUserOperationHash=f;
var e=require("isomorphic-unfetch"),t=require("ethers");function r(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,t}var n=/*#__PURE__*/r(e),a=function(e,t,r){try{var a=n.default||n,i=JSON.stringify({method:t,params:r,id:1,jsonrpc:"2.0"});return Promise.resolve(a(e,{method:"POST",body:i,redirect:"follow"})).then(function(e){return Promise.resolve(e.json())})}catch(e){return Promise.reject(e)}};function i(e,r,n){var a=t.keccak256(function(e){var r=[e.sender,e.nonce,t.keccak256(e.initCode),t.keccak256(e.callData),e.callGasLimit,e.verificationGasLimit,e.preVerificationGas,e.maxFeePerGas,e.maxPriorityFeePerGas,t.keccak256(e.paymasterAndData)];return t.AbiCoder.defaultAbiCoder().encode(["address","uint256","bytes32","bytes32","uint256","uint256","uint256","uint256","uint256","bytes32"],r)}(e)),i=t.AbiCoder.defaultAbiCoder().encode(["bytes32","address","uint256"],[a,r,n]);return t.keccak256(i)}function o(e,r,n){return e+t.AbiCoder.defaultAbiCoder().encode(r,n).slice(2)}function f(e){return t.id(e).slice(0,10)}var c,s=/*#__PURE__*/function(){function e(e,t,r,n,a,i){this.singletonAddress=void 0,this.proxyByteCode=void 0,this.initializerFunctionSelector=void 0,this.initializerFunctionInputAbi=void 0,this.executorFunctionSelector=void 0,this.executorFunctionInputAbi=void 0,this.singletonAddress=e,this.proxyByteCode=t,this.initializerFunctionSelector=r,this.initializerFunctionInputAbi=n,this.executorFunctionSelector=a,this.executorFunctionInputAbi=i}var t=e.prototype;return t.getInitializerCallData=function(e){return o(this.initializerFunctionSelector,this.initializerFunctionInputAbi,e)},t.getExecutorCallData=function(e){return o(this.executorFunctionSelector,this.executorFunctionInputAbi,e)},e}();function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},d.apply(this,arguments)}function u(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,b(e,t)}function b(e,t){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},b(e,t)}exports.Operation=void 0,(c=exports.Operation||(exports.Operation={}))[c.Call=0]="Call",c[c.Delegate=1]="Delegate";var l=/*#__PURE__*/function(){function e(e,t,r){this.address=void 0,this.generatorFunctionSelector=void 0,this.generatorFunctionInputAbi=void 0,this.address=e,this.generatorFunctionSelector=t,this.generatorFunctionInputAbi=r}return e.prototype.getFactoryGeneratorFunctionCallData=function(e){var t=o(this.generatorFunctionSelector,this.generatorFunctionInputAbi,e);return this.address+t.slice(2)},e}(),p=/*#__PURE__*/function(e){function t(t){return void 0===t&&(t="0xb73Eb505Abc30d0e7e15B73A492863235B3F4309"),e.call(this,t,"0x1688f0b9",["address","bytes","uint256"])||this}return u(t,e),t}(l);function h(e){return"0x"+e.map(function(e){return function(e){var r=t.ethers.getBytes(e.data);return t.ethers.solidityPacked(["uint8","address","uint256","uint256","bytes"],[e.operation,e.to,e.value,r.length,r]).slice(2)}(e)}).join("")}var y=/*#__PURE__*/function(e){function r(t,r,n){var a;return void 0===t&&(t="0x3A0a17Bcc84576b099373ab3Eed9702b07D30402"),void 0===r&&(r="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"),void 0===n&&(n=new p),(a=e.call(this,t,"0x608060405234801561001057600080fd5b5060405161017338038061017383398101604081905261002f916100b9565b6001600160a01b0381166100945760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642073696e676c65746f6e20616464726573732070726f766964604482015261195960f21b606482015260840160405180910390fd5b600080546001600160a01b0319166001600160a01b03929092169190911790556100e9565b6000602082840312156100cb57600080fd5b81516001600160a01b03811681146100e257600080fd5b9392505050565b607c806100f76000396000f3fe6080604052600080546001600160a01b0316813563530ca43760e11b1415602857808252602082f35b3682833781823684845af490503d82833e806041573d82fd5b503d81f3fea2646970667358221220022b6bb97dd1e16cb867add83d4159f7550336cbb5b40514145e43f493c1377664736f6c634300080c0033","0x6a1e9826",["address[]","uint256","address","bytes","address","address","uint256","address","address"],"0xf34308ef",["address","uint256","bytes","uint8","address","address","uint256"])||this).entrypointAddress=void 0,a.candideAccountFactory=void 0,a.entrypointAddress=r,a.candideAccountFactory=n,a}u(r,e);var n=r.prototype;return n.createNewAccount=function(e,r,n,a){void 0===r&&(r=1),void 0===n&&(n=0),void 0===a&&(a="0x2a15DE4410d4c8af0A7b6c12803120f43C42B820");var i=this.getInitializerCallData([e,r,t.ZeroAddress,"0x",a,t.ZeroAddress,0,t.ZeroAddress,this.entrypointAddress]);return[this.getProxyAddress(i,this.candideAccountFactory.address,n),this.candideAccountFactory.getFactoryGeneratorFunctionCallData([this.singletonAddress,i,n])]},n.createSendEthCallData=function(e,r){return this.createCallData(e,r,"0x",0,t.ZeroAddress,t.ZeroAddress,0)},n.createCallData=function(e,t,r,n,a,i,o){return this.getExecutorCallData([e,t,r,n,a,i,o])},n.getProxyAddress=function(e,r,n){var a=t.keccak256(t.solidityPacked(["bytes32","uint256"],[t.keccak256(e),n])),i=t.keccak256(t.solidityPacked(["bytes","uint256"],[this.proxyByteCode,this.singletonAddress]));return"0x"+t.solidityPackedKeccak256(["bytes1","address","bytes32","bytes32"],["0xff",r,a,i]).slice(-40)},n.createCallDataSingleTransactionWithPaymaster=function(e,t,r,n){return this.getExecutorCallData([e.to,e.value,e.data,e.operation,t,r,n])},n.createCallDataSingleTransaction=function(e){return this.createCallDataSingleTransactionWithPaymaster(e,t.ZeroAddress,t.ZeroAddress,0)},n.createCallDataBatchTransactionWithPaymaster=function(e,t,r,n){var a=o("0x8d80ff0a",["bytes"],[h(e)]);return this.getExecutorCallData(["0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",0,a,exports.Operation.Delegate,t,r,n])},n.createCallDataBatchTransaction=function(e){return this.createCallDataBatchTransactionWithPaymaster(e,t.ZeroAddress,t.ZeroAddress,0)},r}(s),x=/*#__PURE__*/function(e){function t(t){return void 0===t&&(t="0x9406Cc6185a346906296840746125a0E44976454"),e.call(this,t,"0x5fbfb9cf",["address","uint256"])||this}return u(t,e),t}(l),A=/*#__PURE__*/function(e){function r(t,r,n){var a;return void 0===t&&(t="0x8ABB13360b87Be5EEb1B98647A016adD927a136c"),void 0===r&&(r="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"),void 0===n&&(n=new x),(a=e.call(this,t,"0x60806040526040516107c13803806107c183398101604081905261002291610321565b61002e82826000610035565b505061043e565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161079a602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103ef565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a357825160000361029c576001600160a01b0385163b61029c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102ad565b6102ad83836102b5565b949350505050565b8151156102c55781518083602001fd5b8060405162461bcd60e51b8152600401610148919061040b565b634e487b7160e01b600052604160045260246000fd5b60005b838110156103105781810151838201526020016102f8565b838111156100645750506000910152565b6000806040838503121561033457600080fd5b82516001600160a01b038116811461034b57600080fd5b60208401519092506001600160401b038082111561036857600080fd5b818501915085601f83011261037c57600080fd5b81518181111561038e5761038e6102df565b604051601f8201601f19908116603f011681019083821181831017156103b6576103b66102df565b816040528281528860208487010111156103cf57600080fd5b6103e08360208301602088016102f5565b80955050505050509250929050565b600082516104018184602087016102f5565b9190910192915050565b602081526000825180602084015261042a8160408501602087016102f5565b601f01601f19169190910160400192915050565b61034d8061044d6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102f1602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b60606000808573ffffffffffffffffffffffffffffffffffffffff16856040516101079190610283565b600060405180830381855af49150503d8060008114610142576040519150601f19603f3d011682016040523d82523d6000602084013e610147565b606091505b509150915061015886838387610162565b9695505050505050565b606083156101fd5782516000036101f65773ffffffffffffffffffffffffffffffffffffffff85163b6101f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b5081610207565b610207838361020f565b949350505050565b81511561021f5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101ed919061029f565b60005b8381101561026e578181015183820152602001610256565b8381111561027d576000848401525b50505050565b60008251610295818460208701610253565b9190910192915050565b60208152600082518060208401526102be816040850160208701610253565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201cd78ab6a31213989661cff2d7d05fc9b9c38b1a848e8249e2e398659a9eb7e364736f6c634300080f0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564","0xc4d66de8",["address"],"0xb61d27f6",["address","uint256","bytes"])||this).entrypointAddress=void 0,a.simpleAccountFactory=void 0,a.batchExecutorFunctionSelector=void 0,a.batchExecutorFunctionInputAbi=void 0,a.entrypointAddress=r,a.simpleAccountFactory=n,a.batchExecutorFunctionSelector="0x18dfb3c7",a.batchExecutorFunctionInputAbi=["address[]","bytes[]"],a}u(r,e);var n=r.prototype;return n.createNewAccount=function(e,t){void 0===t&&(t=0);var r=this.getInitializerCallData([e]),n=this.simpleAccountFactory.getFactoryGeneratorFunctionCallData([e,t]);return[this.getProxyAddress(r,this.simpleAccountFactory.address,t),n]},n.getProxyAddress=function(e,r,n){var a=t.AbiCoder.defaultAbiCoder(),i=a.encode(["uint256"],[n]),o=a.encode(["address","bytes"],[this.singletonAddress,e]),f=t.keccak256(t.solidityPacked(["bytes","bytes"],[this.proxyByteCode,o]));return"0x"+t.solidityPackedKeccak256(["bytes1","address","bytes32","bytes32"],["0xff",r,i,f]).slice(-40)},n.createSendEthCallData=function(e,t){return this.createCallData(e,t,"0x")},n.createCallData=function(e,t,r){return this.getExecutorCallData([e,t,r])},n.createBatchCallData=function(e,t){return o(this.batchExecutorFunctionSelector,this.batchExecutorFunctionInputAbi,[e,t])},r}(s),m=/*#__PURE__*/function(){function e(e,t){this.rpcUrl=void 0,this.entrypointAddress=void 0,this.rpcUrl=e,this.entrypointAddress=t}var t=e.prototype;return t.chainId=function(){try{return Promise.resolve(a(this.rpcUrl,"eth_chainId",[])).then(function(e){return"result"in e?{chainId:e.result}:e.error})}catch(e){return Promise.reject(e)}},t.supportedEntryPoints=function(){try{return Promise.resolve(a(this.rpcUrl,"eth_supportedEntryPoints",[])).then(function(e){return"result"in e?{supportedEntryPoints:e.result}:e.error})}catch(e){return Promise.reject(e)}},t.estimateUserOperationGas=function(e){try{return Promise.resolve(a(this.rpcUrl,"eth_estimateUserOperationGas",[e,this.entrypointAddress])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},t.sendUserOperation=function(e){try{return Promise.resolve(a(this.rpcUrl,"eth_sendUserOperation",[e,this.entrypointAddress])).then(function(e){return"result"in e?{userOperationHash:e.result}:e.error})}catch(e){return Promise.reject(e)}},t.getUserOperationReceipt=function(e){try{return Promise.resolve(a(this.rpcUrl,"eth_getUserOperationReceipt",[e])).then(function(e){if("result"in e){var t=e.result,r=d({},t.receipt,{logs:JSON.stringify(t.receipt.logs)});return d({},t,{logs:JSON.stringify(t.logs),receipt:r})}return e.error})}catch(e){return Promise.reject(e)}},t.getUserOperationByHash=function(e){try{return Promise.resolve(a(this.rpcUrl,"eth_getUserOperationByHash",[e])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},e}(),v=/*#__PURE__*/function(e){function t(t,r){var n;return(n=e.call(this)||this).rpcUrl=void 0,n.entrypointAddress=void 0,n.rpcUrl=r,n.entrypointAddress=t,n}u(t,e);var r=t.prototype;return r.getSupportedERC20Tokens=function(){try{return Promise.resolve(a(this.rpcUrl,"pm_supportedERC20Tokens",[])).then(function(e){if("result"in e){var t=e.result;return{tokens:t.tokens,paymasterMetadata:t.paymasterMetadata}}return e.error})}catch(e){return Promise.reject(e)}},r.getSupportedEntrypoint=function(){try{return Promise.resolve(a(this.rpcUrl,"pm_supportedEntryPoint",[])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},r.getPaymasterCallDataForPayingGasWithErc20=function(e,t){try{var r=this;return Promise.resolve(r.getPaymasterCallData(e,[r.rpcUrl,r.entrypointAddress,t]))}catch(e){return Promise.reject(e)}},r.getPaymasterCallDataForGaslessTx=function(e){try{var t=this;return Promise.resolve(t.getPaymasterCallData(e,[t.rpcUrl,t.entrypointAddress]))}catch(e){return Promise.reject(e)}},r.getPaymasterCallData=function(e,t){try{return Promise.resolve(a(t[0],"pm_sponsorUserOperation",[e,t[1],{token:t[2]}])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},t}(function(){}),g={sender:t.ZeroAddress,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0x00",verificationGasLimit:"0x00",preVerificationGas:"0x00",maxFeePerGas:"0x00",maxPriorityFeePerGas:"0x00",paymasterAndData:"0x",signature:"0x"},P={sender:t.ZeroAddress,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0xffffff",verificationGasLimit:"0xffffff",preVerificationGas:"0xffffff",maxFeePerGas:"0xffffff",maxPriorityFeePerGas:"0xfffffff",paymasterAndData:"0x",signature:"0x"},F={__proto__:null,SmartAccount:s,CandideAccount:y,SimpleAccount:A,SmartAccountFactory:l,CandideAccountFactory:p,SimpleAccountFactory:x,Bundler:m,CandideValidationPaymaster:v,getUserOperationHash:i,getCallData:o,getFunctionSelector:f,UserOperationEmptyValues:g,UserOperationDummyValues:P,get Operation(){return exports.Operation}};exports.Bundler=m,exports.CandideAccount=y,exports.CandideAccountFactory=p,exports.CandideValidationPaymaster=v,exports.SimpleAccount=A,exports.SimpleAccountFactory=x,exports.SmartAccount=s,exports.SmartAccountFactory=l,exports.UserOperationDummyValues=P,exports.UserOperationEmptyValues=g,exports.abstractionkit=F,exports.getCallData=o,exports.getFunctionSelector=f,exports.getUserOperationHash=i;

@@ -1,1 +0,1 @@

import*as t from"isomorphic-unfetch";import{keccak256 as e,AbiCoder as r,ZeroAddress as n,solidityPacked as f,solidityPackedKeccak256 as i}from"ethers";var a=function(e,r,n){try{var f=t.default||t,i=JSON.stringify({method:r,params:n,id:1,jsonrpc:"2.0"});return Promise.resolve(f(e,{method:"POST",body:i,redirect:"follow"})).then(function(t){return Promise.resolve(t.json())})}catch(t){return Promise.reject(t)}};function o(t,n,f){var i=e(function(t){var n=[t.sender,t.nonce,e(t.initCode),e(t.callData),t.callGasLimit,t.verificationGasLimit,t.preVerificationGas,t.maxFeePerGas,t.maxPriorityFeePerGas,e(t.paymasterAndData)];return r.defaultAbiCoder().encode(["address","uint256","bytes32","bytes32","uint256","uint256","uint256","uint256","uint256","bytes32"],n)}(t)),a=r.defaultAbiCoder().encode(["bytes32","address","uint256"],[i,n,f]);return e(a)}function c(t,e,n){return t+r.defaultAbiCoder().encode(e,n).slice(2)}var s=/*#__PURE__*/function(){function t(t,e,r,n,f,i){this.singletonAddress=void 0,this.proxyByteCode=void 0,this.initializerFunctionSelector=void 0,this.initializerFunctionInputAbi=void 0,this.executorFunctionSelector=void 0,this.executorFunctionInputAbi=void 0,this.singletonAddress=t,this.proxyByteCode=e,this.initializerFunctionSelector=r,this.initializerFunctionInputAbi=n,this.executorFunctionSelector=f,this.executorFunctionInputAbi=i}var e=t.prototype;return e.getInitializerCallData=function(t){return c(this.initializerFunctionSelector,this.initializerFunctionInputAbi,t)},e.getExecutorCallData=function(t){return c(this.executorFunctionSelector,this.executorFunctionInputAbi,t)},t}();function d(){return d=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},d.apply(this,arguments)}function u(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,b(t,e)}function b(t,e){return b=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},b(t,e)}var l=/*#__PURE__*/function(){function t(t,e,r){this.address=void 0,this.generatorFunctionSelector=void 0,this.generatorFunctionInputAbi=void 0,this.address=t,this.generatorFunctionSelector=e,this.generatorFunctionInputAbi=r}return t.prototype.getFactoryGeneratorFunctionCallData=function(t){var e=c(this.generatorFunctionSelector,this.generatorFunctionInputAbi,t);return this.address+e.slice(2)},t}(),p=/*#__PURE__*/function(t){function e(e){return void 0===e&&(e="0xb73Eb505Abc30d0e7e15B73A492863235B3F4309"),t.call(this,e,"0x1688f0b9",["address","bytes","uint256"])||this}return u(e,t),e}(l),h=/*#__PURE__*/function(t){function r(e,r,n){var f;return void 0===e&&(e="0x3A0a17Bcc84576b099373ab3Eed9702b07D30402"),void 0===r&&(r="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"),void 0===n&&(n=new p),(f=t.call(this,e,"0x608060405234801561001057600080fd5b5060405161017338038061017383398101604081905261002f916100b9565b6001600160a01b0381166100945760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642073696e676c65746f6e20616464726573732070726f766964604482015261195960f21b606482015260840160405180910390fd5b600080546001600160a01b0319166001600160a01b03929092169190911790556100e9565b6000602082840312156100cb57600080fd5b81516001600160a01b03811681146100e257600080fd5b9392505050565b607c806100f76000396000f3fe6080604052600080546001600160a01b0316813563530ca43760e11b1415602857808252602082f35b3682833781823684845af490503d82833e806041573d82fd5b503d81f3fea2646970667358221220022b6bb97dd1e16cb867add83d4159f7550336cbb5b40514145e43f493c1377664736f6c634300080c0033","0x6a1e9826",["address[]","uint256","address","bytes","address","address","uint256","address","address"],"0xf34308ef",["address","uint256","bytes","uint8","address","address","uint256"])||this).entrypointAddress=void 0,f.candideAccountFactory=void 0,f.entrypointAddress=r,f.candideAccountFactory=n,f}u(r,t);var a=r.prototype;return a.createNewAccount=function(t,e,r,f){void 0===e&&(e=1),void 0===r&&(r=0),void 0===f&&(f="0x2a15DE4410d4c8af0A7b6c12803120f43C42B820");var i=this.getInitializerCallData([t,e,n,"0x",f,n,0,n,this.entrypointAddress]);return[this.getProxyAddress(i,this.candideAccountFactory.address,r),this.candideAccountFactory.getFactoryGeneratorFunctionCallData([this.singletonAddress,i,r])]},a.createSendEthCallData=function(t,e){return this.createCallData(t,e,"0x",0,n,n,0)},a.createCallData=function(t,e,r,n,f,i,a){return this.getExecutorCallData([t,e,r,n,f,i,a])},a.getProxyAddress=function(t,r,n){var a=e(f(["bytes32","uint256"],[e(t),n])),o=e(f(["bytes","uint256"],[this.proxyByteCode,this.singletonAddress]));return"0x"+i(["bytes1","address","bytes32","bytes32"],["0xff",r,a,o]).slice(-40)},r}(s),y=/*#__PURE__*/function(t){function e(e){return void 0===e&&(e="0x9406Cc6185a346906296840746125a0E44976454"),t.call(this,e,"0x5fbfb9cf",["address","uint256"])||this}return u(e,t),e}(l),x=/*#__PURE__*/function(t){function n(e,r,n){var f;return void 0===e&&(e="0x8ABB13360b87Be5EEb1B98647A016adD927a136c"),void 0===r&&(r="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"),void 0===n&&(n=new y),(f=t.call(this,e,"0x60806040526040516107c13803806107c183398101604081905261002291610321565b61002e82826000610035565b505061043e565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161079a602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103ef565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a357825160000361029c576001600160a01b0385163b61029c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102ad565b6102ad83836102b5565b949350505050565b8151156102c55781518083602001fd5b8060405162461bcd60e51b8152600401610148919061040b565b634e487b7160e01b600052604160045260246000fd5b60005b838110156103105781810151838201526020016102f8565b838111156100645750506000910152565b6000806040838503121561033457600080fd5b82516001600160a01b038116811461034b57600080fd5b60208401519092506001600160401b038082111561036857600080fd5b818501915085601f83011261037c57600080fd5b81518181111561038e5761038e6102df565b604051601f8201601f19908116603f011681019083821181831017156103b6576103b66102df565b816040528281528860208487010111156103cf57600080fd5b6103e08360208301602088016102f5565b80955050505050509250929050565b600082516104018184602087016102f5565b9190910192915050565b602081526000825180602084015261042a8160408501602087016102f5565b601f01601f19169190910160400192915050565b61034d8061044d6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102f1602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b60606000808573ffffffffffffffffffffffffffffffffffffffff16856040516101079190610283565b600060405180830381855af49150503d8060008114610142576040519150601f19603f3d011682016040523d82523d6000602084013e610147565b606091505b509150915061015886838387610162565b9695505050505050565b606083156101fd5782516000036101f65773ffffffffffffffffffffffffffffffffffffffff85163b6101f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b5081610207565b610207838361020f565b949350505050565b81511561021f5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101ed919061029f565b60005b8381101561026e578181015183820152602001610256565b8381111561027d576000848401525b50505050565b60008251610295818460208701610253565b9190910192915050565b60208152600082518060208401526102be816040850160208701610253565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201cd78ab6a31213989661cff2d7d05fc9b9c38b1a848e8249e2e398659a9eb7e364736f6c634300080f0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564","0xc4d66de8",["address"],"0xb61d27f6",["address","uint256","bytes"])||this).entrypointAddress=void 0,f.simpleAccountFactory=void 0,f.batchExecutorFunctionSelector=void 0,f.batchExecutorFunctionInputAbi=void 0,f.entrypointAddress=r,f.simpleAccountFactory=n,f.batchExecutorFunctionSelector="0x18dfb3c7",f.batchExecutorFunctionInputAbi=["address[]","bytes[]"],f}u(n,t);var a=n.prototype;return a.createNewAccount=function(t,e){void 0===e&&(e=0);var r=this.getInitializerCallData([t]),n=this.simpleAccountFactory.getFactoryGeneratorFunctionCallData([t,e]);return[this.getProxyAddress(r,this.simpleAccountFactory.address,e),n]},a.getProxyAddress=function(t,n,a){var o=r.defaultAbiCoder(),c=o.encode(["uint256"],[a]),s=o.encode(["address","bytes"],[this.singletonAddress,t]),d=e(f(["bytes","bytes"],[this.proxyByteCode,s]));return"0x"+i(["bytes1","address","bytes32","bytes32"],["0xff",n,c,d]).slice(-40)},a.createSendEthCallData=function(t,e){return this.createCallData(t,e,"0x")},a.createCallData=function(t,e,r){return this.getExecutorCallData([t,e,r])},a.createBatchCallData=function(t,e){return c(this.batchExecutorFunctionSelector,this.batchExecutorFunctionInputAbi,[t,e])},n}(s),v=/*#__PURE__*/function(){function t(t,e){this.rpcUrl=void 0,this.entrypointAddress=void 0,this.rpcUrl=t,this.entrypointAddress=e}var e=t.prototype;return e.chainId=function(){try{return Promise.resolve(a(this.rpcUrl,"eth_chainId",[])).then(function(t){return"result"in t?{chainId:t.result}:t.error})}catch(t){return Promise.reject(t)}},e.supportedEntryPoints=function(){try{return Promise.resolve(a(this.rpcUrl,"eth_supportedEntryPoints",[])).then(function(t){return"result"in t?{supportedEntryPoints:t.result}:t.error})}catch(t){return Promise.reject(t)}},e.estimateUserOperationGas=function(t){try{return Promise.resolve(a(this.rpcUrl,"eth_estimateUserOperationGas",[t,this.entrypointAddress])).then(function(t){return"result"in t?t.result:t.error})}catch(t){return Promise.reject(t)}},e.sendUserOperation=function(t){try{return Promise.resolve(a(this.rpcUrl,"eth_sendUserOperation",[t,this.entrypointAddress])).then(function(t){return"result"in t?{userOperationHash:t.result}:t.error})}catch(t){return Promise.reject(t)}},e.getUserOperationReceipt=function(t){try{return Promise.resolve(a(this.rpcUrl,"eth_getUserOperationReceipt",[t])).then(function(t){if("result"in t){var e=t.result,r=d({},e.receipt,{logs:JSON.stringify(e.receipt.logs)});return d({},e,{logs:JSON.stringify(e.logs),receipt:r})}return t.error})}catch(t){return Promise.reject(t)}},e.getUserOperationByHash=function(t){try{return Promise.resolve(a(this.rpcUrl,"eth_getUserOperationByHash",[t])).then(function(t){return"result"in t?t.result:t.error})}catch(t){return Promise.reject(t)}},t}(),m=/*#__PURE__*/function(t){function e(e,r){var n;return(n=t.call(this)||this).rpcUrl=void 0,n.entrypointAddress=void 0,n.rpcUrl=r,n.entrypointAddress=e,n}u(e,t);var r=e.prototype;return r.getSupportedERC20Tokens=function(){try{return Promise.resolve(a(this.rpcUrl,"pm_supportedERC20Tokens",[])).then(function(t){if("result"in t){var e=t.result;return{tokens:e.tokens,paymasterMetadata:e.paymasterMetadata}}return t.error})}catch(t){return Promise.reject(t)}},r.getSupportedEntrypoint=function(){try{return Promise.resolve(a(this.rpcUrl,"pm_supportedEntryPoint",[])).then(function(t){return"result"in t?t.result:t.error})}catch(t){return Promise.reject(t)}},r.getPaymasterCallDataForPayingGasWithErc20=function(t,e){try{var r=this;return Promise.resolve(r.getPaymasterCallData(t,[r.rpcUrl,r.entrypointAddress,e]))}catch(t){return Promise.reject(t)}},r.getPaymasterCallData=function(t,e){try{return Promise.resolve(a(e[0],"pm_sponsorUserOperation",[t,e[1],{token:e[2]}])).then(function(t){return"result"in t?t.result:t.error})}catch(t){return Promise.reject(t)}},e}(function(){}),A={sender:n,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0x00",verificationGasLimit:"0x00",preVerificationGas:"0x00",maxFeePerGas:"0x00",maxPriorityFeePerGas:"0x00",paymasterAndData:"0x",signature:"0x"},F={sender:n,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0xffffff",verificationGasLimit:"0xffffff",preVerificationGas:"0xffffff",maxFeePerGas:"0xffffff",maxPriorityFeePerGas:"0xfffffff",paymasterAndData:"0x",signature:"0x"},P={__proto__:null,SmartAccount:s,CandideAccount:h,SimpleAccount:x,SmartAccountFactory:l,CandideAccountFactory:p,SimpleAccountFactory:y,Bundler:v,CandideValidationPaymaster:m,getUserOperationHash:o,UserOperationEmptyValues:A,UserOperationDummyValues:F};export{v as Bundler,h as CandideAccount,p as CandideAccountFactory,m as CandideValidationPaymaster,x as SimpleAccount,y as SimpleAccountFactory,s as SmartAccount,l as SmartAccountFactory,F as UserOperationDummyValues,A as UserOperationEmptyValues,P as abstractionkit,o as getUserOperationHash};
import*as t from"isomorphic-unfetch";import{keccak256 as e,AbiCoder as r,id as n,ethers as i,ZeroAddress as a,solidityPacked as f,solidityPackedKeccak256 as c}from"ethers";var o=function(e,r,n){try{var i=t.default||t,a=JSON.stringify({method:r,params:n,id:1,jsonrpc:"2.0"});return Promise.resolve(i(e,{method:"POST",body:a,redirect:"follow"})).then(function(t){return Promise.resolve(t.json())})}catch(t){return Promise.reject(t)}};function s(t,n,i){var a=e(function(t){var n=[t.sender,t.nonce,e(t.initCode),e(t.callData),t.callGasLimit,t.verificationGasLimit,t.preVerificationGas,t.maxFeePerGas,t.maxPriorityFeePerGas,e(t.paymasterAndData)];return r.defaultAbiCoder().encode(["address","uint256","bytes32","bytes32","uint256","uint256","uint256","uint256","uint256","bytes32"],n)}(t)),f=r.defaultAbiCoder().encode(["bytes32","address","uint256"],[a,n,i]);return e(f)}function d(t,e,n){return t+r.defaultAbiCoder().encode(e,n).slice(2)}function u(t){return n(t).slice(0,10)}var b,l=/*#__PURE__*/function(){function t(t,e,r,n,i,a){this.singletonAddress=void 0,this.proxyByteCode=void 0,this.initializerFunctionSelector=void 0,this.initializerFunctionInputAbi=void 0,this.executorFunctionSelector=void 0,this.executorFunctionInputAbi=void 0,this.singletonAddress=t,this.proxyByteCode=e,this.initializerFunctionSelector=r,this.initializerFunctionInputAbi=n,this.executorFunctionSelector=i,this.executorFunctionInputAbi=a}var e=t.prototype;return e.getInitializerCallData=function(t){return d(this.initializerFunctionSelector,this.initializerFunctionInputAbi,t)},e.getExecutorCallData=function(t){return d(this.executorFunctionSelector,this.executorFunctionInputAbi,t)},t}();function h(){return h=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},h.apply(this,arguments)}function p(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,y(t,e)}function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},y(t,e)}!function(t){t[t.Call=0]="Call",t[t.Delegate=1]="Delegate"}(b||(b={}));var x=/*#__PURE__*/function(){function t(t,e,r){this.address=void 0,this.generatorFunctionSelector=void 0,this.generatorFunctionInputAbi=void 0,this.address=t,this.generatorFunctionSelector=e,this.generatorFunctionInputAbi=r}return t.prototype.getFactoryGeneratorFunctionCallData=function(t){var e=d(this.generatorFunctionSelector,this.generatorFunctionInputAbi,t);return this.address+e.slice(2)},t}(),v=/*#__PURE__*/function(t){function e(e){return void 0===e&&(e="0xb73Eb505Abc30d0e7e15B73A492863235B3F4309"),t.call(this,e,"0x1688f0b9",["address","bytes","uint256"])||this}return p(e,t),e}(x);function m(t){return"0x"+t.map(function(t){return function(t){var e=i.getBytes(t.data);return i.solidityPacked(["uint8","address","uint256","uint256","bytes"],[t.operation,t.to,t.value,e.length,e]).slice(2)}(t)}).join("")}var A=/*#__PURE__*/function(t){function r(e,r,n){var i;return void 0===e&&(e="0x3A0a17Bcc84576b099373ab3Eed9702b07D30402"),void 0===r&&(r="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"),void 0===n&&(n=new v),(i=t.call(this,e,"0x608060405234801561001057600080fd5b5060405161017338038061017383398101604081905261002f916100b9565b6001600160a01b0381166100945760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642073696e676c65746f6e20616464726573732070726f766964604482015261195960f21b606482015260840160405180910390fd5b600080546001600160a01b0319166001600160a01b03929092169190911790556100e9565b6000602082840312156100cb57600080fd5b81516001600160a01b03811681146100e257600080fd5b9392505050565b607c806100f76000396000f3fe6080604052600080546001600160a01b0316813563530ca43760e11b1415602857808252602082f35b3682833781823684845af490503d82833e806041573d82fd5b503d81f3fea2646970667358221220022b6bb97dd1e16cb867add83d4159f7550336cbb5b40514145e43f493c1377664736f6c634300080c0033","0x6a1e9826",["address[]","uint256","address","bytes","address","address","uint256","address","address"],"0xf34308ef",["address","uint256","bytes","uint8","address","address","uint256"])||this).entrypointAddress=void 0,i.candideAccountFactory=void 0,i.entrypointAddress=r,i.candideAccountFactory=n,i}p(r,t);var n=r.prototype;return n.createNewAccount=function(t,e,r,n){void 0===e&&(e=1),void 0===r&&(r=0),void 0===n&&(n="0x2a15DE4410d4c8af0A7b6c12803120f43C42B820");var i=this.getInitializerCallData([t,e,a,"0x",n,a,0,a,this.entrypointAddress]);return[this.getProxyAddress(i,this.candideAccountFactory.address,r),this.candideAccountFactory.getFactoryGeneratorFunctionCallData([this.singletonAddress,i,r])]},n.createSendEthCallData=function(t,e){return this.createCallData(t,e,"0x",0,a,a,0)},n.createCallData=function(t,e,r,n,i,a,f){return this.getExecutorCallData([t,e,r,n,i,a,f])},n.getProxyAddress=function(t,r,n){var i=e(f(["bytes32","uint256"],[e(t),n])),a=e(f(["bytes","uint256"],[this.proxyByteCode,this.singletonAddress]));return"0x"+c(["bytes1","address","bytes32","bytes32"],["0xff",r,i,a]).slice(-40)},n.createCallDataSingleTransactionWithPaymaster=function(t,e,r,n){return this.getExecutorCallData([t.to,t.value,t.data,t.operation,e,r,n])},n.createCallDataSingleTransaction=function(t){return this.createCallDataSingleTransactionWithPaymaster(t,a,a,0)},n.createCallDataBatchTransactionWithPaymaster=function(t,e,r,n){var i=d("0x8d80ff0a",["bytes"],[m(t)]);return this.getExecutorCallData(["0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",0,i,b.Delegate,e,r,n])},n.createCallDataBatchTransaction=function(t){return this.createCallDataBatchTransactionWithPaymaster(t,a,a,0)},r}(l),g=/*#__PURE__*/function(t){function e(e){return void 0===e&&(e="0x9406Cc6185a346906296840746125a0E44976454"),t.call(this,e,"0x5fbfb9cf",["address","uint256"])||this}return p(e,t),e}(x),F=/*#__PURE__*/function(t){function n(e,r,n){var i;return void 0===e&&(e="0x8ABB13360b87Be5EEb1B98647A016adD927a136c"),void 0===r&&(r="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"),void 0===n&&(n=new g),(i=t.call(this,e,"0x60806040526040516107c13803806107c183398101604081905261002291610321565b61002e82826000610035565b505061043e565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161079a602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103ef565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a357825160000361029c576001600160a01b0385163b61029c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102ad565b6102ad83836102b5565b949350505050565b8151156102c55781518083602001fd5b8060405162461bcd60e51b8152600401610148919061040b565b634e487b7160e01b600052604160045260246000fd5b60005b838110156103105781810151838201526020016102f8565b838111156100645750506000910152565b6000806040838503121561033457600080fd5b82516001600160a01b038116811461034b57600080fd5b60208401519092506001600160401b038082111561036857600080fd5b818501915085601f83011261037c57600080fd5b81518181111561038e5761038e6102df565b604051601f8201601f19908116603f011681019083821181831017156103b6576103b66102df565b816040528281528860208487010111156103cf57600080fd5b6103e08360208301602088016102f5565b80955050505050509250929050565b600082516104018184602087016102f5565b9190910192915050565b602081526000825180602084015261042a8160408501602087016102f5565b601f01601f19169190910160400192915050565b61034d8061044d6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102f1602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b60606000808573ffffffffffffffffffffffffffffffffffffffff16856040516101079190610283565b600060405180830381855af49150503d8060008114610142576040519150601f19603f3d011682016040523d82523d6000602084013e610147565b606091505b509150915061015886838387610162565b9695505050505050565b606083156101fd5782516000036101f65773ffffffffffffffffffffffffffffffffffffffff85163b6101f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b5081610207565b610207838361020f565b949350505050565b81511561021f5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101ed919061029f565b60005b8381101561026e578181015183820152602001610256565b8381111561027d576000848401525b50505050565b60008251610295818460208701610253565b9190910192915050565b60208152600082518060208401526102be816040850160208701610253565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201cd78ab6a31213989661cff2d7d05fc9b9c38b1a848e8249e2e398659a9eb7e364736f6c634300080f0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564","0xc4d66de8",["address"],"0xb61d27f6",["address","uint256","bytes"])||this).entrypointAddress=void 0,i.simpleAccountFactory=void 0,i.batchExecutorFunctionSelector=void 0,i.batchExecutorFunctionInputAbi=void 0,i.entrypointAddress=r,i.simpleAccountFactory=n,i.batchExecutorFunctionSelector="0x18dfb3c7",i.batchExecutorFunctionInputAbi=["address[]","bytes[]"],i}p(n,t);var i=n.prototype;return i.createNewAccount=function(t,e){void 0===e&&(e=0);var r=this.getInitializerCallData([t]),n=this.simpleAccountFactory.getFactoryGeneratorFunctionCallData([t,e]);return[this.getProxyAddress(r,this.simpleAccountFactory.address,e),n]},i.getProxyAddress=function(t,n,i){var a=r.defaultAbiCoder(),o=a.encode(["uint256"],[i]),s=a.encode(["address","bytes"],[this.singletonAddress,t]),d=e(f(["bytes","bytes"],[this.proxyByteCode,s]));return"0x"+c(["bytes1","address","bytes32","bytes32"],["0xff",n,o,d]).slice(-40)},i.createSendEthCallData=function(t,e){return this.createCallData(t,e,"0x")},i.createCallData=function(t,e,r){return this.getExecutorCallData([t,e,r])},i.createBatchCallData=function(t,e){return d(this.batchExecutorFunctionSelector,this.batchExecutorFunctionInputAbi,[t,e])},n}(l),P=/*#__PURE__*/function(){function t(t,e){this.rpcUrl=void 0,this.entrypointAddress=void 0,this.rpcUrl=t,this.entrypointAddress=e}var e=t.prototype;return e.chainId=function(){try{return Promise.resolve(o(this.rpcUrl,"eth_chainId",[])).then(function(t){return"result"in t?{chainId:t.result}:t.error})}catch(t){return Promise.reject(t)}},e.supportedEntryPoints=function(){try{return Promise.resolve(o(this.rpcUrl,"eth_supportedEntryPoints",[])).then(function(t){return"result"in t?{supportedEntryPoints:t.result}:t.error})}catch(t){return Promise.reject(t)}},e.estimateUserOperationGas=function(t){try{return Promise.resolve(o(this.rpcUrl,"eth_estimateUserOperationGas",[t,this.entrypointAddress])).then(function(t){return"result"in t?t.result:t.error})}catch(t){return Promise.reject(t)}},e.sendUserOperation=function(t){try{return Promise.resolve(o(this.rpcUrl,"eth_sendUserOperation",[t,this.entrypointAddress])).then(function(t){return"result"in t?{userOperationHash:t.result}:t.error})}catch(t){return Promise.reject(t)}},e.getUserOperationReceipt=function(t){try{return Promise.resolve(o(this.rpcUrl,"eth_getUserOperationReceipt",[t])).then(function(t){if("result"in t){var e=t.result,r=h({},e.receipt,{logs:JSON.stringify(e.receipt.logs)});return h({},e,{logs:JSON.stringify(e.logs),receipt:r})}return t.error})}catch(t){return Promise.reject(t)}},e.getUserOperationByHash=function(t){try{return Promise.resolve(o(this.rpcUrl,"eth_getUserOperationByHash",[t])).then(function(t){return"result"in t?t.result:t.error})}catch(t){return Promise.reject(t)}},t}(),C=/*#__PURE__*/function(t){function e(e,r){var n;return(n=t.call(this)||this).rpcUrl=void 0,n.entrypointAddress=void 0,n.rpcUrl=r,n.entrypointAddress=e,n}p(e,t);var r=e.prototype;return r.getSupportedERC20Tokens=function(){try{return Promise.resolve(o(this.rpcUrl,"pm_supportedERC20Tokens",[])).then(function(t){if("result"in t){var e=t.result;return{tokens:e.tokens,paymasterMetadata:e.paymasterMetadata}}return t.error})}catch(t){return Promise.reject(t)}},r.getSupportedEntrypoint=function(){try{return Promise.resolve(o(this.rpcUrl,"pm_supportedEntryPoint",[])).then(function(t){return"result"in t?t.result:t.error})}catch(t){return Promise.reject(t)}},r.getPaymasterCallDataForPayingGasWithErc20=function(t,e){try{var r=this;return Promise.resolve(r.getPaymasterCallData(t,[r.rpcUrl,r.entrypointAddress,e]))}catch(t){return Promise.reject(t)}},r.getPaymasterCallDataForGaslessTx=function(t){try{var e=this;return Promise.resolve(e.getPaymasterCallData(t,[e.rpcUrl,e.entrypointAddress]))}catch(t){return Promise.reject(t)}},r.getPaymasterCallData=function(t,e){try{return Promise.resolve(o(e[0],"pm_sponsorUserOperation",[t,e[1],{token:e[2]}])).then(function(t){return"result"in t?t.result:t.error})}catch(t){return Promise.reject(t)}},e}(function(){}),D={sender:a,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0x00",verificationGasLimit:"0x00",preVerificationGas:"0x00",maxFeePerGas:"0x00",maxPriorityFeePerGas:"0x00",paymasterAndData:"0x",signature:"0x"},E={sender:a,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0xffffff",verificationGasLimit:"0xffffff",preVerificationGas:"0xffffff",maxFeePerGas:"0xffffff",maxPriorityFeePerGas:"0xfffffff",paymasterAndData:"0x",signature:"0x"},S={__proto__:null,SmartAccount:l,CandideAccount:A,SimpleAccount:F,SmartAccountFactory:x,CandideAccountFactory:v,SimpleAccountFactory:g,Bundler:P,CandideValidationPaymaster:C,getUserOperationHash:s,getCallData:d,getFunctionSelector:u,UserOperationEmptyValues:D,UserOperationDummyValues:E,get Operation(){return b}};export{P as Bundler,A as CandideAccount,v as CandideAccountFactory,C as CandideValidationPaymaster,b as Operation,F as SimpleAccount,g as SimpleAccountFactory,l as SmartAccount,x as SmartAccountFactory,E as UserOperationDummyValues,D as UserOperationEmptyValues,S as abstractionkit,d as getCallData,u as getFunctionSelector,s as getUserOperationHash};

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("isomorphic-unfetch"),require("ethers")):"function"==typeof define&&define.amd?define(["exports","isomorphic-unfetch","ethers"],t):t((e||self).abstractionkit={},e.isomorphicUnfetch,e.ethers)}(this,function(e,t,r){function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,t}var i=/*#__PURE__*/n(t),f=function(e,t,r){try{var n=i.default||i,f=JSON.stringify({method:t,params:r,id:1,jsonrpc:"2.0"});return Promise.resolve(n(e,{method:"POST",body:f,redirect:"follow"})).then(function(e){return Promise.resolve(e.json())})}catch(e){return Promise.reject(e)}};function c(e,t,n){var i=r.keccak256(function(e){var t=[e.sender,e.nonce,r.keccak256(e.initCode),r.keccak256(e.callData),e.callGasLimit,e.verificationGasLimit,e.preVerificationGas,e.maxFeePerGas,e.maxPriorityFeePerGas,r.keccak256(e.paymasterAndData)];return r.AbiCoder.defaultAbiCoder().encode(["address","uint256","bytes32","bytes32","uint256","uint256","uint256","uint256","uint256","bytes32"],t)}(e)),f=r.AbiCoder.defaultAbiCoder().encode(["bytes32","address","uint256"],[i,t,n]);return r.keccak256(f)}function o(e,t,n){return e+r.AbiCoder.defaultAbiCoder().encode(t,n).slice(2)}var a=/*#__PURE__*/function(){function e(e,t,r,n,i,f){this.singletonAddress=void 0,this.proxyByteCode=void 0,this.initializerFunctionSelector=void 0,this.initializerFunctionInputAbi=void 0,this.executorFunctionSelector=void 0,this.executorFunctionInputAbi=void 0,this.singletonAddress=e,this.proxyByteCode=t,this.initializerFunctionSelector=r,this.initializerFunctionInputAbi=n,this.executorFunctionSelector=i,this.executorFunctionInputAbi=f}var t=e.prototype;return t.getInitializerCallData=function(e){return o(this.initializerFunctionSelector,this.initializerFunctionInputAbi,e)},t.getExecutorCallData=function(e){return o(this.executorFunctionSelector,this.executorFunctionInputAbi,e)},e}();function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s.apply(this,arguments)}function d(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,u(e,t)}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}var b=/*#__PURE__*/function(){function e(e,t,r){this.address=void 0,this.generatorFunctionSelector=void 0,this.generatorFunctionInputAbi=void 0,this.address=e,this.generatorFunctionSelector=t,this.generatorFunctionInputAbi=r}return e.prototype.getFactoryGeneratorFunctionCallData=function(e){var t=o(this.generatorFunctionSelector,this.generatorFunctionInputAbi,e);return this.address+t.slice(2)},e}(),l=/*#__PURE__*/function(e){function t(t){return void 0===t&&(t="0xb73Eb505Abc30d0e7e15B73A492863235B3F4309"),e.call(this,t,"0x1688f0b9",["address","bytes","uint256"])||this}return d(t,e),t}(b),p=/*#__PURE__*/function(e){function t(t,r,n){var i;return void 0===t&&(t="0x3A0a17Bcc84576b099373ab3Eed9702b07D30402"),void 0===r&&(r="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"),void 0===n&&(n=new l),(i=e.call(this,t,"0x608060405234801561001057600080fd5b5060405161017338038061017383398101604081905261002f916100b9565b6001600160a01b0381166100945760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642073696e676c65746f6e20616464726573732070726f766964604482015261195960f21b606482015260840160405180910390fd5b600080546001600160a01b0319166001600160a01b03929092169190911790556100e9565b6000602082840312156100cb57600080fd5b81516001600160a01b03811681146100e257600080fd5b9392505050565b607c806100f76000396000f3fe6080604052600080546001600160a01b0316813563530ca43760e11b1415602857808252602082f35b3682833781823684845af490503d82833e806041573d82fd5b503d81f3fea2646970667358221220022b6bb97dd1e16cb867add83d4159f7550336cbb5b40514145e43f493c1377664736f6c634300080c0033","0x6a1e9826",["address[]","uint256","address","bytes","address","address","uint256","address","address"],"0xf34308ef",["address","uint256","bytes","uint8","address","address","uint256"])||this).entrypointAddress=void 0,i.candideAccountFactory=void 0,i.entrypointAddress=r,i.candideAccountFactory=n,i}d(t,e);var n=t.prototype;return n.createNewAccount=function(e,t,n,i){void 0===t&&(t=1),void 0===n&&(n=0),void 0===i&&(i="0x2a15DE4410d4c8af0A7b6c12803120f43C42B820");var f=this.getInitializerCallData([e,t,r.ZeroAddress,"0x",i,r.ZeroAddress,0,r.ZeroAddress,this.entrypointAddress]);return[this.getProxyAddress(f,this.candideAccountFactory.address,n),this.candideAccountFactory.getFactoryGeneratorFunctionCallData([this.singletonAddress,f,n])]},n.createSendEthCallData=function(e,t){return this.createCallData(e,t,"0x",0,r.ZeroAddress,r.ZeroAddress,0)},n.createCallData=function(e,t,r,n,i,f,c){return this.getExecutorCallData([e,t,r,n,i,f,c])},n.getProxyAddress=function(e,t,n){var i=r.keccak256(r.solidityPacked(["bytes32","uint256"],[r.keccak256(e),n])),f=r.keccak256(r.solidityPacked(["bytes","uint256"],[this.proxyByteCode,this.singletonAddress]));return"0x"+r.solidityPackedKeccak256(["bytes1","address","bytes32","bytes32"],["0xff",t,i,f]).slice(-40)},t}(a),h=/*#__PURE__*/function(e){function t(t){return void 0===t&&(t="0x9406Cc6185a346906296840746125a0E44976454"),e.call(this,t,"0x5fbfb9cf",["address","uint256"])||this}return d(t,e),t}(b),y=/*#__PURE__*/function(e){function t(t,r,n){var i;return void 0===t&&(t="0x8ABB13360b87Be5EEb1B98647A016adD927a136c"),void 0===r&&(r="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"),void 0===n&&(n=new h),(i=e.call(this,t,"0x60806040526040516107c13803806107c183398101604081905261002291610321565b61002e82826000610035565b505061043e565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161079a602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103ef565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a357825160000361029c576001600160a01b0385163b61029c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102ad565b6102ad83836102b5565b949350505050565b8151156102c55781518083602001fd5b8060405162461bcd60e51b8152600401610148919061040b565b634e487b7160e01b600052604160045260246000fd5b60005b838110156103105781810151838201526020016102f8565b838111156100645750506000910152565b6000806040838503121561033457600080fd5b82516001600160a01b038116811461034b57600080fd5b60208401519092506001600160401b038082111561036857600080fd5b818501915085601f83011261037c57600080fd5b81518181111561038e5761038e6102df565b604051601f8201601f19908116603f011681019083821181831017156103b6576103b66102df565b816040528281528860208487010111156103cf57600080fd5b6103e08360208301602088016102f5565b80955050505050509250929050565b600082516104018184602087016102f5565b9190910192915050565b602081526000825180602084015261042a8160408501602087016102f5565b601f01601f19169190910160400192915050565b61034d8061044d6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102f1602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b60606000808573ffffffffffffffffffffffffffffffffffffffff16856040516101079190610283565b600060405180830381855af49150503d8060008114610142576040519150601f19603f3d011682016040523d82523d6000602084013e610147565b606091505b509150915061015886838387610162565b9695505050505050565b606083156101fd5782516000036101f65773ffffffffffffffffffffffffffffffffffffffff85163b6101f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b5081610207565b610207838361020f565b949350505050565b81511561021f5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101ed919061029f565b60005b8381101561026e578181015183820152602001610256565b8381111561027d576000848401525b50505050565b60008251610295818460208701610253565b9190910192915050565b60208152600082518060208401526102be816040850160208701610253565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201cd78ab6a31213989661cff2d7d05fc9b9c38b1a848e8249e2e398659a9eb7e364736f6c634300080f0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564","0xc4d66de8",["address"],"0xb61d27f6",["address","uint256","bytes"])||this).entrypointAddress=void 0,i.simpleAccountFactory=void 0,i.batchExecutorFunctionSelector=void 0,i.batchExecutorFunctionInputAbi=void 0,i.entrypointAddress=r,i.simpleAccountFactory=n,i.batchExecutorFunctionSelector="0x18dfb3c7",i.batchExecutorFunctionInputAbi=["address[]","bytes[]"],i}d(t,e);var n=t.prototype;return n.createNewAccount=function(e,t){void 0===t&&(t=0);var r=this.getInitializerCallData([e]),n=this.simpleAccountFactory.getFactoryGeneratorFunctionCallData([e,t]);return[this.getProxyAddress(r,this.simpleAccountFactory.address,t),n]},n.getProxyAddress=function(e,t,n){var i=r.AbiCoder.defaultAbiCoder(),f=i.encode(["uint256"],[n]),c=i.encode(["address","bytes"],[this.singletonAddress,e]),o=r.keccak256(r.solidityPacked(["bytes","bytes"],[this.proxyByteCode,c]));return"0x"+r.solidityPackedKeccak256(["bytes1","address","bytes32","bytes32"],["0xff",t,f,o]).slice(-40)},n.createSendEthCallData=function(e,t){return this.createCallData(e,t,"0x")},n.createCallData=function(e,t,r){return this.getExecutorCallData([e,t,r])},n.createBatchCallData=function(e,t){return o(this.batchExecutorFunctionSelector,this.batchExecutorFunctionInputAbi,[e,t])},t}(a),A=/*#__PURE__*/function(){function e(e,t){this.rpcUrl=void 0,this.entrypointAddress=void 0,this.rpcUrl=e,this.entrypointAddress=t}var t=e.prototype;return t.chainId=function(){try{return Promise.resolve(f(this.rpcUrl,"eth_chainId",[])).then(function(e){return"result"in e?{chainId:e.result}:e.error})}catch(e){return Promise.reject(e)}},t.supportedEntryPoints=function(){try{return Promise.resolve(f(this.rpcUrl,"eth_supportedEntryPoints",[])).then(function(e){return"result"in e?{supportedEntryPoints:e.result}:e.error})}catch(e){return Promise.reject(e)}},t.estimateUserOperationGas=function(e){try{return Promise.resolve(f(this.rpcUrl,"eth_estimateUserOperationGas",[e,this.entrypointAddress])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},t.sendUserOperation=function(e){try{return Promise.resolve(f(this.rpcUrl,"eth_sendUserOperation",[e,this.entrypointAddress])).then(function(e){return"result"in e?{userOperationHash:e.result}:e.error})}catch(e){return Promise.reject(e)}},t.getUserOperationReceipt=function(e){try{return Promise.resolve(f(this.rpcUrl,"eth_getUserOperationReceipt",[e])).then(function(e){if("result"in e){var t=e.result,r=s({},t.receipt,{logs:JSON.stringify(t.receipt.logs)});return s({},t,{logs:JSON.stringify(t.logs),receipt:r})}return e.error})}catch(e){return Promise.reject(e)}},t.getUserOperationByHash=function(e){try{return Promise.resolve(f(this.rpcUrl,"eth_getUserOperationByHash",[e])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},e}(),m=/*#__PURE__*/function(e){function t(t,r){var n;return(n=e.call(this)||this).rpcUrl=void 0,n.entrypointAddress=void 0,n.rpcUrl=r,n.entrypointAddress=t,n}d(t,e);var r=t.prototype;return r.getSupportedERC20Tokens=function(){try{return Promise.resolve(f(this.rpcUrl,"pm_supportedERC20Tokens",[])).then(function(e){if("result"in e){var t=e.result;return{tokens:t.tokens,paymasterMetadata:t.paymasterMetadata}}return e.error})}catch(e){return Promise.reject(e)}},r.getSupportedEntrypoint=function(){try{return Promise.resolve(f(this.rpcUrl,"pm_supportedEntryPoint",[])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},r.getPaymasterCallDataForPayingGasWithErc20=function(e,t){try{var r=this;return Promise.resolve(r.getPaymasterCallData(e,[r.rpcUrl,r.entrypointAddress,t]))}catch(e){return Promise.reject(e)}},r.getPaymasterCallData=function(e,t){try{return Promise.resolve(f(t[0],"pm_sponsorUserOperation",[e,t[1],{token:t[2]}])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},t}(function(){}),x={sender:r.ZeroAddress,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0x00",verificationGasLimit:"0x00",preVerificationGas:"0x00",maxFeePerGas:"0x00",maxPriorityFeePerGas:"0x00",paymasterAndData:"0x",signature:"0x"},v={sender:r.ZeroAddress,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0xffffff",verificationGasLimit:"0xffffff",preVerificationGas:"0xffffff",maxFeePerGas:"0xffffff",maxPriorityFeePerGas:"0xfffffff",paymasterAndData:"0x",signature:"0x"},F={__proto__:null,SmartAccount:a,CandideAccount:p,SimpleAccount:y,SmartAccountFactory:b,CandideAccountFactory:l,SimpleAccountFactory:h,Bundler:A,CandideValidationPaymaster:m,getUserOperationHash:c,UserOperationEmptyValues:x,UserOperationDummyValues:v};e.Bundler=A,e.CandideAccount=p,e.CandideAccountFactory=l,e.CandideValidationPaymaster=m,e.SimpleAccount=y,e.SimpleAccountFactory=h,e.SmartAccount=a,e.SmartAccountFactory=b,e.UserOperationDummyValues=v,e.UserOperationEmptyValues=x,e.abstractionkit=F,e.getUserOperationHash=c});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("isomorphic-unfetch"),require("ethers")):"function"==typeof define&&define.amd?define(["exports","isomorphic-unfetch","ethers"],t):t((e||self).abstractionkit={},e.isomorphicUnfetch,e.ethers)}(this,function(e,t,r){function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,t}var i=/*#__PURE__*/n(t),a=function(e,t,r){try{var n=i.default||i,a=JSON.stringify({method:t,params:r,id:1,jsonrpc:"2.0"});return Promise.resolve(n(e,{method:"POST",body:a,redirect:"follow"})).then(function(e){return Promise.resolve(e.json())})}catch(e){return Promise.reject(e)}};function f(e,t,n){var i=r.keccak256(function(e){var t=[e.sender,e.nonce,r.keccak256(e.initCode),r.keccak256(e.callData),e.callGasLimit,e.verificationGasLimit,e.preVerificationGas,e.maxFeePerGas,e.maxPriorityFeePerGas,r.keccak256(e.paymasterAndData)];return r.AbiCoder.defaultAbiCoder().encode(["address","uint256","bytes32","bytes32","uint256","uint256","uint256","uint256","uint256","bytes32"],t)}(e)),a=r.AbiCoder.defaultAbiCoder().encode(["bytes32","address","uint256"],[i,t,n]);return r.keccak256(a)}function c(e,t,n){return e+r.AbiCoder.defaultAbiCoder().encode(t,n).slice(2)}function o(e){return r.id(e).slice(0,10)}var s,d=/*#__PURE__*/function(){function e(e,t,r,n,i,a){this.singletonAddress=void 0,this.proxyByteCode=void 0,this.initializerFunctionSelector=void 0,this.initializerFunctionInputAbi=void 0,this.executorFunctionSelector=void 0,this.executorFunctionInputAbi=void 0,this.singletonAddress=e,this.proxyByteCode=t,this.initializerFunctionSelector=r,this.initializerFunctionInputAbi=n,this.executorFunctionSelector=i,this.executorFunctionInputAbi=a}var t=e.prototype;return t.getInitializerCallData=function(e){return c(this.initializerFunctionSelector,this.initializerFunctionInputAbi,e)},t.getExecutorCallData=function(e){return c(this.executorFunctionSelector,this.executorFunctionInputAbi,e)},e}();function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}function b(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,l(e,t)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}e.Operation=void 0,(s=e.Operation||(e.Operation={}))[s.Call=0]="Call",s[s.Delegate=1]="Delegate";var p=/*#__PURE__*/function(){function e(e,t,r){this.address=void 0,this.generatorFunctionSelector=void 0,this.generatorFunctionInputAbi=void 0,this.address=e,this.generatorFunctionSelector=t,this.generatorFunctionInputAbi=r}return e.prototype.getFactoryGeneratorFunctionCallData=function(e){var t=c(this.generatorFunctionSelector,this.generatorFunctionInputAbi,e);return this.address+t.slice(2)},e}(),h=/*#__PURE__*/function(e){function t(t){return void 0===t&&(t="0xb73Eb505Abc30d0e7e15B73A492863235B3F4309"),e.call(this,t,"0x1688f0b9",["address","bytes","uint256"])||this}return b(t,e),t}(p);function y(e){return"0x"+e.map(function(e){return function(e){var t=r.ethers.getBytes(e.data);return r.ethers.solidityPacked(["uint8","address","uint256","uint256","bytes"],[e.operation,e.to,e.value,t.length,t]).slice(2)}(e)}).join("")}var A=/*#__PURE__*/function(t){function n(e,r,n){var i;return void 0===e&&(e="0x3A0a17Bcc84576b099373ab3Eed9702b07D30402"),void 0===r&&(r="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"),void 0===n&&(n=new h),(i=t.call(this,e,"0x608060405234801561001057600080fd5b5060405161017338038061017383398101604081905261002f916100b9565b6001600160a01b0381166100945760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642073696e676c65746f6e20616464726573732070726f766964604482015261195960f21b606482015260840160405180910390fd5b600080546001600160a01b0319166001600160a01b03929092169190911790556100e9565b6000602082840312156100cb57600080fd5b81516001600160a01b03811681146100e257600080fd5b9392505050565b607c806100f76000396000f3fe6080604052600080546001600160a01b0316813563530ca43760e11b1415602857808252602082f35b3682833781823684845af490503d82833e806041573d82fd5b503d81f3fea2646970667358221220022b6bb97dd1e16cb867add83d4159f7550336cbb5b40514145e43f493c1377664736f6c634300080c0033","0x6a1e9826",["address[]","uint256","address","bytes","address","address","uint256","address","address"],"0xf34308ef",["address","uint256","bytes","uint8","address","address","uint256"])||this).entrypointAddress=void 0,i.candideAccountFactory=void 0,i.entrypointAddress=r,i.candideAccountFactory=n,i}b(n,t);var i=n.prototype;return i.createNewAccount=function(e,t,n,i){void 0===t&&(t=1),void 0===n&&(n=0),void 0===i&&(i="0x2a15DE4410d4c8af0A7b6c12803120f43C42B820");var a=this.getInitializerCallData([e,t,r.ZeroAddress,"0x",i,r.ZeroAddress,0,r.ZeroAddress,this.entrypointAddress]);return[this.getProxyAddress(a,this.candideAccountFactory.address,n),this.candideAccountFactory.getFactoryGeneratorFunctionCallData([this.singletonAddress,a,n])]},i.createSendEthCallData=function(e,t){return this.createCallData(e,t,"0x",0,r.ZeroAddress,r.ZeroAddress,0)},i.createCallData=function(e,t,r,n,i,a,f){return this.getExecutorCallData([e,t,r,n,i,a,f])},i.getProxyAddress=function(e,t,n){var i=r.keccak256(r.solidityPacked(["bytes32","uint256"],[r.keccak256(e),n])),a=r.keccak256(r.solidityPacked(["bytes","uint256"],[this.proxyByteCode,this.singletonAddress]));return"0x"+r.solidityPackedKeccak256(["bytes1","address","bytes32","bytes32"],["0xff",t,i,a]).slice(-40)},i.createCallDataSingleTransactionWithPaymaster=function(e,t,r,n){return this.getExecutorCallData([e.to,e.value,e.data,e.operation,t,r,n])},i.createCallDataSingleTransaction=function(e){return this.createCallDataSingleTransactionWithPaymaster(e,r.ZeroAddress,r.ZeroAddress,0)},i.createCallDataBatchTransactionWithPaymaster=function(t,r,n,i){var a=c("0x8d80ff0a",["bytes"],[y(t)]);return this.getExecutorCallData(["0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",0,a,e.Operation.Delegate,r,n,i])},i.createCallDataBatchTransaction=function(e){return this.createCallDataBatchTransactionWithPaymaster(e,r.ZeroAddress,r.ZeroAddress,0)},n}(d),m=/*#__PURE__*/function(e){function t(t){return void 0===t&&(t="0x9406Cc6185a346906296840746125a0E44976454"),e.call(this,t,"0x5fbfb9cf",["address","uint256"])||this}return b(t,e),t}(p),v=/*#__PURE__*/function(e){function t(t,r,n){var i;return void 0===t&&(t="0x8ABB13360b87Be5EEb1B98647A016adD927a136c"),void 0===r&&(r="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"),void 0===n&&(n=new m),(i=e.call(this,t,"0x60806040526040516107c13803806107c183398101604081905261002291610321565b61002e82826000610035565b505061043e565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161079a602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103ef565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a357825160000361029c576001600160a01b0385163b61029c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102ad565b6102ad83836102b5565b949350505050565b8151156102c55781518083602001fd5b8060405162461bcd60e51b8152600401610148919061040b565b634e487b7160e01b600052604160045260246000fd5b60005b838110156103105781810151838201526020016102f8565b838111156100645750506000910152565b6000806040838503121561033457600080fd5b82516001600160a01b038116811461034b57600080fd5b60208401519092506001600160401b038082111561036857600080fd5b818501915085601f83011261037c57600080fd5b81518181111561038e5761038e6102df565b604051601f8201601f19908116603f011681019083821181831017156103b6576103b66102df565b816040528281528860208487010111156103cf57600080fd5b6103e08360208301602088016102f5565b80955050505050509250929050565b600082516104018184602087016102f5565b9190910192915050565b602081526000825180602084015261042a8160408501602087016102f5565b601f01601f19169190910160400192915050565b61034d8061044d6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102f1602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b60606000808573ffffffffffffffffffffffffffffffffffffffff16856040516101079190610283565b600060405180830381855af49150503d8060008114610142576040519150601f19603f3d011682016040523d82523d6000602084013e610147565b606091505b509150915061015886838387610162565b9695505050505050565b606083156101fd5782516000036101f65773ffffffffffffffffffffffffffffffffffffffff85163b6101f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b5081610207565b610207838361020f565b949350505050565b81511561021f5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101ed919061029f565b60005b8381101561026e578181015183820152602001610256565b8381111561027d576000848401525b50505050565b60008251610295818460208701610253565b9190910192915050565b60208152600082518060208401526102be816040850160208701610253565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201cd78ab6a31213989661cff2d7d05fc9b9c38b1a848e8249e2e398659a9eb7e364736f6c634300080f0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564","0xc4d66de8",["address"],"0xb61d27f6",["address","uint256","bytes"])||this).entrypointAddress=void 0,i.simpleAccountFactory=void 0,i.batchExecutorFunctionSelector=void 0,i.batchExecutorFunctionInputAbi=void 0,i.entrypointAddress=r,i.simpleAccountFactory=n,i.batchExecutorFunctionSelector="0x18dfb3c7",i.batchExecutorFunctionInputAbi=["address[]","bytes[]"],i}b(t,e);var n=t.prototype;return n.createNewAccount=function(e,t){void 0===t&&(t=0);var r=this.getInitializerCallData([e]),n=this.simpleAccountFactory.getFactoryGeneratorFunctionCallData([e,t]);return[this.getProxyAddress(r,this.simpleAccountFactory.address,t),n]},n.getProxyAddress=function(e,t,n){var i=r.AbiCoder.defaultAbiCoder(),a=i.encode(["uint256"],[n]),f=i.encode(["address","bytes"],[this.singletonAddress,e]),c=r.keccak256(r.solidityPacked(["bytes","bytes"],[this.proxyByteCode,f]));return"0x"+r.solidityPackedKeccak256(["bytes1","address","bytes32","bytes32"],["0xff",t,a,c]).slice(-40)},n.createSendEthCallData=function(e,t){return this.createCallData(e,t,"0x")},n.createCallData=function(e,t,r){return this.getExecutorCallData([e,t,r])},n.createBatchCallData=function(e,t){return c(this.batchExecutorFunctionSelector,this.batchExecutorFunctionInputAbi,[e,t])},t}(d),x=/*#__PURE__*/function(){function e(e,t){this.rpcUrl=void 0,this.entrypointAddress=void 0,this.rpcUrl=e,this.entrypointAddress=t}var t=e.prototype;return t.chainId=function(){try{return Promise.resolve(a(this.rpcUrl,"eth_chainId",[])).then(function(e){return"result"in e?{chainId:e.result}:e.error})}catch(e){return Promise.reject(e)}},t.supportedEntryPoints=function(){try{return Promise.resolve(a(this.rpcUrl,"eth_supportedEntryPoints",[])).then(function(e){return"result"in e?{supportedEntryPoints:e.result}:e.error})}catch(e){return Promise.reject(e)}},t.estimateUserOperationGas=function(e){try{return Promise.resolve(a(this.rpcUrl,"eth_estimateUserOperationGas",[e,this.entrypointAddress])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},t.sendUserOperation=function(e){try{return Promise.resolve(a(this.rpcUrl,"eth_sendUserOperation",[e,this.entrypointAddress])).then(function(e){return"result"in e?{userOperationHash:e.result}:e.error})}catch(e){return Promise.reject(e)}},t.getUserOperationReceipt=function(e){try{return Promise.resolve(a(this.rpcUrl,"eth_getUserOperationReceipt",[e])).then(function(e){if("result"in e){var t=e.result,r=u({},t.receipt,{logs:JSON.stringify(t.receipt.logs)});return u({},t,{logs:JSON.stringify(t.logs),receipt:r})}return e.error})}catch(e){return Promise.reject(e)}},t.getUserOperationByHash=function(e){try{return Promise.resolve(a(this.rpcUrl,"eth_getUserOperationByHash",[e])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},e}(),g=/*#__PURE__*/function(e){function t(t,r){var n;return(n=e.call(this)||this).rpcUrl=void 0,n.entrypointAddress=void 0,n.rpcUrl=r,n.entrypointAddress=t,n}b(t,e);var r=t.prototype;return r.getSupportedERC20Tokens=function(){try{return Promise.resolve(a(this.rpcUrl,"pm_supportedERC20Tokens",[])).then(function(e){if("result"in e){var t=e.result;return{tokens:t.tokens,paymasterMetadata:t.paymasterMetadata}}return e.error})}catch(e){return Promise.reject(e)}},r.getSupportedEntrypoint=function(){try{return Promise.resolve(a(this.rpcUrl,"pm_supportedEntryPoint",[])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},r.getPaymasterCallDataForPayingGasWithErc20=function(e,t){try{var r=this;return Promise.resolve(r.getPaymasterCallData(e,[r.rpcUrl,r.entrypointAddress,t]))}catch(e){return Promise.reject(e)}},r.getPaymasterCallDataForGaslessTx=function(e){try{var t=this;return Promise.resolve(t.getPaymasterCallData(e,[t.rpcUrl,t.entrypointAddress]))}catch(e){return Promise.reject(e)}},r.getPaymasterCallData=function(e,t){try{return Promise.resolve(a(t[0],"pm_sponsorUserOperation",[e,t[1],{token:t[2]}])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},t}(function(){}),P={sender:r.ZeroAddress,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0x00",verificationGasLimit:"0x00",preVerificationGas:"0x00",maxFeePerGas:"0x00",maxPriorityFeePerGas:"0x00",paymasterAndData:"0x",signature:"0x"},F={sender:r.ZeroAddress,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0xffffff",verificationGasLimit:"0xffffff",preVerificationGas:"0xffffff",maxFeePerGas:"0xffffff",maxPriorityFeePerGas:"0xfffffff",paymasterAndData:"0x",signature:"0x"},C={__proto__:null,SmartAccount:d,CandideAccount:A,SimpleAccount:v,SmartAccountFactory:p,CandideAccountFactory:h,SimpleAccountFactory:m,Bundler:x,CandideValidationPaymaster:g,getUserOperationHash:f,getCallData:c,getFunctionSelector:o,UserOperationEmptyValues:P,UserOperationDummyValues:F,get Operation(){return e.Operation}};e.Bundler=x,e.CandideAccount=A,e.CandideAccountFactory=h,e.CandideValidationPaymaster=g,e.SimpleAccount=v,e.SimpleAccountFactory=m,e.SmartAccount=d,e.SmartAccountFactory=p,e.UserOperationDummyValues=F,e.UserOperationEmptyValues=P,e.abstractionkit=C,e.getCallData=c,e.getFunctionSelector=o,e.getUserOperationHash=f});

@@ -10,4 +10,5 @@ import { Paymaster } from "./Paymaster";

getPaymasterCallDataForPayingGasWithErc20(userOperation: UserOperation, erc20TokenAddress: string): Promise<PmSponsorUserOperationResult | JsonRpcError>;
getPaymasterCallDataForGaslessTx(userOperation: UserOperation): Promise<PmSponsorUserOperationResult | JsonRpcError>;
getPaymasterCallData(userOperation: UserOperation, config: string[]): Promise<PmSponsorUserOperationResult | JsonRpcError>;
}
//# sourceMappingURL=CandideValidationPaymaster.d.ts.map

@@ -64,2 +64,7 @@ import type { BigNumberish, BytesLike } from "ethers";

paymasterAndData: BytesLike;
callGasLimit: BigNumberish;
preVerificationGas: BigNumberish;
verificationGasLimit: BigNumberish;
maxFeePerGas: BigNumberish;
maxPriorityFeePerGas: BigNumberish;
};

@@ -66,0 +71,0 @@ export declare enum Operation {

@@ -7,2 +7,3 @@ import type { BytesLike, BigNumberish } from "ethers";

export declare function sendJsonRpcRequest(rpcUrl: string, method: string, params: JsonRpcParam): Promise<JsonRpcResponse>;
export declare function getFunctionSelector(functionSignature: string): string;
//# sourceMappingURL=utils.d.ts.map

@@ -7,3 +7,3 @@ {

},
"version": "0.0.7",
"version": "0.0.8",
"description": "Account Abstraction 4337 SDK by Candidelabs",

@@ -10,0 +10,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc