@zerodev/sdk 4.0.9 → 4.0.11
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/README.md +125 -3
- package/dist/cjs/index.d.ts +3 -4
- package/dist/cjs/index.js +6 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/kernel-zerodev/abis/ESCDAValidatorAbi.d.ts +2 -2
- package/dist/cjs/kernel-zerodev/abis/ESCDAValidatorAbi.js +2 -2
- package/dist/cjs/kernel-zerodev/abis/ESCDAValidatorAbi.js.map +1 -1
- package/dist/cjs/kernel-zerodev/abis/KernelAccountAbi.d.ts +3 -3
- package/dist/cjs/kernel-zerodev/abis/KernelAccountAbi.js +3 -3
- package/dist/cjs/kernel-zerodev/abis/KernelAccountAbi.js.map +1 -1
- package/dist/cjs/kernel-zerodev/abis/SessionKeyValidatorAbi.d.ts +158 -0
- package/dist/cjs/kernel-zerodev/abis/SessionKeyValidatorAbi.js +210 -0
- package/dist/cjs/kernel-zerodev/abis/SessionKeyValidatorAbi.js.map +1 -0
- package/dist/cjs/kernel-zerodev/abis/Test_ERC20Abi.d.ts +237 -39
- package/dist/cjs/kernel-zerodev/abis/Test_ERC20Abi.js.map +1 -1
- package/dist/cjs/kernel-zerodev/account.d.ts +13 -4
- package/dist/cjs/kernel-zerodev/account.js +50 -38
- package/dist/cjs/kernel-zerodev/account.js.map +1 -1
- package/dist/cjs/kernel-zerodev/constants.d.ts +3 -1
- package/dist/cjs/kernel-zerodev/constants.js +4 -2
- package/dist/cjs/kernel-zerodev/constants.js.map +1 -1
- package/dist/cjs/kernel-zerodev/ethers-provider/account-signer.d.ts +1 -1
- package/dist/cjs/kernel-zerodev/ethers-provider/account-signer.js +1 -1
- package/dist/cjs/kernel-zerodev/ethers-provider/account-signer.js.map +1 -1
- package/dist/cjs/kernel-zerodev/ethers-provider/ethers-provider.d.ts +4 -3
- package/dist/cjs/kernel-zerodev/ethers-provider/ethers-provider.js +12 -1
- package/dist/cjs/kernel-zerodev/ethers-provider/ethers-provider.js.map +1 -1
- package/dist/cjs/kernel-zerodev/middleware/paymaster.js +2 -1
- package/dist/cjs/kernel-zerodev/middleware/paymaster.js.map +1 -1
- package/dist/cjs/kernel-zerodev/paymaster/base.d.ts +3 -2
- package/dist/cjs/kernel-zerodev/paymaster/base.js +2 -1
- package/dist/cjs/kernel-zerodev/paymaster/base.js.map +1 -1
- package/dist/cjs/kernel-zerodev/paymaster/token-paymaster.d.ts +1 -1
- package/dist/cjs/kernel-zerodev/paymaster/token-paymaster.js +2 -1
- package/dist/cjs/kernel-zerodev/paymaster/token-paymaster.js.map +1 -1
- package/dist/cjs/kernel-zerodev/paymaster/verifying-paymaster.d.ts +1 -1
- package/dist/cjs/kernel-zerodev/paymaster/verifying-paymaster.js +2 -1
- package/dist/cjs/kernel-zerodev/paymaster/verifying-paymaster.js.map +1 -1
- package/dist/cjs/kernel-zerodev/provider.js +17 -12
- package/dist/cjs/kernel-zerodev/provider.js.map +1 -1
- package/dist/cjs/kernel-zerodev/signer/empty-account.d.ts +10 -0
- package/dist/cjs/kernel-zerodev/signer/empty-account.js +43 -0
- package/dist/cjs/kernel-zerodev/signer/empty-account.js.map +1 -0
- package/dist/cjs/kernel-zerodev/utils.d.ts +2 -0
- package/dist/cjs/kernel-zerodev/utils.js +11 -1
- package/dist/cjs/kernel-zerodev/utils.js.map +1 -1
- package/dist/cjs/kernel-zerodev/validator/base.d.ts +6 -3
- package/dist/cjs/kernel-zerodev/validator/base.js +20 -3
- package/dist/cjs/kernel-zerodev/validator/base.js.map +1 -1
- package/dist/cjs/kernel-zerodev/validator/erc165-session-key-validator.d.ts +1 -0
- package/dist/cjs/kernel-zerodev/validator/erc165-session-key-validator.js +11 -0
- package/dist/cjs/kernel-zerodev/validator/erc165-session-key-validator.js.map +1 -1
- package/dist/cjs/kernel-zerodev/validator/index.d.ts +2 -1
- package/dist/cjs/kernel-zerodev/validator/index.js +4 -1
- package/dist/cjs/kernel-zerodev/validator/index.js.map +1 -1
- package/dist/cjs/kernel-zerodev/validator/kill-switch-validator.js +1 -0
- package/dist/cjs/kernel-zerodev/validator/kill-switch-validator.js.map +1 -1
- package/dist/cjs/kernel-zerodev/validator/session-key-validator.d.ts +65 -0
- package/dist/cjs/kernel-zerodev/validator/session-key-validator.js +345 -0
- package/dist/cjs/kernel-zerodev/validator/session-key-validator.js.map +1 -0
- package/dist/cjs/kernel-zerodev/validator/types.d.ts +5 -1
- package/dist/cjs/kernel-zerodev/validator/types.js.map +1 -1
- package/dist/cjs/kernel-zerodev/validator-provider/base.d.ts +5 -4
- package/dist/cjs/kernel-zerodev/validator-provider/base.js +17 -2
- package/dist/cjs/kernel-zerodev/validator-provider/base.js.map +1 -1
- package/dist/cjs/kernel-zerodev/validator-provider/ecdsa-provider.d.ts +2 -2
- package/dist/cjs/kernel-zerodev/validator-provider/ecdsa-provider.js.map +1 -1
- package/dist/cjs/kernel-zerodev/validator-provider/erc165-session-key-provider.d.ts +2 -2
- package/dist/cjs/kernel-zerodev/validator-provider/erc165-session-key-provider.js.map +1 -1
- package/dist/cjs/kernel-zerodev/validator-provider/index.d.ts +2 -1
- package/dist/cjs/kernel-zerodev/validator-provider/index.js +4 -1
- package/dist/cjs/kernel-zerodev/validator-provider/index.js.map +1 -1
- package/dist/cjs/kernel-zerodev/validator-provider/kill-switch-provider.d.ts +2 -2
- package/dist/cjs/kernel-zerodev/validator-provider/kill-switch-provider.js.map +1 -1
- package/dist/cjs/kernel-zerodev/validator-provider/session-key-provider.d.ts +18 -0
- package/dist/cjs/kernel-zerodev/validator-provider/session-key-provider.js +114 -0
- package/dist/cjs/kernel-zerodev/validator-provider/session-key-provider.js.map +1 -0
- package/dist/cjs/kernel-zerodev/validator-provider/types.d.ts +5 -0
- package/dist/cjs/kernel-zerodev/validator-provider/types.js.map +1 -1
- package/dist/esm/index.d.ts +3 -4
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/kernel-zerodev/abis/ESCDAValidatorAbi.d.ts +2 -2
- package/dist/esm/kernel-zerodev/abis/ESCDAValidatorAbi.js +2 -2
- package/dist/esm/kernel-zerodev/abis/ESCDAValidatorAbi.js.map +1 -1
- package/dist/esm/kernel-zerodev/abis/KernelAccountAbi.d.ts +3 -3
- package/dist/esm/kernel-zerodev/abis/KernelAccountAbi.js +3 -3
- package/dist/esm/kernel-zerodev/abis/KernelAccountAbi.js.map +1 -1
- package/dist/esm/kernel-zerodev/abis/SessionKeyValidatorAbi.d.ts +158 -0
- package/dist/esm/kernel-zerodev/abis/SessionKeyValidatorAbi.js +207 -0
- package/dist/esm/kernel-zerodev/abis/SessionKeyValidatorAbi.js.map +1 -0
- package/dist/esm/kernel-zerodev/abis/Test_ERC20Abi.d.ts +237 -39
- package/dist/esm/kernel-zerodev/abis/Test_ERC20Abi.js.map +1 -1
- package/dist/esm/kernel-zerodev/account.d.ts +13 -4
- package/dist/esm/kernel-zerodev/account.js +51 -38
- package/dist/esm/kernel-zerodev/account.js.map +1 -1
- package/dist/esm/kernel-zerodev/constants.d.ts +3 -1
- package/dist/esm/kernel-zerodev/constants.js +3 -1
- package/dist/esm/kernel-zerodev/constants.js.map +1 -1
- package/dist/esm/kernel-zerodev/ethers-provider/account-signer.d.ts +1 -1
- package/dist/esm/kernel-zerodev/ethers-provider/account-signer.js +2 -2
- package/dist/esm/kernel-zerodev/ethers-provider/account-signer.js.map +1 -1
- package/dist/esm/kernel-zerodev/ethers-provider/ethers-provider.d.ts +4 -3
- package/dist/esm/kernel-zerodev/ethers-provider/ethers-provider.js +13 -2
- package/dist/esm/kernel-zerodev/ethers-provider/ethers-provider.js.map +1 -1
- package/dist/esm/kernel-zerodev/middleware/paymaster.js +2 -1
- package/dist/esm/kernel-zerodev/middleware/paymaster.js.map +1 -1
- package/dist/esm/kernel-zerodev/paymaster/base.d.ts +3 -2
- package/dist/esm/kernel-zerodev/paymaster/base.js +2 -1
- package/dist/esm/kernel-zerodev/paymaster/base.js.map +1 -1
- package/dist/esm/kernel-zerodev/paymaster/token-paymaster.d.ts +1 -1
- package/dist/esm/kernel-zerodev/paymaster/token-paymaster.js +2 -1
- package/dist/esm/kernel-zerodev/paymaster/token-paymaster.js.map +1 -1
- package/dist/esm/kernel-zerodev/paymaster/verifying-paymaster.d.ts +1 -1
- package/dist/esm/kernel-zerodev/paymaster/verifying-paymaster.js +2 -1
- package/dist/esm/kernel-zerodev/paymaster/verifying-paymaster.js.map +1 -1
- package/dist/esm/kernel-zerodev/provider.js +17 -12
- package/dist/esm/kernel-zerodev/provider.js.map +1 -1
- package/dist/esm/kernel-zerodev/signer/empty-account.d.ts +10 -0
- package/dist/esm/kernel-zerodev/signer/empty-account.js +40 -0
- package/dist/esm/kernel-zerodev/signer/empty-account.js.map +1 -0
- package/dist/esm/kernel-zerodev/utils.d.ts +2 -0
- package/dist/esm/kernel-zerodev/utils.js +8 -0
- package/dist/esm/kernel-zerodev/utils.js.map +1 -1
- package/dist/esm/kernel-zerodev/validator/base.d.ts +6 -3
- package/dist/esm/kernel-zerodev/validator/base.js +20 -3
- package/dist/esm/kernel-zerodev/validator/base.js.map +1 -1
- package/dist/esm/kernel-zerodev/validator/erc165-session-key-validator.d.ts +1 -0
- package/dist/esm/kernel-zerodev/validator/erc165-session-key-validator.js +13 -2
- package/dist/esm/kernel-zerodev/validator/erc165-session-key-validator.js.map +1 -1
- package/dist/esm/kernel-zerodev/validator/index.d.ts +2 -1
- package/dist/esm/kernel-zerodev/validator/index.js +3 -1
- package/dist/esm/kernel-zerodev/validator/index.js.map +1 -1
- package/dist/esm/kernel-zerodev/validator/kill-switch-validator.js +2 -1
- package/dist/esm/kernel-zerodev/validator/kill-switch-validator.js.map +1 -1
- package/dist/esm/kernel-zerodev/validator/session-key-validator.d.ts +65 -0
- package/dist/esm/kernel-zerodev/validator/session-key-validator.js +341 -0
- package/dist/esm/kernel-zerodev/validator/session-key-validator.js.map +1 -0
- package/dist/esm/kernel-zerodev/validator/types.d.ts +5 -1
- package/dist/esm/kernel-zerodev/validator/types.js.map +1 -1
- package/dist/esm/kernel-zerodev/validator-provider/base.d.ts +5 -4
- package/dist/esm/kernel-zerodev/validator-provider/base.js +17 -2
- package/dist/esm/kernel-zerodev/validator-provider/base.js.map +1 -1
- package/dist/esm/kernel-zerodev/validator-provider/ecdsa-provider.d.ts +2 -2
- package/dist/esm/kernel-zerodev/validator-provider/ecdsa-provider.js.map +1 -1
- package/dist/esm/kernel-zerodev/validator-provider/erc165-session-key-provider.d.ts +2 -2
- package/dist/esm/kernel-zerodev/validator-provider/erc165-session-key-provider.js.map +1 -1
- package/dist/esm/kernel-zerodev/validator-provider/index.d.ts +2 -1
- package/dist/esm/kernel-zerodev/validator-provider/index.js +3 -1
- package/dist/esm/kernel-zerodev/validator-provider/index.js.map +1 -1
- package/dist/esm/kernel-zerodev/validator-provider/kill-switch-provider.d.ts +2 -2
- package/dist/esm/kernel-zerodev/validator-provider/kill-switch-provider.js.map +1 -1
- package/dist/esm/kernel-zerodev/validator-provider/session-key-provider.d.ts +18 -0
- package/dist/esm/kernel-zerodev/validator-provider/session-key-provider.js +110 -0
- package/dist/esm/kernel-zerodev/validator-provider/session-key-provider.js.map +1 -0
- package/dist/esm/kernel-zerodev/validator-provider/types.d.ts +5 -0
- package/dist/esm/kernel-zerodev/validator-provider/types.js.map +1 -1
- package/dist/types/index.d.ts +3 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/abis/ESCDAValidatorAbi.d.ts +2 -2
- package/dist/types/kernel-zerodev/abis/KernelAccountAbi.d.ts +3 -3
- package/dist/types/kernel-zerodev/abis/SessionKeyValidatorAbi.d.ts +159 -0
- package/dist/types/kernel-zerodev/abis/SessionKeyValidatorAbi.d.ts.map +1 -0
- package/dist/types/kernel-zerodev/abis/Test_ERC20Abi.d.ts +237 -39
- package/dist/types/kernel-zerodev/abis/Test_ERC20Abi.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/account.d.ts +13 -4
- package/dist/types/kernel-zerodev/account.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/constants.d.ts +3 -1
- package/dist/types/kernel-zerodev/constants.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/ethers-provider/account-signer.d.ts +1 -1
- package/dist/types/kernel-zerodev/ethers-provider/account-signer.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/ethers-provider/ethers-provider.d.ts +4 -3
- package/dist/types/kernel-zerodev/ethers-provider/ethers-provider.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/middleware/paymaster.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/paymaster/base.d.ts +3 -2
- package/dist/types/kernel-zerodev/paymaster/base.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/paymaster/token-paymaster.d.ts +1 -1
- package/dist/types/kernel-zerodev/paymaster/token-paymaster.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/paymaster/verifying-paymaster.d.ts +1 -1
- package/dist/types/kernel-zerodev/paymaster/verifying-paymaster.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/provider.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/signer/empty-account.d.ts +11 -0
- package/dist/types/kernel-zerodev/signer/empty-account.d.ts.map +1 -0
- package/dist/types/kernel-zerodev/utils.d.ts +2 -0
- package/dist/types/kernel-zerodev/utils.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/validator/base.d.ts +6 -3
- package/dist/types/kernel-zerodev/validator/base.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/validator/erc165-session-key-validator.d.ts +1 -0
- package/dist/types/kernel-zerodev/validator/erc165-session-key-validator.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/validator/index.d.ts +2 -1
- package/dist/types/kernel-zerodev/validator/index.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/validator/kill-switch-validator.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/validator/session-key-validator.d.ts +66 -0
- package/dist/types/kernel-zerodev/validator/session-key-validator.d.ts.map +1 -0
- package/dist/types/kernel-zerodev/validator/types.d.ts +5 -1
- package/dist/types/kernel-zerodev/validator/types.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/validator-provider/base.d.ts +5 -4
- package/dist/types/kernel-zerodev/validator-provider/base.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/validator-provider/ecdsa-provider.d.ts +2 -2
- package/dist/types/kernel-zerodev/validator-provider/ecdsa-provider.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/validator-provider/erc165-session-key-provider.d.ts +2 -2
- package/dist/types/kernel-zerodev/validator-provider/erc165-session-key-provider.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/validator-provider/index.d.ts +2 -1
- package/dist/types/kernel-zerodev/validator-provider/index.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/validator-provider/kill-switch-provider.d.ts +2 -2
- package/dist/types/kernel-zerodev/validator-provider/kill-switch-provider.d.ts.map +1 -1
- package/dist/types/kernel-zerodev/validator-provider/session-key-provider.d.ts +19 -0
- package/dist/types/kernel-zerodev/validator-provider/session-key-provider.d.ts.map +1 -0
- package/dist/types/kernel-zerodev/validator-provider/types.d.ts +5 -0
- package/dist/types/kernel-zerodev/validator-provider/types.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/index.ts +3 -4
- package/src/kernel-zerodev/abis/ESCDAValidatorAbi.ts +2 -2
- package/src/kernel-zerodev/abis/KernelAccountAbi.ts +3 -3
- package/src/kernel-zerodev/abis/SessionKeyValidatorAbi.ts +206 -0
- package/src/kernel-zerodev/abis/Test_ERC20Abi.ts +1 -1
- package/src/kernel-zerodev/account.ts +58 -50
- package/src/kernel-zerodev/constants.ts +4 -1
- package/src/kernel-zerodev/ethers-provider/account-signer.ts +3 -3
- package/src/kernel-zerodev/ethers-provider/ethers-provider.ts +25 -7
- package/src/kernel-zerodev/middleware/paymaster.ts +2 -1
- package/src/kernel-zerodev/paymaster/base.ts +5 -1
- package/src/kernel-zerodev/paymaster/token-paymaster.ts +3 -1
- package/src/kernel-zerodev/paymaster/verifying-paymaster.ts +3 -1
- package/src/kernel-zerodev/provider.ts +27 -23
- package/src/kernel-zerodev/signer/empty-account.ts +27 -0
- package/src/kernel-zerodev/utils.ts +10 -0
- package/src/kernel-zerodev/validator/base.ts +32 -6
- package/src/kernel-zerodev/validator/erc165-session-key-validator.ts +20 -1
- package/src/kernel-zerodev/validator/index.ts +8 -1
- package/src/kernel-zerodev/validator/kill-switch-validator.ts +6 -1
- package/src/kernel-zerodev/validator/session-key-validator.ts +483 -0
- package/src/kernel-zerodev/validator/types.ts +14 -1
- package/src/kernel-zerodev/validator-provider/base.ts +24 -13
- package/src/kernel-zerodev/validator-provider/ecdsa-provider.ts +4 -1
- package/src/kernel-zerodev/validator-provider/erc165-session-key-provider.ts +4 -1
- package/src/kernel-zerodev/validator-provider/index.ts +8 -1
- package/src/kernel-zerodev/validator-provider/kill-switch-provider.ts +4 -1
- package/src/kernel-zerodev/validator-provider/session-key-provider.ts +151 -0
- package/src/kernel-zerodev/validator-provider/types.ts +10 -0
|
@@ -1,39 +1,237 @@
|
|
|
1
|
-
export declare const TEST_ERC20Abi:
|
|
2
|
-
inputs: {
|
|
3
|
-
internalType:
|
|
4
|
-
name:
|
|
5
|
-
type:
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
internalType:
|
|
27
|
-
name:
|
|
28
|
-
type:
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
anonymous
|
|
39
|
-
|
|
1
|
+
export declare const TEST_ERC20Abi: readonly [{
|
|
2
|
+
readonly inputs: readonly [{
|
|
3
|
+
readonly internalType: "uint8";
|
|
4
|
+
readonly name: "_decimals";
|
|
5
|
+
readonly type: "uint8";
|
|
6
|
+
}, {
|
|
7
|
+
readonly internalType: "string";
|
|
8
|
+
readonly name: "_name";
|
|
9
|
+
readonly type: "string";
|
|
10
|
+
}, {
|
|
11
|
+
readonly internalType: "string";
|
|
12
|
+
readonly name: "_symbol";
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
}];
|
|
15
|
+
readonly stateMutability: "nonpayable";
|
|
16
|
+
readonly type: "constructor";
|
|
17
|
+
}, {
|
|
18
|
+
readonly anonymous: false;
|
|
19
|
+
readonly inputs: readonly [{
|
|
20
|
+
readonly indexed: true;
|
|
21
|
+
readonly internalType: "address";
|
|
22
|
+
readonly name: "owner";
|
|
23
|
+
readonly type: "address";
|
|
24
|
+
}, {
|
|
25
|
+
readonly indexed: true;
|
|
26
|
+
readonly internalType: "address";
|
|
27
|
+
readonly name: "spender";
|
|
28
|
+
readonly type: "address";
|
|
29
|
+
}, {
|
|
30
|
+
readonly indexed: false;
|
|
31
|
+
readonly internalType: "uint256";
|
|
32
|
+
readonly name: "value";
|
|
33
|
+
readonly type: "uint256";
|
|
34
|
+
}];
|
|
35
|
+
readonly name: "Approval";
|
|
36
|
+
readonly type: "event";
|
|
37
|
+
}, {
|
|
38
|
+
readonly anonymous: false;
|
|
39
|
+
readonly inputs: readonly [{
|
|
40
|
+
readonly indexed: true;
|
|
41
|
+
readonly internalType: "address";
|
|
42
|
+
readonly name: "from";
|
|
43
|
+
readonly type: "address";
|
|
44
|
+
}, {
|
|
45
|
+
readonly indexed: true;
|
|
46
|
+
readonly internalType: "address";
|
|
47
|
+
readonly name: "to";
|
|
48
|
+
readonly type: "address";
|
|
49
|
+
}, {
|
|
50
|
+
readonly indexed: false;
|
|
51
|
+
readonly internalType: "uint256";
|
|
52
|
+
readonly name: "value";
|
|
53
|
+
readonly type: "uint256";
|
|
54
|
+
}];
|
|
55
|
+
readonly name: "Transfer";
|
|
56
|
+
readonly type: "event";
|
|
57
|
+
}, {
|
|
58
|
+
readonly inputs: readonly [{
|
|
59
|
+
readonly internalType: "address";
|
|
60
|
+
readonly name: "owner";
|
|
61
|
+
readonly type: "address";
|
|
62
|
+
}, {
|
|
63
|
+
readonly internalType: "address";
|
|
64
|
+
readonly name: "spender";
|
|
65
|
+
readonly type: "address";
|
|
66
|
+
}];
|
|
67
|
+
readonly name: "allowance";
|
|
68
|
+
readonly outputs: readonly [{
|
|
69
|
+
readonly internalType: "uint256";
|
|
70
|
+
readonly name: "";
|
|
71
|
+
readonly type: "uint256";
|
|
72
|
+
}];
|
|
73
|
+
readonly stateMutability: "view";
|
|
74
|
+
readonly type: "function";
|
|
75
|
+
}, {
|
|
76
|
+
readonly inputs: readonly [{
|
|
77
|
+
readonly internalType: "address";
|
|
78
|
+
readonly name: "spender";
|
|
79
|
+
readonly type: "address";
|
|
80
|
+
}, {
|
|
81
|
+
readonly internalType: "uint256";
|
|
82
|
+
readonly name: "amount";
|
|
83
|
+
readonly type: "uint256";
|
|
84
|
+
}];
|
|
85
|
+
readonly name: "approve";
|
|
86
|
+
readonly outputs: readonly [{
|
|
87
|
+
readonly internalType: "bool";
|
|
88
|
+
readonly name: "";
|
|
89
|
+
readonly type: "bool";
|
|
90
|
+
}];
|
|
91
|
+
readonly stateMutability: "nonpayable";
|
|
92
|
+
readonly type: "function";
|
|
93
|
+
}, {
|
|
94
|
+
readonly inputs: readonly [{
|
|
95
|
+
readonly internalType: "address";
|
|
96
|
+
readonly name: "account";
|
|
97
|
+
readonly type: "address";
|
|
98
|
+
}];
|
|
99
|
+
readonly name: "balanceOf";
|
|
100
|
+
readonly outputs: readonly [{
|
|
101
|
+
readonly internalType: "uint256";
|
|
102
|
+
readonly name: "";
|
|
103
|
+
readonly type: "uint256";
|
|
104
|
+
}];
|
|
105
|
+
readonly stateMutability: "view";
|
|
106
|
+
readonly type: "function";
|
|
107
|
+
}, {
|
|
108
|
+
readonly inputs: readonly [];
|
|
109
|
+
readonly name: "decimals";
|
|
110
|
+
readonly outputs: readonly [{
|
|
111
|
+
readonly internalType: "uint8";
|
|
112
|
+
readonly name: "";
|
|
113
|
+
readonly type: "uint8";
|
|
114
|
+
}];
|
|
115
|
+
readonly stateMutability: "view";
|
|
116
|
+
readonly type: "function";
|
|
117
|
+
}, {
|
|
118
|
+
readonly inputs: readonly [{
|
|
119
|
+
readonly internalType: "address";
|
|
120
|
+
readonly name: "spender";
|
|
121
|
+
readonly type: "address";
|
|
122
|
+
}, {
|
|
123
|
+
readonly internalType: "uint256";
|
|
124
|
+
readonly name: "subtractedValue";
|
|
125
|
+
readonly type: "uint256";
|
|
126
|
+
}];
|
|
127
|
+
readonly name: "decreaseAllowance";
|
|
128
|
+
readonly outputs: readonly [{
|
|
129
|
+
readonly internalType: "bool";
|
|
130
|
+
readonly name: "";
|
|
131
|
+
readonly type: "bool";
|
|
132
|
+
}];
|
|
133
|
+
readonly stateMutability: "nonpayable";
|
|
134
|
+
readonly type: "function";
|
|
135
|
+
}, {
|
|
136
|
+
readonly inputs: readonly [{
|
|
137
|
+
readonly internalType: "address";
|
|
138
|
+
readonly name: "spender";
|
|
139
|
+
readonly type: "address";
|
|
140
|
+
}, {
|
|
141
|
+
readonly internalType: "uint256";
|
|
142
|
+
readonly name: "addedValue";
|
|
143
|
+
readonly type: "uint256";
|
|
144
|
+
}];
|
|
145
|
+
readonly name: "increaseAllowance";
|
|
146
|
+
readonly outputs: readonly [{
|
|
147
|
+
readonly internalType: "bool";
|
|
148
|
+
readonly name: "";
|
|
149
|
+
readonly type: "bool";
|
|
150
|
+
}];
|
|
151
|
+
readonly stateMutability: "nonpayable";
|
|
152
|
+
readonly type: "function";
|
|
153
|
+
}, {
|
|
154
|
+
readonly inputs: readonly [{
|
|
155
|
+
readonly internalType: "address";
|
|
156
|
+
readonly name: "to";
|
|
157
|
+
readonly type: "address";
|
|
158
|
+
}, {
|
|
159
|
+
readonly internalType: "uint256";
|
|
160
|
+
readonly name: "amount";
|
|
161
|
+
readonly type: "uint256";
|
|
162
|
+
}];
|
|
163
|
+
readonly name: "mint";
|
|
164
|
+
readonly outputs: readonly [];
|
|
165
|
+
readonly stateMutability: "nonpayable";
|
|
166
|
+
readonly type: "function";
|
|
167
|
+
}, {
|
|
168
|
+
readonly inputs: readonly [];
|
|
169
|
+
readonly name: "name";
|
|
170
|
+
readonly outputs: readonly [{
|
|
171
|
+
readonly internalType: "string";
|
|
172
|
+
readonly name: "";
|
|
173
|
+
readonly type: "string";
|
|
174
|
+
}];
|
|
175
|
+
readonly stateMutability: "view";
|
|
176
|
+
readonly type: "function";
|
|
177
|
+
}, {
|
|
178
|
+
readonly inputs: readonly [];
|
|
179
|
+
readonly name: "symbol";
|
|
180
|
+
readonly outputs: readonly [{
|
|
181
|
+
readonly internalType: "string";
|
|
182
|
+
readonly name: "";
|
|
183
|
+
readonly type: "string";
|
|
184
|
+
}];
|
|
185
|
+
readonly stateMutability: "view";
|
|
186
|
+
readonly type: "function";
|
|
187
|
+
}, {
|
|
188
|
+
readonly inputs: readonly [];
|
|
189
|
+
readonly name: "totalSupply";
|
|
190
|
+
readonly outputs: readonly [{
|
|
191
|
+
readonly internalType: "uint256";
|
|
192
|
+
readonly name: "";
|
|
193
|
+
readonly type: "uint256";
|
|
194
|
+
}];
|
|
195
|
+
readonly stateMutability: "view";
|
|
196
|
+
readonly type: "function";
|
|
197
|
+
}, {
|
|
198
|
+
readonly inputs: readonly [{
|
|
199
|
+
readonly internalType: "address";
|
|
200
|
+
readonly name: "to";
|
|
201
|
+
readonly type: "address";
|
|
202
|
+
}, {
|
|
203
|
+
readonly internalType: "uint256";
|
|
204
|
+
readonly name: "amount";
|
|
205
|
+
readonly type: "uint256";
|
|
206
|
+
}];
|
|
207
|
+
readonly name: "transfer";
|
|
208
|
+
readonly outputs: readonly [{
|
|
209
|
+
readonly internalType: "bool";
|
|
210
|
+
readonly name: "";
|
|
211
|
+
readonly type: "bool";
|
|
212
|
+
}];
|
|
213
|
+
readonly stateMutability: "nonpayable";
|
|
214
|
+
readonly type: "function";
|
|
215
|
+
}, {
|
|
216
|
+
readonly inputs: readonly [{
|
|
217
|
+
readonly internalType: "address";
|
|
218
|
+
readonly name: "from";
|
|
219
|
+
readonly type: "address";
|
|
220
|
+
}, {
|
|
221
|
+
readonly internalType: "address";
|
|
222
|
+
readonly name: "to";
|
|
223
|
+
readonly type: "address";
|
|
224
|
+
}, {
|
|
225
|
+
readonly internalType: "uint256";
|
|
226
|
+
readonly name: "amount";
|
|
227
|
+
readonly type: "uint256";
|
|
228
|
+
}];
|
|
229
|
+
readonly name: "transferFrom";
|
|
230
|
+
readonly outputs: readonly [{
|
|
231
|
+
readonly internalType: "bool";
|
|
232
|
+
readonly name: "";
|
|
233
|
+
readonly type: "bool";
|
|
234
|
+
}];
|
|
235
|
+
readonly stateMutability: "nonpayable";
|
|
236
|
+
readonly type: "function";
|
|
237
|
+
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Test_ERC20Abi.js","sourceRoot":"","sources":["../../../../src/kernel-zerodev/abis/Test_ERC20Abi.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE;YAC3D,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;SAC5D;QACD,eAAe,EAAE,YAAY;QAC7B,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;g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imals\", type: \"uint8\" },\n { internalType: \"string\", name: \"_name\", type: \"string\" },\n { internalType: \"string\", name: \"_symbol\", type: \"string\" },\n ],\n stateMutability: \"nonpayable\",\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 { internalType: \"address\", name: \"to\", type: \"address\" },\n { internalType: \"uint256\", name: \"amount\", type: \"uint256\" },\n ],\n name: \"mint\",\n outputs: [],\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: \"to\", 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: \"from\", type: \"address\" },\n { internalType: \"address\", name: \"to\", 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,28 +1,37 @@
|
|
|
1
1
|
import type { Address } from "abitype";
|
|
2
2
|
import { type FallbackTransport, type Hex, type Transport } from "viem";
|
|
3
3
|
import { KernelBaseValidator } from "./validator/base.js";
|
|
4
|
-
import { type BaseSmartAccountParams, BaseSmartContractAccount, type
|
|
4
|
+
import { type BaseSmartAccountParams, BaseSmartContractAccount, type BatchUserOperationCallData, type UserOperationRequest, type SignTypedDataParams } from "@alchemy/aa-core";
|
|
5
5
|
import type { PaymasterAndBundlerProviders } from "./paymaster/types.js";
|
|
6
|
+
export declare enum DeploymentState {
|
|
7
|
+
UNDEFINED = "0x0",
|
|
8
|
+
NOT_DEPLOYED = "0x1",
|
|
9
|
+
DEPLOYED = "0x2"
|
|
10
|
+
}
|
|
6
11
|
export interface KernelSmartAccountParams<TTransport extends Transport | FallbackTransport = Transport> extends Partial<BaseSmartAccountParams<TTransport>> {
|
|
7
12
|
projectId: string;
|
|
8
|
-
owner: SmartAccountSigner;
|
|
9
13
|
factoryAddress?: Address;
|
|
10
14
|
index?: bigint;
|
|
11
15
|
validator?: KernelBaseValidator;
|
|
12
16
|
bundlerProvider?: PaymasterAndBundlerProviders;
|
|
17
|
+
defaultValidator?: KernelBaseValidator;
|
|
18
|
+
initCode?: Hex;
|
|
13
19
|
}
|
|
14
20
|
export declare function isKernelAccount(account: any): account is KernelSmartContractAccount;
|
|
15
21
|
export declare class KernelSmartContractAccount<TTransport extends Transport | FallbackTransport = Transport> extends BaseSmartContractAccount<TTransport> {
|
|
16
|
-
private owner;
|
|
17
22
|
private readonly factoryAddress;
|
|
18
23
|
private readonly index;
|
|
24
|
+
private initCode?;
|
|
19
25
|
validator?: KernelBaseValidator;
|
|
26
|
+
defaultValidator?: KernelBaseValidator;
|
|
20
27
|
constructor(params: KernelSmartAccountParams);
|
|
21
28
|
static init(params: KernelSmartAccountParams): Promise<KernelSmartContractAccount>;
|
|
22
29
|
connectValidator(validator: KernelBaseValidator): this;
|
|
23
30
|
getValidator(): KernelBaseValidator;
|
|
24
31
|
getDummySignature(): Hex;
|
|
25
|
-
|
|
32
|
+
getInitCode(): Promise<Hex>;
|
|
33
|
+
getIndex(): bigint;
|
|
34
|
+
approvePlugin(): Promise<void>;
|
|
26
35
|
encodeExecute(target: Hex, value: bigint, data: Hex): Promise<Hex>;
|
|
27
36
|
encodeBatchExecute(_txs: BatchUserOperationCallData): Promise<`0x${string}`>;
|
|
28
37
|
encodeExecuteDelegate(target: Hex, value: bigint, data: Hex): Promise<Hex>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { concatHex, encodeAbiParameters, encodeFunctionData, hashMessage, toBytes,
|
|
1
|
+
import { concatHex, encodeAbiParameters, encodeFunctionData, hashMessage, toBytes, } from "viem";
|
|
2
2
|
import { parseAbiParameters } from "abitype";
|
|
3
|
-
import { KernelBaseValidator
|
|
3
|
+
import { KernelBaseValidator } from "./validator/base.js";
|
|
4
4
|
import { KernelAccountAbi } from "./abis/KernelAccountAbi.js";
|
|
5
5
|
import { KernelFactoryAbi } from "./abis/KernelFactoryAbi.js";
|
|
6
6
|
import { BaseSmartContractAccount, defineReadOnly, getChain, } from "@alchemy/aa-core";
|
|
@@ -10,6 +10,12 @@ import { MultiSendAbi } from "./abis/MultiSendAbi.js";
|
|
|
10
10
|
import { polygonMumbai } from "viem/chains";
|
|
11
11
|
import { getChainId } from "./api/index.js";
|
|
12
12
|
import { createZeroDevPublicErc4337Client } from "./client/create-client.js";
|
|
13
|
+
export var DeploymentState;
|
|
14
|
+
(function (DeploymentState) {
|
|
15
|
+
DeploymentState["UNDEFINED"] = "0x0";
|
|
16
|
+
DeploymentState["NOT_DEPLOYED"] = "0x1";
|
|
17
|
+
DeploymentState["DEPLOYED"] = "0x2";
|
|
18
|
+
})(DeploymentState || (DeploymentState = {}));
|
|
13
19
|
export function isKernelAccount(account) {
|
|
14
20
|
return account && account.connectValidator !== undefined;
|
|
15
21
|
}
|
|
@@ -21,19 +27,19 @@ export class KernelSmartContractAccount extends BaseSmartContractAccount {
|
|
|
21
27
|
chain: params.chain ?? polygonMumbai,
|
|
22
28
|
rpcClient: params.rpcClient ?? BUNDLER_URL,
|
|
23
29
|
});
|
|
24
|
-
Object.defineProperty(this, "
|
|
30
|
+
Object.defineProperty(this, "factoryAddress", {
|
|
25
31
|
enumerable: true,
|
|
26
32
|
configurable: true,
|
|
27
33
|
writable: true,
|
|
28
34
|
value: void 0
|
|
29
35
|
});
|
|
30
|
-
Object.defineProperty(this, "
|
|
36
|
+
Object.defineProperty(this, "index", {
|
|
31
37
|
enumerable: true,
|
|
32
38
|
configurable: true,
|
|
33
39
|
writable: true,
|
|
34
40
|
value: void 0
|
|
35
41
|
});
|
|
36
|
-
Object.defineProperty(this, "
|
|
42
|
+
Object.defineProperty(this, "initCode", {
|
|
37
43
|
enumerable: true,
|
|
38
44
|
configurable: true,
|
|
39
45
|
writable: true,
|
|
@@ -45,10 +51,17 @@ export class KernelSmartContractAccount extends BaseSmartContractAccount {
|
|
|
45
51
|
writable: true,
|
|
46
52
|
value: void 0
|
|
47
53
|
});
|
|
54
|
+
Object.defineProperty(this, "defaultValidator", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
configurable: true,
|
|
57
|
+
writable: true,
|
|
58
|
+
value: void 0
|
|
59
|
+
});
|
|
48
60
|
this.index = params.index ?? 0n;
|
|
49
|
-
this.owner = params.owner;
|
|
50
61
|
this.factoryAddress = params.factoryAddress ?? KERNEL_FACTORY_ADDRESS;
|
|
51
62
|
this.validator = params.validator;
|
|
63
|
+
this.defaultValidator = params.defaultValidator;
|
|
64
|
+
this.initCode = params.initCode;
|
|
52
65
|
}
|
|
53
66
|
static async init(params) {
|
|
54
67
|
const chainId = await getChainId(params.projectId);
|
|
@@ -84,40 +97,39 @@ export class KernelSmartContractAccount extends BaseSmartContractAccount {
|
|
|
84
97
|
getDummySignature() {
|
|
85
98
|
return "0x00000000870fe151d548a1c527c3804866fab30abf28ed17b79d5fc5149f19ca0819fefc3c57f3da4fdf9b10fab3f2f3dca536467ae44943b9dbb8433efe7760ddd72aaa1c";
|
|
86
99
|
}
|
|
87
|
-
async
|
|
100
|
+
async getInitCode() {
|
|
101
|
+
if (this.deploymentState === DeploymentState.DEPLOYED) {
|
|
102
|
+
return "0x";
|
|
103
|
+
}
|
|
104
|
+
const contractCode = await this.rpcProvider.getContractCode(await this.getAddress());
|
|
105
|
+
if ((contractCode?.length ?? 0) > 2) {
|
|
106
|
+
this.deploymentState = DeploymentState.DEPLOYED;
|
|
107
|
+
return "0x";
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
this.deploymentState = DeploymentState.NOT_DEPLOYED;
|
|
111
|
+
}
|
|
112
|
+
return this.initCode ?? this.getAccountInitCode();
|
|
113
|
+
}
|
|
114
|
+
getIndex() {
|
|
115
|
+
return this.index;
|
|
116
|
+
}
|
|
117
|
+
async approvePlugin() {
|
|
88
118
|
if (!this.validator) {
|
|
89
119
|
throw new Error("Validator not connected");
|
|
90
120
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const enableSigLength = 65;
|
|
97
|
-
const staticDummySig = concatHex([
|
|
98
|
-
"0x000000000000000000000000",
|
|
99
|
-
this.validator.getAddress(),
|
|
100
|
-
"0x53dd285022D1512635823952d109dB39467a457E",
|
|
101
|
-
]);
|
|
102
|
-
const pausedUntil = await this.validator.getPausedUntil();
|
|
103
|
-
return concatHex([
|
|
104
|
-
ValidatorMode.enable,
|
|
105
|
-
staticDummySig,
|
|
106
|
-
pad(toHex(enableDataLength), { size: 32 }),
|
|
107
|
-
enableData,
|
|
108
|
-
pad(toHex(enableSigLength), { size: 32 }),
|
|
109
|
-
dummyECDSASig,
|
|
110
|
-
pad(toHex(pausedUntil), { size: 6 }),
|
|
111
|
-
dummyECDSASig,
|
|
112
|
-
]);
|
|
113
|
-
}
|
|
114
|
-
return concatHex([validatorMode, dummyECDSASig]);
|
|
121
|
+
if (this.defaultValidator && !this.validator.getEnableSignature()) {
|
|
122
|
+
const { executor, selector, validAfter, validUntil } = this.validator.getPluginValidatorData();
|
|
123
|
+
const enableSig = await this.defaultValidator.approveExecutor(await this.getAddress(), selector, executor, validUntil, validAfter, this.validator);
|
|
124
|
+
this.validator.setEnableSignature(enableSig);
|
|
125
|
+
}
|
|
115
126
|
}
|
|
116
127
|
async encodeExecute(target, value, data) {
|
|
117
128
|
if (!this.validator) {
|
|
118
129
|
throw new Error("Validator not connected");
|
|
119
130
|
}
|
|
120
|
-
if (target.toLowerCase() === this.
|
|
131
|
+
if (target.toLowerCase() === (await this.getAddress()).toLowerCase() &&
|
|
132
|
+
this.validator.shouldDelegateViaFallback()) {
|
|
121
133
|
return data;
|
|
122
134
|
}
|
|
123
135
|
else {
|
|
@@ -137,8 +149,11 @@ export class KernelSmartContractAccount extends BaseSmartContractAccount {
|
|
|
137
149
|
}
|
|
138
150
|
async signWithEip6492(msg) {
|
|
139
151
|
try {
|
|
152
|
+
if (!this.validator) {
|
|
153
|
+
throw new Error("Validator not connected");
|
|
154
|
+
}
|
|
140
155
|
const formattedMessage = typeof msg === "string" ? toBytes(msg) : msg;
|
|
141
|
-
let sig = await this.
|
|
156
|
+
let sig = await this.validator.signMessage(toBytes(hashMessage({ raw: formattedMessage })));
|
|
142
157
|
if (!(await this.isAccountDeployed())) {
|
|
143
158
|
sig = (encodeAbiParameters(parseAbiParameters("address, bytes, bytes"), [this.factoryAddress, await this.getFactoryInitCode(), sig]) +
|
|
144
159
|
"6492649264926492649264926492649264926492649264926492649264926492");
|
|
@@ -180,7 +195,8 @@ export class KernelSmartContractAccount extends BaseSmartContractAccount {
|
|
|
180
195
|
return concatHex([this.factoryAddress, await this.getFactoryInitCode()]);
|
|
181
196
|
}
|
|
182
197
|
async getFactoryInitCode() {
|
|
183
|
-
|
|
198
|
+
const validator = this.defaultValidator ?? this.validator;
|
|
199
|
+
if (!validator) {
|
|
184
200
|
throw new Error("Validator not connected");
|
|
185
201
|
}
|
|
186
202
|
try {
|
|
@@ -192,10 +208,7 @@ export class KernelSmartContractAccount extends BaseSmartContractAccount {
|
|
|
192
208
|
encodeFunctionData({
|
|
193
209
|
abi: KernelAccountAbi,
|
|
194
210
|
functionName: "initialize",
|
|
195
|
-
args: [
|
|
196
|
-
this.validator.getAddress(),
|
|
197
|
-
await this.validator.getEnableData(),
|
|
198
|
-
],
|
|
211
|
+
args: [validator.getAddress(), await validator.getEnableData()],
|
|
199
212
|
}),
|
|
200
213
|
this.index,
|
|
201
214
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/kernel-zerodev/account.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EAElB,WAAW,EAEX,OAAO,EAEP,GAAG,EACH,KAAK,GACN,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAEL,wBAAwB,EAIxB,cAAc,EACd,QAAQ,GAET,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,GACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAe7E,MAAM,UAAU,eAAe,CAC7B,OAAY;IAEZ,OAAO,OAAO,IAAI,OAAO,CAAC,gBAAgB,KAAK,SAAS,CAAC;AAC3D,CAAC;AAED,MAAM,OAAO,0BAEX,SAAQ,w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C,OAAO,CAAC,CAAC;YAC5C,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;SACnD;IACH,CAAC;CACF","sourcesContent":["import type { Address } from \"abitype\";\nimport {\n concatHex,\n encodeAbiParameters,\n encodeFunctionData,\n type FallbackTransport,\n hashMessage,\n type Hex,\n toBytes,\n type Transport,\n pad,\n toHex,\n} from \"viem\";\nimport { parseAbiParameters } from \"abitype\";\nimport { KernelBaseValidator, ValidatorMode } from \"./validator/base.js\";\nimport { KernelAccountAbi } from \"./abis/KernelAccountAbi.js\";\nimport { KernelFactoryAbi } from \"./abis/KernelFactoryAbi.js\";\nimport {\n type BaseSmartAccountParams,\n BaseSmartContractAccount,\n type SmartAccountSigner,\n type BatchUserOperationCallData,\n type UserOperationRequest,\n defineReadOnly,\n getChain,\n type SignTypedDataParams,\n} from \"@alchemy/aa-core\";\nimport {\n BUNDLER_URL,\n ENTRYPOINT_ADDRESS,\n KERNEL_FACTORY_ADDRESS,\n KERNEL_IMPL_ADDRESS,\n MULTISEND_ADDR,\n} from \"./constants.js\";\nimport { encodeMultiSend } from \"./utils.js\";\nimport { MultiSendAbi } from \"./abis/MultiSendAbi.js\";\nimport { polygonMumbai } from \"viem/chains\";\nimport { getChainId } from \"./api/index.js\";\nimport { createZeroDevPublicErc4337Client } from \"./client/create-client.js\";\nimport type { PaymasterAndBundlerProviders } from \"./paymaster/types.js\";\nimport type { KillSwitchValidator } from \"./validator/kill-switch-validator.js\";\n\nexport interface KernelSmartAccountParams<\n TTransport extends Transport | FallbackTransport = Transport\n> extends Partial<BaseSmartAccountParams<TTransport>> {\n projectId: string;\n owner: SmartAccountSigner;\n factoryAddress?: Address;\n index?: bigint;\n validator?: KernelBaseValidator;\n bundlerProvider?: PaymasterAndBundlerProviders;\n}\n\nexport function isKernelAccount(\n account: any\n): account is KernelSmartContractAccount {\n return account && account.connectValidator !== undefined;\n}\n\nexport class KernelSmartContractAccount<\n TTransport extends Transport | FallbackTransport = Transport\n> extends BaseSmartContractAccount<TTransport> {\n private owner: SmartAccountSigner;\n private readonly factoryAddress: Address;\n private readonly index: bigint;\n validator?: KernelBaseValidator;\n\n constructor(params: KernelSmartAccountParams) {\n super({\n ...params,\n entryPointAddress: params.entryPointAddress ?? ENTRYPOINT_ADDRESS,\n chain: params.chain ?? polygonMumbai,\n rpcClient: params.rpcClient ?? BUNDLER_URL,\n });\n this.index = params.index ?? 0n;\n this.owner = params.owner;\n this.factoryAddress = params.factoryAddress ?? KERNEL_FACTORY_ADDRESS;\n this.validator = params.validator;\n }\n\n public static async init(\n params: KernelSmartAccountParams\n ): Promise<KernelSmartContractAccount> {\n const chainId = await getChainId(params.projectId);\n if (!chainId) {\n throw new Error(\"ChainId not found\");\n }\n const chain = getChain(chainId);\n const rpcClient =\n typeof params.rpcClient === \"string\"\n ? createZeroDevPublicErc4337Client({\n chain,\n rpcUrl: params.rpcClient ?? BUNDLER_URL,\n projectId: params.projectId,\n bundlerProvider: params.bundlerProvider,\n })\n : params.rpcClient;\n const instance = new KernelSmartContractAccount({\n ...params,\n chain,\n rpcClient,\n });\n return instance;\n }\n\n connectValidator(validator: KernelBaseValidator): this {\n defineReadOnly(this, \"validator\", validator);\n return this;\n }\n\n getValidator(): KernelBaseValidator {\n if (!this.validator) {\n throw new Error(\"Validator not connected\");\n }\n return this.validator;\n }\n\n getDummySignature(): Hex {\n return \"0x00000000870fe151d548a1c527c3804866fab30abf28ed17b79d5fc5149f19ca0819fefc3c57f3da4fdf9b10fab3f2f3dca536467ae44943b9dbb8433efe7760ddd72aaa1c\";\n }\n\n async getDynamicDummySignature(\n kernelAccountAddress: Address,\n calldata: Hex\n ): Promise<Hex> {\n if (!this.validator) {\n throw new Error(\"Validator not connected\");\n }\n\n const dummyECDSASig =\n \"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c\";\n const validatorMode = await this.validator.resolveValidatorMode(\n kernelAccountAddress,\n calldata\n );\n if (validatorMode === ValidatorMode.enable) {\n const enableData = await this.validator.getEnableData();\n const enableDataLength = enableData.length / 2 - 1;\n const enableSigLength = 65;\n const staticDummySig = concatHex([\n \"0x000000000000000000000000\",\n this.validator.getAddress(),\n \"0x53dd285022D1512635823952d109dB39467a457E\",\n ]);\n const pausedUntil = await (\n this.validator as KillSwitchValidator\n ).getPausedUntil();\n\n return concatHex([\n ValidatorMode.enable,\n staticDummySig,\n pad(toHex(enableDataLength), { size: 32 }),\n enableData,\n pad(toHex(enableSigLength), { size: 32 }),\n dummyECDSASig,\n pad(toHex(pausedUntil), { size: 6 }),\n dummyECDSASig,\n ]);\n }\n return concatHex([validatorMode, dummyECDSASig]);\n }\n\n async encodeExecute(target: Hex, value: bigint, data: Hex): Promise<Hex> {\n if (!this.validator) {\n throw new Error(\"Validator not connected\");\n }\n if (target.toLowerCase() === this.accountAddress?.toLowerCase()) {\n return data;\n } else {\n return this.encodeExecuteAction(target, value, data, 0);\n }\n }\n\n async encodeBatchExecute(\n _txs: BatchUserOperationCallData\n ): Promise<`0x${string}`> {\n const multiSendCalldata = encodeFunctionData({\n abi: MultiSendAbi,\n functionName: \"multiSend\",\n args: [encodeMultiSend(_txs)],\n });\n return await this.encodeExecuteDelegate(\n MULTISEND_ADDR,\n BigInt(0),\n multiSendCalldata\n );\n }\n\n async encodeExecuteDelegate(\n target: Hex,\n value: bigint,\n data: Hex\n ): Promise<Hex> {\n return this.encodeExecuteAction(target, value, data, 1);\n }\n\n async signWithEip6492(msg: string | Uint8Array): Promise<Hex> {\n try {\n const formattedMessage = typeof msg === \"string\" ? toBytes(msg) : msg;\n let sig = await this.owner.signMessage(\n toBytes(hashMessage({ raw: formattedMessage }))\n );\n // If the account is undeployed, use ERC-6492\n if (!(await this.isAccountDeployed())) {\n sig = (encodeAbiParameters(\n parseAbiParameters(\"address, bytes, bytes\"),\n [this.factoryAddress, await this.getFactoryInitCode(), sig]\n ) +\n \"6492649264926492649264926492649264926492649264926492649264926492\") as Hex; // magic suffix\n }\n\n return sig;\n } catch (err: any) {\n console.error(\"Got Error - \", err.message);\n throw new Error(\"Message Signing with EIP6492 failed\");\n }\n }\n\n async signMessage(msg: Uint8Array | string): Promise<Hex> {\n if (!this.validator) {\n throw new Error(\"Validator not connected\");\n }\n const formattedMessage = typeof msg === \"string\" ? toBytes(msg) : msg;\n return await this.validator.signMessage(formattedMessage);\n }\n\n async signTypedData(params: SignTypedDataParams): Promise<Hex> {\n if (!this.validator) {\n throw new Error(\"Validator not connected\");\n }\n return await this.validator.signTypedData(params);\n }\n\n signUserOp(userOp: UserOperationRequest): Promise<Hex> {\n if (!this.validator) {\n throw new Error(\"Validator not connected\");\n }\n return this.validator.signUserOp(userOp);\n }\n\n protected encodeExecuteAction(\n target: Hex,\n value: bigint,\n data: Hex,\n code: number\n ): Hex {\n return encodeFunctionData({\n abi: KernelAccountAbi,\n functionName: \"execute\",\n args: [target, value, data, code],\n });\n }\n protected async getAccountInitCode(): Promise<Hex> {\n return concatHex([this.factoryAddress, await this.getFactoryInitCode()]);\n }\n\n protected async getFactoryInitCode(): Promise<Hex> {\n if (!this.validator) {\n throw new Error(\"Validator not connected\");\n }\n try {\n return encodeFunctionData({\n abi: KernelFactoryAbi,\n functionName: \"createAccount\",\n args: [\n KERNEL_IMPL_ADDRESS,\n encodeFunctionData({\n abi: KernelAccountAbi,\n functionName: \"initialize\",\n args: [\n this.validator.getAddress(),\n await this.validator.getEnableData(),\n ],\n }),\n this.index,\n ],\n });\n } catch (err: any) {\n console.error(\"err occurred:\", err.message);\n throw new Error(\"Factory Code generation failed\");\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/kernel-zerodev/account.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EAElB,WAAW,EAEX,OAAO,GAER,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,kBAAkB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C,gCAAgC,CAAC,CAAC;SACnD;IACH,CAAC;CACF","sourcesContent":["import type { Address } from \"abitype\";\nimport {\n concatHex,\n encodeAbiParameters,\n encodeFunctionData,\n type FallbackTransport,\n hashMessage,\n type Hex,\n toBytes,\n type Transport,\n} from \"viem\";\nimport { parseAbiParameters } from \"abitype\";\nimport { KernelBaseValidator } from \"./validator/base.js\";\nimport { KernelAccountAbi } from \"./abis/KernelAccountAbi.js\";\nimport { KernelFactoryAbi } from \"./abis/KernelFactoryAbi.js\";\nimport {\n type BaseSmartAccountParams,\n BaseSmartContractAccount,\n type BatchUserOperationCallData,\n type UserOperationRequest,\n defineReadOnly,\n getChain,\n type SignTypedDataParams,\n} from \"@alchemy/aa-core\";\nimport {\n BUNDLER_URL,\n ENTRYPOINT_ADDRESS,\n KERNEL_FACTORY_ADDRESS,\n KERNEL_IMPL_ADDRESS,\n MULTISEND_ADDR,\n} from \"./constants.js\";\nimport { encodeMultiSend } from \"./utils.js\";\nimport { MultiSendAbi } from \"./abis/MultiSendAbi.js\";\nimport { polygonMumbai } from \"viem/chains\";\nimport { getChainId } from \"./api/index.js\";\nimport { createZeroDevPublicErc4337Client } from \"./client/create-client.js\";\nimport type { PaymasterAndBundlerProviders } from \"./paymaster/types.js\";\n\nexport enum DeploymentState {\n UNDEFINED = \"0x0\",\n NOT_DEPLOYED = \"0x1\",\n DEPLOYED = \"0x2\",\n}\nexport interface KernelSmartAccountParams<\n TTransport extends Transport | FallbackTransport = Transport\n> extends Partial<BaseSmartAccountParams<TTransport>> {\n projectId: string;\n factoryAddress?: Address;\n index?: bigint;\n validator?: KernelBaseValidator;\n bundlerProvider?: PaymasterAndBundlerProviders;\n defaultValidator?: KernelBaseValidator;\n initCode?: Hex;\n}\n\nexport function isKernelAccount(\n account: any\n): account is KernelSmartContractAccount {\n return account && account.connectValidator !== undefined;\n}\n\nexport class KernelSmartContractAccount<\n TTransport extends Transport | FallbackTransport = Transport\n> extends BaseSmartContractAccount<TTransport> {\n private readonly factoryAddress: Address;\n private readonly index: bigint;\n private initCode?: Hex;\n validator?: KernelBaseValidator;\n defaultValidator?: KernelBaseValidator;\n\n constructor(params: KernelSmartAccountParams) {\n super({\n ...params,\n entryPointAddress: params.entryPointAddress ?? ENTRYPOINT_ADDRESS,\n chain: params.chain ?? polygonMumbai,\n rpcClient: params.rpcClient ?? BUNDLER_URL,\n });\n this.index = params.index ?? 0n;\n this.factoryAddress = params.factoryAddress ?? KERNEL_FACTORY_ADDRESS;\n this.validator = params.validator;\n this.defaultValidator = params.defaultValidator;\n this.initCode = params.initCode;\n }\n\n public static async init(\n params: KernelSmartAccountParams\n ): Promise<KernelSmartContractAccount> {\n const chainId = await getChainId(params.projectId);\n if (!chainId) {\n throw new Error(\"ChainId not found\");\n }\n const chain = getChain(chainId);\n const rpcClient =\n typeof params.rpcClient === \"string\"\n ? createZeroDevPublicErc4337Client({\n chain,\n rpcUrl: params.rpcClient ?? BUNDLER_URL,\n projectId: params.projectId,\n bundlerProvider: params.bundlerProvider,\n })\n : params.rpcClient;\n const instance = new KernelSmartContractAccount({\n ...params,\n chain,\n rpcClient,\n });\n return instance;\n }\n\n connectValidator(validator: KernelBaseValidator): this {\n defineReadOnly(this, \"validator\", validator);\n return this;\n }\n\n getValidator(): KernelBaseValidator {\n if (!this.validator) {\n throw new Error(\"Validator not connected\");\n }\n return this.validator;\n }\n\n getDummySignature(): Hex {\n return \"0x00000000870fe151d548a1c527c3804866fab30abf28ed17b79d5fc5149f19ca0819fefc3c57f3da4fdf9b10fab3f2f3dca536467ae44943b9dbb8433efe7760ddd72aaa1c\";\n }\n\n async getInitCode(): Promise<Hex> {\n if (this.deploymentState === DeploymentState.DEPLOYED) {\n return \"0x\";\n }\n const contractCode = await this.rpcProvider.getContractCode(\n await this.getAddress()\n );\n\n if ((contractCode?.length ?? 0) > 2) {\n this.deploymentState = DeploymentState.DEPLOYED;\n return \"0x\";\n } else {\n this.deploymentState = DeploymentState.NOT_DEPLOYED;\n }\n\n return this.initCode ?? this.getAccountInitCode();\n }\n\n getIndex(): bigint {\n return this.index;\n }\n\n async approvePlugin() {\n if (!this.validator) {\n throw new Error(\"Validator not connected\");\n }\n if (this.defaultValidator && !this.validator.getEnableSignature()) {\n const { executor, selector, validAfter, validUntil } =\n this.validator.getPluginValidatorData();\n const enableSig = await this.defaultValidator.approveExecutor(\n await this.getAddress(),\n selector,\n executor,\n validUntil,\n validAfter,\n this.validator\n );\n this.validator.setEnableSignature(enableSig);\n }\n }\n\n async encodeExecute(target: Hex, value: bigint, data: Hex): Promise<Hex> {\n if (!this.validator) {\n throw new Error(\"Validator not connected\");\n }\n if (\n target.toLowerCase() === (await this.getAddress()).toLowerCase() &&\n this.validator.shouldDelegateViaFallback()\n ) {\n return data;\n } else {\n return this.encodeExecuteAction(target, value, data, 0);\n }\n }\n\n async encodeBatchExecute(\n _txs: BatchUserOperationCallData\n ): Promise<`0x${string}`> {\n const multiSendCalldata = encodeFunctionData({\n abi: MultiSendAbi,\n functionName: \"multiSend\",\n args: [encodeMultiSend(_txs)],\n });\n return await this.encodeExecuteDelegate(\n MULTISEND_ADDR,\n BigInt(0),\n multiSendCalldata\n );\n }\n\n async encodeExecuteDelegate(\n target: Hex,\n value: bigint,\n data: Hex\n ): Promise<Hex> {\n return this.encodeExecuteAction(target, value, data, 1);\n }\n\n async signWithEip6492(msg: string | Uint8Array): Promise<Hex> {\n try {\n if (!this.validator) {\n throw new Error(\"Validator not connected\");\n }\n const formattedMessage = typeof msg === \"string\" ? toBytes(msg) : msg;\n let sig = await this.validator.signMessage(\n toBytes(hashMessage({ raw: formattedMessage }))\n );\n // If the account is undeployed, use ERC-6492\n if (!(await this.isAccountDeployed())) {\n sig = (encodeAbiParameters(\n parseAbiParameters(\"address, bytes, bytes\"),\n [this.factoryAddress, await this.getFactoryInitCode(), sig]\n ) +\n \"6492649264926492649264926492649264926492649264926492649264926492\") as Hex; // magic suffix\n }\n\n return sig;\n } catch (err: any) {\n console.error(\"Got Error - \", err.message);\n throw new Error(\"Message Signing with EIP6492 failed\");\n }\n }\n\n async signMessage(msg: Uint8Array | string): Promise<Hex> {\n if (!this.validator) {\n throw new Error(\"Validator not connected\");\n }\n const formattedMessage = typeof msg === \"string\" ? toBytes(msg) : msg;\n return await this.validator.signMessage(formattedMessage);\n }\n\n async signTypedData(params: SignTypedDataParams): Promise<Hex> {\n if (!this.validator) {\n throw new Error(\"Validator not connected\");\n }\n return await this.validator.signTypedData(params);\n }\n\n signUserOp(userOp: UserOperationRequest): Promise<Hex> {\n if (!this.validator) {\n throw new Error(\"Validator not connected\");\n }\n return this.validator.signUserOp(userOp);\n }\n\n protected encodeExecuteAction(\n target: Hex,\n value: bigint,\n data: Hex,\n code: number\n ): Hex {\n return encodeFunctionData({\n abi: KernelAccountAbi,\n functionName: \"execute\",\n args: [target, value, data, code],\n });\n }\n protected async getAccountInitCode(): Promise<Hex> {\n return concatHex([this.factoryAddress, await this.getFactoryInitCode()]);\n }\n\n protected async getFactoryInitCode(): Promise<Hex> {\n const validator = this.defaultValidator ?? this.validator;\n if (!validator) {\n throw new Error(\"Validator not connected\");\n }\n try {\n return encodeFunctionData({\n abi: KernelFactoryAbi,\n functionName: \"createAccount\",\n args: [\n KERNEL_IMPL_ADDRESS,\n encodeFunctionData({\n abi: KernelAccountAbi,\n functionName: \"initialize\",\n args: [validator.getAddress(), await validator.getEnableData()],\n }),\n this.index,\n ],\n });\n } catch (err: any) {\n console.error(\"err occurred:\", err.message);\n throw new Error(\"Factory Code generation failed\");\n }\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Hex } from "viem";
|
|
2
2
|
import type { IGasTokenAddresses } from "./paymaster/types.js";
|
|
3
3
|
export declare const DEFAULT_SEND_TX_MAX_RETRIES = 3;
|
|
4
|
-
export declare const DEFAULT_SEND_TX_RETRY_INTERVAL_MS =
|
|
4
|
+
export declare const DEFAULT_SEND_TX_RETRY_INTERVAL_MS = 60000;
|
|
5
5
|
export declare const BUNDLER_URL = "https://v0-6-meta-bundler.onrender.com";
|
|
6
6
|
export declare const PAYMASTER_URL = "https://v0-6-paymaster.onrender.com";
|
|
7
7
|
export declare const ENTRYPOINT_ADDRESS: Hex;
|
|
@@ -16,6 +16,8 @@ export declare const KILL_SWITCH_ACTION = "0xf5aa34DD2cba311947e143183ED325A4A8C
|
|
|
16
16
|
export declare const DUMMY_ECDSA_SIG = "0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c";
|
|
17
17
|
export declare const ERC165_SESSION_KEY_VALIDATOR_ADDRESS = "0xe149290800De29D4b0BF9dB82c508255D81902E6";
|
|
18
18
|
export declare const TOKEN_ACTION = "0x2087C7FfD0d0DAE80a00EE74325aBF3449e0eaf1";
|
|
19
|
+
export declare const SESSION_KEY_VALIDATOR_ADDRESS = "0x1C1D5b70aD6e0c04366aab100261A6Bcc251EA3f";
|
|
20
|
+
export declare const oneAddress = "0x0000000000000000000000000000000000000001";
|
|
19
21
|
export declare const gasTokenChainAddresses: IGasTokenAddresses;
|
|
20
22
|
export declare const ERC20_APPROVAL_AMOUNT: {
|
|
21
23
|
[key: string]: bigint;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseUnits } from "viem";
|
|
2
2
|
import { polygon } from "viem/chains";
|
|
3
3
|
export const DEFAULT_SEND_TX_MAX_RETRIES = 3;
|
|
4
|
-
export const DEFAULT_SEND_TX_RETRY_INTERVAL_MS =
|
|
4
|
+
export const DEFAULT_SEND_TX_RETRY_INTERVAL_MS = 60000;
|
|
5
5
|
export const BUNDLER_URL = "https://v0-6-meta-bundler.onrender.com";
|
|
6
6
|
export const PAYMASTER_URL = "https://v0-6-paymaster.onrender.com";
|
|
7
7
|
export const ENTRYPOINT_ADDRESS = "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789";
|
|
@@ -16,6 +16,8 @@ export const KILL_SWITCH_ACTION = "0xf5aa34DD2cba311947e143183ED325A4A8C674Af";
|
|
|
16
16
|
export const DUMMY_ECDSA_SIG = "0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c";
|
|
17
17
|
export const ERC165_SESSION_KEY_VALIDATOR_ADDRESS = "0xe149290800De29D4b0BF9dB82c508255D81902E6";
|
|
18
18
|
export const TOKEN_ACTION = "0x2087C7FfD0d0DAE80a00EE74325aBF3449e0eaf1";
|
|
19
|
+
export const SESSION_KEY_VALIDATOR_ADDRESS = "0x1C1D5b70aD6e0c04366aab100261A6Bcc251EA3f";
|
|
20
|
+
export const oneAddress = "0x0000000000000000000000000000000000000001";
|
|
19
21
|
export const gasTokenChainAddresses = {
|
|
20
22
|
USDC: {
|
|
21
23
|
1: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|