@charterlabs/rhinestone-sdk 0.3.0 → 0.3.2
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 +31 -200
- package/dist/src/accounts/error.d.ts +8 -1
- package/dist/src/accounts/error.d.ts.map +1 -1
- package/dist/src/accounts/error.js +10 -1
- package/dist/src/accounts/index.d.ts +11 -10
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +79 -50
- package/dist/src/accounts/kernel.d.ts +3 -5
- package/dist/src/accounts/kernel.d.ts.map +1 -1
- package/dist/src/accounts/kernel.js +8 -17
- package/dist/src/accounts/kernel.test.js +10 -3
- package/dist/src/accounts/nexus.d.ts +3 -5
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/nexus.js +108 -57
- package/dist/src/accounts/nexus.test.js +10 -3
- package/dist/src/accounts/passport.d.ts +4 -7
- package/dist/src/accounts/passport.d.ts.map +1 -1
- package/dist/src/accounts/passport.js +0 -91
- package/dist/src/accounts/safe.d.ts +9 -4
- package/dist/src/accounts/safe.d.ts.map +1 -1
- package/dist/src/accounts/safe.js +108 -38
- package/dist/src/accounts/safe.test.js +10 -3
- package/dist/src/accounts/signing/common.d.ts +3 -3
- package/dist/src/accounts/signing/common.d.ts.map +1 -1
- package/dist/src/accounts/signing/common.js +29 -5
- package/dist/src/accounts/signing/message.js +2 -2
- package/dist/src/accounts/signing/typedData.d.ts.map +1 -1
- package/dist/src/accounts/signing/typedData.js +3 -3
- package/dist/src/accounts/startale.d.ts +2 -4
- package/dist/src/accounts/startale.d.ts.map +1 -1
- package/dist/src/accounts/startale.js +0 -4
- package/dist/src/accounts/utils.d.ts.map +1 -1
- package/dist/src/accounts/utils.js +10 -3
- package/dist/src/accounts/walletClient.d.ts.map +1 -1
- package/dist/src/accounts/walletClient.js +6 -0
- package/dist/src/actions/compact.d.ts +4 -2
- package/dist/src/actions/compact.d.ts.map +1 -1
- package/dist/src/actions/compact.js +4 -1
- package/dist/src/actions/deployment.d.ts +19 -0
- package/dist/src/actions/deployment.d.ts.map +1 -0
- package/dist/src/actions/deployment.js +78 -0
- package/dist/src/actions/index.d.ts +3 -1
- package/dist/src/actions/index.d.ts.map +1 -1
- package/dist/src/actions/index.js +12 -0
- package/dist/src/actions/smart-sessions.d.ts +17 -8
- package/dist/src/actions/smart-sessions.d.ts.map +1 -1
- package/dist/src/actions/smart-sessions.js +40 -4
- package/dist/src/errors/index.d.ts +3 -3
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/errors/index.js +3 -1
- package/dist/src/execution/compact.d.ts +15 -18
- package/dist/src/execution/compact.d.ts.map +1 -1
- package/dist/src/execution/compact.js +15 -17
- package/dist/src/execution/error.d.ts +2 -8
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +1 -10
- package/dist/src/execution/index.d.ts +6 -6
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +22 -28
- package/dist/src/execution/permit2.d.ts +12 -17
- package/dist/src/execution/permit2.d.ts.map +1 -1
- package/dist/src/execution/permit2.js +10 -16
- package/dist/src/execution/singleChainOps.d.ts +15 -3
- package/dist/src/execution/singleChainOps.d.ts.map +1 -1
- package/dist/src/execution/singleChainOps.js +17 -3
- package/dist/src/execution/utils.d.ts +36 -12
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +180 -133
- package/dist/src/index.d.ts +26 -8
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +49 -16
- package/dist/src/modules/abi/smart-session-emissary.d.ts +696 -0
- package/dist/src/modules/abi/smart-session-emissary.d.ts.map +1 -0
- package/dist/src/modules/abi/smart-session-emissary.js +565 -0
- package/dist/src/modules/chain-abstraction.d.ts +5 -0
- package/dist/src/modules/chain-abstraction.d.ts.map +1 -0
- package/dist/src/modules/chain-abstraction.js +7 -0
- package/dist/src/modules/common.d.ts +7 -1
- package/dist/src/modules/common.d.ts.map +1 -1
- package/dist/src/modules/index.d.ts +3 -9
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +11 -8
- package/dist/src/modules/index.test.js +3 -9
- package/dist/src/modules/legacy.d.ts +10 -0
- package/dist/src/modules/legacy.d.ts.map +1 -0
- package/dist/src/modules/legacy.js +65 -0
- package/dist/src/modules/validators/core.d.ts +2 -1
- package/dist/src/modules/validators/core.d.ts.map +1 -1
- package/dist/src/modules/validators/core.js +4 -1
- package/dist/src/modules/validators/index.d.ts +2 -2
- package/dist/src/modules/validators/index.d.ts.map +1 -1
- package/dist/src/modules/validators/index.js +1 -6
- package/dist/src/modules/validators/smart-sessions.d.ts +112 -23
- package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.js +426 -301
- package/dist/src/orchestrator/client.d.ts +3 -4
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +49 -53
- package/dist/src/orchestrator/error.d.ts +11 -1
- package/dist/src/orchestrator/error.d.ts.map +1 -1
- package/dist/src/orchestrator/error.js +16 -1
- package/dist/src/orchestrator/index.d.ts +5 -5
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +3 -1
- package/dist/src/orchestrator/registry.d.ts +3 -2
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +15 -14
- package/dist/src/orchestrator/registry.test.js +18 -1
- package/dist/src/orchestrator/types.d.ts +33 -8
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/orchestrator/types.js +15 -1
- package/dist/src/types.d.ts +57 -28
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/index.d.ts +14 -2
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +46 -4
- package/dist/test/utils/utils.d.ts +5 -0
- package/dist/test/utils/utils.d.ts.map +1 -0
- package/dist/test/utils/utils.js +20 -0
- package/package.json +33 -3
- package/dist/src/execution/smart-session.d.ts +0 -13
- package/dist/src/execution/smart-session.d.ts.map +0 -1
- package/dist/src/execution/smart-session.js +0 -178
- package/dist/src/modules/omni-account.d.ts +0 -8
- package/dist/src/modules/omni-account.d.ts.map +0 -1
- package/dist/src/modules/omni-account.js +0 -13
- package/dist/src/modules/validators/smart-sessions.test.d.ts +0 -2
- package/dist/src/modules/validators/smart-sessions.test.d.ts.map +0 -1
- package/dist/src/modules/validators/smart-sessions.test.js +0 -222
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type Abi, type Address, type Chain, type Hex, type PublicClient } from 'viem';
|
|
2
2
|
import { type SmartAccount, type SmartAccountImplementation } from 'viem/account-abstraction';
|
|
3
3
|
import type { Module } from '../modules/common';
|
|
4
|
-
import type {
|
|
5
|
-
import type { OwnerSet, RhinestoneAccountConfig, Session } from '../types';
|
|
4
|
+
import type { OwnerSet, RhinestoneAccountConfig } from '../types';
|
|
6
5
|
import { type ValidatorConfig } from './utils';
|
|
7
6
|
declare function getDeployArgs(config: RhinestoneAccountConfig): {
|
|
8
7
|
factory: `0x${string}`;
|
|
@@ -10,6 +9,13 @@ declare function getDeployArgs(config: RhinestoneAccountConfig): {
|
|
|
10
9
|
salt: `0x${string}`;
|
|
11
10
|
implementation: `0x${string}`;
|
|
12
11
|
initializationCallData: null;
|
|
12
|
+
} | null;
|
|
13
|
+
declare function getV0DeployArgs(config: RhinestoneAccountConfig): {
|
|
14
|
+
factory: `0x${string}`;
|
|
15
|
+
factoryData: `0x${string}`;
|
|
16
|
+
salt: `0x${string}`;
|
|
17
|
+
implementation: `0x${string}`;
|
|
18
|
+
initializationCallData: null;
|
|
13
19
|
};
|
|
14
20
|
declare function getAddress(config: RhinestoneAccountConfig): `0x${string}`;
|
|
15
21
|
declare function getEip712Domain(config: RhinestoneAccountConfig, chain: Chain): {
|
|
@@ -22,7 +28,6 @@ declare function getEip712Domain(config: RhinestoneAccountConfig, chain: Chain):
|
|
|
22
28
|
declare function getInstallData(module: Module): `0x${string}`;
|
|
23
29
|
declare function packSignature(signature: Hex, validator: ValidatorConfig, transformSignature?: (signature: Hex) => Hex): Promise<`0x${string}`>;
|
|
24
30
|
declare function getSmartAccount(client: PublicClient, address: Address, owners: OwnerSet, validatorAddress: Address, sign: (hash: Hex) => Promise<Hex>): Promise<SmartAccount<SmartAccountImplementation<Abi, "0.7">>>;
|
|
25
|
-
declare function getSessionSmartAccount(client: PublicClient, address: Address, session: Session, validatorAddress: Address, enableData: EnableSessionData | null, sign: (hash: Hex) => Promise<Hex>): Promise<SmartAccount<SmartAccountImplementation<Abi, "0.7">>>;
|
|
26
31
|
declare function getGuardianSmartAccount(client: PublicClient, address: Address, guardians: OwnerSet, validatorAddress: Address, sign: (hash: Hex) => Promise<Hex>): Promise<SmartAccount<SmartAccountImplementation<Abi, "0.7">>>;
|
|
27
|
-
export { getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs,
|
|
32
|
+
export { getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getV0DeployArgs, getSmartAccount, getGuardianSmartAccount, };
|
|
28
33
|
//# sourceMappingURL=safe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../../accounts/safe.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EACZ,KAAK,KAAK,EAOV,KAAK,GAAG,EAER,KAAK,YAAY,EAKlB,MAAM,MAAM,CAAA;AACb,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAEhC,MAAM,0BAA0B,CAAA;AAGjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../../accounts/safe.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EACR,KAAK,OAAO,EACZ,KAAK,KAAK,EAOV,KAAK,GAAG,EAER,KAAK,YAAY,EAKlB,MAAM,MAAM,CAAA;AACb,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAEhC,MAAM,0BAA0B,CAAA;AAGjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAM/C,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAe,MAAM,UAAU,CAAA;AAM9E,OAAO,EAAoC,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAoBhF,iBAAS,aAAa,CAAC,MAAM,EAAE,uBAAuB;;;;;;SAmGrD;AAED,iBAAS,eAAe,CAAC,MAAM,EAAE,uBAAuB;;;;;;EAgFvD;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,uBAAuB,iBAiBlD;AAED,iBAAS,eAAe,CAAC,MAAM,EAAE,uBAAuB,EAAE,KAAK,EAAE,KAAK;;;;;;EAarE;AAED,iBAAS,cAAc,CAAC,MAAM,EAAE,MAAM,iBA2BrC;AAED,iBAAe,aAAa,CAC1B,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,eAAe,EAC1B,kBAAkB,GAAE,CAAC,SAAS,EAAE,GAAG,KAAK,GAA8B,0BAMvE;AAED,iBAAe,eAAe,CAC5B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,gBAAgB,EAAE,OAAO,EACzB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,iEAWlC;AAED,iBAAe,uBAAuB,CACpC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,QAAQ,EACnB,gBAAgB,EAAE,OAAO,EACzB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,iEAalC;AA0GD,OAAO,EACL,eAAe,EACf,cAAc,EACd,UAAU,EACV,aAAa,EACb,aAAa,EACb,eAAe,EACf,eAAe,EACf,uBAAuB,GACxB,CAAA"}
|
|
@@ -5,23 +5,29 @@ exports.getInstallData = getInstallData;
|
|
|
5
5
|
exports.getAddress = getAddress;
|
|
6
6
|
exports.packSignature = packSignature;
|
|
7
7
|
exports.getDeployArgs = getDeployArgs;
|
|
8
|
+
exports.getV0DeployArgs = getV0DeployArgs;
|
|
8
9
|
exports.getSmartAccount = getSmartAccount;
|
|
9
|
-
exports.getSessionSmartAccount = getSessionSmartAccount;
|
|
10
10
|
exports.getGuardianSmartAccount = getGuardianSmartAccount;
|
|
11
11
|
const viem_1 = require("viem");
|
|
12
12
|
const account_abstraction_1 = require("viem/account-abstraction");
|
|
13
13
|
const modules_1 = require("../modules");
|
|
14
|
+
const legacy_1 = require("../modules/legacy");
|
|
14
15
|
const validators_1 = require("../modules/validators");
|
|
15
16
|
const error_1 = require("./error");
|
|
16
17
|
const utils_1 = require("./utils");
|
|
17
|
-
const
|
|
18
|
-
const
|
|
18
|
+
const SAFE_7579_LAUNCHPAD_V2_ADDRESS = '0x75798463024Bda64D83c94A64Bc7D7eaB41300eF';
|
|
19
|
+
const SAFE_7579_ADAPTER_V2_ADDRESS = '0x7579f2AD53b01c3D8779Fe17928e0D48885B0003';
|
|
20
|
+
const SAFE_7579_LAUNCHPAD_V1_ADDRESS = '0x7579011aB74c46090561ea277Ba79D510c6C00ff';
|
|
21
|
+
const SAFE_7579_ADAPTER_V1_ADDRESS = '0x7579ee8307284f293b1927136486880611f20002';
|
|
19
22
|
const SAFE_SINGLETON_ADDRESS = '0x29fcb43b46531bca003ddc8fcb67ffe91900c762';
|
|
20
23
|
const SAFE_PROXY_FACTORY_ADDRESS = '0x4e1dcf7ad4e460cfd30791ccc4f9c8a4f820ec67';
|
|
21
24
|
const NO_SAFE_OWNER_ADDRESS = '0xbabe99e62d8bcbd3acf5ccbcfcd4f64fe75e5e72';
|
|
22
25
|
const SAFE_PROXY_INIT_CODE = '0x608060405234801561001057600080fd5b506040516101e63803806101e68339818101604052602081101561003357600080fd5b8101908080519060200190929190505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156100ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806101c46022913960400191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060ab806101196000396000f3fe608060405273ffffffffffffffffffffffffffffffffffffffff600054167fa619486e0000000000000000000000000000000000000000000000000000000060003514156050578060005260206000f35b3660008037600080366000845af43d6000803e60008114156070573d6000fd5b3d6000f3fea264697066735822122003d1488ee65e08fa41e58e888a9865554c535f2c77126a82cb4c0f917f31441364736f6c63430007060033496e76616c69642073696e676c65746f6e20616464726573732070726f7669646564';
|
|
23
26
|
function getDeployArgs(config) {
|
|
24
27
|
if (config.initData) {
|
|
28
|
+
if (!('factory' in config.initData)) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
25
31
|
const factoryData = (0, viem_1.decodeFunctionData)({
|
|
26
32
|
abi: (0, viem_1.parseAbi)([
|
|
27
33
|
'function createProxyWithNonce(address singleton,bytes calldata initializer,uint256 saltNonce) external payable returns (address)',
|
|
@@ -52,6 +58,25 @@ function getDeployArgs(config) {
|
|
|
52
58
|
...moduleSetup.fallbacks,
|
|
53
59
|
...moduleSetup.hooks,
|
|
54
60
|
];
|
|
61
|
+
const adapter = SAFE_7579_ADAPTER_V2_ADDRESS;
|
|
62
|
+
const launchpad = SAFE_7579_LAUNCHPAD_V2_ADDRESS;
|
|
63
|
+
const calldata = (0, viem_1.encodeFunctionData)({
|
|
64
|
+
abi: (0, viem_1.parseAbi)([
|
|
65
|
+
'struct ModuleInit {address module;bytes initData;uint256 moduleType}',
|
|
66
|
+
'function addSafe7579(address safe7579,ModuleInit[] calldata modules,address[] calldata attesters,uint8 threshold) external',
|
|
67
|
+
]),
|
|
68
|
+
functionName: 'addSafe7579',
|
|
69
|
+
args: [
|
|
70
|
+
adapter,
|
|
71
|
+
modules.map((m) => ({
|
|
72
|
+
module: m.address,
|
|
73
|
+
initData: m.initData,
|
|
74
|
+
moduleType: m.type,
|
|
75
|
+
})),
|
|
76
|
+
[],
|
|
77
|
+
0,
|
|
78
|
+
],
|
|
79
|
+
});
|
|
55
80
|
const initData = (0, viem_1.encodeFunctionData)({
|
|
56
81
|
abi: (0, viem_1.parseAbi)([
|
|
57
82
|
'function setup(address[] calldata _owners,uint256 _threshold,address to,bytes calldata data,address fallbackHandler,address paymentToken,uint256 payment, address paymentReceiver) external',
|
|
@@ -60,25 +85,81 @@ function getDeployArgs(config) {
|
|
|
60
85
|
args: [
|
|
61
86
|
owners,
|
|
62
87
|
threshold,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
88
|
+
launchpad,
|
|
89
|
+
calldata,
|
|
90
|
+
adapter,
|
|
91
|
+
viem_1.zeroAddress,
|
|
92
|
+
BigInt(0),
|
|
93
|
+
viem_1.zeroAddress,
|
|
94
|
+
],
|
|
95
|
+
});
|
|
96
|
+
const account = config.account;
|
|
97
|
+
const saltNonce = account?.nonce ?? 0n;
|
|
98
|
+
const factoryData = (0, viem_1.encodeFunctionData)({
|
|
99
|
+
abi: (0, viem_1.parseAbi)([
|
|
100
|
+
'function createProxyWithNonce(address singleton,bytes calldata initializer,uint256 saltNonce) external payable returns (address)',
|
|
101
|
+
]),
|
|
102
|
+
functionName: 'createProxyWithNonce',
|
|
103
|
+
args: [SAFE_SINGLETON_ADDRESS, initData, saltNonce],
|
|
104
|
+
});
|
|
105
|
+
const salt = (0, viem_1.keccak256)((0, viem_1.encodePacked)(['bytes32', 'uint256'], [(0, viem_1.keccak256)(initData), saltNonce]));
|
|
106
|
+
return {
|
|
107
|
+
factory: SAFE_PROXY_FACTORY_ADDRESS,
|
|
108
|
+
factoryData,
|
|
109
|
+
salt,
|
|
110
|
+
implementation: SAFE_SINGLETON_ADDRESS,
|
|
111
|
+
initializationCallData: null,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function getV0DeployArgs(config) {
|
|
115
|
+
if (config.initData) {
|
|
116
|
+
throw new error_1.AccountConfigurationNotSupportedError('Custom V0 accounts are not supported', 'safe');
|
|
117
|
+
}
|
|
118
|
+
const owners = getOwners(config);
|
|
119
|
+
const threshold = getThreshold(config);
|
|
120
|
+
const attesters = (0, legacy_1.getV0Attesters)();
|
|
121
|
+
const moduleSetup = (0, legacy_1.getV0Setup)(config);
|
|
122
|
+
const adapter = SAFE_7579_ADAPTER_V1_ADDRESS;
|
|
123
|
+
const launchpad = SAFE_7579_LAUNCHPAD_V1_ADDRESS;
|
|
124
|
+
const calldata = (0, viem_1.encodeFunctionData)({
|
|
125
|
+
abi: (0, viem_1.parseAbi)([
|
|
126
|
+
'struct ModuleInit {address module;bytes initData;}',
|
|
127
|
+
'function addSafe7579(address safe7579,ModuleInit[] calldata validators,ModuleInit[] calldata executors,ModuleInit[] calldata fallbacks, ModuleInit[] calldata hooks,address[] calldata attesters,uint8 threshold) external',
|
|
128
|
+
]),
|
|
129
|
+
functionName: 'addSafe7579',
|
|
130
|
+
args: [
|
|
131
|
+
adapter,
|
|
132
|
+
moduleSetup.validators.map((v) => ({
|
|
133
|
+
module: v.address,
|
|
134
|
+
initData: v.initData,
|
|
135
|
+
})),
|
|
136
|
+
moduleSetup.executors.map((e) => ({
|
|
137
|
+
module: e.address,
|
|
138
|
+
initData: e.initData,
|
|
139
|
+
})),
|
|
140
|
+
moduleSetup.fallbacks.map((f) => ({
|
|
141
|
+
module: f.address,
|
|
142
|
+
initData: f.initData,
|
|
143
|
+
})),
|
|
144
|
+
moduleSetup.hooks.map((h) => ({
|
|
145
|
+
module: h.address,
|
|
146
|
+
initData: h.initData,
|
|
147
|
+
})),
|
|
148
|
+
attesters.addresses,
|
|
149
|
+
attesters.threshold,
|
|
150
|
+
],
|
|
151
|
+
});
|
|
152
|
+
const initData = (0, viem_1.encodeFunctionData)({
|
|
153
|
+
abi: (0, viem_1.parseAbi)([
|
|
154
|
+
'function setup(address[] calldata _owners,uint256 _threshold,address to,bytes calldata data,address fallbackHandler,address paymentToken,uint256 payment, address paymentReceiver) external',
|
|
155
|
+
]),
|
|
156
|
+
functionName: 'setup',
|
|
157
|
+
args: [
|
|
158
|
+
owners,
|
|
159
|
+
threshold,
|
|
160
|
+
launchpad,
|
|
161
|
+
calldata,
|
|
162
|
+
adapter,
|
|
82
163
|
viem_1.zeroAddress,
|
|
83
164
|
BigInt(0),
|
|
84
165
|
viem_1.zeroAddress,
|
|
@@ -103,7 +184,11 @@ function getDeployArgs(config) {
|
|
|
103
184
|
};
|
|
104
185
|
}
|
|
105
186
|
function getAddress(config) {
|
|
106
|
-
const
|
|
187
|
+
const deployArgs = getDeployArgs(config);
|
|
188
|
+
if (!deployArgs) {
|
|
189
|
+
throw new Error('Cannot derive address: deploy args not available');
|
|
190
|
+
}
|
|
191
|
+
const { factory, implementation, salt } = deployArgs;
|
|
107
192
|
const constructorArgs = (0, viem_1.encodeAbiParameters)((0, viem_1.parseAbiParameters)('address singleton'), [implementation]);
|
|
108
193
|
const address = (0, viem_1.getContractAddress)({
|
|
109
194
|
opcode: 'CREATE2',
|
|
@@ -161,21 +246,6 @@ async function getSmartAccount(client, address, owners, validatorAddress, sign)
|
|
|
161
246
|
return (0, validators_1.getMockSignature)(owners);
|
|
162
247
|
}, sign);
|
|
163
248
|
}
|
|
164
|
-
async function getSessionSmartAccount(client, address, session, validatorAddress, enableData, sign) {
|
|
165
|
-
return await getBaseSmartAccount(address, client, validatorAddress, async () => {
|
|
166
|
-
const dummyOpSignature = (0, validators_1.getMockSignature)(session.owners);
|
|
167
|
-
if (enableData) {
|
|
168
|
-
return (0, validators_1.encodeSmartSessionSignature)(validators_1.SMART_SESSION_MODE_ENABLE, (0, validators_1.getPermissionId)(session), dummyOpSignature, enableData);
|
|
169
|
-
}
|
|
170
|
-
return (0, validators_1.encodeSmartSessionSignature)(validators_1.SMART_SESSION_MODE_USE, (0, validators_1.getPermissionId)(session), dummyOpSignature);
|
|
171
|
-
}, async (hash) => {
|
|
172
|
-
const signature = await sign(hash);
|
|
173
|
-
if (enableData) {
|
|
174
|
-
return (0, validators_1.encodeSmartSessionSignature)(validators_1.SMART_SESSION_MODE_ENABLE, (0, validators_1.getPermissionId)(session), signature, enableData);
|
|
175
|
-
}
|
|
176
|
-
return (0, validators_1.encodeSmartSessionSignature)(validators_1.SMART_SESSION_MODE_USE, (0, validators_1.getPermissionId)(session), signature);
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
249
|
async function getGuardianSmartAccount(client, address, guardians, validatorAddress, sign) {
|
|
180
250
|
return await getBaseSmartAccount(address, client, validatorAddress, async () => {
|
|
181
251
|
return (0, validators_1.getMockSignature)(guardians);
|
|
@@ -2,18 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const vitest_1 = require("vitest");
|
|
4
4
|
const consts_1 = require("../../test/consts");
|
|
5
|
+
const utils_1 = require("../../test/utils/utils");
|
|
5
6
|
const common_1 = require("../modules/common");
|
|
6
7
|
const safe_1 = require("./safe");
|
|
7
8
|
const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
8
9
|
(0, vitest_1.describe)('Accounts: Safe', () => {
|
|
9
10
|
(0, vitest_1.describe)('Deploy Args', () => {
|
|
10
11
|
(0, vitest_1.test)('ECDSA owners', () => {
|
|
11
|
-
const
|
|
12
|
+
const deployArgs = (0, safe_1.getDeployArgs)({
|
|
12
13
|
owners: {
|
|
13
14
|
type: 'ecdsa',
|
|
14
15
|
accounts: [consts_1.accountA, consts_1.accountB],
|
|
15
16
|
},
|
|
16
17
|
});
|
|
18
|
+
(0, utils_1.assertNotNull)(deployArgs);
|
|
19
|
+
const { factory, factoryData, salt, implementation, initializationCallData, } = deployArgs;
|
|
17
20
|
(0, vitest_1.expect)(factory).toEqual('0x4e1dcf7ad4e460cfd30791ccc4f9c8a4f820ec67');
|
|
18
21
|
(0, vitest_1.expect)(factoryData).toEqual('0x1688f0b900000000000000000000000029fcb43b46531bca003ddc8fcb67ffe91900c762000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000444b63e800d0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000075798463024bda64d83c94a64bc7d7eab41300ef00000000000000000000000000000000000000000000000000000000000001600000000000000000000000007579f2ad53b01c3d8779fe17928e0d48885b00030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000f6c02c78ded62973b43bfa523b247da0994869360000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb700000000000000000000000000000000000000000000000000000000000002a447cbbdca0000000000000000000000007579f2ad53b01c3d8779fe17928e0d48885b0003000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000013fdb5234e4e3162a810f54d9f7e980000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000020000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da09948693600000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
19
22
|
(0, vitest_1.expect)(salt).toEqual('0xf31933c8d3ab801f5d7dbfd374464b228d509d625a72334e218cbe08be7716e6');
|
|
@@ -21,12 +24,14 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
21
24
|
(0, vitest_1.expect)(initializationCallData).toEqual(null);
|
|
22
25
|
});
|
|
23
26
|
(0, vitest_1.test)('Passkey owner', () => {
|
|
24
|
-
const
|
|
27
|
+
const deployArgs = (0, safe_1.getDeployArgs)({
|
|
25
28
|
owners: {
|
|
26
29
|
type: 'passkey',
|
|
27
30
|
accounts: [consts_1.passkeyAccount],
|
|
28
31
|
},
|
|
29
32
|
});
|
|
33
|
+
(0, utils_1.assertNotNull)(deployArgs);
|
|
34
|
+
const { factory, factoryData, salt, implementation, initializationCallData, } = deployArgs;
|
|
30
35
|
(0, vitest_1.expect)(factory).toEqual('0x4e1dcf7ad4e460cfd30791ccc4f9c8a4f820ec67');
|
|
31
36
|
(0, vitest_1.expect)(factoryData).toEqual('0x1688f0b900000000000000000000000029fcb43b46531bca003ddc8fcb67ffe91900c762000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000444b63e800d0000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000100000000000000000000000075798463024bda64d83c94a64bc7d7eab41300ef00000000000000000000000000000000000000000000000000000000000001400000000000000000000000007579f2ad53b01c3d8779fe17928e0d48885b00030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000babe99e62d8bcbd3acf5ccbcfcd4f64fe75e5e7200000000000000000000000000000000000000000000000000000000000002c447cbbdca0000000000000000000000007579f2ad53b01c3d8779fe17928e0d48885b0003000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000002a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001800000000000000000000000000000000000578c4cb0e472a5462da43c495c3f330000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005ad9ce1f5035fd62ca96cef16adaaf00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
32
37
|
(0, vitest_1.expect)(salt).toEqual('0xdc83fad4a7d91e2ee81a5adc74eb2bca07d012c5259cb8ea10e89cf05de74c8d');
|
|
@@ -34,7 +39,7 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
34
39
|
(0, vitest_1.expect)(initializationCallData).toEqual(null);
|
|
35
40
|
});
|
|
36
41
|
(0, vitest_1.test)('Existing account', () => {
|
|
37
|
-
const
|
|
42
|
+
const deployArgs = (0, safe_1.getDeployArgs)({
|
|
38
43
|
owners: {
|
|
39
44
|
type: 'ecdsa',
|
|
40
45
|
accounts: [consts_1.accountA, consts_1.accountB],
|
|
@@ -46,6 +51,8 @@ const MOCK_MODULE_ADDRESS = '0x28de6501fa86f2e6cd0b33c3aabdaeb4a1b93f3f';
|
|
|
46
51
|
intentExecutorInstalled: true,
|
|
47
52
|
},
|
|
48
53
|
});
|
|
54
|
+
(0, utils_1.assertNotNull)(deployArgs);
|
|
55
|
+
const { factory, factoryData } = deployArgs;
|
|
49
56
|
(0, vitest_1.expect)(factory).toEqual('0x4e1dcf7ad4e460cfd30791ccc4f9c8a4f820ec67');
|
|
50
57
|
(0, vitest_1.expect)(factoryData).toEqual('0x1688f0b90000000000000000000000007579011ab74c46090561ea277ba79d510c6c00ff0000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000844fff40e1ec88f0966a6bc17a138345cdf7519caf9a1e0bb840330108a6a4315f1028c39000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000');
|
|
51
58
|
});
|
|
@@ -14,9 +14,9 @@ declare function signWithMultiFactorAuth<T>(signers: SignerSet & {
|
|
|
14
14
|
type: 'owner';
|
|
15
15
|
kind: 'multi-factor';
|
|
16
16
|
}, chain: Chain, address: Address, params: T, isUserOpHash: boolean, signMain: (signers: SignerSet, chain: Chain, address: Address, params: T, isUserOpHash: boolean) => Promise<Hex>): Promise<Hex>;
|
|
17
|
-
declare function signWithSession
|
|
18
|
-
type: '
|
|
19
|
-
}, chain: Chain, address: Address,
|
|
17
|
+
declare function signWithSession(signers: SignerSet & {
|
|
18
|
+
type: 'experimental_session';
|
|
19
|
+
}, chain: Chain, address: Address, hash: Hex, signMain: (signers: SignerSet, chain: Chain, address: Address, hash: Hex, isUserOpHash: boolean) => Promise<Hex>): Promise<Hex>;
|
|
20
20
|
declare function signWithGuardians<T>(signers: SignerSet & {
|
|
21
21
|
type: 'guardians';
|
|
22
22
|
}, params: T, signingFunctions: SigningFunctions<T>): Promise<Hex>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../accounts/signing/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;AACtC,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,KAAK,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../accounts/signing/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;AACtC,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,OAAO,EACZ,KAAK,KAAK,EAMV,KAAK,GAAG,EAKT,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAS/D,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAStD,iBAAS,0BAA0B,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,CAkE/D;AAED,KAAK,gBAAgB,CAAC,CAAC,IAAI;IACzB,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,GAAG,CAAC,CAAA;IAC1E,WAAW,EAAE,CACX,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,CAAC,KACN,OAAO,CAAC;QACX,QAAQ,EAAE,YAAY,CAAC,YAAY,CAAA;QACnC,SAAS,EAAE,GAAG,CAAA;KACf,CAAC,CAAA;CACH,CAAA;AAED,iBAAe,uBAAuB,CAAC,CAAC,EACtC,OAAO,EAAE,SAAS,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,cAAc,CAAA;CAAE,EAC5D,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,CAAC,EACT,YAAY,EAAE,OAAO,EACrB,QAAQ,EAAE,CACR,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,CAAC,EACT,YAAY,EAAE,OAAO,KAClB,OAAO,CAAC,GAAG,CAAC,GAChB,OAAO,CAAC,GAAG,CAAC,CA0Cd;AAED,iBAAe,eAAe,CAC5B,OAAO,EAAE,SAAS,GAAG;IAAE,IAAI,EAAE,sBAAsB,CAAA;CAAE,EACrD,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,GAAG,EACT,QAAQ,EAAE,CACR,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,GAAG,EACT,YAAY,EAAE,OAAO,KAClB,OAAO,CAAC,GAAG,CAAC,GAChB,OAAO,CAAC,GAAG,CAAC,CAiBd;AAED,iBAAe,iBAAiB,CAAC,CAAC,EAChC,OAAO,EAAE,SAAS,GAAG;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,EAC1C,MAAM,EAAE,CAAC,EACT,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC,GACpC,OAAO,CAAC,GAAG,CAAC,CAOd;AAED,iBAAe,cAAc,CAAC,CAAC,EAC7B,OAAO,EAAE,SAAS,GAAG;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,EACtC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,CAAC,EACT,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC,EACrC,YAAY,EAAE,OAAO,EACrB,QAAQ,EAAE,CACR,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,CAAC,EACT,YAAY,EAAE,OAAO,KAClB,OAAO,CAAC,GAAG,CAAC,GAChB,OAAO,CAAC,GAAG,CAAC,CAqFd;AAED,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,KAAK,gBAAgB,GACtB,CAAA"}
|
|
@@ -8,6 +8,7 @@ exports.signWithOwners = signWithOwners;
|
|
|
8
8
|
const viem_1 = require("viem");
|
|
9
9
|
const modules_1 = require("../../modules");
|
|
10
10
|
const core_1 = require("../../modules/validators/core");
|
|
11
|
+
const smart_sessions_1 = require("../../modules/validators/smart-sessions");
|
|
11
12
|
const passkeys_1 = require("./passkeys");
|
|
12
13
|
function convertOwnerSetToSignerSet(owners) {
|
|
13
14
|
switch (owners.type) {
|
|
@@ -111,15 +112,38 @@ async function signWithMultiFactorAuth(signers, chain, address, params, isUserOp
|
|
|
111
112
|
]);
|
|
112
113
|
return data;
|
|
113
114
|
}
|
|
114
|
-
async function signWithSession(signers, chain, address,
|
|
115
|
+
async function signWithSession(signers, chain, address, hash, signMain) {
|
|
115
116
|
const sessionSigners = convertOwnerSetToSignerSet(signers.session.owners);
|
|
116
|
-
|
|
117
|
+
const signedHash = signers.verifyExecutions
|
|
118
|
+
? hash
|
|
119
|
+
: (0, viem_1.hashMessage)({
|
|
120
|
+
raw: (0, viem_1.encodePacked)(['bytes32', 'bytes32'], [(0, viem_1.padHex)(address), hash]),
|
|
121
|
+
});
|
|
122
|
+
const validatorSignature = await signMain(sessionSigners, chain, address, signedHash, false);
|
|
123
|
+
return (0, smart_sessions_1.packSignature)(signers, validatorSignature);
|
|
117
124
|
}
|
|
118
125
|
async function signWithGuardians(signers, params, signingFunctions) {
|
|
119
126
|
const signatures = await Promise.all(signers.guardians.map((account) => signingFunctions.signEcdsa(account, params, false)));
|
|
120
127
|
return (0, viem_1.concat)(signatures);
|
|
121
128
|
}
|
|
122
129
|
async function signWithOwners(signers, chain, address, params, signingFunctions, isUserOpHash, signMain) {
|
|
130
|
+
async function signEcdsWithChain(account, params, updateV, chain) {
|
|
131
|
+
const client = account.client;
|
|
132
|
+
const transport = client?.transport;
|
|
133
|
+
if (transport) {
|
|
134
|
+
// Switch chain
|
|
135
|
+
const walletClient = (0, viem_1.createWalletClient)({
|
|
136
|
+
chain,
|
|
137
|
+
transport: (0, viem_1.custom)(transport),
|
|
138
|
+
account,
|
|
139
|
+
});
|
|
140
|
+
await walletClient.switchChain({
|
|
141
|
+
id: chain.id,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
// Sign
|
|
145
|
+
return signingFunctions.signEcdsa(account, params, updateV);
|
|
146
|
+
}
|
|
123
147
|
switch (signers.kind) {
|
|
124
148
|
case 'ecdsa': {
|
|
125
149
|
// Ownable validator uses `v` value to determine which validation mode to use
|
|
@@ -129,7 +153,7 @@ async function signWithOwners(signers, chain, address, params, signingFunctions,
|
|
|
129
153
|
signers.module?.toLowerCase() === core_1.OWNABLE_VALIDATOR_ADDRESS ||
|
|
130
154
|
signers.module?.toLowerCase() === core_1.ENS_VALIDATOR_ADDRESS;
|
|
131
155
|
const updateV = isOwnableOrENS && !isUserOpHash;
|
|
132
|
-
const signatures = await Promise.all(signers.accounts.map((account) =>
|
|
156
|
+
const signatures = await Promise.all(signers.accounts.map((account) => signEcdsWithChain(account, params, updateV, chain)));
|
|
133
157
|
return (0, viem_1.concat)(signatures);
|
|
134
158
|
}
|
|
135
159
|
case 'passkey': {
|
|
@@ -145,8 +169,8 @@ async function signWithOwners(signers, chain, address, params, signingFunctions,
|
|
|
145
169
|
return {
|
|
146
170
|
authenticatorData: signature.webauthn.authenticatorData,
|
|
147
171
|
clientDataJSON: signature.webauthn.clientDataJSON,
|
|
148
|
-
challengeIndex: BigInt(signature.webauthn.challengeIndex),
|
|
149
|
-
typeIndex: BigInt(signature.webauthn.typeIndex),
|
|
172
|
+
challengeIndex: BigInt(signature.webauthn.challengeIndex ?? 0),
|
|
173
|
+
typeIndex: BigInt(signature.webauthn.typeIndex ?? 0),
|
|
150
174
|
r,
|
|
151
175
|
s,
|
|
152
176
|
};
|
|
@@ -13,8 +13,8 @@ async function sign(signers, chain, address, hash, isUserOpHash) {
|
|
|
13
13
|
case 'owner': {
|
|
14
14
|
return (0, common_1.signWithOwners)(signers, chain, address, hash, signingFunctions, isUserOpHash, sign);
|
|
15
15
|
}
|
|
16
|
-
case '
|
|
17
|
-
return (0, common_1.signWithSession)(signers, chain, address, hash,
|
|
16
|
+
case 'experimental_session': {
|
|
17
|
+
return (0, common_1.signWithSession)(signers, chain, address, hash, sign);
|
|
18
18
|
}
|
|
19
19
|
case 'guardians': {
|
|
20
20
|
return (0, common_1.signWithGuardians)(signers, hash, signingFunctions);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedData.d.ts","sourceRoot":"","sources":["../../../../accounts/signing/typedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,GAAG,EACH,SAAS,EACV,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"typedData.d.ts","sourceRoot":"","sources":["../../../../accounts/signing/typedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,GAAG,EACH,SAAS,EACV,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAQ5C,iBAAe,IAAI,CACjB,SAAS,SAAS,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACjE,WAAW,SAAS,MAAM,SAAS,GAAG,cAAc,GAAG,MAAM,SAAS,EAEtE,OAAO,EAAE,SAAS,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,uBAAuB,CAAC,SAAS,EAAE,WAAW,CAAC,GAC1D,OAAO,CAAC,GAAG,CAAC,CA2Bd;AA6BD,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
|
@@ -12,12 +12,12 @@ async function sign(signers, chain, address, parameters) {
|
|
|
12
12
|
case 'owner': {
|
|
13
13
|
return (0, common_1.signWithOwners)(signers, chain, address, parameters, signingFunctions, false, sign);
|
|
14
14
|
}
|
|
15
|
-
case 'session': {
|
|
16
|
-
return (0, common_1.signWithSession)(signers, chain, address, parameters, false, sign);
|
|
17
|
-
}
|
|
18
15
|
case 'guardians': {
|
|
19
16
|
return (0, common_1.signWithGuardians)(signers, parameters, signingFunctions);
|
|
20
17
|
}
|
|
18
|
+
case 'experimental_session': {
|
|
19
|
+
throw new Error('Not supported');
|
|
20
|
+
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
async function signEcdsa(account, parameters) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Address, Chain, Hex, PublicClient } from 'viem';
|
|
2
2
|
import type { Module } from '../modules/common';
|
|
3
|
-
import type {
|
|
4
|
-
import type { OwnerSet, RhinestoneAccountConfig, Session } from '../types';
|
|
3
|
+
import type { OwnerSet, RhinestoneAccountConfig } from '../types';
|
|
5
4
|
import type { ValidatorConfig } from './utils';
|
|
6
5
|
declare function getDeployArgs(config: RhinestoneAccountConfig): {
|
|
7
6
|
factory: `0x${string}`;
|
|
@@ -21,7 +20,6 @@ declare function getEip712Domain(config: RhinestoneAccountConfig, chain: Chain):
|
|
|
21
20
|
declare function getInstallData(module: Module): `0x${string}`;
|
|
22
21
|
declare function packSignature(signature: Hex, validator: ValidatorConfig, transformSignature?: (signature: Hex) => Hex): Promise<`0x${string}`>;
|
|
23
22
|
declare function getSmartAccount(client: PublicClient, address: Address, owners: OwnerSet, validatorAddress: Address, sign: (hash: Hex) => Promise<Hex>): Promise<import("viem/_types/account-abstraction").SmartAccount<import("viem/_types/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">>>;
|
|
24
|
-
declare function getSessionSmartAccount(client: PublicClient, address: Address, session: Session, validatorAddress: Address, enableData: EnableSessionData | null, sign: (hash: Hex) => Promise<Hex>): Promise<import("viem/_types/account-abstraction").SmartAccount<import("viem/_types/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">>>;
|
|
25
23
|
declare function getGuardianSmartAccount(client: PublicClient, address: Address, guardians: OwnerSet, validatorAddress: Address, sign: (hash: Hex) => Promise<Hex>): Promise<import("viem/_types/account-abstraction").SmartAccount<import("viem/_types/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">>>;
|
|
26
|
-
export { getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getSmartAccount,
|
|
24
|
+
export { getEip712Domain, getInstallData, getAddress, packSignature, getDeployArgs, getSmartAccount, getGuardianSmartAccount, };
|
|
27
25
|
//# sourceMappingURL=startale.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startale.d.ts","sourceRoot":"","sources":["../../../accounts/startale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAa7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"startale.d.ts","sourceRoot":"","sources":["../../../accounts/startale.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAa7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EACV,QAAQ,EACR,uBAAuB,EAExB,MAAM,UAAU,CAAA;AAQjB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAc9C,iBAAS,aAAa,CAAC,MAAM,EAAE,uBAAuB;;;;;;EAwDrD;AAED,iBAAS,UAAU,CAAC,MAAM,EAAE,uBAAuB,iBA4BlD;AAED,iBAAS,eAAe,CAAC,MAAM,EAAE,uBAAuB,EAAE,KAAK,EAAE,KAAK;;;;;;EAarE;AAED,iBAAS,cAAc,CAAC,MAAM,EAAE,MAAM,iBAErC;AAED,iBAAe,aAAa,CAC1B,SAAS,EAAE,GAAG,EACd,SAAS,EAAE,eAAe,EAC1B,kBAAkB,GAAE,CAAC,SAAS,EAAE,GAAG,KAAK,GAA8B,0BAQvE;AAED,iBAAe,eAAe,CAC5B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,gBAAgB,EAAE,OAAO,EACzB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,oKAUlC;AAED,iBAAe,uBAAuB,CACpC,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,QAAQ,EACnB,gBAAgB,EAAE,OAAO,EACzB,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,oKAUlC;AAED,OAAO,EACL,eAAe,EACf,cAAc,EACd,UAAU,EACV,aAAa,EACb,aAAa,EACb,eAAe,EACf,uBAAuB,GACxB,CAAA"}
|
|
@@ -6,7 +6,6 @@ exports.getAddress = getAddress;
|
|
|
6
6
|
exports.packSignature = packSignature;
|
|
7
7
|
exports.getDeployArgs = getDeployArgs;
|
|
8
8
|
exports.getSmartAccount = getSmartAccount;
|
|
9
|
-
exports.getSessionSmartAccount = getSessionSmartAccount;
|
|
10
9
|
exports.getGuardianSmartAccount = getGuardianSmartAccount;
|
|
11
10
|
const viem_1 = require("viem");
|
|
12
11
|
const modules_1 = require("../modules");
|
|
@@ -108,9 +107,6 @@ async function packSignature(signature, validator, transformSignature = (signatu
|
|
|
108
107
|
async function getSmartAccount(client, address, owners, validatorAddress, sign) {
|
|
109
108
|
return (0, nexus_1.getSmartAccount)(client, address, owners, validatorAddress, sign, K1_DEFAULT_VALIDATOR_ADDRESS);
|
|
110
109
|
}
|
|
111
|
-
async function getSessionSmartAccount(client, address, session, validatorAddress, enableData, sign) {
|
|
112
|
-
return (0, nexus_1.getSessionSmartAccount)(client, address, session, validatorAddress, enableData, sign, K1_DEFAULT_VALIDATOR_ADDRESS);
|
|
113
|
-
}
|
|
114
110
|
async function getGuardianSmartAccount(client, address, guardians, validatorAddress, sign) {
|
|
115
111
|
return (0, nexus_1.getGuardianSmartAccount)(client, address, guardians, validatorAddress, sign, K1_DEFAULT_VALIDATOR_ADDRESS);
|
|
116
112
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../accounts/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAgBhD,OAAO,KAAK,EAAkC,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,KAAK,QAAQ,GAAG,MAAM,GAAG,cAAc,GAAG,WAAW,CAAA;AAErD,UAAU,eAAe;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,UAAU,aAAa,CAAC,QAAQ,SAAS,QAAQ;IAC/C,IAAI,EAAE,QAAQ,CAAA;IACd,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,OAAO,CAAC,EAAE,GAAG,CAAA;CACd;AAED,UAAU,oBAAoB,CAAC,QAAQ,SAAS,QAAQ;IACtD,IAAI,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;IAC7B,QAAQ,EAAE,SAAS;QACjB,EAAE,EAAE,OAAO,CAAA;QACX,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,EAAE,GAAG,GAAG,SAAS,CAAA;KACvB,EAAE,CAAA;CACJ;AAED,UAAU,qBAAqB;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAkDD,iBAAS,eAAe,CAAC,QAAQ,SAAS,QAAQ,EAAE,EAClD,IAAI,EACJ,QAAQ,GACT,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GAAG,GAAG,CAuFtC;AAED,iBAAe,eAAe,CAC5B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,MAAM,CAAC,CAmCjB;AAED,iBAAS,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../accounts/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAgBhD,OAAO,KAAK,EAAkC,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE5C,KAAK,QAAQ,GAAG,MAAM,GAAG,cAAc,GAAG,WAAW,CAAA;AAErD,UAAU,eAAe;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,OAAO,CAAA;CAChB;AAED,UAAU,aAAa,CAAC,QAAQ,SAAS,QAAQ;IAC/C,IAAI,EAAE,QAAQ,CAAA;IACd,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,OAAO,CAAC,EAAE,GAAG,CAAA;CACd;AAED,UAAU,oBAAoB,CAAC,QAAQ,SAAS,QAAQ;IACtD,IAAI,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;IAC7B,QAAQ,EAAE,SAAS;QACjB,EAAE,EAAE,OAAO,CAAA;QACX,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,EAAE,GAAG,GAAG,SAAS,CAAA;KACvB,EAAE,CAAA;CACJ;AAED,UAAU,qBAAqB;IAC7B,OAAO,EAAE,OAAO,CAAA;IAChB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAkDD,iBAAS,eAAe,CAAC,QAAQ,SAAS,QAAQ,EAAE,EAClD,IAAI,EACJ,QAAQ,GACT,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GAAG,GAAG,CAuFtC;AAED,iBAAe,eAAe,CAC5B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,qBAAqB,GAC1B,OAAO,CAAC,MAAM,CAAC,CAmCjB;AAED,iBAAS,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,6IAuDjE;AAyBD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAA;AAC9E,YAAY,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -145,6 +145,8 @@ function getBundlerClient(config, client) {
|
|
|
145
145
|
return `https://api.pimlico.io/v2/${chainId}/rpc?apikey=${config.apiKey}`;
|
|
146
146
|
case 'biconomy':
|
|
147
147
|
return `https://bundler.biconomy.io/api/v3/${chainId}/${config.apiKey}`;
|
|
148
|
+
case 'custom':
|
|
149
|
+
return typeof config.url === 'string' ? config.url : config.url[chainId];
|
|
148
150
|
}
|
|
149
151
|
}
|
|
150
152
|
function getPaymasterEndpoint(config, chainId) {
|
|
@@ -153,6 +155,8 @@ function getBundlerClient(config, client) {
|
|
|
153
155
|
return `https://api.pimlico.io/v2/${chainId}/rpc?apikey=${config.apiKey}`;
|
|
154
156
|
case 'biconomy':
|
|
155
157
|
return `https://paymaster.biconomy.io/api/v2/${chainId}/${config.apiKey}`;
|
|
158
|
+
case 'custom':
|
|
159
|
+
return typeof config.url === 'string' ? config.url : config.url[chainId];
|
|
156
160
|
}
|
|
157
161
|
}
|
|
158
162
|
const { bundler, paymaster } = config;
|
|
@@ -166,6 +170,7 @@ function getBundlerClient(config, client) {
|
|
|
166
170
|
const paymasterEndpoint = paymaster
|
|
167
171
|
? getPaymasterEndpoint(paymaster, chainId)
|
|
168
172
|
: undefined;
|
|
173
|
+
const isCustomBundler = bundler?.type === 'custom';
|
|
169
174
|
return (0, account_abstraction_1.createBundlerClient)({
|
|
170
175
|
client,
|
|
171
176
|
transport: (0, viem_1.http)(endpoint),
|
|
@@ -174,9 +179,11 @@ function getBundlerClient(config, client) {
|
|
|
174
179
|
transport: (0, viem_1.http)(paymasterEndpoint),
|
|
175
180
|
})
|
|
176
181
|
: undefined,
|
|
177
|
-
userOperation:
|
|
178
|
-
|
|
179
|
-
|
|
182
|
+
userOperation: isCustomBundler
|
|
183
|
+
? undefined
|
|
184
|
+
: {
|
|
185
|
+
estimateFeesPerGas: () => getGasPriceEstimate(endpoint),
|
|
186
|
+
},
|
|
180
187
|
});
|
|
181
188
|
}
|
|
182
189
|
async function getGasPriceEstimate(bundlerUrl) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walletClient.d.ts","sourceRoot":"","sources":["../../../accounts/walletClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAOP,YAAY,EACb,MAAM,MAAM,CAAA;AAGb;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"walletClient.d.ts","sourceRoot":"","sources":["../../../accounts/walletClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAOP,YAAY,EACb,MAAM,MAAM,CAAA;AAGb;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CA8CzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,eAAe,CAC7B,WAAW,EAAE,OAAO,EACpB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAyCT"}
|
|
@@ -34,6 +34,9 @@ function walletClientToAccount(walletClient) {
|
|
|
34
34
|
...transaction,
|
|
35
35
|
});
|
|
36
36
|
},
|
|
37
|
+
// Preserve reference to the wallet client
|
|
38
|
+
// This can be helpful to e.g. get the client's transport
|
|
39
|
+
client: walletClient,
|
|
37
40
|
};
|
|
38
41
|
return account;
|
|
39
42
|
}
|
|
@@ -93,6 +96,9 @@ function wrapParaAccount(viemAccount, walletId) {
|
|
|
93
96
|
signAuthorization: viemAccount.signAuthorization
|
|
94
97
|
? viemAccount.signAuthorization.bind(viemAccount)
|
|
95
98
|
: undefined,
|
|
99
|
+
// Preserve reference to the wallet client
|
|
100
|
+
// This can be helpful to e.g. get the client's transport
|
|
101
|
+
client: viemAccount.client,
|
|
96
102
|
};
|
|
97
103
|
}
|
|
98
104
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type Address } from 'viem';
|
|
1
|
+
import { type Address, type Hex } from 'viem';
|
|
2
2
|
import type { CalldataInput, LazyCallInput } from '../types';
|
|
3
|
+
declare const ALLOCATOR_ADDRESS = "0xc7732071e3a1be6cfce6d13bb05699a31a457679";
|
|
3
4
|
declare function depositEther(value: bigint): LazyCallInput;
|
|
4
5
|
declare function enableEtherWithdrawal(): CalldataInput;
|
|
5
6
|
declare function disableEtherWithdrawal(): CalldataInput;
|
|
@@ -9,5 +10,6 @@ declare function enableErc20Withdrawal(tokenAddress: Address): CalldataInput;
|
|
|
9
10
|
declare function disableErc20Withdrawal(tokenAddress: Address): CalldataInput;
|
|
10
11
|
declare function withdrawErc20(tokenAddress: Address, amount: bigint): LazyCallInput;
|
|
11
12
|
declare function approveErc20(tokenAddress: Address, amount: bigint): CalldataInput;
|
|
12
|
-
|
|
13
|
+
declare function lockTag(): Hex;
|
|
14
|
+
export { ALLOCATOR_ADDRESS, depositEther, enableEtherWithdrawal, disableEtherWithdrawal, withdrawEther, depositErc20, enableErc20Withdrawal, disableErc20Withdrawal, withdrawErc20, approveErc20, lockTag, };
|
|
13
15
|
//# sourceMappingURL=compact.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compact.d.ts","sourceRoot":"","sources":["../../../actions/compact.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"compact.d.ts","sourceRoot":"","sources":["../../../actions/compact.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAIZ,KAAK,GAAG,EAET,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAc5D,QAAA,MAAM,iBAAiB,+CAA+C,CAAA;AAItE,iBAAS,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CA2BlD;AAED,iBAAS,qBAAqB,IAAI,aAAa,CAG9C;AAED,iBAAS,sBAAsB,IAAI,aAAa,CAG/C;AAED,iBAAS,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAOnD;AAED,iBAAS,YAAY,CAAC,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CA6B1E;AAED,iBAAS,qBAAqB,CAAC,YAAY,EAAE,OAAO,GAAG,aAAa,CAGnE;AAED,iBAAS,sBAAsB,CAAC,YAAY,EAAE,OAAO,GAAG,aAAa,CAGpE;AAED,iBAAS,aAAa,CAAC,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAO3E;AAsED,iBAAS,YAAY,CAAC,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAU1E;AA0BD,iBAAS,OAAO,IAAI,GAAG,CAQtB;AAED,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,YAAY,EACZ,OAAO,GACR,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ALLOCATOR_ADDRESS = void 0;
|
|
3
4
|
exports.depositEther = depositEther;
|
|
4
5
|
exports.enableEtherWithdrawal = enableEtherWithdrawal;
|
|
5
6
|
exports.disableEtherWithdrawal = disableEtherWithdrawal;
|
|
@@ -9,9 +10,11 @@ exports.enableErc20Withdrawal = enableErc20Withdrawal;
|
|
|
9
10
|
exports.disableErc20Withdrawal = disableErc20Withdrawal;
|
|
10
11
|
exports.withdrawErc20 = withdrawErc20;
|
|
11
12
|
exports.approveErc20 = approveErc20;
|
|
13
|
+
exports.lockTag = lockTag;
|
|
12
14
|
const viem_1 = require("viem");
|
|
13
15
|
const compact_1 = require("../execution/compact");
|
|
14
|
-
const ALLOCATOR_ADDRESS = '
|
|
16
|
+
const ALLOCATOR_ADDRESS = '0xc7732071e3a1be6cfce6d13bb05699a31a457679';
|
|
17
|
+
exports.ALLOCATOR_ADDRESS = ALLOCATOR_ADDRESS;
|
|
15
18
|
const DEFAULT_RESET_PERIOD = 6;
|
|
16
19
|
const DEFAULT_SCOPE = 0;
|
|
17
20
|
function depositEther(value) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Address, Chain } from 'viem';
|
|
2
|
+
import type { AccountProviderConfig, RhinestoneSDKConfig } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Deploy smart accounts for multiple users from a backend using a sponsor wallet.
|
|
5
|
+
* The sponsor pays for gas, but users own and control their accounts.
|
|
6
|
+
*/
|
|
7
|
+
declare function deployAccountsForOwners(params: {
|
|
8
|
+
sponsorAccount: import('viem').Account;
|
|
9
|
+
ownerAddresses: Address[];
|
|
10
|
+
accountConfig: AccountProviderConfig;
|
|
11
|
+
chain: Chain;
|
|
12
|
+
sdkConfig?: RhinestoneSDKConfig;
|
|
13
|
+
sponsored?: boolean;
|
|
14
|
+
}): Promise<Array<{
|
|
15
|
+
owner: Address;
|
|
16
|
+
account: Address;
|
|
17
|
+
}>>;
|
|
18
|
+
export { deployAccountsForOwners };
|
|
19
|
+
//# sourceMappingURL=deployment.d.ts.map
|