abstractionkit 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abstractionkit.d.ts +6 -2
- package/dist/abstractionkit.d.ts.map +1 -1
- package/dist/account/{CandideAccount.d.ts → Candide/CandideAccount.d.ts} +9 -3
- package/dist/account/Candide/CandideAccount.d.ts.map +1 -0
- package/dist/account/Candide/multisend.d.ts +3 -0
- package/dist/account/Candide/multisend.d.ts.map +1 -0
- package/dist/account/Candide/types.d.ts +9 -0
- package/dist/account/Candide/types.d.ts.map +1 -0
- package/dist/account/SimpleAccount.d.ts +17 -0
- package/dist/account/SimpleAccount.d.ts.map +1 -0
- package/dist/account/SmartAccount.d.ts +1 -2
- package/dist/account/SmartAccount.d.ts.map +1 -1
- package/dist/factory/SimpleAccountFactory.d.ts +5 -0
- package/dist/factory/SimpleAccountFactory.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.m.js +1 -1
- package/dist/index.modern.mjs +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/paymaster/CandideValidationPaymaster.d.ts +6 -8
- package/dist/paymaster/CandideValidationPaymaster.d.ts.map +1 -1
- package/dist/types.d.ts +29 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +3 -2
- package/dist/utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/account/CandideAccount.d.ts.map +0 -1
package/dist/abstractionkit.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
export { SmartAccount } from "./account/SmartAccount";
|
|
2
|
-
export { CandideAccount } from "./account/CandideAccount";
|
|
2
|
+
export { CandideAccount } from "./account/Candide/CandideAccount";
|
|
3
|
+
export { MetaTransaction } from "./account/Candide/types";
|
|
4
|
+
export { SimpleAccount } from "./account/SimpleAccount";
|
|
3
5
|
export { SmartAccountFactory } from "./factory/SmartAccountFactory";
|
|
4
6
|
export { CandideAccountFactory } from "./factory/CandideAccountFactory";
|
|
7
|
+
export { SimpleAccountFactory } from "./factory/SimpleAccountFactory";
|
|
5
8
|
export { Bundler } from "./Bundler";
|
|
6
9
|
export { CandideValidationPaymaster } from "./paymaster/CandideValidationPaymaster";
|
|
7
|
-
export { getUserOperationHash } from "./utils";
|
|
10
|
+
export { getUserOperationHash, getCallData, getFunctionSelector } from "./utils";
|
|
8
11
|
export { UserOperationEmptyValues, UserOperationDummyValues } from "./constants";
|
|
12
|
+
export { Operation } from "./types";
|
|
9
13
|
export type { UserOperation, AbiInputValue, JsonRpcParam, JsonRpcResponse, JsonRpcResult, JsonRpcError, GasEstimationResult, UserOperationByHashResult, UserOperationReceipt, UserOperationReceiptResult, } from "./types";
|
|
10
14
|
//# sourceMappingURL=abstractionkit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstractionkit.d.ts","sourceRoot":"","sources":["../src/abstractionkit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"abstractionkit.d.ts","sourceRoot":"","sources":["../src/abstractionkit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEtE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAC,0BAA0B,EAAC,MAAM,wCAAwC,CAAA;AAEjF,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEjF,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEjF,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,YAAY,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,eAAe,EACf,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,EACpB,0BAA0B,GAC1B,MAAM,SAAS,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { SmartAccount } from "
|
|
1
|
+
import { SmartAccount } from "../SmartAccount";
|
|
2
2
|
import type { BigNumberish, BytesLike } from "ethers";
|
|
3
|
-
import
|
|
4
|
-
import { SmartAccountFactory } from "
|
|
3
|
+
import { Operation } from "../../types";
|
|
4
|
+
import { SmartAccountFactory } from "../../factory/SmartAccountFactory";
|
|
5
|
+
import { MetaTransaction } from "./types";
|
|
5
6
|
export declare class CandideAccount extends SmartAccount {
|
|
6
7
|
readonly entrypointAddress: string;
|
|
7
8
|
readonly candideAccountFactory: SmartAccountFactory;
|
|
@@ -11,5 +12,10 @@ export declare class CandideAccount extends SmartAccount {
|
|
|
11
12
|
createNewAccount(owners: string[], threshold: BigNumberish, c2nonce: BigNumberish, fallbackHandler: string): [string, BytesLike];
|
|
12
13
|
createSendEthCallData(to: string, value: BigNumberish): BytesLike;
|
|
13
14
|
createCallData(to: string, value: BigNumberish, data: BytesLike, operation: Operation, paymaster: string, approveToken: string, approveAmount: BigNumberish): BytesLike;
|
|
15
|
+
getProxyAddress(initializerCallData: BytesLike, factoryAddress: string, c2Nonce: BigNumberish): string;
|
|
16
|
+
createCallDataSingleTransactionWithPaymaster(tx: MetaTransaction, paymaster: string, approveToken: string, approveAmount: BigNumberish): BytesLike;
|
|
17
|
+
createCallDataSingleTransaction(tx: MetaTransaction): BytesLike;
|
|
18
|
+
createCallDataBatchTransactionWithPaymaster(txs: MetaTransaction[], paymaster: string, approveToken: string, approveAmount: BigNumberish): BytesLike;
|
|
19
|
+
createCallDataBatchTransaction(txs: MetaTransaction[]): BytesLike;
|
|
14
20
|
}
|
|
15
21
|
//# sourceMappingURL=CandideAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CandideAccount.d.ts","sourceRoot":"","sources":["../../../src/account/Candide/CandideAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AASxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAI1C,qBAAa,cAAe,SAAQ,YAAY;IAC/C,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,qBAAqB,EAAE,mBAAmB,CAAC;gBAGnD,gBAAgB,GAAE,MAAqD,EACvE,iBAAiB,GAAE,MAAqD,EACxE,qBAAqB,GAAE,mBAAiD;IAuCzE,gBAAgB,CACf,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,CAAC,EAAE,YAAY,GACtB,CAAC,MAAM,EAAE,SAAS,CAAC;IACtB,gBAAgB,CACf,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,YAAY,GACnB,CAAC,MAAM,EAAE,SAAS,CAAC;IACtB,gBAAgB,CACf,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,YAAY,EACrB,eAAe,EAAE,MAAM,GACrB,CAAC,MAAM,EAAE,SAAS,CAAC;IA2CtB,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,SAAS;IAIjE,cAAc,CACb,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,SAAS,EACf,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,YAAY,GACzB,SAAS;IAaZ,eAAe,CACd,mBAAmB,EAAE,SAAS,EAC9B,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,YAAY,GACnB,MAAM;IAsBT,4CAA4C,CAC3C,EAAE,EAAE,eAAe,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,YAAY,GACzB,SAAS;IAaZ,+BAA+B,CAC9B,EAAE,EAAE,eAAe,GAChB,SAAS;IAKb,2CAA2C,CAC1C,GAAG,EAAE,eAAe,EAAE,EACtB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,YAAY,GACxB,SAAS;IAwBb,8BAA8B,CAC7B,GAAG,EAAE,eAAe,EAAE,GACnB,SAAS;CAIb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multisend.d.ts","sourceRoot":"","sources":["../../../src/account/Candide/multisend.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAW1C,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,MAAM,CAEtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/account/Candide/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,SAAS,CAAC;CACxB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SmartAccount } from "./SmartAccount";
|
|
2
|
+
import type { BigNumberish, BytesLike } from "ethers";
|
|
3
|
+
import { SimpleAccountFactory } from "../factory/SimpleAccountFactory";
|
|
4
|
+
import { SmartAccountFactory } from "../factory/SmartAccountFactory";
|
|
5
|
+
export declare class SimpleAccount extends SmartAccount {
|
|
6
|
+
readonly entrypointAddress: string;
|
|
7
|
+
readonly simpleAccountFactory: SimpleAccountFactory;
|
|
8
|
+
readonly batchExecutorFunctionSelector: string;
|
|
9
|
+
readonly batchExecutorFunctionInputAbi: string[];
|
|
10
|
+
constructor(singletonAddress?: string, entrypointAddress?: string, simpleAccountFactory?: SmartAccountFactory);
|
|
11
|
+
createNewAccount(owner: string, c2nonce?: BigNumberish): [string, BytesLike];
|
|
12
|
+
getProxyAddress(initializerCallData: BytesLike, factoryAddress: string, c2Nonce: BigNumberish): string;
|
|
13
|
+
createSendEthCallData(to: string, value: BigNumberish): BytesLike;
|
|
14
|
+
createCallData(to: string, value: BigNumberish, data: BytesLike): BytesLike;
|
|
15
|
+
createBatchCallData(to_list: string[], data_list: BytesLike[]): BytesLike;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=SimpleAccount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleAccount.d.ts","sourceRoot":"","sources":["../../src/account/SimpleAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAO9C,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAIrE,qBAAa,aAAc,SAAQ,YAAY;IAC9C,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IACpD,QAAQ,CAAC,6BAA6B,EAAE,MAAM,CAAC;IAC/C,QAAQ,CAAC,6BAA6B,EAAE,MAAM,EAAE,CAAC;gBAGhD,gBAAgB,GAAE,MAAqD,EACvE,iBAAiB,GAAE,MAAqD,EACxE,oBAAoB,GAAE,mBAAgD;IA4BvE,gBAAgB,CACf,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,YAAgB,GACvB,CAAC,MAAM,EAAE,SAAS,CAAC;IA2BtB,eAAe,CACd,mBAAmB,EAAE,SAAS,EAC9B,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,YAAY,GACnB,MAAM;IAoBT,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,SAAS;IAIjE,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS;IAS3E,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,SAAS;CASzE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BytesLike
|
|
1
|
+
import type { BytesLike } from "ethers";
|
|
2
2
|
import { AbiInputValue } from "../types";
|
|
3
3
|
export declare class SmartAccount {
|
|
4
4
|
readonly singletonAddress: string;
|
|
@@ -10,6 +10,5 @@ export declare class SmartAccount {
|
|
|
10
10
|
constructor(singletonAddress: string, proxyByteCode: BytesLike, initializerFunctionSelector: string, initializerFunctionInputAbi: string[], executorFunctionSelector: string, executorFunctionInputAbi: string[]);
|
|
11
11
|
getInitializerCallData(initializerFunctionInputParameters: AbiInputValue[]): BytesLike;
|
|
12
12
|
getExecutorCallData(executorFunctionInputParameters: AbiInputValue[]): BytesLike;
|
|
13
|
-
getProxyAddress(initializerCallData: BytesLike, factoryAddress: string, c2Nonce: BigNumberish): string;
|
|
14
13
|
}
|
|
15
14
|
//# sourceMappingURL=SmartAccount.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SmartAccount.d.ts","sourceRoot":"","sources":["../../src/account/SmartAccount.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SmartAccount.d.ts","sourceRoot":"","sources":["../../src/account/SmartAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,qBAAa,YAAY;IACxB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC;IAClC,QAAQ,CAAC,2BAA2B,EAAE,MAAM,CAAC;IAC7C,QAAQ,CAAC,2BAA2B,EAAE,MAAM,EAAE,CAAC;IAC/C,QAAQ,CAAC,wBAAwB,EAAE,MAAM,CAAC;IAC1C,QAAQ,CAAC,wBAAwB,EAAE,MAAM,EAAE,CAAC;gBAG3C,gBAAgB,EAAE,MAAM,EACxB,aAAa,EAAE,SAAS,EACxB,2BAA2B,EAAE,MAAM,EACnC,2BAA2B,EAAE,MAAM,EAAE,EACrC,wBAAwB,EAAE,MAAM,EAChC,wBAAwB,EAAE,MAAM,EAAE;IAUnC,sBAAsB,CACrB,kCAAkC,EAAE,aAAa,EAAE,GACjD,SAAS;IASZ,mBAAmB,CAClB,+BAA+B,EAAE,aAAa,EAAE,GAC9C,SAAS;CAQZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SimpleAccountFactory.d.ts","sourceRoot":"","sources":["../../src/factory/SimpleAccountFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,qBAAa,oBAAqB,SAAQ,mBAAmB;gBAChD,OAAO,GAAE,MAAqD;CAK1E"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=require("ethers");function t(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 r=/*#__PURE__*/t(require("isomorphic-unfetch")),n=function(e,t,n){try{var i=r.default||r,o=JSON.stringify({method:t,params:n,id:1,jsonrpc:"2.0"});return Promise.resolve(i(e,{method:"POST",body:o,redirect:"follow"})).then(function(e){return Promise.resolve(e.json())})}catch(e){return Promise.reject(e)}};function i(t,r,n){var i=e.keccak256(function(t){var r=[t.sender,t.nonce,e.keccak256(t.initCode),e.keccak256(t.callData),t.callGasLimit,t.verificationGasLimit,t.preVerificationGas,t.maxFeePerGas,t.maxPriorityFeePerGas,e.keccak256(t.paymasterAndData)];return e.AbiCoder.defaultAbiCoder().encode(["address","uint256","bytes32","bytes32","uint256","uint256","uint256","uint256","uint256","bytes32"],r)}(t)),o=e.AbiCoder.defaultAbiCoder().encode(["bytes32","address","uint256"],[i,r,n]);return e.keccak256(o)}function o(t,r,n){return t+e.AbiCoder.defaultAbiCoder().encode(r,n).slice(2)}var s=/*#__PURE__*/function(){function t(e,t,r,n,i,o){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=o}var r=t.prototype;return r.getInitializerCallData=function(e){return o(this.initializerFunctionSelector,this.initializerFunctionInputAbi,e)},r.getExecutorCallData=function(e){return o(this.executorFunctionSelector,this.executorFunctionInputAbi,e)},r.getProxyAddress=function(t,r,n){var i=e.keccak256(e.solidityPacked(["bytes32","uint256"],[e.keccak256(t),n])),o=e.keccak256(e.solidityPacked(["bytes","uint256"],[this.proxyByteCode,this.singletonAddress]));return"0x"+e.solidityPackedKeccak256(["bytes1","address","bytes32","bytes32"],["0xff",r,i,o]).slice(-40)},t}();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 c(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 d=/*#__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 c(t,e),t}(d),f=/*#__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 l),(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}c(r,t);var n=r.prototype;return n.createNewAccount=function(t,r,n,i){void 0===r&&(r=1),void 0===n&&(n=0),void 0===i&&(i=e.ZeroAddress);var o=this.getInitializerCallData([t,r,e.ZeroAddress,"0x",i,e.ZeroAddress,0,e.ZeroAddress,this.entrypointAddress]);return[this.getProxyAddress(o,this.candideAccountFactory.address,n),this.candideAccountFactory.getFactoryGeneratorFunctionCallData([this.singletonAddress,o,n])]},n.createSendEthCallData=function(t,r){return this.createCallData(t,r,"0x",0,e.ZeroAddress,e.ZeroAddress,0)},n.createCallData=function(e,t,r,n,i,o,s){return this.getExecutorCallData([e,t,r,n,i,o,s])},r}(s),p=/*#__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(n(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(n(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(n(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(n(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(n(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(n(this.rpcUrl,"eth_getUserOperationByHash",[e])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},e}(),h=/*#__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}c(t,e);var r=t.prototype;return 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(n(t[0],"pm_sponsorUserOperation",[e,t[1],{token:t[2]}])).then(function(e){return"result"in e?{paymasterAndData:e.result}:e.error})}catch(e){return Promise.reject(e)}},t}(function(){}),y={sender:e.ZeroAddress,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0x00",verificationGasLimit:"0x00",preVerificationGas:"0x00",maxFeePerGas:"0x00",maxPriorityFeePerGas:"0x00",paymasterAndData:"0x",signature:"0x"},b={sender:e.ZeroAddress,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0xffffff",verificationGasLimit:"0xffffff",preVerificationGas:"0xffffff",maxFeePerGas:"0xffffff",maxPriorityFeePerGas:"0xfffffff",paymasterAndData:"0x",signature:"0x"},x={__proto__:null,SmartAccount:s,CandideAccount:f,SmartAccountFactory:d,CandideAccountFactory:l,Bundler:p,CandideValidationPaymaster:h,getUserOperationHash:i,UserOperationEmptyValues:y,UserOperationDummyValues:b};exports.Bundler=p,exports.CandideAccount=f,exports.CandideAccountFactory=l,exports.CandideValidationPaymaster=h,exports.SmartAccount=s,exports.SmartAccountFactory=d,exports.UserOperationDummyValues=b,exports.UserOperationEmptyValues=y,exports.abstractionkit=x,exports.getUserOperationHash=i;
|
|
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),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;
|
package/dist/index.m.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{keccak256 as t,AbiCoder as e,solidityPacked as r,solidityPackedKeccak256 as n,ZeroAddress as i}from"ethers";import*as o from"isomorphic-unfetch";var s=function(t,e,r){try{var n=o.default||o,i=JSON.stringify({method:e,params:r,id:1,jsonrpc:"2.0"});return Promise.resolve(n(t,{method:"POST",body:i,redirect:"follow"})).then(function(t){return Promise.resolve(t.json())})}catch(t){return Promise.reject(t)}};function a(r,n,i){var o=t(function(r){var n=[r.sender,r.nonce,t(r.initCode),t(r.callData),r.callGasLimit,r.verificationGasLimit,r.preVerificationGas,r.maxFeePerGas,r.maxPriorityFeePerGas,t(r.paymasterAndData)];return e.defaultAbiCoder().encode(["address","uint256","bytes32","bytes32","uint256","uint256","uint256","uint256","uint256","bytes32"],n)}(r)),s=e.defaultAbiCoder().encode(["bytes32","address","uint256"],[o,n,i]);return t(s)}function c(t,r,n){return t+e.defaultAbiCoder().encode(r,n).slice(2)}var u=/*#__PURE__*/function(){function e(t,e,r,n,i,o){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=o}var i=e.prototype;return i.getInitializerCallData=function(t){return c(this.initializerFunctionSelector,this.initializerFunctionInputAbi,t)},i.getExecutorCallData=function(t){return c(this.executorFunctionSelector,this.executorFunctionInputAbi,t)},i.getProxyAddress=function(e,i,o){var s=t(r(["bytes32","uint256"],[t(e),o])),a=t(r(["bytes","uint256"],[this.proxyByteCode,this.singletonAddress]));return"0x"+n(["bytes1","address","bytes32","bytes32"],["0xff",i,s,a]).slice(-40)},e}();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 f(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,l(t,e)}function l(t,e){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},l(t,e)}var p=/*#__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}(),h=/*#__PURE__*/function(t){function e(e){return void 0===e&&(e="0xb73Eb505Abc30d0e7e15B73A492863235B3F4309"),t.call(this,e,"0x1688f0b9",["address","bytes","uint256"])||this}return f(e,t),e}(p),y=/*#__PURE__*/function(t){function e(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}f(e,t);var r=e.prototype;return r.createNewAccount=function(t,e,r,n){void 0===e&&(e=1),void 0===r&&(r=0),void 0===n&&(n=i);var o=this.getInitializerCallData([t,e,i,"0x",n,i,0,i,this.entrypointAddress]);return[this.getProxyAddress(o,this.candideAccountFactory.address,r),this.candideAccountFactory.getFactoryGeneratorFunctionCallData([this.singletonAddress,o,r])]},r.createSendEthCallData=function(t,e){return this.createCallData(t,e,"0x",0,i,i,0)},r.createCallData=function(t,e,r,n,i,o,s){return this.getExecutorCallData([t,e,r,n,i,o,s])},e}(u),b=/*#__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(s(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(s(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(s(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(s(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(s(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(s(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}f(e,t);var r=e.prototype;return 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(s(e[0],"pm_sponsorUserOperation",[t,e[1],{token:e[2]}])).then(function(t){return"result"in t?{paymasterAndData:t.result}:t.error})}catch(t){return Promise.reject(t)}},e}(function(){}),v={sender:i,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0x00",verificationGasLimit:"0x00",preVerificationGas:"0x00",maxFeePerGas:"0x00",maxPriorityFeePerGas:"0x00",paymasterAndData:"0x",signature:"0x"},x={sender:i,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0xffffff",verificationGasLimit:"0xffffff",preVerificationGas:"0xffffff",maxFeePerGas:"0xffffff",maxPriorityFeePerGas:"0xfffffff",paymasterAndData:"0x",signature:"0x"},A={__proto__:null,SmartAccount:u,CandideAccount:y,SmartAccountFactory:p,CandideAccountFactory:h,Bundler:b,CandideValidationPaymaster:m,getUserOperationHash:a,UserOperationEmptyValues:v,UserOperationDummyValues:x};export{b as Bundler,y as CandideAccount,h as CandideAccountFactory,m as CandideValidationPaymaster,u as SmartAccount,p as SmartAccountFactory,x as UserOperationDummyValues,v as UserOperationEmptyValues,A as abstractionkit,a as getUserOperationHash};
|
|
1
|
+
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};
|
package/dist/index.modern.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{keccak256 as t,AbiCoder as e,solidityPacked as r,solidityPackedKeccak256 as i,ZeroAddress as s}from"ethers";import*as n from"isomorphic-unfetch";function a(r,i,s){const n=t(function(r){const i=[r.sender,r.nonce,t(r.initCode),t(r.callData),r.callGasLimit,r.verificationGasLimit,r.preVerificationGas,r.maxFeePerGas,r.maxPriorityFeePerGas,t(r.paymasterAndData)];return e.defaultAbiCoder().encode(["address","uint256","bytes32","bytes32","uint256","uint256","uint256","uint256","uint256","bytes32"],i)}(r)),a=e.defaultAbiCoder().encode(["bytes32","address","uint256"],[n,i,s]);return t(a)}function o(t,r,i){return t+e.defaultAbiCoder().encode(r,i).slice(2)}async function c(t,e,r){const i=n.default||n,s={method:"POST",body:JSON.stringify({method:e,params:r,id:1,jsonrpc:"2.0"}),redirect:"follow"},a=await i(t,s);return await a.json()}class d{constructor(t,e,r,i,s,n){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=i,this.executorFunctionSelector=s,this.executorFunctionInputAbi=n}getInitializerCallData(t){return o(this.initializerFunctionSelector,this.initializerFunctionInputAbi,t)}getExecutorCallData(t){return o(this.executorFunctionSelector,this.executorFunctionInputAbi,t)}getProxyAddress(e,s,n){const a=t(r(["bytes32","uint256"],[t(e),n])),o=t(r(["bytes","uint256"],[this.proxyByteCode,this.singletonAddress]));return"0x"+i(["bytes1","address","bytes32","bytes32"],["0xff",s,a,o]).slice(-40)}}class u{constructor(t,e,r){this.address=void 0,this.generatorFunctionSelector=void 0,this.generatorFunctionInputAbi=void 0,this.address=t,this.generatorFunctionSelector=e,this.generatorFunctionInputAbi=r}getFactoryGeneratorFunctionCallData(t){const e=o(this.generatorFunctionSelector,this.generatorFunctionInputAbi,t);return this.address+e.slice(2)}}class l extends u{constructor(t="0xb73Eb505Abc30d0e7e15B73A492863235B3F4309"){super(t,"0x1688f0b9",["address","bytes","uint256"])}}class f extends d{constructor(t="0x3A0a17Bcc84576b099373ab3Eed9702b07D30402",e="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",r=new l){super(t,"0x608060405234801561001057600080fd5b5060405161017338038061017383398101604081905261002f916100b9565b6001600160a01b0381166100945760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642073696e676c65746f6e20616464726573732070726f766964604482015261195960f21b606482015260840160405180910390fd5b600080546001600160a01b0319166001600160a01b03929092169190911790556100e9565b6000602082840312156100cb57600080fd5b81516001600160a01b03811681146100e257600080fd5b9392505050565b607c806100f76000396000f3fe6080604052600080546001600160a01b0316813563530ca43760e11b1415602857808252602082f35b3682833781823684845af490503d82833e806041573d82fd5b503d81f3fea2646970667358221220022b6bb97dd1e16cb867add83d4159f7550336cbb5b40514145e43f493c1377664736f6c634300080c0033","0x6a1e9826",["address[]","uint256","address","bytes","address","address","uint256","address","address"],"0xf34308ef",["address","uint256","bytes","uint8","address","address","uint256"]),this.entrypointAddress=void 0,this.candideAccountFactory=void 0,this.entrypointAddress=e,this.candideAccountFactory=r}createNewAccount(t,e=1,r=0,i=s){const n=this.getInitializerCallData([t,e,s,"0x",i,s,0,s,this.entrypointAddress]);return[this.getProxyAddress(n,this.candideAccountFactory.address,r),this.candideAccountFactory.getFactoryGeneratorFunctionCallData([this.singletonAddress,n,r])]}createSendEthCallData(t,e){return this.createCallData(t,e,"0x",0,s,s,0)}createCallData(t,e,r,i,s,n,a){return this.getExecutorCallData([t,e,r,i,s,n,a])}}function p(){return p=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},p.apply(this,arguments)}class h{constructor(t,e){this.rpcUrl=void 0,this.entrypointAddress=void 0,this.rpcUrl=t,this.entrypointAddress=e}async chainId(){const t=await c(this.rpcUrl,"eth_chainId",[]);return"result"in t?{chainId:t.result}:t.error}async supportedEntryPoints(){const t=await c(this.rpcUrl,"eth_supportedEntryPoints",[]);return"result"in t?{supportedEntryPoints:t.result}:t.error}async estimateUserOperationGas(t){const e=await c(this.rpcUrl,"eth_estimateUserOperationGas",[t,this.entrypointAddress]);return"result"in e?e.result:e.error}async sendUserOperation(t){const e=await c(this.rpcUrl,"eth_sendUserOperation",[t,this.entrypointAddress]);return"result"in e?{userOperationHash:e.result}:e.error}async getUserOperationReceipt(t){const e=await c(this.rpcUrl,"eth_getUserOperationReceipt",[t]);if("result"in e){const t=e.result,r=p({},t.receipt,{logs:JSON.stringify(t.receipt.logs)});return p({},t,{logs:JSON.stringify(t.logs),receipt:r})}return e.error}async getUserOperationByHash(t){const e=await c(this.rpcUrl,"eth_getUserOperationByHash",[t]);return"result"in e?e.result:e.error}}class y{}class b extends y{constructor(t,e){super(),this.rpcUrl=void 0,this.entrypointAddress=void 0,this.rpcUrl=e,this.entrypointAddress=t}async getPaymasterCallDataForPayingGasWithErc20(t,e){return this.getPaymasterCallData(t,[this.rpcUrl,this.entrypointAddress,e])}async getPaymasterCallData(t,e){const r=e[0],i=e[1],s=e[2],n=await c(r,"pm_sponsorUserOperation",[t,i,{token:s}]);return"result"in n?{paymasterAndData:n.result}:n.error}}const x={sender:s,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0x00",verificationGasLimit:"0x00",preVerificationGas:"0x00",maxFeePerGas:"0x00",maxPriorityFeePerGas:"0x00",paymasterAndData:"0x",signature:"0x"},A={sender:s,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0xffffff",verificationGasLimit:"0xffffff",preVerificationGas:"0xffffff",maxFeePerGas:"0xffffff",maxPriorityFeePerGas:"0xfffffff",paymasterAndData:"0x",signature:"0x"};var F={__proto__:null,SmartAccount:d,CandideAccount:f,SmartAccountFactory:u,CandideAccountFactory:l,Bundler:h,CandideValidationPaymaster:b,getUserOperationHash:a,UserOperationEmptyValues:x,UserOperationDummyValues:A};export{h as Bundler,f as CandideAccount,l as CandideAccountFactory,b as CandideValidationPaymaster,d as SmartAccount,u as SmartAccountFactory,A as UserOperationDummyValues,x as UserOperationEmptyValues,F as abstractionkit,a as getUserOperationHash};
|
|
1
|
+
import*as t from"isomorphic-unfetch";import{keccak256 as e,AbiCoder as a,id as r,ethers as s,ZeroAddress as f,solidityPacked as i,solidityPackedKeccak256 as n}from"ethers";function c(t,r,s){const f=e(function(t){const r=[t.sender,t.nonce,e(t.initCode),e(t.callData),t.callGasLimit,t.verificationGasLimit,t.preVerificationGas,t.maxFeePerGas,t.maxPriorityFeePerGas,e(t.paymasterAndData)];return a.defaultAbiCoder().encode(["address","uint256","bytes32","bytes32","uint256","uint256","uint256","uint256","uint256","bytes32"],r)}(t)),i=a.defaultAbiCoder().encode(["bytes32","address","uint256"],[f,r,s]);return e(i)}function o(t,e,r){return t+a.defaultAbiCoder().encode(e,r).slice(2)}async function d(e,a,r){const s=t.default||t,f={method:"POST",body:JSON.stringify({method:a,params:r,id:1,jsonrpc:"2.0"}),redirect:"follow"},i=await s(e,f);return await i.json()}function b(t){return r(t).slice(0,10)}class u{constructor(t,e,a,r,s,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=t,this.proxyByteCode=e,this.initializerFunctionSelector=a,this.initializerFunctionInputAbi=r,this.executorFunctionSelector=s,this.executorFunctionInputAbi=f}getInitializerCallData(t){return o(this.initializerFunctionSelector,this.initializerFunctionInputAbi,t)}getExecutorCallData(t){return o(this.executorFunctionSelector,this.executorFunctionInputAbi,t)}}var l;!function(t){t[t.Call=0]="Call",t[t.Delegate=1]="Delegate"}(l||(l={}));class h{constructor(t,e,a){this.address=void 0,this.generatorFunctionSelector=void 0,this.generatorFunctionInputAbi=void 0,this.address=t,this.generatorFunctionSelector=e,this.generatorFunctionInputAbi=a}getFactoryGeneratorFunctionCallData(t){const e=o(this.generatorFunctionSelector,this.generatorFunctionInputAbi,t);return this.address+e.slice(2)}}class p extends h{constructor(t="0xb73Eb505Abc30d0e7e15B73A492863235B3F4309"){super(t,"0x1688f0b9",["address","bytes","uint256"])}}function y(t){return"0x"+t.map(t=>function(t){const e=s.getBytes(t.data);return s.solidityPacked(["uint8","address","uint256","uint256","bytes"],[t.operation,t.to,t.value,e.length,e]).slice(2)}(t)).join("")}class x extends u{constructor(t="0x3A0a17Bcc84576b099373ab3Eed9702b07D30402",e="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",a=new p){super(t,"0x608060405234801561001057600080fd5b5060405161017338038061017383398101604081905261002f916100b9565b6001600160a01b0381166100945760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642073696e676c65746f6e20616464726573732070726f766964604482015261195960f21b606482015260840160405180910390fd5b600080546001600160a01b0319166001600160a01b03929092169190911790556100e9565b6000602082840312156100cb57600080fd5b81516001600160a01b03811681146100e257600080fd5b9392505050565b607c806100f76000396000f3fe6080604052600080546001600160a01b0316813563530ca43760e11b1415602857808252602082f35b3682833781823684845af490503d82833e806041573d82fd5b503d81f3fea2646970667358221220022b6bb97dd1e16cb867add83d4159f7550336cbb5b40514145e43f493c1377664736f6c634300080c0033","0x6a1e9826",["address[]","uint256","address","bytes","address","address","uint256","address","address"],"0xf34308ef",["address","uint256","bytes","uint8","address","address","uint256"]),this.entrypointAddress=void 0,this.candideAccountFactory=void 0,this.entrypointAddress=e,this.candideAccountFactory=a}createNewAccount(t,e=1,a=0,r="0x2a15DE4410d4c8af0A7b6c12803120f43C42B820"){const s=this.getInitializerCallData([t,e,f,"0x",r,f,0,f,this.entrypointAddress]);return[this.getProxyAddress(s,this.candideAccountFactory.address,a),this.candideAccountFactory.getFactoryGeneratorFunctionCallData([this.singletonAddress,s,a])]}createSendEthCallData(t,e){return this.createCallData(t,e,"0x",0,f,f,0)}createCallData(t,e,a,r,s,f,i){return this.getExecutorCallData([t,e,a,r,s,f,i])}getProxyAddress(t,a,r){const s=e(i(["bytes32","uint256"],[e(t),r])),f=e(i(["bytes","uint256"],[this.proxyByteCode,this.singletonAddress]));return"0x"+n(["bytes1","address","bytes32","bytes32"],["0xff",a,s,f]).slice(-40)}createCallDataSingleTransactionWithPaymaster(t,e,a,r){return this.getExecutorCallData([t.to,t.value,t.data,t.operation,e,a,r])}createCallDataSingleTransaction(t){return this.createCallDataSingleTransactionWithPaymaster(t,f,f,0)}createCallDataBatchTransactionWithPaymaster(t,e,a,r){const s=o("0x8d80ff0a",["bytes"],[y(t)]);return this.getExecutorCallData(["0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",0,s,l.Delegate,e,a,r])}createCallDataBatchTransaction(t){return this.createCallDataBatchTransactionWithPaymaster(t,f,f,0)}}class A extends h{constructor(t="0x9406Cc6185a346906296840746125a0E44976454"){super(t,"0x5fbfb9cf",["address","uint256"])}}class g extends u{constructor(t="0x8ABB13360b87Be5EEb1B98647A016adD927a136c",e="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",a=new A){super(t,"0x60806040526040516107c13803806107c183398101604081905261002291610321565b61002e82826000610035565b505061043e565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d0838360405180606001604052806027815260200161079a602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100711760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103ef565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a357825160000361029c576001600160a01b0385163b61029c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102ad565b6102ad83836102b5565b949350505050565b8151156102c55781518083602001fd5b8060405162461bcd60e51b8152600401610148919061040b565b634e487b7160e01b600052604160045260246000fd5b60005b838110156103105781810151838201526020016102f8565b838111156100645750506000910152565b6000806040838503121561033457600080fd5b82516001600160a01b038116811461034b57600080fd5b60208401519092506001600160401b038082111561036857600080fd5b818501915085601f83011261037c57600080fd5b81518181111561038e5761038e6102df565b604051601f8201601f19908116603f011681019083821181831017156103b6576103b66102df565b816040528281528860208487010111156103cf57600080fd5b6103e08360208301602088016102f5565b80955050505050509250929050565b600082516104018184602087016102f5565b9190910192915050565b602081526000825180602084015261042a8160408501602087016102f5565b601f01601f19169190910160400192915050565b61034d8061044d6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610074565b6100b9565b565b606061004e83836040518060600160405280602781526020016102f1602791396100dd565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b90565b60006100b47f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e8080156100d8573d6000f35b3d6000fd5b60606000808573ffffffffffffffffffffffffffffffffffffffff16856040516101079190610283565b600060405180830381855af49150503d8060008114610142576040519150601f19603f3d011682016040523d82523d6000602084013e610147565b606091505b509150915061015886838387610162565b9695505050505050565b606083156101fd5782516000036101f65773ffffffffffffffffffffffffffffffffffffffff85163b6101f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b5081610207565b610207838361020f565b949350505050565b81511561021f5781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101ed919061029f565b60005b8381101561026e578181015183820152602001610256565b8381111561027d576000848401525b50505050565b60008251610295818460208701610253565b9190910192915050565b60208152600082518060208401526102be816040850160208701610253565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212201cd78ab6a31213989661cff2d7d05fc9b9c38b1a848e8249e2e398659a9eb7e364736f6c634300080f0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564","0xc4d66de8",["address"],"0xb61d27f6",["address","uint256","bytes"]),this.entrypointAddress=void 0,this.simpleAccountFactory=void 0,this.batchExecutorFunctionSelector=void 0,this.batchExecutorFunctionInputAbi=void 0,this.entrypointAddress=e,this.simpleAccountFactory=a,this.batchExecutorFunctionSelector="0x18dfb3c7",this.batchExecutorFunctionInputAbi=["address[]","bytes[]"]}createNewAccount(t,e=0){const a=this.getInitializerCallData([t]),r=this.simpleAccountFactory.getFactoryGeneratorFunctionCallData([t,e]);return[this.getProxyAddress(a,this.simpleAccountFactory.address,e),r]}getProxyAddress(t,r,s){const f=a.defaultAbiCoder(),c=f.encode(["uint256"],[s]),o=f.encode(["address","bytes"],[this.singletonAddress,t]),d=e(i(["bytes","bytes"],[this.proxyByteCode,o]));return"0x"+n(["bytes1","address","bytes32","bytes32"],["0xff",r,c,d]).slice(-40)}createSendEthCallData(t,e){return this.createCallData(t,e,"0x")}createCallData(t,e,a){return this.getExecutorCallData([t,e,a])}createBatchCallData(t,e){return o(this.batchExecutorFunctionSelector,this.batchExecutorFunctionInputAbi,[t,e])}}function F(){return F=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},F.apply(this,arguments)}class C{constructor(t,e){this.rpcUrl=void 0,this.entrypointAddress=void 0,this.rpcUrl=t,this.entrypointAddress=e}async chainId(){const t=await d(this.rpcUrl,"eth_chainId",[]);return"result"in t?{chainId:t.result}:t.error}async supportedEntryPoints(){const t=await d(this.rpcUrl,"eth_supportedEntryPoints",[]);return"result"in t?{supportedEntryPoints:t.result}:t.error}async estimateUserOperationGas(t){const e=await d(this.rpcUrl,"eth_estimateUserOperationGas",[t,this.entrypointAddress]);return"result"in e?e.result:e.error}async sendUserOperation(t){const e=await d(this.rpcUrl,"eth_sendUserOperation",[t,this.entrypointAddress]);return"result"in e?{userOperationHash:e.result}:e.error}async getUserOperationReceipt(t){const e=await d(this.rpcUrl,"eth_getUserOperationReceipt",[t]);if("result"in e){const t=e.result,a=F({},t.receipt,{logs:JSON.stringify(t.receipt.logs)});return F({},t,{logs:JSON.stringify(t.logs),receipt:a})}return e.error}async getUserOperationByHash(t){const e=await d(this.rpcUrl,"eth_getUserOperationByHash",[t]);return"result"in e?e.result:e.error}}class D{}class m extends D{constructor(t,e){super(),this.rpcUrl=void 0,this.entrypointAddress=void 0,this.rpcUrl=e,this.entrypointAddress=t}async getSupportedERC20Tokens(){const t=await d(this.rpcUrl,"pm_supportedERC20Tokens",[]);if("result"in t){const e=t.result;return{tokens:e.tokens,paymasterMetadata:e.paymasterMetadata}}return t.error}async getSupportedEntrypoint(){const t=await d(this.rpcUrl,"pm_supportedEntryPoint",[]);return"result"in t?t.result:t.error}async getPaymasterCallDataForPayingGasWithErc20(t,e){return this.getPaymasterCallData(t,[this.rpcUrl,this.entrypointAddress,e])}async getPaymasterCallDataForGaslessTx(t){return this.getPaymasterCallData(t,[this.rpcUrl,this.entrypointAddress])}async getPaymasterCallData(t,e){const a=e[0],r=e[1],s=e[2],f=await d(a,"pm_sponsorUserOperation",[t,r,{token:s}]);return"result"in f?f.result:f.error}}const E={sender:f,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0x00",verificationGasLimit:"0x00",preVerificationGas:"0x00",maxFeePerGas:"0x00",maxPriorityFeePerGas:"0x00",paymasterAndData:"0x",signature:"0x"},P={sender:f,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0xffffff",verificationGasLimit:"0xffffff",preVerificationGas:"0xffffff",maxFeePerGas:"0xffffff",maxPriorityFeePerGas:"0xfffffff",paymasterAndData:"0x",signature:"0x"};var v={__proto__:null,SmartAccount:u,CandideAccount:x,SimpleAccount:g,SmartAccountFactory:h,CandideAccountFactory:p,SimpleAccountFactory:A,Bundler:C,CandideValidationPaymaster:m,getUserOperationHash:c,getCallData:o,getFunctionSelector:b,UserOperationEmptyValues:E,UserOperationDummyValues:P,get Operation(){return l}};export{C as Bundler,x as CandideAccount,p as CandideAccountFactory,m as CandideValidationPaymaster,l as Operation,g as SimpleAccount,A as SimpleAccountFactory,u as SmartAccount,h as SmartAccountFactory,P as UserOperationDummyValues,E as UserOperationEmptyValues,v as abstractionkit,o as getCallData,b as getFunctionSelector,c as getUserOperationHash};
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("ethers"),require("isomorphic-unfetch")):"function"==typeof define&&define.amd?define(["exports","ethers","isomorphic-unfetch"],t):t((e||self).abstractionkit={},e.ethers,e.isomorphicUnfetch)}(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(r),o=function(e,t,r){try{var n=i.default||i,o=JSON.stringify({method:t,params:r,id:1,jsonrpc:"2.0"});return Promise.resolve(n(e,{method:"POST",body:o,redirect:"follow"})).then(function(e){return Promise.resolve(e.json())})}catch(e){return Promise.reject(e)}};function s(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)),o=t.AbiCoder.defaultAbiCoder().encode(["bytes32","address","uint256"],[i,r,n]);return t.keccak256(o)}function a(e,r,n){return e+t.AbiCoder.defaultAbiCoder().encode(r,n).slice(2)}var c=/*#__PURE__*/function(){function e(e,t,r,n,i,o){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=o}var r=e.prototype;return r.getInitializerCallData=function(e){return a(this.initializerFunctionSelector,this.initializerFunctionInputAbi,e)},r.getExecutorCallData=function(e){return a(this.executorFunctionSelector,this.executorFunctionInputAbi,e)},r.getProxyAddress=function(e,r,n){var i=t.keccak256(t.solidityPacked(["bytes32","uint256"],[t.keccak256(e),n])),o=t.keccak256(t.solidityPacked(["bytes","uint256"],[this.proxyByteCode,this.singletonAddress]));return"0x"+t.solidityPackedKeccak256(["bytes1","address","bytes32","bytes32"],["0xff",r,i,o]).slice(-40)},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 d(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,f(e,t)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}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=a(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 d(t,e),t}(l),h=/*#__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 p),(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(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=t.ZeroAddress);var o=this.getInitializerCallData([e,r,t.ZeroAddress,"0x",i,t.ZeroAddress,0,t.ZeroAddress,this.entrypointAddress]);return[this.getProxyAddress(o,this.candideAccountFactory.address,n),this.candideAccountFactory.getFactoryGeneratorFunctionCallData([this.singletonAddress,o,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,o,s){return this.getExecutorCallData([e,t,r,n,i,o,s])},r}(c),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(o(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(o(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(o(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(o(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(o(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(o(this.rpcUrl,"eth_getUserOperationByHash",[e])).then(function(e){return"result"in e?e.result:e.error})}catch(e){return Promise.reject(e)}},e}(),b=/*#__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.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(o(t[0],"pm_sponsorUserOperation",[e,t[1],{token:t[2]}])).then(function(e){return"result"in e?{paymasterAndData:e.result}:e.error})}catch(e){return Promise.reject(e)}},t}(function(){}),m={sender:t.ZeroAddress,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0x00",verificationGasLimit:"0x00",preVerificationGas:"0x00",maxFeePerGas:"0x00",maxPriorityFeePerGas:"0x00",paymasterAndData:"0x",signature:"0x"},A={sender:t.ZeroAddress,nonce:"0x00",initCode:"0x",callData:"0x",callGasLimit:"0xffffff",verificationGasLimit:"0xffffff",preVerificationGas:"0xffffff",maxFeePerGas:"0xffffff",maxPriorityFeePerGas:"0xfffffff",paymasterAndData:"0x",signature:"0x"},v={__proto__:null,SmartAccount:c,CandideAccount:h,SmartAccountFactory:l,CandideAccountFactory:p,Bundler:y,CandideValidationPaymaster:b,getUserOperationHash:s,UserOperationEmptyValues:m,UserOperationDummyValues:A};e.Bundler=y,e.CandideAccount=h,e.CandideAccountFactory=p,e.CandideValidationPaymaster=b,e.SmartAccount=c,e.SmartAccountFactory=l,e.UserOperationDummyValues=A,e.UserOperationEmptyValues=m,e.abstractionkit=v,e.getUserOperationHash=s});
|
|
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),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});
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { Paymaster } from "./Paymaster";
|
|
2
|
-
import { UserOperation, JsonRpcError } from "../types";
|
|
3
|
-
import { BytesLike } from "ethers";
|
|
2
|
+
import { UserOperation, JsonRpcError, SupportedERC20Tokens, PmSponsorUserOperationResult } from "../types";
|
|
4
3
|
export declare class CandideValidationPaymaster extends Paymaster {
|
|
5
4
|
readonly rpcUrl: string;
|
|
6
5
|
readonly entrypointAddress: string;
|
|
7
6
|
constructor(entrypointAddress: string, rpcUrl: string);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} | JsonRpcError>;
|
|
7
|
+
getSupportedERC20Tokens(): Promise<SupportedERC20Tokens | JsonRpcError>;
|
|
8
|
+
getSupportedEntrypoint(): Promise<string | JsonRpcError>;
|
|
9
|
+
getPaymasterCallDataForPayingGasWithErc20(userOperation: UserOperation, erc20TokenAddress: string): Promise<PmSponsorUserOperationResult | JsonRpcError>;
|
|
10
|
+
getPaymasterCallDataForGaslessTx(userOperation: UserOperation): Promise<PmSponsorUserOperationResult | JsonRpcError>;
|
|
11
|
+
getPaymasterCallData(userOperation: UserOperation, config: string[]): Promise<PmSponsorUserOperationResult | JsonRpcError>;
|
|
14
12
|
}
|
|
15
13
|
//# sourceMappingURL=CandideValidationPaymaster.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CandideValidationPaymaster.d.ts","sourceRoot":"","sources":["../../src/paymaster/CandideValidationPaymaster.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,
|
|
1
|
+
{"version":3,"file":"CandideValidationPaymaster.d.ts","sourceRoot":"","sources":["../../src/paymaster/CandideValidationPaymaster.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EACN,aAAa,EACb,YAAY,EACZ,oBAAoB,EACpB,4BAA4B,EAC5B,MAAM,UAAU,CAAC;AAElB,qBAAa,0BAA2B,SAAQ,SAAS;IACxD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;gBAEvB,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAM/C,uBAAuB,IAAI,OAAO,CACvC,oBAAoB,GAAG,YAAY,CACnC;IAeK,sBAAsB,IAAI,OAAO,CAAC,MAAM,GAAG,YAAY,CAAC;IAcxD,yCAAyC,CAC9C,aAAa,EAAE,aAAa,EAC5B,iBAAiB,EAAE,MAAM,GACvB,OAAO,CAAC,4BAA4B,GAAG,YAAY,CAAC;IAMjD,gCAAgC,CACrC,aAAa,EAAE,aAAa,GAC1B,OAAO,CAAC,4BAA4B,GAAG,YAAY,CAAC;IAMjD,oBAAoB,CACzB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,EAAE,GACd,OAAO,CAAC,4BAA4B,GAAG,YAAY,CAAC;CAiBvD"}
|
package/dist/types.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type JsonRpcResponse = {
|
|
|
19
19
|
result?: JsonRpcResult;
|
|
20
20
|
error?: JsonRpcError;
|
|
21
21
|
};
|
|
22
|
-
export type JsonRpcResult = string | string[] | GasEstimationResult | UserOperationByHashResult | UserOperationReceipt | UserOperationReceiptResult;
|
|
22
|
+
export type JsonRpcResult = string | string[] | GasEstimationResult | UserOperationByHashResult | UserOperationReceipt | UserOperationReceiptResult | SupportedERC20Tokens | PmSponsorUserOperationResult;
|
|
23
23
|
export type JsonRpcError = {
|
|
24
24
|
code: number;
|
|
25
25
|
message: string;
|
|
@@ -27,8 +27,7 @@ export type JsonRpcError = {
|
|
|
27
27
|
export type GasEstimationResult = {
|
|
28
28
|
callGasLimit: BigNumberish;
|
|
29
29
|
preVerificationGas: BigNumberish;
|
|
30
|
-
|
|
31
|
-
deadline: BigNumberish;
|
|
30
|
+
verificationGasLimit: BigNumberish;
|
|
32
31
|
};
|
|
33
32
|
export type UserOperationByHashResult = {
|
|
34
33
|
userOperation: UserOperation;
|
|
@@ -60,8 +59,35 @@ export type UserOperationReceiptResult = {
|
|
|
60
59
|
logs: string;
|
|
61
60
|
receipt: UserOperationReceipt;
|
|
62
61
|
};
|
|
62
|
+
export type PmSponsorUserOperationResult = {
|
|
63
|
+
paymasterAndData: BytesLike;
|
|
64
|
+
callGasLimit: BigNumberish;
|
|
65
|
+
preVerificationGas: BigNumberish;
|
|
66
|
+
verificationGasLimit: BigNumberish;
|
|
67
|
+
maxFeePerGas: BigNumberish;
|
|
68
|
+
maxPriorityFeePerGas: BigNumberish;
|
|
69
|
+
};
|
|
63
70
|
export declare enum Operation {
|
|
64
71
|
Call = 0,
|
|
65
72
|
Delegate = 1
|
|
66
73
|
}
|
|
74
|
+
export interface ERC20Token {
|
|
75
|
+
symbol: string;
|
|
76
|
+
address: string;
|
|
77
|
+
decimal: number;
|
|
78
|
+
fee: number;
|
|
79
|
+
exchangeRate: string;
|
|
80
|
+
}
|
|
81
|
+
export interface PaymasterMetadata {
|
|
82
|
+
name: string;
|
|
83
|
+
description: string;
|
|
84
|
+
icons: string[];
|
|
85
|
+
address: string;
|
|
86
|
+
sponsoredEventTopic: string;
|
|
87
|
+
dummyPaymasterAndData: string;
|
|
88
|
+
}
|
|
89
|
+
export interface SupportedERC20Tokens {
|
|
90
|
+
paymasterMetadata: PaymasterMetadata;
|
|
91
|
+
tokens: ERC20Token[];
|
|
92
|
+
}
|
|
67
93
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEtD,MAAM,MAAM,aAAa,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,YAAY,EAAE,YAAY,CAAC;IAC3B,oBAAoB,EAAE,YAAY,CAAC;IACnC,kBAAkB,EAAE,YAAY,CAAC;IACjC,YAAY,EAAE,YAAY,CAAC;IAC3B,oBAAoB,EAAE,YAAY,CAAC;IACnC,gBAAgB,EAAE,SAAS,CAAC;IAC5B,SAAS,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,aAAa,GACtB,MAAM,GACN,YAAY,GACZ,SAAS,GACT,OAAO,GACP,aAAa,EAAE,CAAC;AAEnB,MAAM,MAAM,YAAY,GACrB,MAAM,GACN,YAAY,GACZ,SAAS,GACT,OAAO,GACP,MAAM,GACN,YAAY,EAAE,CAAC;AAElB,MAAM,MAAM,eAAe,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,KAAK,CAAC,EAAE,YAAY,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,aAAa,GACtB,MAAM,GACN,MAAM,EAAE,GACR,mBAAmB,GACnB,yBAAyB,GACzB,oBAAoB,GACpB,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEtD,MAAM,MAAM,aAAa,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,YAAY,EAAE,YAAY,CAAC;IAC3B,oBAAoB,EAAE,YAAY,CAAC;IACnC,kBAAkB,EAAE,YAAY,CAAC;IACjC,YAAY,EAAE,YAAY,CAAC;IAC3B,oBAAoB,EAAE,YAAY,CAAC;IACnC,gBAAgB,EAAE,SAAS,CAAC;IAC5B,SAAS,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,aAAa,GACtB,MAAM,GACN,YAAY,GACZ,SAAS,GACT,OAAO,GACP,aAAa,EAAE,CAAC;AAEnB,MAAM,MAAM,YAAY,GACrB,MAAM,GACN,YAAY,GACZ,SAAS,GACT,OAAO,GACP,MAAM,GACN,YAAY,EAAE,CAAC;AAElB,MAAM,MAAM,eAAe,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,KAAK,CAAC,EAAE,YAAY,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,aAAa,GACtB,MAAM,GACN,MAAM,EAAE,GACR,mBAAmB,GACnB,yBAAyB,GACzB,oBAAoB,GACpB,0BAA0B,GAC1B,oBAAoB,GACpB,4BAA4B,CAAC;AAEhC,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IACjC,YAAY,EAAE,YAAY,CAAC;IAC3B,kBAAkB,EAAE,YAAY,CAAC;IACjC,oBAAoB,EAAE,YAAY,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACvC,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,YAAY,CAAC;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,eAAe,EAAE,SAAS,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAClC,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,YAAY,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,YAAY,CAAC;IAChC,OAAO,EAAE,YAAY,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,SAAS,CAAC;IAC3B,gBAAgB,EAAE,YAAY,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACxC,UAAU,EAAE,SAAS,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,YAAY,CAAC;IAC5B,aAAa,EAAE,YAAY,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,oBAAoB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IAC1C,gBAAgB,EAAE,SAAS,CAAC;IAC5B,YAAY,EAAE,YAAY,CAAC;IAC3B,kBAAkB,EAAE,YAAY,CAAC;IACjC,oBAAoB,EAAE,YAAY,CAAC;IACnC,YAAY,EAAE,YAAY,CAAC;IAC3B,oBAAoB,EAAE,YAAY,CAAC;CACnC,CAAC;AAEF,oBAAY,SAAS;IACpB,IAAI,IAAI;IACR,QAAQ,IAAI;CACZ;AAED,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;CACrB;AACD,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,qBAAqB,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,oBAAoB;IACpC,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,MAAM,EAAE,UAAU,EAAE,CAAC;CACrB"}
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BytesLike, BigNumberish } from "ethers";
|
|
2
2
|
import type { AbiInputValue, UserOperation, JsonRpcResponse, JsonRpcParam } from "./types";
|
|
3
|
-
export declare function getUserOperationHash(useroperation: UserOperation, entrypointAddress:
|
|
3
|
+
export declare function getUserOperationHash(useroperation: UserOperation, entrypointAddress: string, chainId: BigNumberish): BytesLike;
|
|
4
4
|
export declare function getPackedUserOperation(useroperation: UserOperation): BytesLike;
|
|
5
5
|
export declare function getCallData(functionSelector: string, functionInputAbi: string[], functionInputParameters: AbiInputValue[]): BytesLike;
|
|
6
6
|
export declare function sendJsonRpcRequest(rpcUrl: string, method: string, params: JsonRpcParam): Promise<JsonRpcResponse>;
|
|
7
|
+
export declare function getFunctionSelector(functionSignature: string): string;
|
|
7
8
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG3F,wBAAgB,oBAAoB,CACnC,aAAa,EAAE,aAAa,EAC5B,iBAAiB,EAAE,MAAM,EACzB,OAAO,EAAE,YAAY,GACnB,SAAS,CAcX;AAED,wBAAgB,sBAAsB,CACrC,aAAa,EAAE,aAAa,GAC1B,SAAS,CA+BX;AAED,wBAAgB,WAAW,CAC1B,gBAAgB,EAAE,MAAM,EACxB,gBAAgB,EAAE,MAAM,EAAE,EAC1B,uBAAuB,EAAE,aAAa,EAAE,GACtC,SAAS,CASX;AAED,wBAAsB,kBAAkB,CACvC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,YAAY,GAClB,OAAO,CAAC,eAAe,CAAC,CAmB1B;AAGD,wBAAgB,mBAAmB,CAClC,iBAAiB,EAAE,MAAM,GACvB,MAAM,CAER"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CandideAccount.d.ts","sourceRoot":"","sources":["../../src/account/CandideAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,qBAAa,cAAe,SAAQ,YAAY;IAC/C,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,qBAAqB,EAAE,mBAAmB,CAAC;gBAGnD,gBAAgB,GAAE,MAAqD,EACvE,iBAAiB,GAAE,MAAqD,EACxE,qBAAqB,GAAE,mBAAiD;IAuCzE,gBAAgB,CACf,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,CAAC,EAAE,YAAY,GACtB,CAAC,MAAM,EAAE,SAAS,CAAC;IACtB,gBAAgB,CACf,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,YAAY,GACnB,CAAC,MAAM,EAAE,SAAS,CAAC;IACtB,gBAAgB,CACf,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,YAAY,EACrB,eAAe,EAAE,MAAM,GACrB,CAAC,MAAM,EAAE,SAAS,CAAC;IA2CtB,qBAAqB,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,SAAS;IAGjE,cAAc,CACb,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,SAAS,EACf,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,YAAY,GACzB,SAAS;CAYZ"}
|