permissionless 0.0.13 → 0.0.14
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/CHANGELOG.md +8 -0
- package/_cjs/accounts/index.js +3 -1
- package/_cjs/accounts/index.js.map +1 -1
- package/_cjs/accounts/kernel/abi/KernelAccountAbi.js +84 -0
- package/_cjs/accounts/kernel/abi/KernelAccountAbi.js.map +1 -0
- package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js +211 -0
- package/_cjs/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -0
- package/_cjs/accounts/signerToSafeSmartAccount.js +1 -1
- package/_cjs/actions/pimlico/sponsorUserOperation.js +12 -4
- package/_cjs/actions/pimlico/sponsorUserOperation.js.map +1 -1
- package/_cjs/clients/createSmartAccountClient.js.map +1 -1
- package/_cjs/clients/decorators/pimlico.js.map +1 -1
- package/_esm/accounts/index.js +2 -1
- package/_esm/accounts/index.js.map +1 -1
- package/_esm/accounts/kernel/abi/KernelAccountAbi.js +87 -0
- package/_esm/accounts/kernel/abi/KernelAccountAbi.js.map +1 -0
- package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js +262 -0
- package/_esm/accounts/kernel/signerToEcdsaKernelSmartAccount.js.map +1 -0
- package/_esm/accounts/signerToSafeSmartAccount.js +1 -1
- package/_esm/actions/pimlico/sponsorUserOperation.js +13 -5
- package/_esm/actions/pimlico/sponsorUserOperation.js.map +1 -1
- package/_esm/clients/createSmartAccountClient.js +1 -1
- package/_esm/clients/createSmartAccountClient.js.map +1 -1
- package/_esm/clients/decorators/pimlico.js.map +1 -1
- package/_types/accounts/index.d.ts +2 -1
- package/_types/accounts/index.d.ts.map +1 -1
- package/_types/accounts/kernel/abi/KernelAccountAbi.d.ts +68 -0
- package/_types/accounts/kernel/abi/KernelAccountAbi.d.ts.map +1 -0
- package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts +25 -0
- package/_types/accounts/kernel/signerToEcdsaKernelSmartAccount.d.ts.map +1 -0
- package/_types/actions/pimlico/sponsorUserOperation.d.ts +4 -3
- package/_types/actions/pimlico/sponsorUserOperation.d.ts.map +1 -1
- package/_types/actions/pimlico.d.ts +2 -2
- package/_types/actions/pimlico.d.ts.map +1 -1
- package/_types/clients/createSmartAccountClient.d.ts +6 -1
- package/_types/clients/createSmartAccountClient.d.ts.map +1 -1
- package/_types/clients/decorators/pimlico.d.ts +3 -3
- package/_types/clients/decorators/pimlico.d.ts.map +1 -1
- package/_types/types/pimlico.d.ts +4 -1
- package/_types/types/pimlico.d.ts.map +1 -1
- package/accounts/index.ts +8 -1
- package/accounts/kernel/abi/KernelAccountAbi.ts +87 -0
- package/accounts/kernel/signerToEcdsaKernelSmartAccount.ts +363 -0
- package/accounts/signerToSafeSmartAccount.ts +1 -1
- package/actions/pimlico/sponsorUserOperation.ts +20 -7
- package/actions/pimlico.ts +2 -2
- package/clients/createSmartAccountClient.ts +6 -1
- package/clients/decorators/pimlico.ts +4 -4
- package/package.json +1 -1
- package/types/pimlico.ts +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# permissionless
|
|
2
2
|
|
|
3
|
+
## 0.0.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4d6f01f: Add sponsorship policies option to pimlicoPaymasterClient
|
|
8
|
+
Update Safe 4337 module version to 0.2.0
|
|
9
|
+
- 5fe172d: Introduce a simpel version of Kernel SmartAccount (by ZeroDev), using their ECDSA Validator
|
|
10
|
+
|
|
3
11
|
## 0.0.13
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/_cjs/accounts/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.privateKeyToSafeSmartAccount = exports.privateKeyToSimpleSmartAccount = exports.SignTransactionNotSupportedBySmartAccount = exports.signerToSimpleSmartAccount = exports.signerToSafeSmartAccount = void 0;
|
|
3
|
+
exports.signerToEcdsaKernelSmartAccount = exports.privateKeyToSafeSmartAccount = exports.privateKeyToSimpleSmartAccount = exports.SignTransactionNotSupportedBySmartAccount = exports.signerToSimpleSmartAccount = exports.signerToSafeSmartAccount = void 0;
|
|
4
4
|
const privateKeyToSimpleSmartAccount_js_1 = require("./privateKeyToSimpleSmartAccount.js");
|
|
5
5
|
Object.defineProperty(exports, "privateKeyToSimpleSmartAccount", { enumerable: true, get: function () { return privateKeyToSimpleSmartAccount_js_1.privateKeyToSimpleSmartAccount; } });
|
|
6
6
|
const signerToSimpleSmartAccount_js_1 = require("./signerToSimpleSmartAccount.js");
|
|
@@ -9,6 +9,8 @@ const privateKeyToSafeSmartAccount_js_1 = require("./privateKeyToSafeSmartAccoun
|
|
|
9
9
|
Object.defineProperty(exports, "privateKeyToSafeSmartAccount", { enumerable: true, get: function () { return privateKeyToSafeSmartAccount_js_1.privateKeyToSafeSmartAccount; } });
|
|
10
10
|
const signerToSafeSmartAccount_js_1 = require("./signerToSafeSmartAccount.js");
|
|
11
11
|
Object.defineProperty(exports, "signerToSafeSmartAccount", { enumerable: true, get: function () { return signerToSafeSmartAccount_js_1.signerToSafeSmartAccount; } });
|
|
12
|
+
const signerToEcdsaKernelSmartAccount_js_1 = require("./kernel/signerToEcdsaKernelSmartAccount.js");
|
|
13
|
+
Object.defineProperty(exports, "signerToEcdsaKernelSmartAccount", { enumerable: true, get: function () { return signerToEcdsaKernelSmartAccount_js_1.signerToEcdsaKernelSmartAccount; } });
|
|
12
14
|
const types_js_1 = require("./types.js");
|
|
13
15
|
Object.defineProperty(exports, "SignTransactionNotSupportedBySmartAccount", { enumerable: true, get: function () { return types_js_1.SignTransactionNotSupportedBySmartAccount; } });
|
|
14
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../accounts/index.ts"],"names":[],"mappings":";;;AAAA,2FAAoF;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../accounts/index.ts"],"names":[],"mappings":";;;AAAA,2FAAoF;AAkChF,+GAlCK,kEAA8B,OAkCL;AAhClC,mFAGwC;AA2BpC,2GA5BA,0DAA0B,OA4BA;AAzB9B,uFAAgF;AA6B5E,6GA7BK,8DAA4B,OA6BL;AA3BhC,+EAIsC;AAiBlC,yGAlBA,sDAAwB,OAkBA;AAf5B,oGAGoD;AAoBhD,gHArBA,oEAA+B,OAqBA;AAlBnC,yCAImB;AASf,0HAZA,oDAAyC,OAYA"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KernelInitAbi = exports.KernelExecuteAbi = void 0;
|
|
4
|
+
exports.KernelExecuteAbi = [
|
|
5
|
+
{
|
|
6
|
+
inputs: [
|
|
7
|
+
{
|
|
8
|
+
internalType: "address",
|
|
9
|
+
name: "to",
|
|
10
|
+
type: "address"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
internalType: "uint256",
|
|
14
|
+
name: "value",
|
|
15
|
+
type: "uint256"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
internalType: "bytes",
|
|
19
|
+
name: "data",
|
|
20
|
+
type: "bytes"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
internalType: "enum Operation",
|
|
24
|
+
name: "",
|
|
25
|
+
type: "uint8"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
name: "execute",
|
|
29
|
+
outputs: [],
|
|
30
|
+
stateMutability: "payable",
|
|
31
|
+
type: "function"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
inputs: [
|
|
35
|
+
{
|
|
36
|
+
components: [
|
|
37
|
+
{
|
|
38
|
+
internalType: "address",
|
|
39
|
+
name: "to",
|
|
40
|
+
type: "address"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
internalType: "uint256",
|
|
44
|
+
name: "value",
|
|
45
|
+
type: "uint256"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
internalType: "bytes",
|
|
49
|
+
name: "data",
|
|
50
|
+
type: "bytes"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
internalType: "struct Call[]",
|
|
54
|
+
name: "calls",
|
|
55
|
+
type: "tuple[]"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
name: "executeBatch",
|
|
59
|
+
outputs: [],
|
|
60
|
+
stateMutability: "payable",
|
|
61
|
+
type: "function"
|
|
62
|
+
}
|
|
63
|
+
];
|
|
64
|
+
exports.KernelInitAbi = [
|
|
65
|
+
{
|
|
66
|
+
inputs: [
|
|
67
|
+
{
|
|
68
|
+
internalType: "contract IKernelValidator",
|
|
69
|
+
name: "_defaultValidator",
|
|
70
|
+
type: "address"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
internalType: "bytes",
|
|
74
|
+
name: "_data",
|
|
75
|
+
type: "bytes"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
name: "initialize",
|
|
79
|
+
outputs: [],
|
|
80
|
+
stateMutability: "payable",
|
|
81
|
+
type: "function"
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
//# sourceMappingURL=KernelAccountAbi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KernelAccountAbi.js","sourceRoot":"","sources":["../../../../accounts/kernel/abi/KernelAccountAbi.ts"],"names":[],"mappings":";;;AAGa,QAAA,gBAAgB,GAAG;IAC5B;QACI,MAAM,EAAE;YACJ;gBACI,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,IAAI;gBACV,IAAI,EAAE,SAAS;aAClB;YACD;gBACI,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aAClB;YACD;gBACI,YAAY,EAAE,OAAO;gBACrB,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,OAAO;aAChB;YACD;gBACI,YAAY,EAAE,gBAAgB;gBAC9B,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,OAAO;aAChB;SACJ;QACD,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,UAAU;KACnB;IACD;QACI,MAAM,EAAE;YACJ;gBACI,UAAU,EAAE;oBACR;wBACI,YAAY,EAAE,SAAS;wBACvB,IAAI,EAAE,IAAI;wBACV,IAAI,EAAE,SAAS;qBAClB;oBACD;wBACI,YAAY,EAAE,SAAS;wBACvB,IAAI,EAAE,OAAO;wBACb,IAAI,EAAE,SAAS;qBAClB;oBACD;wBACI,YAAY,EAAE,OAAO;wBACrB,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,OAAO;qBAChB;iBACJ;gBACD,YAAY,EAAE,eAAe;gBAC7B,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aAClB;SACJ;QACD,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,UAAU;KACnB;CACK,CAAA;AAKG,QAAA,aAAa,GAAG;IACzB;QACI,MAAM,EAAE;YACJ;gBACI,YAAY,EAAE,2BAA2B;gBACzC,IAAI,EAAE,mBAAmB;gBACzB,IAAI,EAAE,SAAS;aAClB;YACD;gBACI,YAAY,EAAE,OAAO;gBACrB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,OAAO;aAChB;SACJ;QACD,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,UAAU;KACnB;CACK,CAAA"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.signerToEcdsaKernelSmartAccount = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
const accounts_1 = require("viem/accounts");
|
|
6
|
+
const actions_1 = require("viem/actions");
|
|
7
|
+
const getAccountNonce_js_1 = require("../../actions/public/getAccountNonce.js");
|
|
8
|
+
const getSenderAddress_js_1 = require("../../actions/public/getSenderAddress.js");
|
|
9
|
+
const getUserOperationHash_js_1 = require("../../utils/getUserOperationHash.js");
|
|
10
|
+
const types_js_1 = require("../types.js");
|
|
11
|
+
const KernelAccountAbi_js_1 = require("./abi/KernelAccountAbi.js");
|
|
12
|
+
const createAccountAbi = [
|
|
13
|
+
{
|
|
14
|
+
inputs: [
|
|
15
|
+
{
|
|
16
|
+
internalType: "address",
|
|
17
|
+
name: "_implementation",
|
|
18
|
+
type: "address"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
internalType: "bytes",
|
|
22
|
+
name: "_data",
|
|
23
|
+
type: "bytes"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
internalType: "uint256",
|
|
27
|
+
name: "_index",
|
|
28
|
+
type: "uint256"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
name: "createAccount",
|
|
32
|
+
outputs: [
|
|
33
|
+
{
|
|
34
|
+
internalType: "address",
|
|
35
|
+
name: "proxy",
|
|
36
|
+
type: "address"
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
stateMutability: "payable",
|
|
40
|
+
type: "function"
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
const KERNEL_ADDRESSES = {
|
|
44
|
+
ECDSA_VALIDATOR: "0xd9AB5096a832b9ce79914329DAEE236f8Eea0390",
|
|
45
|
+
ACCOUNT_V2_2_LOGIC: "0x0DA6a956B9488eD4dd761E59f52FDc6c8068E6B5",
|
|
46
|
+
FACTORY_ADDRESS: "0x5de4839a76cf55d0c90e2061ef4386d962E15ae3"
|
|
47
|
+
};
|
|
48
|
+
const getAccountInitCode = async ({ owner, index, factoryAddress, accountLogicAddress, ecdsaValidatorAddress }) => {
|
|
49
|
+
if (!owner)
|
|
50
|
+
throw new Error("Owner account not found");
|
|
51
|
+
const initialisationData = (0, viem_1.encodeFunctionData)({
|
|
52
|
+
abi: KernelAccountAbi_js_1.KernelInitAbi,
|
|
53
|
+
functionName: "initialize",
|
|
54
|
+
args: [ecdsaValidatorAddress, owner]
|
|
55
|
+
});
|
|
56
|
+
return (0, viem_1.concatHex)([
|
|
57
|
+
factoryAddress,
|
|
58
|
+
(0, viem_1.encodeFunctionData)({
|
|
59
|
+
abi: createAccountAbi,
|
|
60
|
+
functionName: "createAccount",
|
|
61
|
+
args: [accountLogicAddress, initialisationData, index]
|
|
62
|
+
})
|
|
63
|
+
]);
|
|
64
|
+
};
|
|
65
|
+
const getAccountAddress = async ({ client, owner, entryPoint, initCodeProvider, ecdsaValidatorAddress, deployedAccountAddress }) => {
|
|
66
|
+
if (deployedAccountAddress !== undefined) {
|
|
67
|
+
const deployedAccountOwner = await (0, actions_1.readContract)(client, {
|
|
68
|
+
address: ecdsaValidatorAddress,
|
|
69
|
+
abi: [
|
|
70
|
+
{
|
|
71
|
+
inputs: [
|
|
72
|
+
{
|
|
73
|
+
internalType: "address",
|
|
74
|
+
name: "",
|
|
75
|
+
type: "address"
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
name: "ecdsaValidatorStorage",
|
|
79
|
+
outputs: [
|
|
80
|
+
{
|
|
81
|
+
internalType: "address",
|
|
82
|
+
name: "owner",
|
|
83
|
+
type: "address"
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
stateMutability: "view",
|
|
87
|
+
type: "function"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
functionName: "ecdsaValidatorStorage",
|
|
91
|
+
args: [deployedAccountAddress]
|
|
92
|
+
});
|
|
93
|
+
if (!(0, viem_1.isAddressEqual)(deployedAccountOwner, owner)) {
|
|
94
|
+
throw new Error("Invalid owner for the already deployed account");
|
|
95
|
+
}
|
|
96
|
+
return deployedAccountAddress;
|
|
97
|
+
}
|
|
98
|
+
const initCode = await initCodeProvider();
|
|
99
|
+
return (0, getSenderAddress_js_1.getSenderAddress)(client, {
|
|
100
|
+
initCode,
|
|
101
|
+
entryPoint
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
async function signerToEcdsaKernelSmartAccount(client, { signer, entryPoint, index = 0n, factoryAddress = KERNEL_ADDRESSES.FACTORY_ADDRESS, accountLogicAddress = KERNEL_ADDRESSES.ACCOUNT_V2_2_LOGIC, ecdsaValidatorAddress = KERNEL_ADDRESSES.ECDSA_VALIDATOR, deployedAccountAddress }) {
|
|
105
|
+
const viemSigner = signer.type === "local"
|
|
106
|
+
? {
|
|
107
|
+
...signer,
|
|
108
|
+
signTransaction: (_, __) => {
|
|
109
|
+
throw new types_js_1.SignTransactionNotSupportedBySmartAccount();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
: signer;
|
|
113
|
+
const generateInitCode = () => getAccountInitCode({
|
|
114
|
+
owner: viemSigner.address,
|
|
115
|
+
index,
|
|
116
|
+
factoryAddress,
|
|
117
|
+
accountLogicAddress,
|
|
118
|
+
ecdsaValidatorAddress
|
|
119
|
+
});
|
|
120
|
+
const [accountAddress, chainId] = await Promise.all([
|
|
121
|
+
getAccountAddress({
|
|
122
|
+
client,
|
|
123
|
+
entryPoint,
|
|
124
|
+
owner: viemSigner.address,
|
|
125
|
+
ecdsaValidatorAddress,
|
|
126
|
+
initCodeProvider: generateInitCode,
|
|
127
|
+
deployedAccountAddress
|
|
128
|
+
}),
|
|
129
|
+
(0, actions_1.getChainId)(client)
|
|
130
|
+
]);
|
|
131
|
+
if (!accountAddress)
|
|
132
|
+
throw new Error("Account address not found");
|
|
133
|
+
const account = (0, accounts_1.toAccount)({
|
|
134
|
+
address: accountAddress,
|
|
135
|
+
async signMessage({ message }) {
|
|
136
|
+
return (0, actions_1.signMessage)(client, { account: viemSigner, message });
|
|
137
|
+
},
|
|
138
|
+
async signTransaction(_, __) {
|
|
139
|
+
throw new types_js_1.SignTransactionNotSupportedBySmartAccount();
|
|
140
|
+
},
|
|
141
|
+
async signTypedData(typedData) {
|
|
142
|
+
return (0, actions_1.signTypedData)(client, { account: viemSigner, ...typedData });
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
return {
|
|
146
|
+
...account,
|
|
147
|
+
client: client,
|
|
148
|
+
publicKey: accountAddress,
|
|
149
|
+
entryPoint: entryPoint,
|
|
150
|
+
source: "kernelEcdsaSmartAccount",
|
|
151
|
+
async getNonce() {
|
|
152
|
+
return (0, getAccountNonce_js_1.getAccountNonce)(client, {
|
|
153
|
+
sender: accountAddress,
|
|
154
|
+
entryPoint: entryPoint
|
|
155
|
+
});
|
|
156
|
+
},
|
|
157
|
+
async signUserOperation(userOperation) {
|
|
158
|
+
const hash = (0, getUserOperationHash_js_1.getUserOperationHash)({
|
|
159
|
+
userOperation: {
|
|
160
|
+
...userOperation,
|
|
161
|
+
signature: "0x"
|
|
162
|
+
},
|
|
163
|
+
entryPoint: entryPoint,
|
|
164
|
+
chainId: chainId
|
|
165
|
+
});
|
|
166
|
+
const signature = await (0, actions_1.signMessage)(client, {
|
|
167
|
+
account: viemSigner,
|
|
168
|
+
message: { raw: hash }
|
|
169
|
+
});
|
|
170
|
+
return (0, viem_1.concatHex)(["0x00000000", signature]);
|
|
171
|
+
},
|
|
172
|
+
async getInitCode() {
|
|
173
|
+
const contractCode = await (0, actions_1.getBytecode)(client, {
|
|
174
|
+
address: accountAddress
|
|
175
|
+
});
|
|
176
|
+
if ((contractCode?.length ?? 0) > 2)
|
|
177
|
+
return "0x";
|
|
178
|
+
return generateInitCode();
|
|
179
|
+
},
|
|
180
|
+
async encodeDeployCallData(_) {
|
|
181
|
+
throw new Error("Simple account doesn't support account deployment");
|
|
182
|
+
},
|
|
183
|
+
async encodeCallData(_tx) {
|
|
184
|
+
if (Array.isArray(_tx)) {
|
|
185
|
+
return (0, viem_1.encodeFunctionData)({
|
|
186
|
+
abi: KernelAccountAbi_js_1.KernelExecuteAbi,
|
|
187
|
+
functionName: "executeBatch",
|
|
188
|
+
args: [
|
|
189
|
+
_tx.map((tx) => ({
|
|
190
|
+
to: tx.to,
|
|
191
|
+
value: tx.value,
|
|
192
|
+
data: tx.data
|
|
193
|
+
}))
|
|
194
|
+
]
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
return (0, viem_1.encodeFunctionData)({
|
|
199
|
+
abi: KernelAccountAbi_js_1.KernelExecuteAbi,
|
|
200
|
+
functionName: "execute",
|
|
201
|
+
args: [_tx.to, _tx.value, _tx.data, 0]
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
async getDummySignature() {
|
|
206
|
+
return "0x00000000fffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c";
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
exports.signerToEcdsaKernelSmartAccount = signerToEcdsaKernelSmartAccount;
|
|
211
|
+
//# sourceMappingURL=signerToEcdsaKernelSmartAccount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signerToEcdsaKernelSmartAccount.js","sourceRoot":"","sources":["../../../accounts/kernel/signerToEcdsaKernelSmartAccount.ts"],"names":[],"mappings":";;;AAAA,+BAUa;AACb,4CAAyC;AACzC,0CAMqB;AACrB,gFAAyE;AACzE,kFAA2E;AAC3E,iFAA0E;AAE1E,0CAGoB;AACpB,mEAA2E;AAU3E,MAAM,gBAAgB,GAAG;IACrB;QACI,MAAM,EAAE;YACJ;gBACI,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE,SAAS;aAClB;YACD;gBACI,YAAY,EAAE,OAAO;gBACrB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,OAAO;aAChB;YACD;g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AAI,EAAE,EAAE,CAAC,IAAI;yBAChB,CAAC,CAAC;qBACN;iBACJ,CAAC,CAAA;aACL;iBAAM;gBAEH,OAAO,IAAA,yBAAkB,EAAC;oBACtB,GAAG,EAAE,sCAAgB;oBACrB,YAAY,EAAE,SAAS;oBACvB,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;iBACzC,CAAC,CAAA;aACL;QACL,CAAC;QAGD,KAAK,CAAC,iBAAiB;YACnB,OAAO,8IAA8I,CAAA;QACzJ,CAAC;KACJ,CAAA;AACL,CAAC;AAxJD,0EAwJC"}
|
|
@@ -21,7 +21,7 @@ const EIP712_SAFE_OPERATION_TYPE = {
|
|
|
21
21
|
};
|
|
22
22
|
const SAFE_VERSION_TO_ADDRESSES_MAP = {
|
|
23
23
|
"1.4.1": {
|
|
24
|
-
ADD_MODULES_LIB_ADDRESS: "
|
|
24
|
+
ADD_MODULES_LIB_ADDRESS: "0x8EcD4ec46D4D2a6B64fE960B3D64e8B94B2234eb",
|
|
25
25
|
SAFE_4337_MODULE_ADDRESS: "0x39E54Bb2b3Aa444b4B39DEe15De3b7809c36Fc38",
|
|
26
26
|
SAFE_PROXY_FACTORY_ADDRESS: "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67",
|
|
27
27
|
SAFE_SINGLETON_ADDRESS: "0x41675C099F32341bf84BFc5382aF534df5C7461a",
|
|
@@ -5,10 +5,18 @@ const deepHexlify_js_1 = require("../../utils/deepHexlify.js");
|
|
|
5
5
|
const sponsorUserOperation = async (client, args) => {
|
|
6
6
|
const response = await client.request({
|
|
7
7
|
method: "pm_sponsorUserOperation",
|
|
8
|
-
params:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
params: args.sponsorshipPolicyId
|
|
9
|
+
? [
|
|
10
|
+
(0, deepHexlify_js_1.deepHexlify)(args.userOperation),
|
|
11
|
+
args.entryPoint,
|
|
12
|
+
{
|
|
13
|
+
sponsorshipPolicyId: args.sponsorshipPolicyId
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
: [
|
|
17
|
+
(0, deepHexlify_js_1.deepHexlify)(args.userOperation),
|
|
18
|
+
args.entryPoint
|
|
19
|
+
]
|
|
12
20
|
});
|
|
13
21
|
return {
|
|
14
22
|
paymasterAndData: response.paymasterAndData,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/pimlico/sponsorUserOperation.ts"],"names":[],"mappings":";;;AAOA,+DAAwD;
|
|
1
|
+
{"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/pimlico/sponsorUserOperation.ts"],"names":[],"mappings":";;;AAOA,+DAAwD;AA8CjD,MAAM,oBAAoB,GAAG,KAAK,EAKrC,MAAuE,EACvE,IAA2C,EACJ,EAAE;IACzC,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,yBAAyB;QACjC,MAAM,EAAE,IAAI,CAAC,mBAAmB;YAC5B,CAAC,CAAC;gBACI,IAAA,4BAAW,EACP,IAAI,CAAC,aAAa,CACW;gBACjC,IAAI,CAAC,UAAU;gBACf;oBACI,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;iBAChD;aACJ;YACH,CAAC,CAAC;gBACI,IAAA,4BAAW,EACP,IAAI,CAAC,aAAa,CACW;gBACjC,IAAI,CAAC,UAAU;aAClB;KACV,CAAC,CAAA;IAEF,OAAO;QACH,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;QAC3C,kBAAkB,EAAE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QACvD,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QAC3D,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;KAC9C,CAAA;AACL,CAAC,CAAA;AAlCY,QAAA,oBAAoB,wBAkChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSmartAccountClient.js","sourceRoot":"","sources":["../../clients/createSmartAccountClient.ts"],"names":[],"mappings":";;;AAQA,+BAAmC;AAKnC,kEAGqC;
|
|
1
|
+
{"version":3,"file":"createSmartAccountClient.js","sourceRoot":"","sources":["../../clients/createSmartAccountClient.ts"],"names":[],"mappings":";;;AAQA,+BAAmC;AAKnC,kEAGqC;AAyD9B,MAAM,wBAAwB,GAAG,CAKpC,UACkC,EACiC,EAAE;IACrE,MAAM,EACF,GAAG,GAAG,SAAS,EACf,IAAI,GAAG,sBAAsB,EAC7B,SAAS,EACZ,GAAG,UAAU,CAAA;IACd,MAAM,MAAM,GAAG,IAAA,mBAAY,EAAC;QACxB,GAAG,UAAU;QACb,GAAG;QACH,IAAI;QACJ,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;QAC1D,IAAI,EAAE,oBAAoB;KAC7B,CAAC,CAAA;IAEF,OAAO,MAAM,CAAC,MAAM,CAChB,IAAA,qCAAmB,EAAC;QAChB,oBAAoB,EAAE,UAAU,CAAC,oBAAoB;KACxD,CAAC,CACL,CAAA;AACL,CAAC,CAAA;AA1BY,QAAA,wBAAwB,4BA0BpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":";;;AACA,mGAG0D;AAC1D,+FAIwD;AACxD,2FAIsD;AAmD/C,MAAM,qBAAqB,GAAG,CACjC,MAAc,EACO,EAAE,CAAC,CAAC;IACzB,wBAAwB,EAAE,KAAK,IAAI,EAAE,CACjC,IAAA,sDAAwB,EAAC,MAA8B,CAAC;IAC5D,sBAAsB,EAAE,KAAK,EAAE,IAAsC,EAAE,EAAE,CACrE,IAAA,kDAAsB,EAAC,MAA8B,EAAE,IAAI,CAAC;CACnE,CAAC,CAAA;AAPW,QAAA,qBAAqB,yBAOhC;AA+BK,MAAM,uBAAuB,GAAG,CACnC,MAAc,EACe,EAAE,CAAC,CAAC;IACjC,oBAAoB,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"pimlico.js","sourceRoot":"","sources":["../../../clients/decorators/pimlico.ts"],"names":[],"mappings":";;;AACA,mGAG0D;AAC1D,+FAIwD;AACxD,2FAIsD;AAmD/C,MAAM,qBAAqB,GAAG,CACjC,MAAc,EACO,EAAE,CAAC,CAAC;IACzB,wBAAwB,EAAE,KAAK,IAAI,EAAE,CACjC,IAAA,sDAAwB,EAAC,MAA8B,CAAC;IAC5D,sBAAsB,EAAE,KAAK,EAAE,IAAsC,EAAE,EAAE,CACrE,IAAA,kDAAsB,EAAC,MAA8B,EAAE,IAAI,CAAC;CACnE,CAAC,CAAA;AAPW,QAAA,qBAAqB,yBAOhC;AA+BK,MAAM,uBAAuB,GAAG,CACnC,MAAc,EACe,EAAE,CAAC,CAAC;IACjC,oBAAoB,EAAE,KAAK,EAAE,IAA2C,EAAE,EAAE,CACxE,IAAA,8CAAoB,EAAC,MAAgC,EAAE,IAAI,CAAC;CACnE,CAAC,CAAA;AALW,QAAA,uBAAuB,2BAKlC"}
|
package/_esm/accounts/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { privateKeyToSimpleSmartAccount } from "./privateKeyToSimpleSmartAccount
|
|
|
2
2
|
import { signerToSimpleSmartAccount } from "./signerToSimpleSmartAccount.js";
|
|
3
3
|
import { privateKeyToSafeSmartAccount } from "./privateKeyToSafeSmartAccount.js";
|
|
4
4
|
import { signerToSafeSmartAccount } from "./signerToSafeSmartAccount.js";
|
|
5
|
+
import { signerToEcdsaKernelSmartAccount } from "./kernel/signerToEcdsaKernelSmartAccount.js";
|
|
5
6
|
import { SignTransactionNotSupportedBySmartAccount } from "./types.js";
|
|
6
|
-
export { signerToSafeSmartAccount, signerToSimpleSmartAccount, SignTransactionNotSupportedBySmartAccount, privateKeyToSimpleSmartAccount, privateKeyToSafeSmartAccount };
|
|
7
|
+
export { signerToSafeSmartAccount, signerToSimpleSmartAccount, SignTransactionNotSupportedBySmartAccount, privateKeyToSimpleSmartAccount, privateKeyToSafeSmartAccount, signerToEcdsaKernelSmartAccount };
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAA;AAEpF,OAAO,EAEH,0BAA0B,EAC7B,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AAEhF,OAAO,EAGH,wBAAwB,EAC3B,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EACH,yCAAyC,EAG5C,MAAM,YAAY,CAAA;AAEnB,OAAO,EAIH,wBAAwB,EAExB,0BAA0B,EAC1B,yCAAyC,EACzC,8BAA8B,EAE9B,4BAA4B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../accounts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAA;AAEpF,OAAO,EAEH,0BAA0B,EAC7B,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AAEhF,OAAO,EAGH,wBAAwB,EAC3B,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EAEH,+BAA+B,EAClC,MAAM,6CAA6C,CAAA;AAEpD,OAAO,EACH,yCAAyC,EAG5C,MAAM,YAAY,CAAA;AAEnB,OAAO,EAIH,wBAAwB,EAExB,0BAA0B,EAC1B,yCAAyC,EACzC,8BAA8B,EAE9B,4BAA4B,EAE5B,+BAA+B,EAClC,CAAA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The exeute abi, used to execute a transaction on the kernel smart account
|
|
3
|
+
*/
|
|
4
|
+
export const KernelExecuteAbi = [
|
|
5
|
+
{
|
|
6
|
+
inputs: [
|
|
7
|
+
{
|
|
8
|
+
internalType: "address",
|
|
9
|
+
name: "to",
|
|
10
|
+
type: "address"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
internalType: "uint256",
|
|
14
|
+
name: "value",
|
|
15
|
+
type: "uint256"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
internalType: "bytes",
|
|
19
|
+
name: "data",
|
|
20
|
+
type: "bytes"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
internalType: "enum Operation",
|
|
24
|
+
name: "",
|
|
25
|
+
type: "uint8"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
name: "execute",
|
|
29
|
+
outputs: [],
|
|
30
|
+
stateMutability: "payable",
|
|
31
|
+
type: "function"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
inputs: [
|
|
35
|
+
{
|
|
36
|
+
components: [
|
|
37
|
+
{
|
|
38
|
+
internalType: "address",
|
|
39
|
+
name: "to",
|
|
40
|
+
type: "address"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
internalType: "uint256",
|
|
44
|
+
name: "value",
|
|
45
|
+
type: "uint256"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
internalType: "bytes",
|
|
49
|
+
name: "data",
|
|
50
|
+
type: "bytes"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
internalType: "struct Call[]",
|
|
54
|
+
name: "calls",
|
|
55
|
+
type: "tuple[]"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
name: "executeBatch",
|
|
59
|
+
outputs: [],
|
|
60
|
+
stateMutability: "payable",
|
|
61
|
+
type: "function"
|
|
62
|
+
}
|
|
63
|
+
];
|
|
64
|
+
/**
|
|
65
|
+
* The init abi, used to initialise kernel account
|
|
66
|
+
*/
|
|
67
|
+
export const KernelInitAbi = [
|
|
68
|
+
{
|
|
69
|
+
inputs: [
|
|
70
|
+
{
|
|
71
|
+
internalType: "contract IKernelValidator",
|
|
72
|
+
name: "_defaultValidator",
|
|
73
|
+
type: "address"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
internalType: "bytes",
|
|
77
|
+
name: "_data",
|
|
78
|
+
type: "bytes"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
name: "initialize",
|
|
82
|
+
outputs: [],
|
|
83
|
+
stateMutability: "payable",
|
|
84
|
+
type: "function"
|
|
85
|
+
}
|
|
86
|
+
];
|
|
87
|
+
//# sourceMappingURL=KernelAccountAbi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KernelAccountAbi.js","sourceRoot":"","sources":["../../../../accounts/kernel/abi/KernelAccountAbi.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B;QACI,MAAM,EAAE;YACJ;gBACI,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,IAAI;gBACV,IAAI,EAAE,SAAS;aAClB;YACD;gBACI,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aAClB;YACD;gBACI,YAAY,EAAE,OAAO;gBACrB,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,OAAO;aAChB;YACD;gBACI,YAAY,EAAE,gBAAgB;gBAC9B,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,OAAO;aAChB;SACJ;QACD,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,UAAU;KACnB;IACD;QACI,MAAM,EAAE;YACJ;gBACI,UAAU,EAAE;oBACR;wBACI,YAAY,EAAE,SAAS;wBACvB,IAAI,EAAE,IAAI;wBACV,IAAI,EAAE,S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