@zerodev/sdk 4.0.29 → 4.0.31

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 (44) hide show
  1. package/dist/cjs/index.d.ts +1 -1
  2. package/dist/cjs/index.js +3 -1
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/cjs/kernel-zerodev/abis/ERC20Abi.d.ts +231 -39
  5. package/dist/cjs/kernel-zerodev/abis/ERC20Abi.js.map +1 -1
  6. package/dist/cjs/kernel-zerodev/validator/session-key-validator.d.ts +11 -6
  7. package/dist/cjs/kernel-zerodev/validator/session-key-validator.js +81 -5
  8. package/dist/cjs/kernel-zerodev/validator/session-key-validator.js.map +1 -1
  9. package/dist/cjs/kernel-zerodev/validator/types.d.ts +27 -1
  10. package/dist/cjs/kernel-zerodev/validator/types.js.map +1 -1
  11. package/dist/esm/index.d.ts +1 -1
  12. package/dist/esm/index.js +1 -1
  13. package/dist/esm/index.js.map +1 -1
  14. package/dist/esm/kernel-zerodev/abis/ERC20Abi.d.ts +231 -39
  15. package/dist/esm/kernel-zerodev/abis/ERC20Abi.js.map +1 -1
  16. package/dist/esm/kernel-zerodev/validator/session-key-validator.d.ts +11 -6
  17. package/dist/esm/kernel-zerodev/validator/session-key-validator.js +78 -4
  18. package/dist/esm/kernel-zerodev/validator/session-key-validator.js.map +1 -1
  19. package/dist/esm/kernel-zerodev/validator/types.d.ts +27 -1
  20. package/dist/esm/kernel-zerodev/validator/types.js +2 -1
  21. package/dist/esm/kernel-zerodev/validator/types.js.map +1 -1
  22. package/dist/types/index.d.ts +1 -1
  23. package/dist/types/index.d.ts.map +1 -1
  24. package/dist/types/kernel-zerodev/abis/ERC20Abi.d.ts +231 -39
  25. package/dist/types/kernel-zerodev/abis/ERC20Abi.d.ts.map +1 -1
  26. package/dist/types/kernel-zerodev/ethers-provider/ethers-provider.d.ts +0 -17
  27. package/dist/types/kernel-zerodev/ethers-provider/ethers-provider.d.ts.map +1 -1
  28. package/dist/types/kernel-zerodev/middleware/gas-estimator.d.ts +0 -4
  29. package/dist/types/kernel-zerodev/middleware/gas-estimator.d.ts.map +1 -1
  30. package/dist/types/kernel-zerodev/owner/passkey/types.d.ts +0 -1
  31. package/dist/types/kernel-zerodev/owner/passkey/types.d.ts.map +1 -1
  32. package/dist/types/kernel-zerodev/utils/ERC4337-utils.d.ts +0 -12
  33. package/dist/types/kernel-zerodev/utils/ERC4337-utils.d.ts.map +1 -1
  34. package/dist/types/kernel-zerodev/utils/calc-pre-verification-gas.d.ts +0 -28
  35. package/dist/types/kernel-zerodev/utils/calc-pre-verification-gas.d.ts.map +1 -1
  36. package/dist/types/kernel-zerodev/validator/session-key-validator.d.ts +11 -6
  37. package/dist/types/kernel-zerodev/validator/session-key-validator.d.ts.map +1 -1
  38. package/dist/types/kernel-zerodev/validator/types.d.ts +27 -1
  39. package/dist/types/kernel-zerodev/validator/types.d.ts.map +1 -1
  40. package/package.json +3 -3
  41. package/src/index.ts +5 -1
  42. package/src/kernel-zerodev/abis/ERC20Abi.ts +1 -1
  43. package/src/kernel-zerodev/validator/session-key-validator.ts +111 -9
  44. package/src/kernel-zerodev/validator/types.ts +64 -0
@@ -3,7 +3,7 @@ export { ValidatorMode, KernelBaseValidator, } from "./kernel-zerodev/validator/
3
3
  export * from "./kernel-zerodev/validator/index.js";
4
4
  export type * from "./kernel-zerodev/validator/types.js";
5
5
  export type { KernelBaseValidatorParams } from "./kernel-zerodev/validator/base.js";
6
- export { ParamCondition } from "./kernel-zerodev/validator/session-key-validator.js";
6
+ export { ParamCondition, getAbiItem, getPermissionFromABI, } from "./kernel-zerodev/validator/session-key-validator.js";
7
7
  export { ValidatorProvider } from "./kernel-zerodev/validator-provider/base.js";
8
8
  export type { ValidatorProviderParams, ValidatorProviderParamsOpts, ExtendedValidatorProviderParams, } from "./kernel-zerodev/validator-provider/base.js";
9
9
  export type * from "./kernel-zerodev/validator-provider/types.js";
package/dist/cjs/index.js CHANGED
@@ -26,7 +26,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
26
26
  return result;
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.constants = exports.EmptyAccountSigner = exports.ZeroDevAccountSigner = exports.ZeroDevEthersProvider = exports.getChainId = exports.Operation = exports.ZeroDevProvider = exports.KernelSmartContractAccount = exports.ValidatorProvider = exports.ParamCondition = exports.KernelBaseValidator = exports.ValidatorMode = void 0;
29
+ exports.constants = exports.EmptyAccountSigner = exports.ZeroDevAccountSigner = exports.ZeroDevEthersProvider = exports.getChainId = exports.Operation = exports.ZeroDevProvider = exports.KernelSmartContractAccount = exports.ValidatorProvider = exports.getPermissionFromABI = exports.getAbiItem = exports.ParamCondition = exports.KernelBaseValidator = exports.ValidatorMode = void 0;
30
30
  __exportStar(require("./kernel-zerodev/abis/index.js"), exports);
31
31
  var base_js_1 = require("./kernel-zerodev/validator/base.js");
32
32
  Object.defineProperty(exports, "ValidatorMode", { enumerable: true, get: function () { return base_js_1.ValidatorMode; } });
@@ -34,6 +34,8 @@ Object.defineProperty(exports, "KernelBaseValidator", { enumerable: true, get: f
34
34
  __exportStar(require("./kernel-zerodev/validator/index.js"), exports);
35
35
  var session_key_validator_js_1 = require("./kernel-zerodev/validator/session-key-validator.js");
36
36
  Object.defineProperty(exports, "ParamCondition", { enumerable: true, get: function () { return session_key_validator_js_1.ParamCondition; } });
37
+ Object.defineProperty(exports, "getAbiItem", { enumerable: true, get: function () { return session_key_validator_js_1.getAbiItem; } });
38
+ Object.defineProperty(exports, "getPermissionFromABI", { enumerable: true, get: function () { return session_key_validator_js_1.getPermissionFromABI; } });
37
39
  var base_js_2 = require("./kernel-zerodev/validator-provider/base.js");
38
40
  Object.defineProperty(exports, "ValidatorProvider", { enumerable: true, get: function () { return base_js_2.ValidatorProvider; } });
39
41
  __exportStar(require("./kernel-zerodev/validator-provider/index.js"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,iEAA+C;AAG/C,8DAG4C;AAF1C,wGAAA,aAAa,OAAA;AACb,8GAAA,mBAAmB,OAAA;AAErB,sEAAoD;AAGpD,gGAAqF;AAA5E,0HAAA,cAAc,OAAA;AAGvB,uEAAgF;AAAvE,4GAAA,iBAAiB,OAAA;AAO1B,+EAA6D;AAI7D,0DAAyE;AAAhE,wHAAA,0BAA0B,OAAA;AAEnC,4DAA0E;AAAjE,8GAAA,eAAe,OAAA;AAAE,wGAAA,SAAS,OAAA;AAGnC,4DAA0C;AAC1C,0DAA2D;AAAlD,sGAAA,UAAU,OAAA;AACnB,0FAA4F;AAAnF,2HAAA,qBAAqB,OAAA;AAC9B,wFAA0F;AAAjF,yHAAA,oBAAoB,OAAA;AAC7B,6EAA8E;AAArE,sHAAA,kBAAkB,OAAA;AAG3B,2EAA2D;AAG3D,kEAAgD","sourcesContent":["// Add you exports here, make sure to export types separately from impls and use the `type` keyword when exporting them\n// Don't use wildcard exports, instead use named exports\n\n//kernel exports\nexport * from \"./kernel-zerodev/abis/index.js\";\n\n// Validator exports\nexport {\n ValidatorMode,\n KernelBaseValidator,\n} from \"./kernel-zerodev/validator/base.js\";\nexport * from \"./kernel-zerodev/validator/index.js\";\nexport type * from \"./kernel-zerodev/validator/types.js\";\nexport type { KernelBaseValidatorParams } from \"./kernel-zerodev/validator/base.js\";\nexport { ParamCondition } from \"./kernel-zerodev/validator/session-key-validator.js\";\n\n// Validator Provider exports\nexport { ValidatorProvider } from \"./kernel-zerodev/validator-provider/base.js\";\nexport type {\n ValidatorProviderParams,\n ValidatorProviderParamsOpts,\n ExtendedValidatorProviderParams,\n} from \"./kernel-zerodev/validator-provider/base.js\";\nexport type * from \"./kernel-zerodev/validator-provider/types.js\";\nexport * from \"./kernel-zerodev/validator-provider/index.js\";\n\n// Core exports\nexport type * from \"./kernel-zerodev/paymaster/types.js\";\nexport { KernelSmartContractAccount } from \"./kernel-zerodev/account.js\";\nexport type { KernelSmartAccountParams } from \"./kernel-zerodev/account.js\";\nexport { ZeroDevProvider, Operation } from \"./kernel-zerodev/provider.js\";\n\n// Utils exports\nexport * from \"./kernel-zerodev/utils.js\";\nexport { getChainId } from \"./kernel-zerodev/api/index.js\";\nexport { ZeroDevEthersProvider } from \"./kernel-zerodev/ethers-provider/ethers-provider.js\";\nexport { ZeroDevAccountSigner } from \"./kernel-zerodev/ethers-provider/account-signer.js\";\nexport { EmptyAccountSigner } from \"./kernel-zerodev/signer/empty-account.js\";\n\n// Constant exports\nexport * as constants from \"./kernel-zerodev/constants.js\";\n\n// Owner exports\nexport * from \"./kernel-zerodev/owner/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,iEAA+C;AAG/C,8DAG4C;AAF1C,wGAAA,aAAa,OAAA;AACb,8GAAA,mBAAmB,OAAA;AAErB,sEAAoD;AAGpD,gGAI6D;AAH3D,0HAAA,cAAc,OAAA;AACd,sHAAA,UAAU,OAAA;AACV,gIAAA,oBAAoB,OAAA;AAItB,uEAAgF;AAAvE,4GAAA,iBAAiB,OAAA;AAO1B,+EAA6D;AAI7D,0DAAyE;AAAhE,wHAAA,0BAA0B,OAAA;AAEnC,4DAA0E;AAAjE,8GAAA,eAAe,OAAA;AAAE,wGAAA,SAAS,OAAA;AAGnC,4DAA0C;AAC1C,0DAA2D;AAAlD,sGAAA,UAAU,OAAA;AACnB,0FAA4F;AAAnF,2HAAA,qBAAqB,OAAA;AAC9B,wFAA0F;AAAjF,yHAAA,oBAAoB,OAAA;AAC7B,6EAA8E;AAArE,sHAAA,kBAAkB,OAAA;AAG3B,2EAA2D;AAG3D,kEAAgD","sourcesContent":["// Add you exports here, make sure to export types separately from impls and use the `type` keyword when exporting them\n// Don't use wildcard exports, instead use named exports\n\n//kernel exports\nexport * from \"./kernel-zerodev/abis/index.js\";\n\n// Validator exports\nexport {\n ValidatorMode,\n KernelBaseValidator,\n} from \"./kernel-zerodev/validator/base.js\";\nexport * from \"./kernel-zerodev/validator/index.js\";\nexport type * from \"./kernel-zerodev/validator/types.js\";\nexport type { KernelBaseValidatorParams } from \"./kernel-zerodev/validator/base.js\";\nexport {\n ParamCondition,\n getAbiItem,\n getPermissionFromABI,\n} from \"./kernel-zerodev/validator/session-key-validator.js\";\n\n// Validator Provider exports\nexport { ValidatorProvider } from \"./kernel-zerodev/validator-provider/base.js\";\nexport type {\n ValidatorProviderParams,\n ValidatorProviderParamsOpts,\n ExtendedValidatorProviderParams,\n} from \"./kernel-zerodev/validator-provider/base.js\";\nexport type * from \"./kernel-zerodev/validator-provider/types.js\";\nexport * from \"./kernel-zerodev/validator-provider/index.js\";\n\n// Core exports\nexport type * from \"./kernel-zerodev/paymaster/types.js\";\nexport { KernelSmartContractAccount } from \"./kernel-zerodev/account.js\";\nexport type { KernelSmartAccountParams } from \"./kernel-zerodev/account.js\";\nexport { ZeroDevProvider, Operation } from \"./kernel-zerodev/provider.js\";\n\n// Utils exports\nexport * from \"./kernel-zerodev/utils.js\";\nexport { getChainId } from \"./kernel-zerodev/api/index.js\";\nexport { ZeroDevEthersProvider } from \"./kernel-zerodev/ethers-provider/ethers-provider.js\";\nexport { ZeroDevAccountSigner } from \"./kernel-zerodev/ethers-provider/account-signer.js\";\nexport { EmptyAccountSigner } from \"./kernel-zerodev/signer/empty-account.js\";\n\n// Constant exports\nexport * as constants from \"./kernel-zerodev/constants.js\";\n\n// Owner exports\nexport * from \"./kernel-zerodev/owner/index.js\";\n"]}
@@ -1,39 +1,231 @@
1
- export declare const ERC20Abi: ({
2
- inputs: {
3
- internalType: string;
4
- name: string;
5
- type: string;
6
- }[];
7
- stateMutability: string;
8
- type: string;
9
- anonymous?: undefined;
10
- name?: undefined;
11
- outputs?: undefined;
12
- } | {
13
- anonymous: boolean;
14
- inputs: {
15
- indexed: boolean;
16
- internalType: string;
17
- name: string;
18
- type: string;
19
- }[];
20
- name: string;
21
- type: string;
22
- stateMutability?: undefined;
23
- outputs?: undefined;
24
- } | {
25
- inputs: {
26
- internalType: string;
27
- name: string;
28
- type: string;
29
- }[];
30
- name: string;
31
- outputs: {
32
- internalType: string;
33
- name: string;
34
- type: string;
35
- }[];
36
- stateMutability: string;
37
- type: string;
38
- anonymous?: undefined;
39
- })[];
1
+ export declare const ERC20Abi: readonly [{
2
+ readonly inputs: readonly [{
3
+ readonly internalType: "string";
4
+ readonly name: "name_";
5
+ readonly type: "string";
6
+ }, {
7
+ readonly internalType: "string";
8
+ readonly name: "symbol_";
9
+ readonly type: "string";
10
+ }, {
11
+ readonly internalType: "uint8";
12
+ readonly name: "decimals_";
13
+ readonly type: "uint8";
14
+ }, {
15
+ readonly internalType: "uint256";
16
+ readonly name: "initialBalance_";
17
+ readonly type: "uint256";
18
+ }, {
19
+ readonly internalType: "address payable";
20
+ readonly name: "feeReceiver_";
21
+ readonly type: "address";
22
+ }];
23
+ readonly stateMutability: "payable";
24
+ readonly type: "constructor";
25
+ }, {
26
+ readonly anonymous: false;
27
+ readonly inputs: readonly [{
28
+ readonly indexed: true;
29
+ readonly internalType: "address";
30
+ readonly name: "owner";
31
+ readonly type: "address";
32
+ }, {
33
+ readonly indexed: true;
34
+ readonly internalType: "address";
35
+ readonly name: "spender";
36
+ readonly type: "address";
37
+ }, {
38
+ readonly indexed: false;
39
+ readonly internalType: "uint256";
40
+ readonly name: "value";
41
+ readonly type: "uint256";
42
+ }];
43
+ readonly name: "Approval";
44
+ readonly type: "event";
45
+ }, {
46
+ readonly anonymous: false;
47
+ readonly inputs: readonly [{
48
+ readonly indexed: true;
49
+ readonly internalType: "address";
50
+ readonly name: "from";
51
+ readonly type: "address";
52
+ }, {
53
+ readonly indexed: true;
54
+ readonly internalType: "address";
55
+ readonly name: "to";
56
+ readonly type: "address";
57
+ }, {
58
+ readonly indexed: false;
59
+ readonly internalType: "uint256";
60
+ readonly name: "value";
61
+ readonly type: "uint256";
62
+ }];
63
+ readonly name: "Transfer";
64
+ readonly type: "event";
65
+ }, {
66
+ readonly inputs: readonly [{
67
+ readonly internalType: "address";
68
+ readonly name: "owner";
69
+ readonly type: "address";
70
+ }, {
71
+ readonly internalType: "address";
72
+ readonly name: "spender";
73
+ readonly type: "address";
74
+ }];
75
+ readonly name: "allowance";
76
+ readonly outputs: readonly [{
77
+ readonly internalType: "uint256";
78
+ readonly name: "";
79
+ readonly type: "uint256";
80
+ }];
81
+ readonly stateMutability: "view";
82
+ readonly type: "function";
83
+ }, {
84
+ readonly inputs: readonly [{
85
+ readonly internalType: "address";
86
+ readonly name: "spender";
87
+ readonly type: "address";
88
+ }, {
89
+ readonly internalType: "uint256";
90
+ readonly name: "amount";
91
+ readonly type: "uint256";
92
+ }];
93
+ readonly name: "approve";
94
+ readonly outputs: readonly [{
95
+ readonly internalType: "bool";
96
+ readonly name: "";
97
+ readonly type: "bool";
98
+ }];
99
+ readonly stateMutability: "nonpayable";
100
+ readonly type: "function";
101
+ }, {
102
+ readonly inputs: readonly [{
103
+ readonly internalType: "address";
104
+ readonly name: "account";
105
+ readonly type: "address";
106
+ }];
107
+ readonly name: "balanceOf";
108
+ readonly outputs: readonly [{
109
+ readonly internalType: "uint256";
110
+ readonly name: "";
111
+ readonly type: "uint256";
112
+ }];
113
+ readonly stateMutability: "view";
114
+ readonly type: "function";
115
+ }, {
116
+ readonly inputs: readonly [];
117
+ readonly name: "decimals";
118
+ readonly outputs: readonly [{
119
+ readonly internalType: "uint8";
120
+ readonly name: "";
121
+ readonly type: "uint8";
122
+ }];
123
+ readonly stateMutability: "view";
124
+ readonly type: "function";
125
+ }, {
126
+ readonly inputs: readonly [{
127
+ readonly internalType: "address";
128
+ readonly name: "spender";
129
+ readonly type: "address";
130
+ }, {
131
+ readonly internalType: "uint256";
132
+ readonly name: "subtractedValue";
133
+ readonly type: "uint256";
134
+ }];
135
+ readonly name: "decreaseAllowance";
136
+ readonly outputs: readonly [{
137
+ readonly internalType: "bool";
138
+ readonly name: "";
139
+ readonly type: "bool";
140
+ }];
141
+ readonly stateMutability: "nonpayable";
142
+ readonly type: "function";
143
+ }, {
144
+ readonly inputs: readonly [{
145
+ readonly internalType: "address";
146
+ readonly name: "spender";
147
+ readonly type: "address";
148
+ }, {
149
+ readonly internalType: "uint256";
150
+ readonly name: "addedValue";
151
+ readonly type: "uint256";
152
+ }];
153
+ readonly name: "increaseAllowance";
154
+ readonly outputs: readonly [{
155
+ readonly internalType: "bool";
156
+ readonly name: "";
157
+ readonly type: "bool";
158
+ }];
159
+ readonly stateMutability: "nonpayable";
160
+ readonly type: "function";
161
+ }, {
162
+ readonly inputs: readonly [];
163
+ readonly name: "name";
164
+ readonly outputs: readonly [{
165
+ readonly internalType: "string";
166
+ readonly name: "";
167
+ readonly type: "string";
168
+ }];
169
+ readonly stateMutability: "view";
170
+ readonly type: "function";
171
+ }, {
172
+ readonly inputs: readonly [];
173
+ readonly name: "symbol";
174
+ readonly outputs: readonly [{
175
+ readonly internalType: "string";
176
+ readonly name: "";
177
+ readonly type: "string";
178
+ }];
179
+ readonly stateMutability: "view";
180
+ readonly type: "function";
181
+ }, {
182
+ readonly inputs: readonly [];
183
+ readonly name: "totalSupply";
184
+ readonly outputs: readonly [{
185
+ readonly internalType: "uint256";
186
+ readonly name: "";
187
+ readonly type: "uint256";
188
+ }];
189
+ readonly stateMutability: "view";
190
+ readonly type: "function";
191
+ }, {
192
+ readonly inputs: readonly [{
193
+ readonly internalType: "address";
194
+ readonly name: "recipient";
195
+ readonly type: "address";
196
+ }, {
197
+ readonly internalType: "uint256";
198
+ readonly name: "amount";
199
+ readonly type: "uint256";
200
+ }];
201
+ readonly name: "transfer";
202
+ readonly outputs: readonly [{
203
+ readonly internalType: "bool";
204
+ readonly name: "";
205
+ readonly type: "bool";
206
+ }];
207
+ readonly stateMutability: "nonpayable";
208
+ readonly type: "function";
209
+ }, {
210
+ readonly inputs: readonly [{
211
+ readonly internalType: "address";
212
+ readonly name: "sender";
213
+ readonly type: "address";
214
+ }, {
215
+ readonly internalType: "address";
216
+ readonly name: "recipient";
217
+ readonly type: "address";
218
+ }, {
219
+ readonly internalType: "uint256";
220
+ readonly name: "amount";
221
+ readonly type: "uint256";
222
+ }];
223
+ readonly name: "transferFrom";
224
+ readonly outputs: readonly [{
225
+ readonly internalType: "bool";
226
+ readonly name: "";
227
+ readonly type: "bool";
228
+ }];
229
+ readonly stateMutability: "nonpayable";
230
+ readonly type: "function";
231
+ }];
@@ -1 +1 @@
1
- {"version":3,"file":"ERC20Abi.js","sourceRoot":"","sources":["../../../../src/kernel-zerodev/abis/ERC20Abi.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACtB;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzD,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3D,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE;YAC3D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE;YACrE;gBACE,YAAY,EAAE,iBAAiB;gBAC/B,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,SAAS;aAChB;SACF;QACD,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,aAAa;KACpB;IACD;QACE,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACN;gBACE,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,OAAO,EA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Y,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;YAC5D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE;YAC/D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;SAC7D;QACD,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC3D,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;CACF,CAAC","sourcesContent":["export const ERC20Abi = [\n {\n inputs: [\n { internalType: \"string\", name: \"name_\", type: \"string\" },\n { internalType: \"string\", name: \"symbol_\", type: \"string\" },\n { internalType: \"uint8\", name: \"decimals_\", type: \"uint8\" },\n { internalType: \"uint256\", name: \"initialBalance_\", type: \"uint256\" },\n {\n internalType: \"address payable\",\n name: \"feeReceiver_\",\n type: \"address\",\n },\n ],\n stateMutability: \"payable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n { indexed: true, internalType: \"address\", name: \"from\", type: \"address\" },\n { indexed: true, internalType: \"address\", name: \"to\", type: \"address\" },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"owner\", type: \"address\" },\n { internalType: \"address\", name: \"spender\", type: \"address\" },\n ],\n name: \"allowance\",\n outputs: [{ internalType: \"uint256\", name: \"\", type: \"uint256\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"spender\", type: \"address\" },\n { internalType: \"uint256\", name: \"amount\", type: \"uint256\" },\n ],\n name: \"approve\",\n outputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"account\", type: \"address\" }],\n name: \"balanceOf\",\n outputs: [{ internalType: \"uint256\", name: \"\", type: \"uint256\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [{ internalType: \"uint8\", name: \"\", type: \"uint8\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"spender\", type: \"address\" },\n { internalType: \"uint256\", name: \"subtractedValue\", type: \"uint256\" },\n ],\n name: \"decreaseAllowance\",\n outputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"spender\", type: \"address\" },\n { internalType: \"uint256\", name: \"addedValue\", type: \"uint256\" },\n ],\n name: \"increaseAllowance\",\n outputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [{ internalType: \"string\", name: \"\", type: \"string\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [{ internalType: \"string\", name: \"\", type: \"string\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [{ internalType: \"uint256\", name: \"\", type: \"uint256\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"recipient\", type: \"address\" },\n { internalType: \"uint256\", name: \"amount\", type: \"uint256\" },\n ],\n name: \"transfer\",\n outputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"sender\", type: \"address\" },\n { internalType: \"address\", name: \"recipient\", type: \"address\" },\n { internalType: \"uint256\", name: \"amount\", type: \"uint256\" },\n ],\n name: \"transferFrom\",\n outputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n];\n"]}
1
+ {"version":3,"file":"ERC20Abi.js","sourceRoot":"","sources":["../../../../src/kernel-zerodev/abis/ERC20Abi.ts"],"names":[],"mappings":";;;AAAa,QAAA,QAAQ,GAAG;IACtB;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzD,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC3D,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE;YAC3D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAS,EAAE;YACrE;gBACE,YAAY,EAAE,iBAAiB;gBAC/B,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,SAAS;aAChB;SACF;QACD,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,aAAa;KACpB;IACD;QACE,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACN;gBACE,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,OAAO,EAAE,IAAI;gBACb,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;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AAM,EAAE;YACN,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;YAC5D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE;YAC/D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;SAC7D;QACD,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC3D,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;CACO,CAAC","sourcesContent":["export const ERC20Abi = [\n {\n inputs: [\n { internalType: \"string\", name: \"name_\", type: \"string\" },\n { internalType: \"string\", name: \"symbol_\", type: \"string\" },\n { internalType: \"uint8\", name: \"decimals_\", type: \"uint8\" },\n { internalType: \"uint256\", name: \"initialBalance_\", type: \"uint256\" },\n {\n internalType: \"address payable\",\n name: \"feeReceiver_\",\n type: \"address\",\n },\n ],\n stateMutability: \"payable\",\n type: \"constructor\",\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: \"address\",\n name: \"owner\",\n type: \"address\",\n },\n {\n indexed: true,\n internalType: \"address\",\n name: \"spender\",\n type: \"address\",\n },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Approval\",\n type: \"event\",\n },\n {\n anonymous: false,\n inputs: [\n { indexed: true, internalType: \"address\", name: \"from\", type: \"address\" },\n { indexed: true, internalType: \"address\", name: \"to\", type: \"address\" },\n {\n indexed: false,\n internalType: \"uint256\",\n name: \"value\",\n type: \"uint256\",\n },\n ],\n name: \"Transfer\",\n type: \"event\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"owner\", type: \"address\" },\n { internalType: \"address\", name: \"spender\", type: \"address\" },\n ],\n name: \"allowance\",\n outputs: [{ internalType: \"uint256\", name: \"\", type: \"uint256\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"spender\", type: \"address\" },\n { internalType: \"uint256\", name: \"amount\", type: \"uint256\" },\n ],\n name: \"approve\",\n outputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [{ internalType: \"address\", name: \"account\", type: \"address\" }],\n name: \"balanceOf\",\n outputs: [{ internalType: \"uint256\", name: \"\", type: \"uint256\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"decimals\",\n outputs: [{ internalType: \"uint8\", name: \"\", type: \"uint8\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"spender\", type: \"address\" },\n { internalType: \"uint256\", name: \"subtractedValue\", type: \"uint256\" },\n ],\n name: \"decreaseAllowance\",\n outputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"spender\", type: \"address\" },\n { internalType: \"uint256\", name: \"addedValue\", type: \"uint256\" },\n ],\n name: \"increaseAllowance\",\n outputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"name\",\n outputs: [{ internalType: \"string\", name: \"\", type: \"string\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"symbol\",\n outputs: [{ internalType: \"string\", name: \"\", type: \"string\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [],\n name: \"totalSupply\",\n outputs: [{ internalType: \"uint256\", name: \"\", type: \"uint256\" }],\n stateMutability: \"view\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"recipient\", type: \"address\" },\n { internalType: \"uint256\", name: \"amount\", type: \"uint256\" },\n ],\n name: \"transfer\",\n outputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n {\n inputs: [\n { internalType: \"address\", name: \"sender\", type: \"address\" },\n { internalType: \"address\", name: \"recipient\", type: \"address\" },\n { internalType: \"uint256\", name: \"amount\", type: \"uint256\" },\n ],\n name: \"transferFrom\",\n outputs: [{ internalType: \"bool\", name: \"\", type: \"bool\" }],\n stateMutability: \"nonpayable\",\n type: \"function\",\n },\n] as const;\n"]}
@@ -1,7 +1,10 @@
1
- import { type Address, type Hex, type SmartAccountSigner, type UserOperationRequest, type SignTypedDataParams } from "@alchemy/aa-core";
1
+ import { type Address, type Hex, type SmartAccountSigner, type UserOperationRequest, type SignTypedDataParams, type Abi } from "@alchemy/aa-core";
2
2
  import { KernelBaseValidator, type KernelBaseValidatorParams, type ValidatorPluginData } from "./base.js";
3
+ import { type GetAbiItemParameters } from "viem";
3
4
  import { MerkleTree } from "merkletreejs";
4
- import type { Operation } from "../provider.js";
5
+ import { Operation } from "../provider.js";
6
+ import type { GetAbiItemReturnType } from "viem/dist/types/utils/abi/getAbiItem.js";
7
+ import type { GeneratePermissionFromArgsParameters } from "./types.js";
5
8
  export interface SessionKeyValidatorParams extends KernelBaseValidatorParams {
6
9
  sessionKey: SmartAccountSigner;
7
10
  sessionKeyData: SessionKeyData;
@@ -24,19 +27,21 @@ export interface ParamRules {
24
27
  condition: ParamCondition;
25
28
  param: Hex;
26
29
  }
27
- export interface Permission {
30
+ export type Permission = {
28
31
  target: Address;
29
- valueLimit: bigint;
30
32
  sig: Hex;
31
33
  rules: ParamRules[];
32
- operation: Operation;
33
- }
34
+ valueLimit?: bigint;
35
+ operation?: Operation;
36
+ };
34
37
  export interface SessionKeyData {
35
38
  validUntil: number;
36
39
  validAfter: number;
37
40
  paymaster?: Address;
38
41
  permissions?: Permission[];
39
42
  }
43
+ export declare function getAbiItem<TAbi extends Abi | readonly unknown[], TItemName extends string>({ abi, args, name, }: GetAbiItemParameters<TAbi, TItemName>): GetAbiItemReturnType<TAbi, TItemName>;
44
+ export declare function getPermissionFromABI<TAbi extends Abi | readonly unknown[], TFunctionName extends string | undefined = string>({ abi, target, args, conditions, functionName, operation, valueLimit, }: GeneratePermissionFromArgsParameters<TAbi, TFunctionName>): Permission;
40
45
  export declare class SessionKeyValidator extends KernelBaseValidator {
41
46
  protected sessionKey: SmartAccountSigner;
42
47
  sessionKeyData: SessionKeyData;
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SessionKeyValidator = exports.ParamCondition = void 0;
3
+ exports.SessionKeyValidator = exports.getPermissionFromABI = exports.getAbiItem = exports.ParamCondition = void 0;
4
4
  const aa_core_1 = require("@alchemy/aa-core");
5
5
  const base_js_1 = require("./base.js");
6
6
  const viem_1 = require("viem");
7
+ const utils_1 = require("viem/utils");
7
8
  const SessionKeyValidatorAbi_js_1 = require("../abis/SessionKeyValidatorAbi.js");
8
9
  const constants_js_1 = require("../constants.js");
9
10
  const KernelAccountAbi_js_1 = require("../abis/KernelAccountAbi.js");
10
11
  const merkletreejs_1 = require("merkletreejs");
12
+ const provider_js_1 = require("../provider.js");
11
13
  const index_js_1 = require("../api/index.js");
12
14
  const utils_js_1 = require("../utils.js");
13
15
  BigInt.prototype.toJSON = function () {
@@ -22,6 +24,73 @@ var ParamCondition;
22
24
  ParamCondition[ParamCondition["LESS_THAN_OR_EQUAL"] = 4] = "LESS_THAN_OR_EQUAL";
23
25
  ParamCondition[ParamCondition["NOT_EQUAL"] = 5] = "NOT_EQUAL";
24
26
  })(ParamCondition || (exports.ParamCondition = ParamCondition = {}));
27
+ function getAbiItem({ abi, args = [], name, }) {
28
+ const abiItems = abi.filter((x) => "name" in x && x.name === name);
29
+ if (abiItems.length === 0)
30
+ return undefined;
31
+ if (abiItems.length === 1)
32
+ return abiItems[0];
33
+ const abiItemsParamFiltered = [];
34
+ for (const abiItem of abiItems) {
35
+ if (!("inputs" in abiItem))
36
+ continue;
37
+ if (!args || args.length === 0) {
38
+ if (!abiItem.inputs || abiItem.inputs.length === 0)
39
+ return abiItem;
40
+ continue;
41
+ }
42
+ if (!abiItem.inputs)
43
+ continue;
44
+ if (abiItem.inputs.length === 0)
45
+ continue;
46
+ if (abiItem.inputs.length !== args.length)
47
+ continue;
48
+ abiItemsParamFiltered.push(abiItem);
49
+ }
50
+ if (abiItemsParamFiltered.length === 0)
51
+ return abiItems[0];
52
+ else if (abiItemsParamFiltered.length === 1)
53
+ return abiItemsParamFiltered[0];
54
+ else
55
+ throw Error(`Couldn't parse funtion signature using params, set appropriate one from below:\n${abiItemsParamFiltered
56
+ .map((item) => (0, utils_1.formatAbiItem)(item))
57
+ .reduce((a, c) => `${a}\n${c}`)}`);
58
+ }
59
+ exports.getAbiItem = getAbiItem;
60
+ function getPermissionFromABI({ abi, target, args, conditions, functionName, operation, valueLimit, }) {
61
+ const abiItem = getAbiItem({
62
+ abi,
63
+ args,
64
+ name: functionName,
65
+ });
66
+ if (abiItem.type !== "function") {
67
+ throw Error(`${functionName} not found in abi`);
68
+ }
69
+ const functionSelector = (0, viem_1.getFunctionSelector)(abiItem);
70
+ let paramRules = [];
71
+ if (args &&
72
+ Array.isArray(args) &&
73
+ conditions &&
74
+ Array.isArray(conditions) &&
75
+ args.length === conditions.length) {
76
+ paramRules = args
77
+ .map((arg, i) => arg &&
78
+ conditions && {
79
+ param: (0, viem_1.pad)((0, viem_1.isHex)(arg) ? arg : (0, viem_1.toHex)(arg), { size: 32 }),
80
+ offset: i * 32,
81
+ condition: conditions[i],
82
+ })
83
+ .filter((rule) => rule);
84
+ }
85
+ return {
86
+ sig: functionSelector,
87
+ rules: paramRules,
88
+ target,
89
+ operation: operation ?? provider_js_1.Operation.Call,
90
+ valueLimit: valueLimit ?? 0n,
91
+ };
92
+ }
93
+ exports.getPermissionFromABI = getPermissionFromABI;
25
94
  class SessionKeyValidator extends base_js_1.KernelBaseValidator {
26
95
  constructor(params) {
27
96
  super(params);
@@ -46,8 +115,15 @@ class SessionKeyValidator extends base_js_1.KernelBaseValidator {
46
115
  this.sessionKey = params.sessionKey;
47
116
  this.sessionKeyData = {
48
117
  ...params.sessionKeyData,
118
+ validAfter: params.sessionKeyData.validAfter ?? 0,
119
+ validUntil: params.sessionKeyData.validUntil ?? 0,
49
120
  paymaster: params.sessionKeyData.paymaster ?? viem_1.zeroAddress,
50
121
  };
122
+ this.sessionKeyData.permissions = this.sessionKeyData.permissions?.map((perm) => ({
123
+ ...perm,
124
+ operation: perm.operation ?? provider_js_1.Operation.Call,
125
+ valueLimit: perm.valueLimit ?? 0n,
126
+ }));
51
127
  this.merkleTree = this.getMerkleTree();
52
128
  if (this.shouldDelegateViaFallback()) {
53
129
  throw Error("Session key permissions not set");
@@ -92,14 +168,14 @@ class SessionKeyValidator extends base_js_1.KernelBaseValidator {
92
168
  if (!operationPermissions.length)
93
169
  return undefined;
94
170
  const signaturePermissions = this.filterBySignature(operationPermissions, args[2].slice(0, 10).toLowerCase());
95
- const valueLimitPermissions = signaturePermissions.filter((permission) => permission.valueLimit >= args[1]);
171
+ const valueLimitPermissions = signaturePermissions.filter((permission) => (permission.valueLimit ?? 0n) >= args[1]);
96
172
  if (!valueLimitPermissions.length)
97
173
  return undefined;
98
174
  const sortedPermissions = valueLimitPermissions.sort((a, b) => {
99
- if (b.valueLimit > a.valueLimit) {
175
+ if ((b.valueLimit ?? 0n) > (a.valueLimit ?? 0n)) {
100
176
  return 1;
101
177
  }
102
- else if (b.valueLimit < a.valueLimit) {
178
+ else if ((b.valueLimit ?? 0n) < (a.valueLimit ?? 0n)) {
103
179
  return -1;
104
180
  }
105
181
  else {
@@ -113,7 +189,7 @@ class SessionKeyValidator extends base_js_1.KernelBaseValidator {
113
189
  }
114
190
  }
115
191
  filterByOperation(permissions, operation) {
116
- return permissions.filter((permission) => permission.operation === operation);
192
+ return permissions.filter((permission) => permission.operation === operation || provider_js_1.Operation.Call === operation);
117
193
  }
118
194
  filterBySignature(permissions, signature) {
119
195
  return permissions.filter((permission) => permission.sig.toLowerCase() === signature);