permissionless 0.0.13 → 0.0.15

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.
Files changed (77) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/_cjs/accounts/index.js +3 -1
  3. package/_cjs/accounts/index.js.map +1 -1
  4. package/_cjs/accounts/kernel/abi/KernelAccountAbi.js +84 -0
  5. package/_cjs/accounts/kernel/abi/KernelAccountAbi.js.map +1 -0
  6. package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js +211 -0
  7. package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -0
  8. package/_cjs/accounts/signerToSafeSmartAccount.js +2 -2
  9. package/_cjs/actions/pimlico/sponsorUserOperation.js +12 -4
  10. package/_cjs/actions/pimlico/sponsorUserOperation.js.map +1 -1
  11. package/_cjs/actions/pimlico/validateSponsorshipPolicies.js +16 -0
  12. package/_cjs/actions/pimlico/validateSponsorshipPolicies.js.map +1 -0
  13. package/_cjs/actions/pimlico.js +3 -1
  14. package/_cjs/actions/pimlico.js.map +1 -1
  15. package/_cjs/clients/createSmartAccountClient.js.map +1 -1
  16. package/_cjs/clients/decorators/pimlico.js +3 -1
  17. package/_cjs/clients/decorators/pimlico.js.map +1 -1
  18. package/_cjs/utils/getRequiredPrefund.js +12 -0
  19. package/_cjs/utils/getRequiredPrefund.js.map +1 -0
  20. package/_cjs/utils/index.js +3 -1
  21. package/_cjs/utils/index.js.map +1 -1
  22. package/_esm/accounts/index.js +2 -1
  23. package/_esm/accounts/index.js.map +1 -1
  24. package/_esm/accounts/kernel/abi/KernelAccountAbi.js +87 -0
  25. package/_esm/accounts/kernel/abi/KernelAccountAbi.js.map +1 -0
  26. package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js +262 -0
  27. package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -0
  28. package/_esm/accounts/signerToSafeSmartAccount.js +2 -2
  29. package/_esm/actions/pimlico/sponsorUserOperation.js +13 -5
  30. package/_esm/actions/pimlico/sponsorUserOperation.js.map +1 -1
  31. package/_esm/actions/pimlico/validateSponsorshipPolicies.js +47 -0
  32. package/_esm/actions/pimlico/validateSponsorshipPolicies.js.map +1 -0
  33. package/_esm/actions/pimlico.js +2 -1
  34. package/_esm/actions/pimlico.js.map +1 -1
  35. package/_esm/clients/createSmartAccountClient.js +1 -1
  36. package/_esm/clients/createSmartAccountClient.js.map +1 -1
  37. package/_esm/clients/decorators/pimlico.js +38 -1
  38. package/_esm/clients/decorators/pimlico.js.map +1 -1
  39. package/_esm/utils/getRequiredPrefund.js +22 -0
  40. package/_esm/utils/getRequiredPrefund.js.map +1 -0
  41. package/_esm/utils/index.js +2 -1
  42. package/_esm/utils/index.js.map +1 -1
  43. package/_types/accounts/index.d.ts +2 -1
  44. package/_types/accounts/index.d.ts.map +1 -1
  45. package/_types/accounts/kernel/abi/KernelAccountAbi.d.ts +68 -0
  46. package/_types/accounts/kernel/abi/KernelAccountAbi.d.ts.map +1 -0
  47. package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts +25 -0
  48. package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts.map +1 -0
  49. package/_types/actions/pimlico/sponsorUserOperation.d.ts +4 -3
  50. package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +1 -1
  51. package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts +54 -0
  52. package/_types/actions/pimlico/validateSponsorshipPolicies.d.ts.map +1 -0
  53. package/_types/actions/pimlico.d.ts +4 -3
  54. package/_types/actions/pimlico.d.ts.map +1 -1
  55. package/_types/clients/createSmartAccountClient.d.ts +6 -1
  56. package/_types/clients/createSmartAccountClient.d.ts.map +1 -1
  57. package/_types/clients/decorators/pimlico.d.ts +40 -3
  58. package/_types/clients/decorators/pimlico.d.ts.map +1 -1
  59. package/_types/types/pimlico.d.ts +21 -1
  60. package/_types/types/pimlico.d.ts.map +1 -1
  61. package/_types/utils/getRequiredPrefund.d.ts +20 -0
  62. package/_types/utils/getRequiredPrefund.d.ts.map +1 -0
  63. package/_types/utils/index.d.ts +2 -1
  64. package/_types/utils/index.d.ts.map +1 -1
  65. package/accounts/index.ts +8 -1
  66. package/accounts/kernel/abi/KernelAccountAbi.ts +87 -0
  67. package/accounts/kernel/signerToEcdsaKernelSmartAccount.ts +363 -0
  68. package/accounts/signerToSafeSmartAccount.ts +2 -2
  69. package/actions/pimlico/sponsorUserOperation.ts +20 -7
  70. package/actions/pimlico/validateSponsorshipPolicies.ts +76 -0
  71. package/actions/pimlico.ts +13 -4
  72. package/clients/createSmartAccountClient.ts +6 -1
  73. package/clients/decorators/pimlico.ts +52 -5
  74. package/package.json +1 -1
  75. package/types/pimlico.ts +21 -1
  76. package/utils/getRequiredPrefund.ts +31 -0
  77. package/utils/index.ts +6 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # permissionless
2
2
 
3
+ ## 0.0.15
4
+
5
+ ### Patch Changes
6
+
7
+ - 2857b89: Added getRequiredPrefund utility function
8
+ - 7c54173: Added support for pm_validateSponsorshipPolicies for pimlicoPaymasterClient
9
+
10
+ ## 0.0.14
11
+
12
+ ### Patch Changes
13
+
14
+ - 4d6f01f: Add sponsorship policies option to pimlicoPaymasterClient
15
+ Update Safe 4337 module version to 0.2.0
16
+ - 5fe172d: Introduce a simpel version of Kernel SmartAccount (by ZeroDev), using their ECDSA Validator
17
+
3
18
  ## 0.0.13
4
19
 
5
20
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.privateKeyToSafeSmartAccount = exports.privateKeyToSimpleSmartAccount = exports.SignTransactionNotSupportedBySmartAccount = exports.signerToSimpleSmartAccount = exports.signerToSafeSmartAccount = void 0;
3
+ exports.signerToEcdsaKernelSmartAccount = exports.privateKeyToSafeSmartAccount = exports.privateKeyToSimpleSmartAccount = exports.SignTransactionNotSupportedBySmartAccount = exports.signerToSimpleSmartAccount = exports.signerToSafeSmartAccount = void 0;
4
4
  const privateKeyToSimpleSmartAccount_js_1 = require("./privateKeyToSimpleSmartAccount.js");
5
5
  Object.defineProperty(exports, "privateKeyToSimpleSmartAccount", { enumerable: true, get: function () { return privateKeyToSimpleSmartAccount_js_1.privateKeyToSimpleSmartAccount; } });
6
6
  const signerToSimpleSmartAccount_js_1 = require("./signerToSimpleSmartAccount.js");
@@ -9,6 +9,8 @@ const privateKeyToSafeSmartAccount_js_1 = require("./privateKeyToSafeSmartAccoun
9
9
  Object.defineProperty(exports, "privateKeyToSafeSmartAccount", { enumerable: true, get: function () { return privateKeyToSafeSmartAccount_js_1.privateKeyToSafeSmartAccount; } });
10
10
  const signerToSafeSmartAccount_js_1 = require("./signerToSafeSmartAccount.js");
11
11
  Object.defineProperty(exports, "signerToSafeSmartAccount", { enumerable: true, get: function () { return signerToSafeSmartAccount_js_1.signerToSafeSmartAccount; } });
12
+ const signerToEcdsaKernelSmartAccount_js_1 = require("./kernel/signerToEcdsaKernelSmartAccount.js");
13
+ Object.defineProperty(exports, "signerToEcdsaKernelSmartAccount", { enumerable: true, get: function () { return signerToEcdsaKernelSmartAccount_js_1.signerToEcdsaKernelSmartAccount; } });
12
14
  const types_js_1 = require("./types.js");
13
15
  Object.defineProperty(exports, "SignTransactionNotSupportedBySmartAccount", { enumerable: true, get: function () { return types_js_1.SignTransactionNotSupportedBySmartAccount; } });
14
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../accounts/index.ts"],"names":[],"mappings":";;;AAAA,2FAAoF;AA6BhF,+GA7BK,kEAA8B,OA6BL;AA3BlC,mFAGwC;AAsBpC,2GAvBA,0DAA0B,OAuBA;AApB9B,uFAAgF;AAwB5E,6GAxBK,8DAA4B,OAwBL;AAtBhC,+EAIsC;AAYlC,yGAbA,sDAAwB,OAaA;AAV5B,yCAImB;AASf,0HAZA,oDAAyC,OAYA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../accounts/index.ts"],"names":[],"mappings":";;;AAAA,2FAAoF;AAkChF,+GAlCK,kEAA8B,OAkCL;AAhClC,mFAGwC;AA2BpC,2GA5BA,0DAA0B,OA4BA;AAzB9B,uFAAgF;AA6B5E,6GA7BK,8DAA4B,OA6BL;AA3BhC,+EAIsC;AAiBlC,yGAlBA,sDAAwB,OAkBA;AAf5B,oGAGoD;AAoBhD,gHArBA,oEAA+B,OAqBA;AAlBnC,yCAImB;AASf,0HAZA,oDAAyC,OAYA"}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KernelInitAbi = exports.KernelExecuteAbi = void 0;
4
+ exports.KernelExecuteAbi = [
5
+ {
6
+ inputs: [
7
+ {
8
+ internalType: "address",
9
+ name: "to",
10
+ type: "address"
11
+ },
12
+ {
13
+ internalType: "uint256",
14
+ name: "value",
15
+ type: "uint256"
16
+ },
17
+ {
18
+ internalType: "bytes",
19
+ name: "data",
20
+ type: "bytes"
21
+ },
22
+ {
23
+ internalType: "enum Operation",
24
+ name: "",
25
+ type: "uint8"
26
+ }
27
+ ],
28
+ name: "execute",
29
+ outputs: [],
30
+ stateMutability: "payable",
31
+ type: "function"
32
+ },
33
+ {
34
+ inputs: [
35
+ {
36
+ components: [
37
+ {
38
+ internalType: "address",
39
+ name: "to",
40
+ type: "address"
41
+ },
42
+ {
43
+ internalType: "uint256",
44
+ name: "value",
45
+ type: "uint256"
46
+ },
47
+ {
48
+ internalType: "bytes",
49
+ name: "data",
50
+ type: "bytes"
51
+ }
52
+ ],
53
+ internalType: "struct Call[]",
54
+ name: "calls",
55
+ type: "tuple[]"
56
+ }
57
+ ],
58
+ name: "executeBatch",
59
+ outputs: [],
60
+ stateMutability: "payable",
61
+ type: "function"
62
+ }
63
+ ];
64
+ exports.KernelInitAbi = [
65
+ {
66
+ inputs: [
67
+ {
68
+ internalType: "contract IKernelValidator",
69
+ name: "_defaultValidator",
70
+ type: "address"
71
+ },
72
+ {
73
+ internalType: "bytes",
74
+ name: "_data",
75
+ type: "bytes"
76
+ }
77
+ ],
78
+ name: "initialize",
79
+ outputs: [],
80
+ stateMutability: "payable",
81
+ type: "function"
82
+ }
83
+ ];
84
+ //# sourceMappingURL=KernelAccountAbi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KernelAccountAbi.js","sourceRoot":"","sources":["../../../../accounts/kernel/abi/KernelAccountAbi.ts"],"names":[],"mappings":";;;AAGa,QAAA,gBAAgB,GAAG;IAC5B;QACI,MAAM,EAAE;YACJ;gBACI,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,IAAI;gBACV,IAAI,EAAE,SAAS;aAClB;YACD;gBACI,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aAClB;YACD;gBACI,YAAY,EAAE,OAAO;gBACrB,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,OAAO;aAChB;YACD;gBACI,YAAY,EAAE,gBAAgB;gBAC9B,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,OAAO;aAChB;SACJ;QACD,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,UAAU;KACnB;IACD;QACI,MAAM,EAAE;YACJ;gBACI,UAAU,EAAE;oBACR;wBACI,YAAY,EAAE,SAAS;wBACvB,IAAI,EAAE,IAAI;wBACV,IAAI,EAAE,SAAS;qBAClB;oBACD;wBACI,YAAY,EAAE,SAAS;wBACvB,IAAI,EAAE,OAAO;wBACb,IAAI,EAAE,SAAS;qBAClB;oBACD;wBACI,YAAY,EAAE,OAAO;wBACrB,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,OAAO;qBAChB;iBACJ;gBACD,YAAY,EAAE,eAAe;gBAC7B,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aAClB;SACJ;QACD,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,UAAU;KACnB;CACK,CAAA;AAKG,QAAA,aAAa,GAAG;IACzB;QACI,MAAM,EAAE;YACJ;gBACI,YAAY,EAAE,2BAA2B;gBACzC,IAAI,EAAE,mBAAmB;gBACzB,IAAI,EAAE,SAAS;aAClB;YACD;gBACI,YAAY,EAAE,OAAO;gBACrB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,OAAO;aAChB;SACJ;QACD,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,UAAU;KACnB;CACK,CAAA"}
@@ -0,0 +1,211 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.signerToEcdsaKernelSmartAccount = void 0;
4
+ const viem_1 = require("viem");
5
+ const accounts_1 = require("viem/accounts");
6
+ const actions_1 = require("viem/actions");
7
+ const getAccountNonce_js_1 = require("../../actions/public/getAccountNonce.js");
8
+ const getSenderAddress_js_1 = require("../../actions/public/getSenderAddress.js");
9
+ const getUserOperationHash_js_1 = require("../../utils/getUserOperationHash.js");
10
+ const types_js_1 = require("../types.js");
11
+ const KernelAccountAbi_js_1 = require("./abi/KernelAccountAbi.js");
12
+ const createAccountAbi = [
13
+ {
14
+ inputs: [
15
+ {
16
+ internalType: "address",
17
+ name: "_implementation",
18
+ type: "address"
19
+ },
20
+ {
21
+ internalType: "bytes",
22
+ name: "_data",
23
+ type: "bytes"
24
+ },
25
+ {
26
+ internalType: "uint256",
27
+ name: "_index",
28
+ type: "uint256"
29
+ }
30
+ ],
31
+ name: "createAccount",
32
+ outputs: [
33
+ {
34
+ internalType: "address",
35
+ name: "proxy",
36
+ type: "address"
37
+ }
38
+ ],
39
+ stateMutability: "payable",
40
+ type: "function"
41
+ }
42
+ ];
43
+ const KERNEL_ADDRESSES = {
44
+ ECDSA_VALIDATOR: "0xd9AB5096a832b9ce79914329DAEE236f8Eea0390",
45
+ ACCOUNT_V2_2_LOGIC: "0x0DA6a956B9488eD4dd761E59f52FDc6c8068E6B5",
46
+ FACTORY_ADDRESS: "0x5de4839a76cf55d0c90e2061ef4386d962E15ae3"
47
+ };
48
+ const getAccountInitCode = async ({ owner, index, factoryAddress, accountLogicAddress, ecdsaValidatorAddress }) => {
49
+ if (!owner)
50
+ throw new Error("Owner account not found");
51
+ const initialisationData = (0, viem_1.encodeFunctionData)({
52
+ abi: KernelAccountAbi_js_1.KernelInitAbi,
53
+ functionName: "initialize",
54
+ args: [ecdsaValidatorAddress, owner]
55
+ });
56
+ return (0, viem_1.concatHex)([
57
+ factoryAddress,
58
+ (0, viem_1.encodeFunctionData)({
59
+ abi: createAccountAbi,
60
+ functionName: "createAccount",
61
+ args: [accountLogicAddress, initialisationData, index]
62
+ })
63
+ ]);
64
+ };
65
+ const getAccountAddress = async ({ client, owner, entryPoint, initCodeProvider, ecdsaValidatorAddress, deployedAccountAddress }) => {
66
+ if (deployedAccountAddress !== undefined) {
67
+ const deployedAccountOwner = await (0, actions_1.readContract)(client, {
68
+ address: ecdsaValidatorAddress,
69
+ abi: [
70
+ {
71
+ inputs: [
72
+ {
73
+ internalType: "address",
74
+ name: "",
75
+ type: "address"
76
+ }
77
+ ],
78
+ name: "ecdsaValidatorStorage",
79
+ outputs: [
80
+ {
81
+ internalType: "address",
82
+ name: "owner",
83
+ type: "address"
84
+ }
85
+ ],
86
+ stateMutability: "view",
87
+ type: "function"
88
+ }
89
+ ],
90
+ functionName: "ecdsaValidatorStorage",
91
+ args: [deployedAccountAddress]
92
+ });
93
+ if (!(0, viem_1.isAddressEqual)(deployedAccountOwner, owner)) {
94
+ throw new Error("Invalid owner for the already deployed account");
95
+ }
96
+ return deployedAccountAddress;
97
+ }
98
+ const initCode = await initCodeProvider();
99
+ return (0, getSenderAddress_js_1.getSenderAddress)(client, {
100
+ initCode,
101
+ entryPoint
102
+ });
103
+ };
104
+ async function signerToEcdsaKernelSmartAccount(client, { signer, entryPoint, index = 0n, factoryAddress = KERNEL_ADDRESSES.FACTORY_ADDRESS, accountLogicAddress = KERNEL_ADDRESSES.ACCOUNT_V2_2_LOGIC, ecdsaValidatorAddress = KERNEL_ADDRESSES.ECDSA_VALIDATOR, deployedAccountAddress }) {
105
+ const viemSigner = signer.type === "local"
106
+ ? {
107
+ ...signer,
108
+ signTransaction: (_, __) => {
109
+ throw new types_js_1.SignTransactionNotSupportedBySmartAccount();
110
+ }
111
+ }
112
+ : signer;
113
+ const generateInitCode = () => getAccountInitCode({
114
+ owner: viemSigner.address,
115
+ index,
116
+ factoryAddress,
117
+ accountLogicAddress,
118
+ ecdsaValidatorAddress
119
+ });
120
+ const [accountAddress, chainId] = await Promise.all([
121
+ getAccountAddress({
122
+ client,
123
+ entryPoint,
124
+ owner: viemSigner.address,
125
+ ecdsaValidatorAddress,
126
+ initCodeProvider: generateInitCode,
127
+ deployedAccountAddress
128
+ }),
129
+ (0, actions_1.getChainId)(client)
130
+ ]);
131
+ if (!accountAddress)
132
+ throw new Error("Account address not found");
133
+ const account = (0, accounts_1.toAccount)({
134
+ address: accountAddress,
135
+ async signMessage({ message }) {
136
+ return (0, actions_1.signMessage)(client, { account: viemSigner, message });
137
+ },
138
+ async signTransaction(_, __) {
139
+ throw new types_js_1.SignTransactionNotSupportedBySmartAccount();
140
+ },
141
+ async signTypedData(typedData) {
142
+ return (0, actions_1.signTypedData)(client, { account: viemSigner, ...typedData });
143
+ }
144
+ });
145
+ return {
146
+ ...account,
147
+ client: client,
148
+ publicKey: accountAddress,
149
+ entryPoint: entryPoint,
150
+ source: "kernelEcdsaSmartAccount",
151
+ async getNonce() {
152
+ return (0, getAccountNonce_js_1.getAccountNonce)(client, {
153
+ sender: accountAddress,
154
+ entryPoint: entryPoint
155
+ });
156
+ },
157
+ async signUserOperation(userOperation) {
158
+ const hash = (0, getUserOperationHash_js_1.getUserOperationHash)({
159
+ userOperation: {
160
+ ...userOperation,
161
+ signature: "0x"
162
+ },
163
+ entryPoint: entryPoint,
164
+ chainId: chainId
165
+ });
166
+ const signature = await (0, actions_1.signMessage)(client, {
167
+ account: viemSigner,
168
+ message: { raw: hash }
169
+ });
170
+ return (0, viem_1.concatHex)(["0x00000000", signature]);
171
+ },
172
+ async getInitCode() {
173
+ const contractCode = await (0, actions_1.getBytecode)(client, {
174
+ address: accountAddress
175
+ });
176
+ if ((contractCode?.length ?? 0) > 2)
177
+ return "0x";
178
+ return generateInitCode();
179
+ },
180
+ async encodeDeployCallData(_) {
181
+ throw new Error("Simple account doesn't support account deployment");
182
+ },
183
+ async encodeCallData(_tx) {
184
+ if (Array.isArray(_tx)) {
185
+ return (0, viem_1.encodeFunctionData)({
186
+ abi: KernelAccountAbi_js_1.KernelExecuteAbi,
187
+ functionName: "executeBatch",
188
+ args: [
189
+ _tx.map((tx) => ({
190
+ to: tx.to,
191
+ value: tx.value,
192
+ data: tx.data
193
+ }))
194
+ ]
195
+ });
196
+ }
197
+ else {
198
+ return (0, viem_1.encodeFunctionData)({
199
+ abi: KernelAccountAbi_js_1.KernelExecuteAbi,
200
+ functionName: "execute",
201
+ args: [_tx.to, _tx.value, _tx.data, 0]
202
+ });
203
+ }
204
+ },
205
+ async getDummySignature() {
206
+ return "0x00000000fffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c";
207
+ }
208
+ };
209
+ }
210
+ exports.signerToEcdsaKernelSmartAccount = signerToEcdsaKernelSmartAccount;
211
+ //# sourceMappingURL=signerToEcdsaKernelSmartAccount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signerToEcdsaKernelSmartAccount.js","sourceRoot":"","sources":["../../../accounts/kernel/signerToEcdsaKernelSmartAccount.ts"],"names":[],"mappings":";;;AAAA,+BAUa;AACb,4CAAyC;AACzC,0CAMqB;AACrB,gFAAyE;AACzE,kFAA2E;A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C,GAAG,CAAC,EAAE;gBAEpB,OAAO,IAAA,yBAAkB,EAAC;oBACtB,GAAG,EAAE,sCAAgB;oBACrB,YAAY,EAAE,cAAc;oBAC5B,IAAI,EAAE;wBACF,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;4BACb,EAAE,EAAE,EAAE,CAAC,EAAE;4BACT,KAAK,EAAE,EAAE,CAAC,KAAK;4BACf,IAAI,EAAE,EAAE,CAAC,IAAI;yBAChB,CAAC,CAAC;qBACN;iBACJ,CAAC,CAAA;aACL;iBAAM;gBAEH,OAAO,IAAA,yBAAkB,EAAC;oBACtB,GAAG,EAAE,sCAAgB;oBACrB,YAAY,EAAE,SAAS;oBACvB,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;iBACzC,CAAC,CAAA;aACL;QACL,CAAC;QAGD,KAAK,CAAC,iBAAiB;YACnB,OAAO,8IAA8I,CAAA;QACzJ,CAAC;KACJ,CAAA;AACL,CAAC;AAxJD,0EAwJC"}
@@ -21,8 +21,8 @@ const EIP712_SAFE_OPERATION_TYPE = {
21
21
  };
22
22
  const SAFE_VERSION_TO_ADDRESSES_MAP = {
23
23
  "1.4.1": {
24
- ADD_MODULES_LIB_ADDRESS: "0x191EFDC03615B575922289DC339F4c70aC5C30Af",
25
- SAFE_4337_MODULE_ADDRESS: "0x39E54Bb2b3Aa444b4B39DEe15De3b7809c36Fc38",
24
+ ADD_MODULES_LIB_ADDRESS: "0x8EcD4ec46D4D2a6B64fE960B3D64e8B94B2234eb",
25
+ SAFE_4337_MODULE_ADDRESS: "0xa581c4A4DB7175302464fF3C06380BC3270b4037",
26
26
  SAFE_PROXY_FACTORY_ADDRESS: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67",
27
27
  SAFE_SINGLETON_ADDRESS: "0x41675C099F32341bf84BFc5382aF534df5C7461a",
28
28
  MULTI_SEND_ADDRESS: "0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526",
@@ -5,10 +5,18 @@ const deepHexlify_js_1 = require("../../utils/deepHexlify.js");
5
5
  const sponsorUserOperation = async (client, args) => {
6
6
  const response = await client.request({
7
7
  method: "pm_sponsorUserOperation",
8
- params: [
9
- (0, deepHexlify_js_1.deepHexlify)(args.userOperation),
10
- args.entryPoint
11
- ]
8
+ params: args.sponsorshipPolicyId
9
+ ? [
10
+ (0, deepHexlify_js_1.deepHexlify)(args.userOperation),
11
+ args.entryPoint,
12
+ {
13
+ sponsorshipPolicyId: args.sponsorshipPolicyId
14
+ }
15
+ ]
16
+ : [
17
+ (0, deepHexlify_js_1.deepHexlify)(args.userOperation),
18
+ args.entryPoint
19
+ ]
12
20
  });
13
21
  return {
14
22
  paymasterAndData: response.paymasterAndData,
@@ -1 +1 @@
1
- {"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/pimlico/sponsorUserOperation.ts"],"names":[],"mappings":";;;AAOA,+DAAwD;AA6CjD,MAAM,oBAAoB,GAAG,KAAK,EAKrC,MAAuE,EACvE,IAAoC,EACG,EAAE;IACzC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,yBAAyB;QACjC,MAAM,EAAE;YACJ,IAAA,4BAAW,EAAC,IAAI,CAAC,aAAa,CAAiC;YAC/D,IAAI,CAAC,UAAU;SAClB;KACJ,CAAC,CAAA;IAEF,OAAO;QACH,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;QAC3C,kBAAkB,EAAE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QACvD,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QAC3D,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;KAC9C,CAAA;AACL,CAAC,CAAA;AAtBY,QAAA,oBAAoB,wBAsBhC"}
1
+ {"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/pimlico/sponsorUserOperation.ts"],"names":[],"mappings":";;;AAOA,+DAAwD;AA8CjD,MAAM,oBAAoB,GAAG,KAAK,EAKrC,MAAuE,EACvE,IAA2C,EACJ,EAAE;IACzC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,yBAAyB;QACjC,MAAM,EAAE,IAAI,CAAC,mBAAmB;YAC5B,CAAC,CAAC;gBACI,IAAA,4BAAW,EACP,IAAI,CAAC,aAAa,CACW;gBACjC,IAAI,CAAC,UAAU;gBACf;oBACI,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;iBAChD;aACJ;YACH,CAAC,CAAC;gBACI,IAAA,4BAAW,EACP,IAAI,CAAC,aAAa,CACW;gBACjC,IAAI,CAAC,UAAU;aAClB;KACV,CAAC,CAAA;IAEF,OAAO;QACH,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;QAC3C,kBAAkB,EAAE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QACvD,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QAC3D,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;KAC9C,CAAA;AACL,CAAC,CAAA;AAlCY,QAAA,oBAAoB,wBAkChC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateSponsorshipPolicies = void 0;
4
+ const deepHexlify_js_1 = require("../../utils/deepHexlify.js");
5
+ const validateSponsorshipPolicies = async (client, args) => {
6
+ return await client.request({
7
+ method: "pm_validateSponsorshipPolicies",
8
+ params: [
9
+ (0, deepHexlify_js_1.deepHexlify)(args.userOperation),
10
+ args.entryPoint,
11
+ args.sponsorshipPolicyIds
12
+ ]
13
+ });
14
+ };
15
+ exports.validateSponsorshipPolicies = validateSponsorshipPolicies;
16
+ //# sourceMappingURL=validateSponsorshipPolicies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateSponsorshipPolicies.js","sourceRoot":"","sources":["../../../actions/pimlico/validateSponsorshipPolicies.ts"],"names":[],"mappings":";;;AAMA,+DAAwD;AAqDjD,MAAM,2BAA2B,GAAG,KAAK,EAK5C,MAAuE,EACvE,IAA2C,EACG,EAAE;IAChD,OAAO,MAAM,MAAM,CAAC,OAAO,CAAC;QACxB,MAAM,EAAE,gCAAgC;QACxC,MAAM,EAAE;YACJ,IAAA,4BAAW,EAAC,IAAI,CAAC,aAAa,CAAiC;YAC/D,IAAI,CAAC,UAAU;YACf,IAAI,CAAC,oBAAoB;SAC5B;KACJ,CAAC,CAAA;AACN,CAAC,CAAA;AAhBY,QAAA,2BAA2B,+BAgBvC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pimlicoPaymasterActions = exports.pimlicoBundlerActions = exports.sponsorUserOperation = exports.getUserOperationStatus = exports.getUserOperationGasPrice = void 0;
3
+ exports.validateSponsorshipPolicies = exports.pimlicoPaymasterActions = exports.pimlicoBundlerActions = exports.sponsorUserOperation = exports.getUserOperationStatus = exports.getUserOperationGasPrice = void 0;
4
4
  const getUserOperationGasPrice_js_1 = require("./pimlico/getUserOperationGasPrice.js");
5
5
  Object.defineProperty(exports, "getUserOperationGasPrice", { enumerable: true, get: function () { return getUserOperationGasPrice_js_1.getUserOperationGasPrice; } });
6
6
  const getUserOperationStatus_js_1 = require("./pimlico/getUserOperationStatus.js");
@@ -10,4 +10,6 @@ Object.defineProperty(exports, "sponsorUserOperation", { enumerable: true, get:
10
10
  const pimlico_js_1 = require("../clients/decorators/pimlico.js");
11
11
  Object.defineProperty(exports, "pimlicoBundlerActions", { enumerable: true, get: function () { return pimlico_js_1.pimlicoBundlerActions; } });
12
12
  Object.defineProperty(exports, "pimlicoPaymasterActions", { enumerable: true, get: function () { return pimlico_js_1.pimlicoPaymasterActions; } });
13
+ const validateSponsorshipPolicies_js_1 = require("./pimlico/validateSponsorshipPolicies.js");
14
+ Object.defineProperty(exports, "validateSponsorshipPolicies", { enumerable: true, get: function () { return validateSponsorshipPolicies_js_1.validateSponsorshipPolicies; } });
13
15
  //# sourceMappingURL=pimlico.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../actions/pimlico.ts"],"names":[],"mappings":";;;AAAA,uFAG8C;AAgC1C,yGAjCA,sDAAwB,OAiCA;AA/B5B,mFAI4C;AA4BxC,uGA7BA,kDAAsB,OA6BA;AA3B1B,+EAI0C;AAwBtC,qGAzBA,8CAAoB,OAyBA;AAlBxB,iEAGyC;AAgBrC,sGAlBA,kCAAqB,OAkBA;AACrB,wGAlBA,oCAAuB,OAkBA"}
1
+ {"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../actions/pimlico.ts"],"names":[],"mappings":";;;AAAA,uFAG8C;AAwC1C,yGAzCA,sDAAwB,OAyCA;AAvC5B,mFAI4C;AAoCxC,uGArCA,kDAAsB,OAqCA;AAnC1B,+EAI0C;AAgCtC,qGAjCA,8CAAoB,OAiCA;AA1BxB,iEAGyC;AAwBrC,sGA1BA,kCAAqB,OA0BA;AACrB,wGA1BA,oCAAuB,OA0BA;AAvB3B,6FAIiD;AAoB7C,4GArBA,4DAA2B,OAqBA"}
@@ -1 +1 @@
1
- {"version":3,"file":"createSmartAccountClient.js","sourceRoot":"","sources":["../../clients/createSmartAccountClient.ts"],"names":[],"mappings":";;;AAQA,+BAAmC;AAKnC,kEAGqC;AAoD9B,MAAM,wBAAwB,GAAG,CAKpC,UACkC,EACiC,EAAE;IACrE,MAAM,EACF,GAAG,GAAG,SAAS,EACf,IAAI,GAAG,sBAAsB,EAC7B,SAAS,EACZ,GAAG,UAAU,CAAA;IACd,MAAM,MAAM,GAAG,IAAA,mBAAY,EAAC;QACxB,GAAG,UAAU;QACb,GAAG;QACH,IAAI;QACJ,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;QAC1D,IAAI,EAAE,oBAAoB;KAC7B,CAAC,CAAA;IAEF,OAAO,MAAM,CAAC,MAAM,CAChB,IAAA,qCAAmB,EAAC;QAChB,oBAAoB,EAAE,UAAU,CAAC,oBAAoB;KACxD,CAAC,CACL,CAAA;AACL,CAAC,CAAA;AA1BY,QAAA,wBAAwB,4BA0BpC"}
1
+ {"version":3,"file":"createSmartAccountClient.js","sourceRoot":"","sources":["../../clients/createSmartAccountClient.ts"],"names":[],"mappings":";;;AAQA,+BAAmC;AAKnC,kEAGqC;AAyD9B,MAAM,wBAAwB,GAAG,CAKpC,UACkC,EACiC,EAAE;IACrE,MAAM,EACF,GAAG,GAAG,SAAS,EACf,IAAI,GAAG,sBAAsB,EAC7B,SAAS,EACZ,GAAG,UAAU,CAAA;IACd,MAAM,MAAM,GAAG,IAAA,mBAAY,EAAC;QACxB,GAAG,UAAU;QACb,GAAG;QACH,IAAI;QACJ,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;QAC1D,IAAI,EAAE,oBAAoB;KAC7B,CAAC,CAAA;IAEF,OAAO,MAAM,CAAC,MAAM,CAChB,IAAA,qCAAmB,EAAC;QAChB,oBAAoB,EAAE,UAAU,CAAC,oBAAoB;KACxD,CAAC,CACL,CAAA;AACL,CAAC,CAAA;AA1BY,QAAA,wBAAwB,4BA0BpC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.pimlicoPaymasterActions = exports.pimlicoBundlerActions = void 0;
4
+ const pimlico_js_1 = require("../../actions/pimlico.js");
4
5
  const getUserOperationGasPrice_js_1 = require("../../actions/pimlico/getUserOperationGasPrice.js");
5
6
  const getUserOperationStatus_js_1 = require("../../actions/pimlico/getUserOperationStatus.js");
6
7
  const sponsorUserOperation_js_1 = require("../../actions/pimlico/sponsorUserOperation.js");
@@ -10,7 +11,8 @@ const pimlicoBundlerActions = (client) => ({
10
11
  });
11
12
  exports.pimlicoBundlerActions = pimlicoBundlerActions;
12
13
  const pimlicoPaymasterActions = (client) => ({
13
- sponsorUserOperation: async (args) => (0, sponsorUserOperation_js_1.sponsorUserOperation)(client, args)
14
+ sponsorUserOperation: async (args) => (0, sponsorUserOperation_js_1.sponsorUserOperation)(client, args),
15
+ validateSponsorshipPolicies: async (args) => (0, pimlico_js_1.validateSponsorshipPolicies)(client, args)
14
16
  });
15
17
  exports.pimlicoPaymasterActions = pimlicoPaymasterActions;
16
18
  //# sourceMappingURL=pimlico.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":";;;AACA,mGAG0D;AAC1D,+FAIwD;AACxD,2FAIsD;AAmD/C,MAAM,qBAAqB,GAAG,CACjC,MAAc,EACO,EAAE,CAAC,CAAC;IACzB,wBAAwB,EAAE,KAAK,IAAI,EAAE,CACjC,IAAA,sDAAwB,EAAC,MAA8B,CAAC;IAC5D,sBAAsB,EAAE,KAAK,EAAE,IAAsC,EAAE,EAAE,CACrE,IAAA,kDAAsB,EAAC,MAA8B,EAAE,IAAI,CAAC;CACnE,CAAC,CAAA;AAPW,QAAA,qBAAqB,yBAOhC;AA+BK,MAAM,uBAAuB,GAAG,CACnC,MAAc,EACe,EAAE,CAAC,CAAC;IACjC,oBAAoB,EAAE,KAAK,EAAE,IAAoC,EAAE,EAAE,CACjE,IAAA,8CAAoB,EAAC,MAAgC,EAAE,IAAI,CAAC;CACnE,CAAC,CAAA;AALW,QAAA,uBAAuB,2BAKlC"}
1
+ {"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":";;;AACA,yDAIiC;AACjC,mGAG0D;AAC1D,+FAIwD;AACxD,2FAIsD;AAmD/C,MAAM,qBAAqB,GAAG,CACjC,MAAc,EACO,EAAE,CAAC,CAAC;IACzB,wBAAwB,EAAE,KAAK,IAAI,EAAE,CACjC,IAAA,sDAAwB,EAAC,MAA8B,CAAC;IAC5D,sBAAsB,EAAE,KAAK,EAAE,IAAsC,EAAE,EAAE,CACrE,IAAA,kDAAsB,EAAC,MAA8B,EAAE,IAAI,CAAC;CACnE,CAAC,CAAA;AAPW,QAAA,qBAAqB,yBAOhC;AAsEK,MAAM,uBAAuB,GAAG,CACnC,MAAc,EACe,EAAE,CAAC,CAAC;IACjC,oBAAoB,EAAE,KAAK,EAAE,IAA2C,EAAE,EAAE,CACxE,IAAA,8CAAoB,EAAC,MAAgC,EAAE,IAAI,CAAC;IAChE,2BAA2B,EAAE,KAAK,EAC9B,IAA2C,EAC7C,EAAE,CAAC,IAAA,wCAA2B,EAAC,MAAgC,EAAE,IAAI,CAAC;CAC3E,CAAC,CAAA;AARW,QAAA,uBAAuB,2BAQlC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRequiredPrefund = void 0;
4
+ const getRequiredPrefund = ({ userOperation }) => {
5
+ const multiplier = userOperation.paymasterAndData.length > 2 ? 3n : 1n;
6
+ const requiredGas = userOperation.callGasLimit +
7
+ userOperation.verificationGasLimit * multiplier +
8
+ userOperation.preVerificationGas;
9
+ return BigInt(requiredGas) * BigInt(userOperation.maxFeePerGas);
10
+ };
11
+ exports.getRequiredPrefund = getRequiredPrefund;
12
+ //# sourceMappingURL=getRequiredPrefund.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRequiredPrefund.js","sourceRoot":"","sources":["../../utils/getRequiredPrefund.ts"],"names":[],"mappings":";;;AAoBO,MAAM,kBAAkB,GAAG,CAAC,EAC/B,aAAa,EACc,EAAU,EAAE;IACvC,MAAM,UAAU,GAAG,aAAa,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IACtE,MAAM,WAAW,GACb,aAAa,CAAC,YAAY;QAC1B,aAAa,CAAC,oBAAoB,GAAG,UAAU;QAC/C,aAAa,CAAC,kBAAkB,CAAA;IAEpC,OAAO,MAAM,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,CAAA;AACnE,CAAC,CAAA;AAVY,QAAA,kBAAkB,sBAU9B"}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AccountOrClientNotFoundError = exports.signUserOperationHashWithECDSA = exports.getUserOperationHash = exports.parseAccount = void 0;
3
+ exports.AccountOrClientNotFoundError = exports.signUserOperationHashWithECDSA = exports.getRequiredPrefund = exports.getUserOperationHash = exports.parseAccount = void 0;
4
+ const getRequiredPrefund_js_1 = require("./getRequiredPrefund.js");
5
+ Object.defineProperty(exports, "getRequiredPrefund", { enumerable: true, get: function () { return getRequiredPrefund_js_1.getRequiredPrefund; } });
4
6
  const getUserOperationHash_js_1 = require("./getUserOperationHash.js");
5
7
  Object.defineProperty(exports, "getUserOperationHash", { enumerable: true, get: function () { return getUserOperationHash_js_1.getUserOperationHash; } });
6
8
  const signUserOperationHashWithECDSA_js_1 = require("./signUserOperationHashWithECDSA.js");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":";;;AACA,uEAGkC;AAa9B,qGAdA,8CAAoB,OAcA;AAZxB,2FAG4C;AAYxC,6GAdA,gEAA4B,OAcA;AAD5B,+GAZA,kEAA8B,OAYA;AATlC,SAAgB,YAAY,CAAC,OAA0B;IACnD,IAAI,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAA;IACjD,OAAO,OAAO,CAAA;AAClB,CAAC;AAJD,oCAIC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":";;;AACA,mEAGgC;AAkB5B,mGAnBA,0CAAkB,OAmBA;AAjBtB,uEAGkC;AAa9B,qGAdA,8CAAoB,OAcA;AAZxB,2FAG4C;AAcxC,6GAhBA,gEAA4B,OAgBA;AAD5B,+GAdA,kEAA8B,OAcA;AAXlC,SAAgB,YAAY,CAAC,OAA0B;IACnD,IAAI,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAA;IACjD,OAAO,OAAO,CAAA;AAClB,CAAC;AAJD,oCAIC"}
@@ -2,6 +2,7 @@ import { privateKeyToSimpleSmartAccount } from "./privateKeyToSimpleSmartAccount
2
2
  import { signerToSimpleSmartAccount } from "./signerToSimpleSmartAccount.js";
3
3
  import { privateKeyToSafeSmartAccount } from "./privateKeyToSafeSmartAccount.js";
4
4
  import { signerToSafeSmartAccount } from "./signerToSafeSmartAccount.js";
5
+ import { signerToEcdsaKernelSmartAccount } from "./kernel/signerToEcdsaKernelSmartAccount.js";
5
6
  import { SignTransactionNotSupportedBySmartAccount } from "./types.js";
6
- export { signerToSafeSmartAccount, signerToSimpleSmartAccount, SignTransactionNotSupportedBySmartAccount, privateKeyToSimpleSmartAccount, privateKeyToSafeSmartAccount };
7
+ export { signerToSafeSmartAccount, signerToSimpleSmartAccount, SignTransactionNotSupportedBySmartAccount, privateKeyToSimpleSmartAccount, privateKeyToSafeSmartAccount, signerToEcdsaKernelSmartAccount };
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAA;AAEpF,OAAO,EAEH,0BAA0B,EAC7B,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AAEhF,OAAO,EAGH,wBAAwB,EAC3B,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EACH,yCAAyC,EAG5C,MAAM,YAAY,CAAA;AAEnB,OAAO,EAIH,wBAAwB,EAExB,0BAA0B,EAC1B,yCAAyC,EACzC,8BAA8B,EAE9B,4BAA4B,EAC/B,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAA;AAEpF,OAAO,EAEH,0BAA0B,EAC7B,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AAEhF,OAAO,EAGH,wBAAwB,EAC3B,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EAEH,+BAA+B,EAClC,MAAM,6CAA6C,CAAA;AAEpD,OAAO,EACH,yCAAyC,EAG5C,MAAM,YAAY,CAAA;AAEnB,OAAO,EAIH,wBAAwB,EAExB,0BAA0B,EAC1B,yCAAyC,EACzC,8BAA8B,EAE9B,4BAA4B,EAE5B,+BAA+B,EAClC,CAAA"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * The exeute abi, used to execute a transaction on the kernel smart account
3
+ */
4
+ export const KernelExecuteAbi = [
5
+ {
6
+ inputs: [
7
+ {
8
+ internalType: "address",
9
+ name: "to",
10
+ type: "address"
11
+ },
12
+ {
13
+ internalType: "uint256",
14
+ name: "value",
15
+ type: "uint256"
16
+ },
17
+ {
18
+ internalType: "bytes",
19
+ name: "data",
20
+ type: "bytes"
21
+ },
22
+ {
23
+ internalType: "enum Operation",
24
+ name: "",
25
+ type: "uint8"
26
+ }
27
+ ],
28
+ name: "execute",
29
+ outputs: [],
30
+ stateMutability: "payable",
31
+ type: "function"
32
+ },
33
+ {
34
+ inputs: [
35
+ {
36
+ components: [
37
+ {
38
+ internalType: "address",
39
+ name: "to",
40
+ type: "address"
41
+ },
42
+ {
43
+ internalType: "uint256",
44
+ name: "value",
45
+ type: "uint256"
46
+ },
47
+ {
48
+ internalType: "bytes",
49
+ name: "data",
50
+ type: "bytes"
51
+ }
52
+ ],
53
+ internalType: "struct Call[]",
54
+ name: "calls",
55
+ type: "tuple[]"
56
+ }
57
+ ],
58
+ name: "executeBatch",
59
+ outputs: [],
60
+ stateMutability: "payable",
61
+ type: "function"
62
+ }
63
+ ];
64
+ /**
65
+ * The init abi, used to initialise kernel account
66
+ */
67
+ export const KernelInitAbi = [
68
+ {
69
+ inputs: [
70
+ {
71
+ internalType: "contract IKernelValidator",
72
+ name: "_defaultValidator",
73
+ type: "address"
74
+ },
75
+ {
76
+ internalType: "bytes",
77
+ name: "_data",
78
+ type: "bytes"
79
+ }
80
+ ],
81
+ name: "initialize",
82
+ outputs: [],
83
+ stateMutability: "payable",
84
+ type: "function"
85
+ }
86
+ ];
87
+ //# sourceMappingURL=KernelAccountAbi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KernelAccountAbi.js","sourceRoot":"","sources":["../../../../accounts/kernel/abi/KernelAccountAbi.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B;QACI,MAAM,EAAE;YACJ;gBACI,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,IAAI;gBACV,IAAI,EAAE,SAAS;aAClB;YACD;gBACI,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aAClB;YACD;gBACI,YAAY,EAAE,OAAO;gBACrB,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,OAAO;aAChB;YACD;gBACI,YAAY,EAAE,gBAAgB;gBAC9B,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,OAAO;aAChB;SACJ;QACD,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,UAAU;KACnB;IACD;QACI,M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