permissionless 0.0.12 → 0.0.13
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 +10 -0
- package/_cjs/accounts/index.js +9 -2
- package/_cjs/accounts/index.js.map +1 -1
- package/_cjs/accounts/privateKeyToSafeSmartAccount.js +24 -0
- package/_cjs/accounts/privateKeyToSafeSmartAccount.js.map +1 -0
- package/_cjs/accounts/privateKeyToSimpleSmartAccount.js +8 -160
- package/_cjs/accounts/privateKeyToSimpleSmartAccount.js.map +1 -1
- package/_cjs/accounts/signerToSafeSmartAccount.js +492 -0
- package/_cjs/accounts/signerToSafeSmartAccount.js.map +1 -0
- package/_cjs/accounts/signerToSimpleSmartAccount.js +190 -0
- package/_cjs/accounts/signerToSimpleSmartAccount.js.map +1 -0
- package/_cjs/accounts/types.js +20 -0
- package/_cjs/accounts/types.js.map +1 -1
- package/_cjs/actions/bundler/chainId.js.map +1 -1
- package/_cjs/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_cjs/actions/bundler/getUserOperationByHash.js.map +1 -1
- package/_cjs/actions/bundler/getUserOperationReceipt.js.map +1 -1
- package/_cjs/actions/bundler/sendUserOperation.js.map +1 -1
- package/_cjs/actions/bundler/supportedEntryPoints.js.map +1 -1
- package/_cjs/actions/bundler/waitForUserOperationReceipt.js.map +1 -1
- package/_cjs/actions/smartAccount/prepareUserOperationRequest.js +3 -1
- package/_cjs/actions/smartAccount/prepareUserOperationRequest.js.map +1 -1
- package/_cjs/actions/smartAccount/sendTransaction.js +3 -2
- package/_cjs/actions/smartAccount/sendTransaction.js.map +1 -1
- package/_cjs/actions/smartAccount/sendTransactions.js +46 -0
- package/_cjs/actions/smartAccount/sendTransactions.js.map +1 -0
- package/_cjs/actions/smartAccount.js +3 -1
- package/_cjs/actions/smartAccount.js.map +1 -1
- package/_cjs/clients/decorators/smartAccount.js +5 -0
- package/_cjs/clients/decorators/smartAccount.js.map +1 -1
- package/_esm/accounts/index.js +6 -3
- package/_esm/accounts/index.js.map +1 -1
- package/_esm/accounts/privateKeyToSafeSmartAccount.js +26 -0
- package/_esm/accounts/privateKeyToSafeSmartAccount.js.map +1 -0
- package/_esm/accounts/privateKeyToSimpleSmartAccount.js +9 -160
- package/_esm/accounts/privateKeyToSimpleSmartAccount.js.map +1 -1
- package/_esm/accounts/signerToSafeSmartAccount.js +499 -0
- package/_esm/accounts/signerToSafeSmartAccount.js.map +1 -0
- package/_esm/accounts/signerToSimpleSmartAccount.js +191 -0
- package/_esm/accounts/signerToSimpleSmartAccount.js.map +1 -0
- package/_esm/accounts/types.js +18 -0
- package/_esm/accounts/types.js.map +1 -1
- package/_esm/actions/bundler/chainId.js.map +1 -1
- package/_esm/actions/bundler/estimateUserOperationGas.js.map +1 -1
- package/_esm/actions/bundler/getUserOperationByHash.js.map +1 -1
- package/_esm/actions/bundler/getUserOperationReceipt.js.map +1 -1
- package/_esm/actions/bundler/sendUserOperation.js.map +1 -1
- package/_esm/actions/bundler/supportedEntryPoints.js.map +1 -1
- package/_esm/actions/bundler/waitForUserOperationReceipt.js.map +1 -1
- package/_esm/actions/pimlico/getUserOperationGasPrice.js +1 -1
- package/_esm/actions/pimlico/getUserOperationStatus.js +1 -1
- package/_esm/actions/smartAccount/prepareUserOperationRequest.js +3 -1
- package/_esm/actions/smartAccount/prepareUserOperationRequest.js.map +1 -1
- package/_esm/actions/smartAccount/sendTransaction.js +3 -2
- package/_esm/actions/smartAccount/sendTransaction.js.map +1 -1
- package/_esm/actions/smartAccount/sendTransactions.js +90 -0
- package/_esm/actions/smartAccount/sendTransactions.js.map +1 -0
- package/_esm/actions/smartAccount.js +2 -1
- package/_esm/actions/smartAccount.js.map +1 -1
- package/_esm/actions/stackup/accounts.js +1 -1
- package/_esm/actions/stackup/sponsorUserOperation.js +1 -1
- package/_esm/clients/decorators/pimlico.js +1 -1
- package/_esm/clients/decorators/smartAccount.js +5 -0
- package/_esm/clients/decorators/smartAccount.js.map +1 -1
- package/_esm/clients/pimlico.js +1 -1
- package/_esm/clients/stackup.js +1 -1
- package/_types/accounts/index.d.ts +6 -3
- package/_types/accounts/index.d.ts.map +1 -1
- package/_types/accounts/privateKeyToSafeSmartAccount.d.ts +26 -0
- package/_types/accounts/privateKeyToSafeSmartAccount.d.ts.map +1 -0
- package/_types/accounts/privateKeyToSimpleSmartAccount.d.ts +5 -11
- package/_types/accounts/privateKeyToSimpleSmartAccount.d.ts.map +1 -1
- package/_types/accounts/signerToSafeSmartAccount.d.ts +28 -0
- package/_types/accounts/signerToSafeSmartAccount.d.ts.map +1 -0
- package/_types/accounts/signerToSimpleSmartAccount.d.ts +15 -0
- package/_types/accounts/signerToSimpleSmartAccount.d.ts.map +1 -0
- package/_types/accounts/types.d.ts +14 -3
- package/_types/accounts/types.d.ts.map +1 -1
- package/_types/actions/bundler/chainId.d.ts +3 -2
- package/_types/actions/bundler/chainId.d.ts.map +1 -1
- package/_types/actions/bundler/estimateUserOperationGas.d.ts +3 -3
- package/_types/actions/bundler/estimateUserOperationGas.d.ts.map +1 -1
- package/_types/actions/bundler/getUserOperationByHash.d.ts +3 -3
- package/_types/actions/bundler/getUserOperationByHash.d.ts.map +1 -1
- package/_types/actions/bundler/getUserOperationReceipt.d.ts +3 -3
- package/_types/actions/bundler/getUserOperationReceipt.d.ts.map +1 -1
- package/_types/actions/bundler/sendUserOperation.d.ts +3 -3
- package/_types/actions/bundler/sendUserOperation.d.ts.map +1 -1
- package/_types/actions/bundler/supportedEntryPoints.d.ts +3 -3
- package/_types/actions/bundler/supportedEntryPoints.d.ts.map +1 -1
- package/_types/actions/bundler/waitForUserOperationReceipt.d.ts +2 -3
- package/_types/actions/bundler/waitForUserOperationReceipt.d.ts.map +1 -1
- package/_types/actions/pimlico/getUserOperationGasPrice.d.ts +1 -1
- package/_types/actions/pimlico/getUserOperationStatus.d.ts +1 -1
- package/_types/actions/smartAccount/prepareUserOperationRequest.d.ts.map +1 -1
- package/_types/actions/smartAccount/sendTransaction.d.ts.map +1 -1
- package/_types/actions/smartAccount/sendTransactions.d.ts +63 -0
- package/_types/actions/smartAccount/sendTransactions.d.ts.map +1 -0
- package/_types/actions/smartAccount.d.ts +2 -1
- package/_types/actions/smartAccount.d.ts.map +1 -1
- package/_types/actions/stackup/accounts.d.ts +1 -1
- package/_types/actions/stackup/sponsorUserOperation.d.ts +1 -1
- package/_types/clients/createSmartAccountClient.d.ts +1 -0
- package/_types/clients/createSmartAccountClient.d.ts.map +1 -1
- package/_types/clients/decorators/bundler.d.ts +1 -1
- package/_types/clients/decorators/pimlico.d.ts +3 -3
- package/_types/clients/decorators/smartAccount.d.ts +51 -0
- package/_types/clients/decorators/smartAccount.d.ts.map +1 -1
- package/_types/clients/pimlico.d.ts +1 -1
- package/_types/clients/stackup.d.ts +1 -1
- package/_types/types/index.d.ts +1 -0
- package/_types/types/index.d.ts.map +1 -1
- package/accounts/index.ts +26 -7
- package/accounts/privateKeyToSafeSmartAccount.ts +73 -0
- package/accounts/privateKeyToSimpleSmartAccount.ts +15 -191
- package/accounts/signerToSafeSmartAccount.ts +775 -0
- package/accounts/signerToSimpleSmartAccount.ts +267 -0
- package/accounts/types.ts +43 -12
- package/actions/bundler/chainId.ts +9 -1
- package/actions/bundler/estimateUserOperationGas.ts +8 -3
- package/actions/bundler/getUserOperationByHash.ts +8 -3
- package/actions/bundler/getUserOperationReceipt.ts +16 -3
- package/actions/bundler/sendUserOperation.ts +8 -3
- package/actions/bundler/supportedEntryPoints.ts +8 -3
- package/actions/bundler/waitForUserOperationReceipt.ts +15 -4
- package/actions/pimlico/getUserOperationGasPrice.ts +1 -1
- package/actions/pimlico/getUserOperationStatus.ts +1 -1
- package/actions/smartAccount/prepareUserOperationRequest.ts +3 -1
- package/actions/smartAccount/sendTransaction.ts +3 -1
- package/actions/smartAccount/sendTransactions.ts +141 -0
- package/actions/smartAccount.ts +8 -1
- package/actions/stackup/accounts.ts +1 -1
- package/actions/stackup/sponsorUserOperation.ts +1 -1
- package/clients/decorators/bundler.ts +1 -1
- package/clients/decorators/pimlico.ts +3 -3
- package/clients/decorators/smartAccount.ts +61 -0
- package/clients/pimlico.ts +1 -1
- package/clients/stackup.ts +1 -1
- package/package.json +2 -2
- package/types/index.ts +5 -0
- package/tsconfig.build.tsbuildinfo +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# permissionless
|
|
2
2
|
|
|
3
|
+
## 0.0.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 69a7b4b: Added support to enable extra modules and transactions during setup for Safe account
|
|
8
|
+
- 639775d: Added support for passing in custom signers
|
|
9
|
+
- 0254c24: Enable batch calls for Safe account
|
|
10
|
+
- b95e9e5: Enable setting custom nonce for user operations
|
|
11
|
+
- 39164f7: Added support for Safe account management
|
|
12
|
+
|
|
3
13
|
## 0.0.12
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/_cjs/accounts/index.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.privateKeyToSimpleSmartAccount = exports.SignTransactionNotSupportedBySmartAccount = void 0;
|
|
3
|
+
exports.privateKeyToSafeSmartAccount = exports.privateKeyToSimpleSmartAccount = exports.SignTransactionNotSupportedBySmartAccount = exports.signerToSimpleSmartAccount = exports.signerToSafeSmartAccount = void 0;
|
|
4
4
|
const privateKeyToSimpleSmartAccount_js_1 = require("./privateKeyToSimpleSmartAccount.js");
|
|
5
|
-
Object.defineProperty(exports, "SignTransactionNotSupportedBySmartAccount", { enumerable: true, get: function () { return privateKeyToSimpleSmartAccount_js_1.SignTransactionNotSupportedBySmartAccount; } });
|
|
6
5
|
Object.defineProperty(exports, "privateKeyToSimpleSmartAccount", { enumerable: true, get: function () { return privateKeyToSimpleSmartAccount_js_1.privateKeyToSimpleSmartAccount; } });
|
|
6
|
+
const signerToSimpleSmartAccount_js_1 = require("./signerToSimpleSmartAccount.js");
|
|
7
|
+
Object.defineProperty(exports, "signerToSimpleSmartAccount", { enumerable: true, get: function () { return signerToSimpleSmartAccount_js_1.signerToSimpleSmartAccount; } });
|
|
8
|
+
const privateKeyToSafeSmartAccount_js_1 = require("./privateKeyToSafeSmartAccount.js");
|
|
9
|
+
Object.defineProperty(exports, "privateKeyToSafeSmartAccount", { enumerable: true, get: function () { return privateKeyToSafeSmartAccount_js_1.privateKeyToSafeSmartAccount; } });
|
|
10
|
+
const signerToSafeSmartAccount_js_1 = require("./signerToSafeSmartAccount.js");
|
|
11
|
+
Object.defineProperty(exports, "signerToSafeSmartAccount", { enumerable: true, get: function () { return signerToSafeSmartAccount_js_1.signerToSafeSmartAccount; } });
|
|
12
|
+
const types_js_1 = require("./types.js");
|
|
13
|
+
Object.defineProperty(exports, "SignTransactionNotSupportedBySmartAccount", { enumerable: true, get: function () { return types_js_1.SignTransactionNotSupportedBySmartAccount; } });
|
|
7
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../accounts/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../accounts/index.ts"],"names":[],"mappings":";;;AAAA,2FAAoF;AA6BhF,+GA7BK,kEAA8B,OA6BL;AA3BlC,mFAGwC;AAsBpC,2GAvBA,0DAA0B,OAuBA;AApB9B,uFAAgF;AAwB5E,6GAxBK,8DAA4B,OAwBL;AAtBhC,+EAIsC;AAYlC,yGAbA,sDAAwB,OAaA;AAV5B,yCAImB;AASf,0HAZA,oDAAyC,OAYA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.privateKeyToSafeSmartAccount = void 0;
|
|
4
|
+
const accounts_1 = require("viem/accounts");
|
|
5
|
+
const signerToSafeSmartAccount_js_1 = require("./signerToSafeSmartAccount.js");
|
|
6
|
+
async function privateKeyToSafeSmartAccount(client, { privateKey, safeVersion, entryPoint, addModuleLibAddress: _addModuleLibAddress, safe4337ModuleAddress: _safe4337ModuleAddress, safeProxyFactoryAddress: _safeProxyFactoryAddress, safeSingletonAddress: _safeSingletonAddress, multiSendAddress: _multiSendAddress, multiSendCallOnlyAddress: _multiSendCallOnlyAddress, saltNonce = 0n, safeModules = [], setupTransactions = [] }) {
|
|
7
|
+
const privateKeyAccount = (0, accounts_1.privateKeyToAccount)(privateKey);
|
|
8
|
+
return (0, signerToSafeSmartAccount_js_1.signerToSafeSmartAccount)(client, {
|
|
9
|
+
signer: privateKeyAccount,
|
|
10
|
+
safeVersion,
|
|
11
|
+
entryPoint,
|
|
12
|
+
addModuleLibAddress: _addModuleLibAddress,
|
|
13
|
+
safe4337ModuleAddress: _safe4337ModuleAddress,
|
|
14
|
+
safeProxyFactoryAddress: _safeProxyFactoryAddress,
|
|
15
|
+
safeSingletonAddress: _safeSingletonAddress,
|
|
16
|
+
multiSendAddress: _multiSendAddress,
|
|
17
|
+
multiSendCallOnlyAddress: _multiSendCallOnlyAddress,
|
|
18
|
+
saltNonce,
|
|
19
|
+
safeModules,
|
|
20
|
+
setupTransactions
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
exports.privateKeyToSafeSmartAccount = privateKeyToSafeSmartAccount;
|
|
24
|
+
//# sourceMappingURL=privateKeyToSafeSmartAccount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privateKeyToSafeSmartAccount.js","sourceRoot":"","sources":["../../accounts/privateKeyToSafeSmartAccount.ts"],"names":[],"mappings":";;;AAOA,4CAAmD;AACnD,+EAIsC;AAO/B,KAAK,UAAU,4BAA4B,CAI9C,MAAkC,EAClC,EACI,UAAU,EACV,WAAW,EACX,UAAU,EACV,mBAAmB,EAAE,oBAAoB,EACzC,qBAAqB,EAAE,sBAAsB,EAC7C,uBAAuB,EAAE,wBAAwB,EACjD,oBAAoB,EAAE,qBAAqB,EAC3C,gBAAgB,EAAE,iBAAiB,EACnC,wBAAwB,EAAE,yBAAyB,EACnD,SAAS,GAAG,EAAE,EACd,WAAW,GAAG,EAAE,EAChB,iBAAiB,GAAG,EAAE,EAkBzB;IAED,MAAM,iBAAiB,GAAG,IAAA,8BAAmB,EAAC,UAAU,CAAC,CAAA;IAEzD,OAAO,IAAA,sDAAwB,EAAC,MAAM,EAAE;QACpC,MAAM,EAAE,iBAAiB;QACzB,WAAW;QACX,UAAU;QACV,mBAAmB,EAAE,oBAAoB;QACzC,qBAAqB,EAAE,sBAAsB;QAC7C,uBAAuB,EAAE,wBAAwB;QACjD,oBAAoB,EAAE,qBAAqB;QAC3C,gBAAgB,EAAE,iBAAiB;QACnC,wBAAwB,EAAE,yBAAyB;QACnD,SAAS;QACT,WAAW;QACX,iBAAiB;KACpB,CAAC,CAAA;AACN,CAAC;AArDD,oEAqDC"}
|
|
@@ -1,168 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.privateKeyToSimpleSmartAccount =
|
|
4
|
-
const viem_1 = require("viem");
|
|
3
|
+
exports.privateKeyToSimpleSmartAccount = void 0;
|
|
5
4
|
const accounts_1 = require("viem/accounts");
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const getSenderAddress_js_1 = require("../actions/public/getSenderAddress.js");
|
|
9
|
-
const getUserOperationHash_js_1 = require("../utils/getUserOperationHash.js");
|
|
10
|
-
class SignTransactionNotSupportedBySmartAccount extends viem_1.BaseError {
|
|
11
|
-
constructor({ docsPath } = {}) {
|
|
12
|
-
super([
|
|
13
|
-
"A smart account cannot sign or send transaction, it can only sign message or userOperation.",
|
|
14
|
-
"Please send user operation instead."
|
|
15
|
-
].join("\n"), {
|
|
16
|
-
docsPath,
|
|
17
|
-
docsSlug: "account"
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(this, "name", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
configurable: true,
|
|
22
|
-
writable: true,
|
|
23
|
-
value: "SignTransactionNotSupportedBySmartAccount"
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.SignTransactionNotSupportedBySmartAccount = SignTransactionNotSupportedBySmartAccount;
|
|
28
|
-
const getAccountInitCode = async (factoryAddress, owner, index = 0n) => {
|
|
29
|
-
if (!owner)
|
|
30
|
-
throw new Error("Owner account not found");
|
|
31
|
-
return (0, viem_1.concatHex)([
|
|
32
|
-
factoryAddress,
|
|
33
|
-
(0, viem_1.encodeFunctionData)({
|
|
34
|
-
abi: [
|
|
35
|
-
{
|
|
36
|
-
inputs: [
|
|
37
|
-
{
|
|
38
|
-
internalType: "address",
|
|
39
|
-
name: "owner",
|
|
40
|
-
type: "address"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
internalType: "uint256",
|
|
44
|
-
name: "salt",
|
|
45
|
-
type: "uint256"
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
name: "createAccount",
|
|
49
|
-
outputs: [
|
|
50
|
-
{
|
|
51
|
-
internalType: "contract SimpleAccount",
|
|
52
|
-
name: "ret",
|
|
53
|
-
type: "address"
|
|
54
|
-
}
|
|
55
|
-
],
|
|
56
|
-
stateMutability: "nonpayable",
|
|
57
|
-
type: "function"
|
|
58
|
-
}
|
|
59
|
-
],
|
|
60
|
-
functionName: "createAccount",
|
|
61
|
-
args: [owner, index]
|
|
62
|
-
})
|
|
63
|
-
]);
|
|
64
|
-
};
|
|
65
|
-
const getAccountAddress = async ({ client, factoryAddress, entryPoint, owner }) => {
|
|
66
|
-
const initCode = await getAccountInitCode(factoryAddress, owner);
|
|
67
|
-
return (0, getSenderAddress_js_1.getSenderAddress)(client, {
|
|
68
|
-
initCode,
|
|
69
|
-
entryPoint
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
async function privateKeyToSimpleSmartAccount(client, { privateKey, factoryAddress, entryPoint }) {
|
|
5
|
+
const signerToSimpleSmartAccount_js_1 = require("./signerToSimpleSmartAccount.js");
|
|
6
|
+
async function privateKeyToSimpleSmartAccount(client, { privateKey, factoryAddress, entryPoint, index = 0n }) {
|
|
73
7
|
const privateKeyAccount = (0, accounts_1.privateKeyToAccount)(privateKey);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
owner: privateKeyAccount.address
|
|
80
|
-
}),
|
|
81
|
-
(0, actions_1.getChainId)(client)
|
|
82
|
-
]);
|
|
83
|
-
if (!accountAddress)
|
|
84
|
-
throw new Error("Account address not found");
|
|
85
|
-
const account = (0, accounts_1.toAccount)({
|
|
86
|
-
address: accountAddress,
|
|
87
|
-
async signMessage({ message }) {
|
|
88
|
-
return privateKeyAccount.signMessage({ message });
|
|
89
|
-
},
|
|
90
|
-
async signTransaction(_, __) {
|
|
91
|
-
throw new SignTransactionNotSupportedBySmartAccount();
|
|
92
|
-
},
|
|
93
|
-
async signTypedData(typedData) {
|
|
94
|
-
return privateKeyAccount.signTypedData({ ...typedData, privateKey });
|
|
95
|
-
}
|
|
8
|
+
return (0, signerToSimpleSmartAccount_js_1.signerToSimpleSmartAccount)(client, {
|
|
9
|
+
signer: privateKeyAccount,
|
|
10
|
+
factoryAddress,
|
|
11
|
+
entryPoint,
|
|
12
|
+
index
|
|
96
13
|
});
|
|
97
|
-
return {
|
|
98
|
-
...account,
|
|
99
|
-
client: client,
|
|
100
|
-
publicKey: accountAddress,
|
|
101
|
-
entryPoint: entryPoint,
|
|
102
|
-
source: "privateKeySimpleSmartAccount",
|
|
103
|
-
async getNonce() {
|
|
104
|
-
return (0, getAccountNonce_js_1.getAccountNonce)(client, {
|
|
105
|
-
sender: accountAddress,
|
|
106
|
-
entryPoint: entryPoint
|
|
107
|
-
});
|
|
108
|
-
},
|
|
109
|
-
async signUserOperation(userOperation) {
|
|
110
|
-
return account.signMessage({
|
|
111
|
-
message: {
|
|
112
|
-
raw: (0, getUserOperationHash_js_1.getUserOperationHash)({
|
|
113
|
-
userOperation,
|
|
114
|
-
entryPoint: entryPoint,
|
|
115
|
-
chainId: chainId
|
|
116
|
-
})
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
},
|
|
120
|
-
async getInitCode() {
|
|
121
|
-
const contractCode = await (0, actions_1.getBytecode)(client, {
|
|
122
|
-
address: accountAddress
|
|
123
|
-
});
|
|
124
|
-
if ((contractCode?.length ?? 0) > 2)
|
|
125
|
-
return "0x";
|
|
126
|
-
return getAccountInitCode(factoryAddress, privateKeyAccount.address);
|
|
127
|
-
},
|
|
128
|
-
async encodeDeployCallData(_) {
|
|
129
|
-
throw new Error("Simple account doesn't support account deployment");
|
|
130
|
-
},
|
|
131
|
-
async encodeCallData({ to, value, data }) {
|
|
132
|
-
return (0, viem_1.encodeFunctionData)({
|
|
133
|
-
abi: [
|
|
134
|
-
{
|
|
135
|
-
inputs: [
|
|
136
|
-
{
|
|
137
|
-
internalType: "address",
|
|
138
|
-
name: "dest",
|
|
139
|
-
type: "address"
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
internalType: "uint256",
|
|
143
|
-
name: "value",
|
|
144
|
-
type: "uint256"
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
internalType: "bytes",
|
|
148
|
-
name: "func",
|
|
149
|
-
type: "bytes"
|
|
150
|
-
}
|
|
151
|
-
],
|
|
152
|
-
name: "execute",
|
|
153
|
-
outputs: [],
|
|
154
|
-
stateMutability: "nonpayable",
|
|
155
|
-
type: "function"
|
|
156
|
-
}
|
|
157
|
-
],
|
|
158
|
-
functionName: "execute",
|
|
159
|
-
args: [to, value, data]
|
|
160
|
-
});
|
|
161
|
-
},
|
|
162
|
-
async getDummySignature() {
|
|
163
|
-
return "0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c";
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
14
|
}
|
|
167
15
|
exports.privateKeyToSimpleSmartAccount = privateKeyToSimpleSmartAccount;
|
|
168
16
|
//# sourceMappingURL=privateKeyToSimpleSmartAccount.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"privateKeyToSimpleSmartAccount.js","sourceRoot":"","sources":["../../accounts/privateKeyToSimpleSmartAccount.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"privateKeyToSimpleSmartAccount.js","sourceRoot":"","sources":["../../accounts/privateKeyToSimpleSmartAccount.ts"],"names":[],"mappings":";;;AAOA,4CAAmD;AACnD,mFAGwC;AAOjC,KAAK,UAAU,8BAA8B,CAIhD,MAAkC,EAClC,EACI,UAAU,EACV,cAAc,EACd,UAAU,EACV,KAAK,GAAG,EAAE,EAMb;IAED,MAAM,iBAAiB,GAAG,IAAA,8BAAmB,EAAC,UAAU,CAAC,CAAA;IAEzD,OAAO,IAAA,0DAA0B,EAAC,MAAM,EAAE;QACtC,MAAM,EAAE,iBAAiB;QACzB,cAAc;QACd,UAAU;QACV,KAAK;KACR,CAAC,CAAA;AACN,CAAC;AAzBD,wEAyBC"}
|