@zerodev/sdk 5.2.1-alpha-8 → 5.2.1-alpha-10
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/_cjs/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js +17 -5
- package/_cjs/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js.map +1 -1
- package/_cjs/accounts/kernel/createKernelAccount.js +2 -2
- package/_cjs/clients/kernelAccountClient.js +20 -4
- package/_cjs/clients/kernelAccountClient.js.map +1 -1
- package/_cjs/clients/paymasterClient.js +18 -1
- package/_cjs/clients/paymasterClient.js.map +1 -1
- package/_cjs/clients/utils.js +31 -0
- package/_cjs/clients/utils.js.map +1 -0
- package/_cjs/constants.js +5 -2
- package/_cjs/constants.js.map +1 -1
- package/_cjs/providers/KernelEIP1193Provider.js +37 -0
- package/_cjs/providers/KernelEIP1193Provider.js.map +1 -1
- package/_esm/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js +17 -5
- package/_esm/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.js.map +1 -1
- package/_esm/accounts/kernel/createKernelAccount.js +2 -2
- package/_esm/clients/kernelAccountClient.js +21 -5
- package/_esm/clients/kernelAccountClient.js.map +1 -1
- package/_esm/clients/paymasterClient.js +19 -2
- package/_esm/clients/paymasterClient.js.map +1 -1
- package/_esm/clients/utils.js +26 -0
- package/_esm/clients/utils.js.map +1 -0
- package/_esm/constants.js +4 -1
- package/_esm/constants.js.map +1 -1
- package/_esm/providers/KernelEIP1193Provider.js +37 -0
- package/_esm/providers/KernelEIP1193Provider.js.map +1 -1
- package/_types/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.d.ts +19 -5
- package/_types/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.d.ts.map +1 -1
- package/_types/clients/kernelAccountClient.d.ts +4 -4
- package/_types/clients/kernelAccountClient.d.ts.map +1 -1
- package/_types/clients/paymasterClient.d.ts.map +1 -1
- package/_types/clients/utils.d.ts +3 -0
- package/_types/clients/utils.d.ts.map +1 -0
- package/_types/constants.d.ts +4 -1
- package/_types/constants.d.ts.map +1 -1
- package/_types/providers/KernelEIP1193Provider.d.ts +2 -0
- package/_types/providers/KernelEIP1193Provider.d.ts.map +1 -1
- package/accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.ts +17 -5
- package/accounts/kernel/createKernelAccount.ts +2 -2
- package/clients/kernelAccountClient.ts +25 -5
- package/clients/paymasterClient.ts +24 -1
- package/clients/utils.ts +28 -0
- package/constants.ts +6 -2
- package/package.json +1 -1
- package/providers/KernelEIP1193Provider.ts +51 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getEntryPointVersion } from "permissionless";
|
|
2
|
+
import { http, createClient } from "viem";
|
|
2
3
|
import { zerodevPaymasterActions } from "./decorators/kernel.js";
|
|
4
|
+
import { setPimlicoAsProvider } from "./utils.js";
|
|
3
5
|
/**
|
|
4
6
|
* Creates a ZeroDev-specific Paymaster Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
|
|
5
7
|
*
|
|
@@ -18,9 +20,24 @@ import { zerodevPaymasterActions } from "./decorators/kernel.js";
|
|
|
18
20
|
* })
|
|
19
21
|
*/
|
|
20
22
|
export const createZeroDevPaymasterClient = (parameters) => {
|
|
21
|
-
const { key = "public", name = "ZeroDev Paymaster Client" } = parameters;
|
|
23
|
+
const { key = "public", name = "ZeroDev Paymaster Client", entryPoint: entryPointAddress, transport } = parameters;
|
|
24
|
+
const entryPointVersion = getEntryPointVersion(entryPointAddress);
|
|
25
|
+
const shouldIncludePimlicoProvider = transport({}).config.key === "http" && entryPointVersion === "v0.7";
|
|
22
26
|
const client = createClient({
|
|
23
27
|
...parameters,
|
|
28
|
+
transport: (opts) => {
|
|
29
|
+
let _transport = transport({
|
|
30
|
+
...opts,
|
|
31
|
+
retryCount: 0
|
|
32
|
+
});
|
|
33
|
+
if (!shouldIncludePimlicoProvider)
|
|
34
|
+
return _transport;
|
|
35
|
+
_transport = http(setPimlicoAsProvider(_transport.value?.url))({
|
|
36
|
+
...opts,
|
|
37
|
+
retryCount: 0
|
|
38
|
+
});
|
|
39
|
+
return _transport;
|
|
40
|
+
},
|
|
24
41
|
key,
|
|
25
42
|
name,
|
|
26
43
|
type: "zerodevPaymasterClient"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paymasterClient.js","sourceRoot":"","sources":["../../clients/paymasterClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"paymasterClient.js","sourceRoot":"","sources":["../../clients/paymasterClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAErD,OAAO,EACH,IAAI,EAMJ,YAAY,EACf,MAAM,MAAM,CAAA;AAEb,OAAO,EAEH,uBAAuB,EAC1B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AASjD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAKxC,UAEC,EACiC,EAAE;IACpC,MAAM,EACF,GAAG,GAAG,QAAQ,EACd,IAAI,GAAG,0BAA0B,EACjC,UAAU,EAAE,iBAAiB,EAC7B,SAAS,EACZ,GAAG,UAAU,CAAA;IACd,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAA;IACjE,MAAM,4BAA4B,GAC9B,SAAS,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,KAAK,MAAM,IAAI,iBAAiB,KAAK,MAAM,CAAA;IACvE,MAAM,MAAM,GAAG,YAAY,CAAC;QACxB,GAAG,UAAU;QACb,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE;YAChB,IAAI,UAAU,GAAG,SAAS,CAAC;gBACvB,GAAG,IAAI;gBACP,UAAU,EAAE,CAAC;aAChB,CAAC,CAAA;YACF,IAAI,CAAC,4BAA4B;gBAAE,OAAO,UAAU,CAAA;YACpD,UAAU,GAAG,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;gBAC3D,GAAG,IAAI;gBACP,UAAU,EAAE,CAAC;aAChB,CAAC,CAAA;YACF,OAAO,UAAU,CAAA;QACrB,CAAC;QACD,GAAG;QACH,IAAI;QACJ,IAAI,EAAE,wBAAwB;KACjC,CAAC,CAAA;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,uBAAuB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAA;AACxE,CAAC,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const setPimlicoAsProvider = (urlString) => {
|
|
2
|
+
const url = new URL(urlString);
|
|
3
|
+
const params = url.searchParams;
|
|
4
|
+
if (params.has("bundlerProvider")) {
|
|
5
|
+
params.set("bundlerProvider", "PIMLICO");
|
|
6
|
+
}
|
|
7
|
+
else if (params.has("paymasterProvider")) {
|
|
8
|
+
params.set("paymasterProvider", "PIMLICO");
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
params.set("provider", "PIMLICO");
|
|
12
|
+
}
|
|
13
|
+
url.search = params.toString();
|
|
14
|
+
return url.toString();
|
|
15
|
+
};
|
|
16
|
+
export const hasPimlicoAsProvider = (urlString) => {
|
|
17
|
+
const url = new URL(urlString);
|
|
18
|
+
const params = url.searchParams;
|
|
19
|
+
const provider = params.get("provider") ??
|
|
20
|
+
params.get("bundlerProvider") ??
|
|
21
|
+
params.get("paymasterProvider");
|
|
22
|
+
if (provider === "PIMLICO")
|
|
23
|
+
return true;
|
|
24
|
+
return false;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../clients/utils.ts"],"names":[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7
|
"0x5FC0236D6c88a65beD32EECDC5D60a5CAb377717": "0.2.3",
|
|
8
8
|
"0xd3082872F8B06073A021b4602e022d5A070d7cfC": "0.2.4",
|
|
9
|
-
"
|
|
9
|
+
"0x94F097E1ebEB4ecA3AAE54cabb08905B239A7D27": "0.3.0-beta"
|
|
10
10
|
};
|
|
11
11
|
export const TOKEN_ACTION = "0x2087C7FfD0d0DAE80a00EE74325aBF3449e0eaf1";
|
|
12
12
|
export const KERNEL_NAME = "Kernel";
|
|
@@ -38,4 +38,7 @@ export var EXEC_TYPE;
|
|
|
38
38
|
// Safe's library for create and create2: https://github.com/safe-global/safe-contracts/blob/0acdd35a203299585438f53885df630f9d486a86/contracts/libraries/CreateCall.sol
|
|
39
39
|
// Address was found here: https://github.com/safe-global/safe-deployments/blob/926ec6bbe2ebcac3aa2c2c6c0aff74aa590cbc6a/src/assets/v1.4.1/create_call.json
|
|
40
40
|
export const safeCreateCallAddress = "0x9b35Af71d77eaf8d7e40252370304687390A1A52";
|
|
41
|
+
export const KernelFactoryToInitCodeHashMap = {
|
|
42
|
+
"0x5de4839a76cf55d0c90e2061ef4386d962E15ae3": "0xee9d8350bd899dd261db689aafd87eb8a30f085adbaff48152399438ff4eed73"
|
|
43
|
+
};
|
|
41
44
|
//# sourceMappingURL=constants.js.map
|
package/_esm/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AACA,OAAO,EAA0B,MAAM,MAAM,CAAA;AAE7C,MAAM,CAAC,MAAM,eAAe,GACxB,sIAAsI,CAAA;AAE1I,MAAM,CAAC,MAAM,sBAAsB,GAA+B;IAC9D,4CAA4C,EAAE,OAAO;IACrD,4CAA4C,EAAE,OAAO;IACrD,4CAA4C,EAAE,OAAO;IACrD,4CAA4C,EAAE,OAAO;IACrD,4CAA4C,EAAE,OAAO;IACrD,4CAA4C,EAAE,YAAY;CAC7D,CAAA;AACD,MAAM,CAAC,MAAM,YAAY,GAAG,4CAA4C,CAAA;AACxE,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAA;AACnC,MAAM,CAAC,MAAM,qBAAqB,GAA2C;IACzE,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,YAAY;CACvB,CAAA;AACD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,MAAM;IACjB,UAAU,EAAE,MAAM;CACZ,CAAA;AACV,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,kCAAgB,CAAA;IAChB,iCAAe,CAAA;AACnB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AACD,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACjB,4BAAe,CAAA;IACf,2BAAc,CAAA;IACd,mCAAsB,CAAA;AAC1B,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB;AACD,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACjB,6BAAgB,CAAA;IAChB,8BAAiB,CAAA;AACrB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED,wKAAwK;AACxK,2JAA2J;AAC3J,MAAM,CAAC,MAAM,qBAAqB,GAC9B,4CAA4C,CAAA;AAChD,MAAM,CAAC,MAAM,8BAA8B,GAA4B;IACnE,4CAA4C,EACxC,oEAAoE;CAC3E,CAAA"}
|
|
@@ -20,8 +20,13 @@ export class KernelEIP1193Provider extends EventEmitter {
|
|
|
20
20
|
return this.handleEthAccounts();
|
|
21
21
|
case "eth_sendTransaction":
|
|
22
22
|
return this.handleEthSendTransaction(params);
|
|
23
|
+
case "eth_sign":
|
|
24
|
+
return this.handleEthSign(params);
|
|
23
25
|
case "personal_sign":
|
|
24
26
|
return this.handlePersonalSign(params);
|
|
27
|
+
case "eth_signTypedData":
|
|
28
|
+
case "eth_signTypedData_v4":
|
|
29
|
+
return this.handleEthSignTypedDataV4(params);
|
|
25
30
|
default:
|
|
26
31
|
return this.kernelClient.transport.request({ method, params });
|
|
27
32
|
}
|
|
@@ -42,6 +47,20 @@ export class KernelEIP1193Provider extends EventEmitter {
|
|
|
42
47
|
const [tx] = params;
|
|
43
48
|
return this.kernelClient.sendTransaction(tx);
|
|
44
49
|
}
|
|
50
|
+
async handleEthSign(params) {
|
|
51
|
+
if (!this.kernelClient?.account) {
|
|
52
|
+
throw new Error("account not connected!");
|
|
53
|
+
}
|
|
54
|
+
const [address, message] = params;
|
|
55
|
+
if (address.toLowerCase() !==
|
|
56
|
+
this.kernelClient.account.address.toLowerCase()) {
|
|
57
|
+
throw new Error("cannot sign for address that is not the current account");
|
|
58
|
+
}
|
|
59
|
+
return this.kernelClient.signMessage({
|
|
60
|
+
message,
|
|
61
|
+
account: this.kernelClient.account
|
|
62
|
+
});
|
|
63
|
+
}
|
|
45
64
|
async handlePersonalSign(params) {
|
|
46
65
|
if (!this.kernelClient?.account) {
|
|
47
66
|
throw new Error("account not connected!");
|
|
@@ -56,5 +75,23 @@ export class KernelEIP1193Provider extends EventEmitter {
|
|
|
56
75
|
account: this.kernelClient.account
|
|
57
76
|
});
|
|
58
77
|
}
|
|
78
|
+
async handleEthSignTypedDataV4(params) {
|
|
79
|
+
if (!this.kernelClient?.account) {
|
|
80
|
+
throw new Error("account not connected!");
|
|
81
|
+
}
|
|
82
|
+
const [address, typedDataJSON] = params;
|
|
83
|
+
const typedData = JSON.parse(typedDataJSON);
|
|
84
|
+
if (address.toLowerCase() !==
|
|
85
|
+
this.kernelClient.account.address.toLowerCase()) {
|
|
86
|
+
throw new Error("cannot sign for address that is not the current account");
|
|
87
|
+
}
|
|
88
|
+
return this.kernelClient.signTypedData({
|
|
89
|
+
account: this.kernelClient.account,
|
|
90
|
+
domain: typedData.domain,
|
|
91
|
+
types: typedData.types,
|
|
92
|
+
message: typedData.message,
|
|
93
|
+
primaryType: typedData.primaryType
|
|
94
|
+
});
|
|
95
|
+
}
|
|
59
96
|
}
|
|
60
97
|
//# sourceMappingURL=KernelEIP1193Provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KernelEIP1193Provider.js","sourceRoot":"","sources":["../../providers/KernelEIP1193Provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAA4B,MAAM,cAAc,CAAA;AAEvD,OAAO,EAKN,MAAM,MAAM,CAAA;AAEb,MAAM,OAAO,qBAEX,SAAQ,YAAY;IAGlB,YAAY,YAA6C;QACrD,KAAK,EAAE,CAAA;QAHH;;;;;WAA6C;QAIjD,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IACpC,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EACV,MAAM,EACN,MAAM,GAAG,EAAE,EACK;QAChB,QAAQ,MAAM,EAAE,CAAC;YACb,KAAK,qBAAqB;gBACtB,OAAO,IAAI,CAAC,wBAAwB,EAAE,CAAA;YAC1C,KAAK,cAAc;gBACf,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAA;YACnC,KAAK,qBAAqB;gBACtB,OAAO,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAA;YAChD,KAAK,eAAe;gBAChB,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAA0B,CAAC,CAAA;YAC9D;gBACI,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;QACtE,CAAC;IACL,CAAC;IAEO,KAAK,CAAC,wBAAwB;QAClC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;YAC7B,OAAO,EAAE,CAAA;QACb,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC9C,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I,CAAC,YAAY,EAAE,OAAO,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;QAC7C,CAAC;QACD,MAAM,CAAC,OAAO,EAAE,aAAa,CAAC,GAAG,MAAM,CAAA;QACvC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QAC3C,IACI,OAAO,CAAC,WAAW,EAAE;YACrB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,EACjD,CAAC;YACC,MAAM,IAAI,KAAK,CACX,yDAAyD,CAC5D,CAAA;QACL,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC;YACnC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,OAAO;YAClC,MAAM,EAAE,SAAS,CAAC,MAAM;YACxB,KAAK,EAAE,SAAS,CAAC,KAAK;YACtB,OAAO,EAAE,SAAS,CAAC,OAAO;YAC1B,WAAW,EAAE,SAAS,CAAC,WAAW;SACrC,CAAC,CAAA;IACN,CAAC;CACJ"}
|
|
@@ -355,7 +355,7 @@ export declare const KernelV3AccountAbi: readonly [{
|
|
|
355
355
|
readonly internalType: "bytes[]";
|
|
356
356
|
}];
|
|
357
357
|
readonly outputs: readonly [];
|
|
358
|
-
readonly stateMutability: "
|
|
358
|
+
readonly stateMutability: "payable";
|
|
359
359
|
}, {
|
|
360
360
|
readonly type: "function";
|
|
361
361
|
readonly name: "invalidateNonce";
|
|
@@ -428,9 +428,9 @@ export declare const KernelV3AccountAbi: readonly [{
|
|
|
428
428
|
readonly type: "function";
|
|
429
429
|
readonly name: "permissionConfig";
|
|
430
430
|
readonly inputs: readonly [{
|
|
431
|
-
readonly name: "
|
|
432
|
-
readonly type: "
|
|
433
|
-
readonly internalType: "
|
|
431
|
+
readonly name: "pId";
|
|
432
|
+
readonly type: "bytes4";
|
|
433
|
+
readonly internalType: "PermissionId";
|
|
434
434
|
}];
|
|
435
435
|
readonly outputs: readonly [{
|
|
436
436
|
readonly name: "";
|
|
@@ -492,7 +492,7 @@ export declare const KernelV3AccountAbi: readonly [{
|
|
|
492
492
|
readonly type: "function";
|
|
493
493
|
readonly name: "supportsExecutionMode";
|
|
494
494
|
readonly inputs: readonly [{
|
|
495
|
-
readonly name: "";
|
|
495
|
+
readonly name: "mode";
|
|
496
496
|
readonly type: "bytes32";
|
|
497
497
|
readonly internalType: "ExecMode";
|
|
498
498
|
}];
|
|
@@ -749,6 +749,16 @@ export declare const KernelV3AccountAbi: readonly [{
|
|
|
749
749
|
readonly internalType: "uint256";
|
|
750
750
|
}];
|
|
751
751
|
readonly anonymous: false;
|
|
752
|
+
}, {
|
|
753
|
+
readonly type: "event";
|
|
754
|
+
readonly name: "RootValidatorUpdated";
|
|
755
|
+
readonly inputs: readonly [{
|
|
756
|
+
readonly name: "rootValidator";
|
|
757
|
+
readonly type: "bytes21";
|
|
758
|
+
readonly indexed: false;
|
|
759
|
+
readonly internalType: "ValidationId";
|
|
760
|
+
}];
|
|
761
|
+
readonly anonymous: false;
|
|
752
762
|
}, {
|
|
753
763
|
readonly type: "event";
|
|
754
764
|
readonly name: "SelectorSet";
|
|
@@ -911,6 +921,10 @@ export declare const KernelV3AccountAbi: readonly [{
|
|
|
911
921
|
readonly type: "error";
|
|
912
922
|
readonly name: "PolicySignatureOrderError";
|
|
913
923
|
readonly inputs: readonly [];
|
|
924
|
+
}, {
|
|
925
|
+
readonly type: "error";
|
|
926
|
+
readonly name: "RootValidatorCannotBeRemoved";
|
|
927
|
+
readonly inputs: readonly [];
|
|
914
928
|
}, {
|
|
915
929
|
readonly type: "error";
|
|
916
930
|
readonly name: "SignerPrefixNotPresent";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KernelAccountAbi.d.ts","sourceRoot":"","sources":["../../../../../accounts/kernel/abi/kernel_v_3_0_0/KernelAccountAbi.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+rBrB,CAAA"}
|
|
@@ -26,7 +26,7 @@ export declare const createKernelAccountClient: <entryPoint extends EntryPoint,
|
|
|
26
26
|
maxPriorityFeePerGas: bigint;
|
|
27
27
|
}>) | undefined;
|
|
28
28
|
sponsorUserOperation?: ((args: {
|
|
29
|
-
userOperation: import("permissionless
|
|
29
|
+
userOperation: import("permissionless").UserOperation<import("permissionless/types/entrypoint.js").GetEntryPointVersion<entryPoint>>;
|
|
30
30
|
entryPoint: entryPoint;
|
|
31
31
|
}) => Promise<entryPoint extends "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789" ? Pick<{
|
|
32
32
|
sender: `0x${string}`;
|
|
@@ -66,9 +66,9 @@ export declare const createKernelAccountClient: <entryPoint extends EntryPoint,
|
|
|
66
66
|
paymasterAndData?: undefined;
|
|
67
67
|
}, "callGasLimit" | "verificationGasLimit" | "preVerificationGas" | "paymaster" | "paymasterVerificationGasLimit" | "paymasterPostOpGasLimit" | "paymasterData">>) | undefined;
|
|
68
68
|
} | ((args: {
|
|
69
|
-
userOperation: import("permissionless
|
|
69
|
+
userOperation: import("permissionless").UserOperation<import("permissionless/types/entrypoint.js").GetEntryPointVersion<entryPoint>>;
|
|
70
70
|
entryPoint: entryPoint;
|
|
71
|
-
}) => Promise<import("permissionless
|
|
71
|
+
}) => Promise<import("permissionless").UserOperation<import("permissionless/types/entrypoint.js").GetEntryPointVersion<entryPoint>>>) | undefined;
|
|
72
72
|
entryPoint: entryPoint;
|
|
73
73
|
}) => {
|
|
74
74
|
account: TSmartAccount;
|
|
@@ -299,7 +299,7 @@ export declare const createKernelAccountClient: <entryPoint extends EntryPoint,
|
|
|
299
299
|
}, TPrimaryType extends string>(args: import("viem").SignTypedDataParameters<TTypedData, TPrimaryType, TSmartAccount>) => Promise<`0x${string}`>;
|
|
300
300
|
deployContract: <const TAbi extends readonly unknown[] | import("viem").Abi, TChainOverride_1 extends Chain | undefined = undefined>(args: import("viem").DeployContractParameters<TAbi, TChain, TSmartAccount, TChainOverride_1> extends infer T ? { [K in keyof T]: import("viem").DeployContractParameters<TAbi, TChain, TSmartAccount, TChainOverride_1>[K]; } : never) => Promise<`0x${string}`>;
|
|
301
301
|
writeContract: <const TAbi_1 extends readonly unknown[] | import("viem").Abi, TFunctionName extends import("viem").ContractFunctionName<TAbi_1, "nonpayable" | "payable"> = import("viem").ContractFunctionName<TAbi_1, "nonpayable" | "payable">, TArgs extends import("viem").ContractFunctionArgs<TAbi_1, "nonpayable" | "payable", TFunctionName> = import("viem").ContractFunctionArgs<TAbi_1, "nonpayable" | "payable", TFunctionName>, TChainOverride_2 extends Chain | undefined = undefined>(args: import("viem").WriteContractParameters<TAbi_1, TFunctionName, TArgs, TChain, TSmartAccount, TChainOverride_2>) => Promise<`0x${string}`>;
|
|
302
|
-
prepareUserOperationRequest: <TTransport_1 extends Transport>(args: (import("permissionless/_types/actions/smartAccount.js").PrepareUserOperationRequestParameters<entryPoint, TSmartAccount> extends infer T_3 ? { [K_2 in keyof T_3]: import("permissionless/_types/actions/smartAccount.js").PrepareUserOperationRequestParameters<entryPoint, TSmartAccount>[K_2]; } : never) extends infer T_1 ? { [K_1 in keyof T_1]: (import("permissionless/_types/actions/smartAccount.js").PrepareUserOperationRequestParameters<entryPoint, TSmartAccount> extends infer T_2 ? { [K_2 in keyof T_2]: import("permissionless/_types/actions/smartAccount.js").PrepareUserOperationRequestParameters<entryPoint, TSmartAccount>[K_2]; } : never)[K_1]; } : never, stateOverrides?: import("permissionless/_types/types/bundler.js").StateOverrides | undefined) => Promise<import("permissionless
|
|
302
|
+
prepareUserOperationRequest: <TTransport_1 extends Transport>(args: (import("permissionless/_types/actions/smartAccount.js").PrepareUserOperationRequestParameters<entryPoint, TSmartAccount> extends infer T_3 ? { [K_2 in keyof T_3]: import("permissionless/_types/actions/smartAccount.js").PrepareUserOperationRequestParameters<entryPoint, TSmartAccount>[K_2]; } : never) extends infer T_1 ? { [K_1 in keyof T_1]: (import("permissionless/_types/actions/smartAccount.js").PrepareUserOperationRequestParameters<entryPoint, TSmartAccount> extends infer T_2 ? { [K_2 in keyof T_2]: import("permissionless/_types/actions/smartAccount.js").PrepareUserOperationRequestParameters<entryPoint, TSmartAccount>[K_2]; } : never)[K_1]; } : never, stateOverrides?: import("permissionless/_types/types/bundler.js").StateOverrides | undefined) => Promise<import("permissionless").UserOperation<import("permissionless/types").GetEntryPointVersion<entryPoint>> extends infer T_4 ? { [K_3 in keyof T_4]: import("permissionless").UserOperation<import("permissionless/types").GetEntryPointVersion<entryPoint>>[K_3]; } : never>;
|
|
303
303
|
sendUserOperation: <TTransport_2 extends Transport>(args: (import("permissionless/_types/actions/smartAccount.js").SendUserOperationParameters<entryPoint, TSmartAccount> extends infer T_7 ? { [K_5 in keyof T_7]: import("permissionless/_types/actions/smartAccount.js").SendUserOperationParameters<entryPoint, TSmartAccount>[K_5]; } : never) extends infer T_5 ? { [K_4 in keyof T_5]: (import("permissionless/_types/actions/smartAccount.js").SendUserOperationParameters<entryPoint, TSmartAccount> extends infer T_6 ? { [K_5 in keyof T_6]: import("permissionless/_types/actions/smartAccount.js").SendUserOperationParameters<entryPoint, TSmartAccount>[K_5]; } : never)[K_4]; } : never) => Promise<`0x${string}`>;
|
|
304
304
|
sendTransactions: (args: import("permissionless/_types/actions/smartAccount.js").SendTransactionsWithPaymasterParameters<entryPoint, TSmartAccount> extends infer T_8 ? { [K_6 in keyof T_8]: import("permissionless/_types/actions/smartAccount.js").SendTransactionsWithPaymasterParameters<entryPoint, TSmartAccount>[K_6]; } : never) => Promise<`0x${string}`>;
|
|
305
305
|
signUserOperation: <TTransport_3 extends Transport>(args: import("../actions/index.js").SignUserOperationParameters<entryPoint, TSmartAccount> extends infer T_9 ? { [K_7 in keyof T_9]: import("../actions/index.js").SignUserOperationParameters<entryPoint, TSmartAccount>[K_7]; } : never) => Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernelAccountClient.d.ts","sourceRoot":"","sources":["../../clients/kernelAccountClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"kernelAccountClient.d.ts","sourceRoot":"","sources":["../../clients/kernelAccountClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAEH,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,SAAS,EAEjB,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAE9D,OAAO,EACH,KAAK,0BAA0B,EAElC,MAAM,wBAAwB,CAAA;AAG/B,MAAM,MAAM,mBAAmB,CAC3B,UAAU,SAAS,UAAU,EAC7B,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACnD,OAAO,SAAS,kBAAkB,CAAC,UAAU,CAAC,GAAG,SAAS,GACpD,kBAAkB,CAAC,UAAU,CAAC,GAC9B,SAAS,IACf,QAAQ,CACR,MAAM,CACF,SAAS,EACT,KAAK,EACL,OAAO,EACP,gBAAgB,CAAC,UAAU,CAAC,EAC5B,0BAA0B,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,CACzD,CACJ,CAAA;AAED,MAAM,MAAM,wBAAwB,CAChC,UAAU,SAAS,UAAU,EAC7B,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACnD,OAAO,SAAS,YAAY,CAAC,UAAU,CAAC,GAAG,SAAS,GAC9C,YAAY,CAAC,UAAU,CAAC,GACxB,SAAS,IACf,QAAQ,CACR,IAAI,CACA,YAAY,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,EACvC,WAAW,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,iBAAiB,CAC7D,GAAG;IACA,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,gBAAgB,EAAE,SAAS,CAAA;CAC9B,GAAG,UAAU,CAAC,UAAU,CAAC,GAAG;IACrB,UAAU,EAAE,UAAU,CAAA;CACzB,CACR,CAAA;AAED,eAAO,MAAM,yBAAyB;;;;;;;sBANZ,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoElC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paymasterClient.d.ts","sourceRoot":"","sources":["../../clients/paymasterClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"paymasterClient.d.ts","sourceRoot":"","sources":["../../clients/paymasterClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,EAEH,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,kBAAkB,EACvB,KAAK,SAAS,EAEjB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EACH,KAAK,6BAA6B,EAErC,MAAM,wBAAwB,CAAA;AAG/B,MAAM,MAAM,sBAAsB,CAAC,UAAU,SAAS,UAAU,IAAI,MAAM,CACtE,SAAS,EACT,KAAK,GAAG,SAAS,EACjB,OAAO,GAAG,SAAS,EACnB,yBAAyB,CAAC,UAAU,CAAC,EACrC,6BAA6B,CAAC,UAAU,CAAC,CAC5C,CAAA;AACD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;wCAqCxC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../clients/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,cAAe,MAAM,KAAG,MAgBxD,CAAA;AAED,eAAO,MAAM,oBAAoB,cAAe,MAAM,KAAG,OASxD,CAAA"}
|
package/_types/constants.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EntryPointVersion } from "permissionless/types/entrypoint";
|
|
2
|
-
import { type Address } from "viem";
|
|
2
|
+
import { type Address, type Hex } from "viem";
|
|
3
3
|
export declare const DUMMY_ECDSA_SIG = "0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c";
|
|
4
4
|
export declare const KernelImplToVersionMap: {
|
|
5
5
|
[key: Address]: string;
|
|
@@ -28,4 +28,7 @@ export declare enum EXEC_TYPE {
|
|
|
28
28
|
TRY_EXEC = "0x01"
|
|
29
29
|
}
|
|
30
30
|
export declare const safeCreateCallAddress = "0x9b35Af71d77eaf8d7e40252370304687390A1A52";
|
|
31
|
+
export declare const KernelFactoryToInitCodeHashMap: {
|
|
32
|
+
[key: Address]: Hex;
|
|
33
|
+
};
|
|
31
34
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,MAAM,CAAA;AAE7C,eAAO,MAAM,eAAe,yIAC8G,CAAA;AAE1I,eAAO,MAAM,sBAAsB,EAAE;IAAE,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAA;CAO5D,CAAA;AACD,eAAO,MAAM,YAAY,+CAA+C,CAAA;AACxE,eAAO,MAAM,WAAW,WAAW,CAAA;AACnC,eAAO,MAAM,qBAAqB,EAAE;KAAG,GAAG,IAAI,iBAAiB,GAAG,MAAM;CAGvE,CAAA;AACD,eAAO,MAAM,cAAc;;;;CAIjB,CAAA;AACV,oBAAY,cAAc;IACtB,OAAO,SAAS;IAChB,MAAM,SAAS;CAClB;AACD,oBAAY,SAAS;IACjB,MAAM,SAAS;IACf,KAAK,SAAS;IACd,aAAa,SAAS;CACzB;AACD,oBAAY,SAAS;IACjB,OAAO,SAAS;IAChB,QAAQ,SAAS;CACpB;AAID,eAAO,MAAM,qBAAqB,+CACc,CAAA;AAChD,eAAO,MAAM,8BAA8B,EAAE;IAAE,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,CAAA;CAGjE,CAAA"}
|
|
@@ -10,6 +10,8 @@ export declare class KernelEIP1193Provider<entryPoint extends EntryPoint> extend
|
|
|
10
10
|
private handleEthRequestAccounts;
|
|
11
11
|
private handleEthAccounts;
|
|
12
12
|
private handleEthSendTransaction;
|
|
13
|
+
private handleEthSign;
|
|
13
14
|
private handlePersonalSign;
|
|
15
|
+
private handleEthSignTypedDataV4;
|
|
14
16
|
}
|
|
15
17
|
//# sourceMappingURL=KernelEIP1193Provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KernelEIP1193Provider.d.ts","sourceRoot":"","sources":["../../providers/KernelEIP1193Provider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAGxB,MAAM,MAAM,CAAA;AAEb,qBAAa,qBAAqB,CAC9B,UAAU,SAAS,UAAU,CAC/B,SAAQ,YAAY;IAClB,OAAO,CAAC,YAAY,CAAiC;gBAEzC,YAAY,EAAE,mBAAmB,CAAC,UAAU,CAAC;IAKnD,OAAO,CAAC,EACV,MAAM,EACN,MAAW,EACd,EAAE,iBAAiB,GAAG,UAAU,CAAC,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"KernelEIP1193Provider.d.ts","sourceRoot":"","sources":["../../providers/KernelEIP1193Provider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAGxB,MAAM,MAAM,CAAA;AAEb,qBAAa,qBAAqB,CAC9B,UAAU,SAAS,UAAU,CAC/B,SAAQ,YAAY;IAClB,OAAO,CAAC,YAAY,CAAiC;gBAEzC,YAAY,EAAE,mBAAmB,CAAC,UAAU,CAAC;IAKnD,OAAO,CAAC,EACV,MAAM,EACN,MAAW,EACd,EAAE,iBAAiB,GAAG,UAAU,CAAC,gBAAgB,CAAC;YAoBrC,wBAAwB;YAOxB,iBAAiB;YAOjB,wBAAwB;YAKxB,aAAa;YAoBb,kBAAkB;YAsBlB,wBAAwB;CAyBzC"}
|
|
@@ -295,7 +295,7 @@ export const KernelV3AccountAbi = [
|
|
|
295
295
|
{ name: "hookData", type: "bytes[]", internalType: "bytes[]" }
|
|
296
296
|
],
|
|
297
297
|
outputs: [],
|
|
298
|
-
stateMutability: "
|
|
298
|
+
stateMutability: "payable"
|
|
299
299
|
},
|
|
300
300
|
{
|
|
301
301
|
type: "function",
|
|
@@ -338,9 +338,7 @@ export const KernelV3AccountAbi = [
|
|
|
338
338
|
{
|
|
339
339
|
type: "function",
|
|
340
340
|
name: "permissionConfig",
|
|
341
|
-
inputs: [
|
|
342
|
-
{ name: "vId", type: "bytes21", internalType: "ValidationId" }
|
|
343
|
-
],
|
|
341
|
+
inputs: [{ name: "pId", type: "bytes4", internalType: "PermissionId" }],
|
|
344
342
|
outputs: [
|
|
345
343
|
{
|
|
346
344
|
name: "",
|
|
@@ -407,7 +405,7 @@ export const KernelV3AccountAbi = [
|
|
|
407
405
|
{
|
|
408
406
|
type: "function",
|
|
409
407
|
name: "supportsExecutionMode",
|
|
410
|
-
inputs: [{ name: "", type: "bytes32", internalType: "ExecMode" }],
|
|
408
|
+
inputs: [{ name: "mode", type: "bytes32", internalType: "ExecMode" }],
|
|
411
409
|
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
412
410
|
stateMutability: "pure"
|
|
413
411
|
},
|
|
@@ -662,6 +660,19 @@ export const KernelV3AccountAbi = [
|
|
|
662
660
|
],
|
|
663
661
|
anonymous: false
|
|
664
662
|
},
|
|
663
|
+
{
|
|
664
|
+
type: "event",
|
|
665
|
+
name: "RootValidatorUpdated",
|
|
666
|
+
inputs: [
|
|
667
|
+
{
|
|
668
|
+
name: "rootValidator",
|
|
669
|
+
type: "bytes21",
|
|
670
|
+
indexed: false,
|
|
671
|
+
internalType: "ValidationId"
|
|
672
|
+
}
|
|
673
|
+
],
|
|
674
|
+
anonymous: false
|
|
675
|
+
},
|
|
665
676
|
{
|
|
666
677
|
type: "event",
|
|
667
678
|
name: "SelectorSet",
|
|
@@ -777,5 +788,6 @@ export const KernelV3AccountAbi = [
|
|
|
777
788
|
inputs: [{ name: "i", type: "uint256", internalType: "uint256" }]
|
|
778
789
|
},
|
|
779
790
|
{ type: "error", name: "PolicySignatureOrderError", inputs: [] },
|
|
791
|
+
{ type: "error", name: "RootValidatorCannotBeRemoved", inputs: [] },
|
|
780
792
|
{ type: "error", name: "SignerPrefixNotPresent", inputs: [] }
|
|
781
793
|
] as const
|
|
@@ -120,9 +120,9 @@ export const KERNEL_ADDRESSES: {
|
|
|
120
120
|
FACTORY_STAKER: Address
|
|
121
121
|
} = {
|
|
122
122
|
ACCOUNT_LOGIC_V0_6: "0xd3082872F8B06073A021b4602e022d5A070d7cfC",
|
|
123
|
-
ACCOUNT_LOGIC_V0_7: "
|
|
123
|
+
ACCOUNT_LOGIC_V0_7: "0x94F097E1ebEB4ecA3AAE54cabb08905B239A7D27",
|
|
124
124
|
FACTORY_ADDRESS_V0_6: "0x5de4839a76cf55d0c90e2061ef4386d962E15ae3",
|
|
125
|
-
FACTORY_ADDRESS_V0_7: "
|
|
125
|
+
FACTORY_ADDRESS_V0_7: "0x6723b44Abeec4E71eBE3232BD5B455805baDD22f",
|
|
126
126
|
FACTORY_STAKER: "0xd703aaE79538628d27099B8c4f621bE4CCd142d5"
|
|
127
127
|
}
|
|
128
128
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { getEntryPointVersion } from "permissionless"
|
|
1
2
|
import type { SmartAccount } from "permissionless/accounts/types"
|
|
2
3
|
import type { Middleware } from "permissionless/actions/smartAccount"
|
|
3
4
|
import type { EntryPoint, Prettify } from "permissionless/types"
|
|
4
5
|
import type { BundlerRpcSchema } from "permissionless/types/bundler"
|
|
5
6
|
import {
|
|
7
|
+
http,
|
|
6
8
|
type Chain,
|
|
7
9
|
type Client,
|
|
8
10
|
type ClientConfig,
|
|
@@ -15,6 +17,7 @@ import {
|
|
|
15
17
|
type KernelAccountClientActions,
|
|
16
18
|
kernelAccountClientActions
|
|
17
19
|
} from "./decorators/kernel.js"
|
|
20
|
+
import { hasPimlicoAsProvider, setPimlicoAsProvider } from "./utils.js"
|
|
18
21
|
|
|
19
22
|
export type KernelAccountClient<
|
|
20
23
|
entryPoint extends EntryPoint,
|
|
@@ -70,21 +73,38 @@ export const createKernelAccountClient = <
|
|
|
70
73
|
const {
|
|
71
74
|
key = "Account",
|
|
72
75
|
name = "Kernel Account Client",
|
|
73
|
-
bundlerTransport
|
|
76
|
+
bundlerTransport,
|
|
77
|
+
entryPoint
|
|
74
78
|
} = parameters
|
|
79
|
+
const entryPointVersion = getEntryPointVersion(entryPoint)
|
|
80
|
+
const shouldIncludePimlicoProvider =
|
|
81
|
+
bundlerTransport({}).config.key === "http" &&
|
|
82
|
+
entryPointVersion === "v0.7"
|
|
83
|
+
|
|
75
84
|
const client = createClient({
|
|
76
85
|
...parameters,
|
|
77
86
|
key,
|
|
78
87
|
name,
|
|
79
|
-
transport: (opts) =>
|
|
88
|
+
transport: (opts) => {
|
|
89
|
+
let _bundlerTransport = bundlerTransport({
|
|
90
|
+
...opts,
|
|
91
|
+
retryCount: 0
|
|
92
|
+
})
|
|
93
|
+
if (!shouldIncludePimlicoProvider) return _bundlerTransport
|
|
94
|
+
_bundlerTransport = http(
|
|
95
|
+
setPimlicoAsProvider(_bundlerTransport.value?.url)
|
|
96
|
+
)({ ...opts, retryCount: 0 })
|
|
97
|
+
return _bundlerTransport
|
|
98
|
+
},
|
|
80
99
|
type: "kernelAccountClient"
|
|
81
100
|
})
|
|
82
101
|
|
|
83
102
|
let middleware = parameters.middleware
|
|
84
|
-
|
|
85
103
|
if (
|
|
86
|
-
!middleware ||
|
|
87
|
-
|
|
104
|
+
(!middleware ||
|
|
105
|
+
(typeof middleware !== "function" && !middleware.gasPrice)) &&
|
|
106
|
+
client.transport?.url &&
|
|
107
|
+
hasPimlicoAsProvider(client.transport.url)
|
|
88
108
|
) {
|
|
89
109
|
const gasPrice = () => getUserOperationGasPrice(client)
|
|
90
110
|
middleware = {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { getEntryPointVersion } from "permissionless"
|
|
1
2
|
import type { EntryPoint } from "permissionless/types/entrypoint"
|
|
2
3
|
import {
|
|
4
|
+
http,
|
|
3
5
|
type Account,
|
|
4
6
|
type Chain,
|
|
5
7
|
type Client,
|
|
@@ -12,6 +14,7 @@ import {
|
|
|
12
14
|
type ZeroDevPaymasterClientActions,
|
|
13
15
|
zerodevPaymasterActions
|
|
14
16
|
} from "./decorators/kernel.js"
|
|
17
|
+
import { setPimlicoAsProvider } from "./utils.js"
|
|
15
18
|
|
|
16
19
|
export type ZeroDevPaymasterClient<entryPoint extends EntryPoint> = Client<
|
|
17
20
|
Transport,
|
|
@@ -46,9 +49,29 @@ export const createZeroDevPaymasterClient = <
|
|
|
46
49
|
entryPoint: entryPoint
|
|
47
50
|
}
|
|
48
51
|
): ZeroDevPaymasterClient<entryPoint> => {
|
|
49
|
-
const {
|
|
52
|
+
const {
|
|
53
|
+
key = "public",
|
|
54
|
+
name = "ZeroDev Paymaster Client",
|
|
55
|
+
entryPoint: entryPointAddress,
|
|
56
|
+
transport
|
|
57
|
+
} = parameters
|
|
58
|
+
const entryPointVersion = getEntryPointVersion(entryPointAddress)
|
|
59
|
+
const shouldIncludePimlicoProvider =
|
|
60
|
+
transport({}).config.key === "http" && entryPointVersion === "v0.7"
|
|
50
61
|
const client = createClient({
|
|
51
62
|
...parameters,
|
|
63
|
+
transport: (opts) => {
|
|
64
|
+
let _transport = transport({
|
|
65
|
+
...opts,
|
|
66
|
+
retryCount: 0
|
|
67
|
+
})
|
|
68
|
+
if (!shouldIncludePimlicoProvider) return _transport
|
|
69
|
+
_transport = http(setPimlicoAsProvider(_transport.value?.url))({
|
|
70
|
+
...opts,
|
|
71
|
+
retryCount: 0
|
|
72
|
+
})
|
|
73
|
+
return _transport
|
|
74
|
+
},
|
|
52
75
|
key,
|
|
53
76
|
name,
|
|
54
77
|
type: "zerodevPaymasterClient"
|
package/clients/utils.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const setPimlicoAsProvider = (urlString: string): string => {
|
|
2
|
+
const url = new URL(urlString)
|
|
3
|
+
|
|
4
|
+
const params = url.searchParams
|
|
5
|
+
|
|
6
|
+
if (params.has("bundlerProvider")) {
|
|
7
|
+
params.set("bundlerProvider", "PIMLICO")
|
|
8
|
+
} else if (params.has("paymasterProvider")) {
|
|
9
|
+
params.set("paymasterProvider", "PIMLICO")
|
|
10
|
+
} else {
|
|
11
|
+
params.set("provider", "PIMLICO")
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
url.search = params.toString()
|
|
15
|
+
|
|
16
|
+
return url.toString()
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const hasPimlicoAsProvider = (urlString: string): boolean => {
|
|
20
|
+
const url = new URL(urlString)
|
|
21
|
+
const params = url.searchParams
|
|
22
|
+
const provider =
|
|
23
|
+
params.get("provider") ??
|
|
24
|
+
params.get("bundlerProvider") ??
|
|
25
|
+
params.get("paymasterProvider")
|
|
26
|
+
if (provider === "PIMLICO") return true
|
|
27
|
+
return false
|
|
28
|
+
}
|
package/constants.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EntryPointVersion } from "permissionless/types/entrypoint"
|
|
2
|
-
import { type Address } from "viem"
|
|
2
|
+
import { type Address, type Hex } from "viem"
|
|
3
3
|
|
|
4
4
|
export const DUMMY_ECDSA_SIG =
|
|
5
5
|
"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"
|
|
@@ -10,7 +10,7 @@ export const KernelImplToVersionMap: { [key: Address]: string } = {
|
|
|
10
10
|
"0xD3F582F6B4814E989Ee8E96bc3175320B5A540ab": "0.2.3",
|
|
11
11
|
"0x5FC0236D6c88a65beD32EECDC5D60a5CAb377717": "0.2.3",
|
|
12
12
|
"0xd3082872F8B06073A021b4602e022d5A070d7cfC": "0.2.4",
|
|
13
|
-
"
|
|
13
|
+
"0x94F097E1ebEB4ecA3AAE54cabb08905B239A7D27": "0.3.0-beta"
|
|
14
14
|
}
|
|
15
15
|
export const TOKEN_ACTION = "0x2087C7FfD0d0DAE80a00EE74325aBF3449e0eaf1"
|
|
16
16
|
export const KERNEL_NAME = "Kernel"
|
|
@@ -41,3 +41,7 @@ export enum EXEC_TYPE {
|
|
|
41
41
|
// Address was found here: https://github.com/safe-global/safe-deployments/blob/926ec6bbe2ebcac3aa2c2c6c0aff74aa590cbc6a/src/assets/v1.4.1/create_call.json
|
|
42
42
|
export const safeCreateCallAddress =
|
|
43
43
|
"0x9b35Af71d77eaf8d7e40252370304687390A1A52"
|
|
44
|
+
export const KernelFactoryToInitCodeHashMap: { [key: Address]: Hex } = {
|
|
45
|
+
"0x5de4839a76cf55d0c90e2061ef4386d962E15ae3":
|
|
46
|
+
"0xee9d8350bd899dd261db689aafd87eb8a30f085adbaff48152399438ff4eed73"
|
|
47
|
+
}
|