@rhinestone/sdk 0.11.1 → 0.11.3
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/dist/src/accounts/index.d.ts +5 -2
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +46 -0
- package/dist/src/accounts/kernel.d.ts +4 -1
- package/dist/src/accounts/kernel.d.ts.map +1 -1
- package/dist/src/accounts/kernel.js +73 -42
- package/dist/src/accounts/kernel.test.js +17 -0
- package/dist/src/accounts/nexus.d.ts +4 -1
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/nexus.js +37 -0
- package/dist/src/accounts/nexus.test.js +14 -0
- package/dist/src/accounts/safe.d.ts +4 -1
- package/dist/src/accounts/safe.d.ts.map +1 -1
- package/dist/src/accounts/safe.js +37 -0
- package/dist/src/accounts/safe.test.js +14 -0
- package/dist/src/actions/index.d.ts +12 -0
- package/dist/src/actions/index.d.ts.map +1 -0
- package/dist/src/actions/index.js +165 -0
- package/dist/src/actions/index.test.d.ts +2 -0
- package/dist/src/actions/index.test.d.ts.map +1 -0
- package/dist/src/actions/index.test.js +170 -0
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +22 -12
- package/dist/src/execution/utils.d.ts +5 -4
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +84 -23
- package/dist/src/index.d.ts +17 -26
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -0
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +5 -0
- package/dist/src/modules/validators/core.d.ts +4 -2
- package/dist/src/modules/validators/core.d.ts.map +1 -1
- package/dist/src/modules/validators/core.js +24 -0
- package/dist/src/types.d.ts +11 -2
- package/dist/src/types.d.ts.map +1 -1
- package/dist/test/consts.d.ts +2 -1
- package/dist/test/consts.d.ts.map +1 -1
- package/dist/test/consts.js +3 -1
- package/package.json +1 -1
|
@@ -11,25 +11,27 @@ exports.signUserOp = signUserOp;
|
|
|
11
11
|
exports.submitUserOp = submitUserOp;
|
|
12
12
|
exports.prepareTransactionAsIntent = prepareTransactionAsIntent;
|
|
13
13
|
exports.submitIntentInternal = submitIntentInternal;
|
|
14
|
+
exports.getValidatorAccount = getValidatorAccount;
|
|
14
15
|
const viem_1 = require("viem");
|
|
15
16
|
const account_abstraction_1 = require("viem/account-abstraction");
|
|
16
17
|
const accounts_1 = require("../accounts");
|
|
17
18
|
const utils_1 = require("../accounts/utils");
|
|
18
19
|
const validators_1 = require("../modules/validators");
|
|
20
|
+
const core_1 = require("../modules/validators/core");
|
|
19
21
|
const orchestrator_1 = require("../orchestrator");
|
|
20
22
|
const consts_1 = require("../orchestrator/consts");
|
|
21
23
|
const registry_1 = require("../orchestrator/registry");
|
|
22
24
|
const smart_session_1 = require("./smart-session");
|
|
23
25
|
async function prepareTransaction(config, transaction) {
|
|
24
|
-
const { sourceChain, targetChain, tokenRequests,
|
|
26
|
+
const { sourceChain, targetChain, tokenRequests, signers } = getTransactionParams(transaction);
|
|
25
27
|
const accountAddress = (0, accounts_1.getAddress)(config);
|
|
26
28
|
let bundleData;
|
|
27
|
-
if (
|
|
29
|
+
if (signers) {
|
|
28
30
|
if (!sourceChain) {
|
|
29
|
-
throw new Error(`Specifying source chain is required when using smart sessions`);
|
|
31
|
+
throw new Error(`Specifying source chain is required when using smart sessions or guardians`);
|
|
30
32
|
}
|
|
31
33
|
// Smart sessions require a UserOp flow
|
|
32
|
-
bundleData = await prepareTransactionAsUserOp(config, sourceChain, targetChain, transaction.calls, transaction.gasLimit, tokenRequests, accountAddress,
|
|
34
|
+
bundleData = await prepareTransactionAsUserOp(config, sourceChain, targetChain, transaction.calls, transaction.gasLimit, tokenRequests, accountAddress, signers);
|
|
33
35
|
}
|
|
34
36
|
else {
|
|
35
37
|
bundleData = await prepareTransactionAsIntent(config, sourceChain, targetChain, transaction.calls, transaction.gasLimit, tokenRequests, accountAddress);
|
|
@@ -40,7 +42,8 @@ async function prepareTransaction(config, transaction) {
|
|
|
40
42
|
};
|
|
41
43
|
}
|
|
42
44
|
async function signTransaction(config, preparedTransaction) {
|
|
43
|
-
const { sourceChain, targetChain,
|
|
45
|
+
const { sourceChain, targetChain, signers } = getTransactionParams(preparedTransaction.transaction);
|
|
46
|
+
const withSession = signers?.type === 'session' ? signers.session : null;
|
|
44
47
|
const bundleData = preparedTransaction.bundleData;
|
|
45
48
|
const accountAddress = (0, accounts_1.getAddress)(config);
|
|
46
49
|
let signature;
|
|
@@ -53,7 +56,7 @@ async function signTransaction(config, preparedTransaction) {
|
|
|
53
56
|
throw new Error(`User operation is required when using smart sessions`);
|
|
54
57
|
}
|
|
55
58
|
// Smart sessions require a UserOp flow
|
|
56
|
-
signature = await signUserOp(config, sourceChain, targetChain, accountAddress,
|
|
59
|
+
signature = await signUserOp(config, sourceChain, targetChain, accountAddress, signers, userOp, bundleData.orderPath);
|
|
57
60
|
}
|
|
58
61
|
else {
|
|
59
62
|
signature = await signIntent(config, sourceChain, targetChain, bundleData.hash);
|
|
@@ -66,7 +69,8 @@ async function signTransaction(config, preparedTransaction) {
|
|
|
66
69
|
}
|
|
67
70
|
async function submitTransaction(config, signedTransaction) {
|
|
68
71
|
const { bundleData, transaction, signature } = signedTransaction;
|
|
69
|
-
const { sourceChain, targetChain,
|
|
72
|
+
const { sourceChain, targetChain, signers } = getTransactionParams(transaction);
|
|
73
|
+
const withSession = signers?.type === 'session' ? signers.session : null;
|
|
70
74
|
if (withSession) {
|
|
71
75
|
if (!sourceChain) {
|
|
72
76
|
throw new Error(`Specifying source chain is required when using smart sessions`);
|
|
@@ -86,7 +90,7 @@ function getTransactionParams(transaction) {
|
|
|
86
90
|
const sourceChain = 'chain' in transaction ? transaction.chain : transaction.sourceChain;
|
|
87
91
|
const targetChain = 'chain' in transaction ? transaction.chain : transaction.targetChain;
|
|
88
92
|
const initialTokenRequests = transaction.tokenRequests;
|
|
89
|
-
const
|
|
93
|
+
const signers = transaction.signers;
|
|
90
94
|
// Across requires passing some value to repay the solvers
|
|
91
95
|
const tokenRequests = initialTokenRequests.length === 0
|
|
92
96
|
? [
|
|
@@ -100,15 +104,15 @@ function getTransactionParams(transaction) {
|
|
|
100
104
|
sourceChain,
|
|
101
105
|
targetChain,
|
|
102
106
|
tokenRequests,
|
|
103
|
-
|
|
107
|
+
signers,
|
|
104
108
|
};
|
|
105
109
|
}
|
|
106
|
-
async function prepareTransactionAsUserOp(config, sourceChain, targetChain, calls, gasLimit, tokenRequests, accountAddress,
|
|
110
|
+
async function prepareTransactionAsUserOp(config, sourceChain, targetChain, calls, gasLimit, tokenRequests, accountAddress, signers) {
|
|
107
111
|
if (sourceChain.id === targetChain.id) {
|
|
108
112
|
throw new Error('Source and target chains cannot be the same when using user operations');
|
|
109
113
|
}
|
|
110
114
|
const orderPath = await getUserOpOrderPath(sourceChain, targetChain, tokenRequests, accountAddress, gasLimit, config.rhinestoneApiKey);
|
|
111
|
-
const userOp = await getUserOp(config, targetChain,
|
|
115
|
+
const userOp = await getUserOp(config, targetChain, signers, orderPath, calls, tokenRequests, accountAddress);
|
|
112
116
|
const hash = (0, account_abstraction_1.getUserOperationHash)({
|
|
113
117
|
userOperation: userOp,
|
|
114
118
|
entryPointAddress: account_abstraction_1.entryPoint07Address,
|
|
@@ -162,17 +166,20 @@ async function signIntent(config, sourceChain, targetChain, bundleHash) {
|
|
|
162
166
|
}, bundleHash);
|
|
163
167
|
return signature;
|
|
164
168
|
}
|
|
165
|
-
async function signUserOp(config, sourceChain, targetChain, accountAddress,
|
|
166
|
-
const
|
|
167
|
-
if (!
|
|
168
|
-
throw new Error('
|
|
169
|
+
async function signUserOp(config, sourceChain, targetChain, accountAddress, signers, userOp, orderPath) {
|
|
170
|
+
const validator = getValidator(config, signers);
|
|
171
|
+
if (!validator) {
|
|
172
|
+
throw new Error('Validator not available');
|
|
169
173
|
}
|
|
170
174
|
const targetPublicClient = (0, viem_1.createPublicClient)({
|
|
171
175
|
chain: targetChain,
|
|
172
176
|
transport: (0, viem_1.http)(),
|
|
173
177
|
});
|
|
174
|
-
const
|
|
175
|
-
|
|
178
|
+
const targetAccount = await getValidatorAccount(config, signers, targetPublicClient, targetChain);
|
|
179
|
+
if (!targetAccount) {
|
|
180
|
+
throw new Error('No account found');
|
|
181
|
+
}
|
|
182
|
+
userOp.signature = await targetAccount.signUserOperation(userOp);
|
|
176
183
|
const userOpHash = (0, account_abstraction_1.getUserOperationHash)({
|
|
177
184
|
userOperation: userOp,
|
|
178
185
|
chainId: targetChain.id,
|
|
@@ -181,11 +188,18 @@ async function signUserOp(config, sourceChain, targetChain, accountAddress, with
|
|
|
181
188
|
});
|
|
182
189
|
orderPath[0].orderBundle.segments[0].witness.userOpHash = userOpHash;
|
|
183
190
|
const { hash, appDomainSeparator, contentsType, structHash } = await (0, smart_session_1.hashErc7739)(sourceChain, orderPath, accountAddress);
|
|
184
|
-
const
|
|
185
|
-
|
|
191
|
+
const owners = getOwners(signers);
|
|
192
|
+
if (!owners) {
|
|
193
|
+
throw new Error('No owners found');
|
|
194
|
+
}
|
|
195
|
+
const signature = await (0, accounts_1.getPackedSignature)(config, owners, targetChain, {
|
|
196
|
+
address: validator.address,
|
|
186
197
|
isRoot: false,
|
|
187
198
|
}, hash, (signature) => {
|
|
188
|
-
|
|
199
|
+
const sessionData = signers?.type === 'session' ? signers.session : null;
|
|
200
|
+
return sessionData
|
|
201
|
+
? (0, smart_session_1.getSessionSignature)(signature, appDomainSeparator, structHash, contentsType, sessionData)
|
|
202
|
+
: signature;
|
|
189
203
|
});
|
|
190
204
|
return signature;
|
|
191
205
|
}
|
|
@@ -239,15 +253,18 @@ async function getUserOpOrderPath(sourceChain, targetChain, tokenRequests, accou
|
|
|
239
253
|
const orderPath = await orchestrator.getOrderPath(metaIntent, accountAddress);
|
|
240
254
|
return orderPath;
|
|
241
255
|
}
|
|
242
|
-
async function getUserOp(config, targetChain,
|
|
256
|
+
async function getUserOp(config, targetChain, signers, orderPath, calls, tokenRequests, accountAddress) {
|
|
243
257
|
const targetPublicClient = (0, viem_1.createPublicClient)({
|
|
244
258
|
chain: targetChain,
|
|
245
259
|
transport: (0, viem_1.http)(),
|
|
246
260
|
});
|
|
247
|
-
const
|
|
261
|
+
const targetAccount = await getValidatorAccount(config, signers, targetPublicClient, targetChain);
|
|
262
|
+
if (!targetAccount) {
|
|
263
|
+
throw new Error('No account found');
|
|
264
|
+
}
|
|
248
265
|
const targetBundlerClient = (0, utils_1.getBundlerClient)(config, targetPublicClient);
|
|
249
266
|
return await targetBundlerClient.prepareUserOperation({
|
|
250
|
-
account:
|
|
267
|
+
account: targetAccount,
|
|
251
268
|
calls: [...orderPath[0].injectedExecutions, ...calls],
|
|
252
269
|
stateOverride: [
|
|
253
270
|
...tokenRequests.map((request) => {
|
|
@@ -292,3 +309,47 @@ async function submitIntentInternal(config, sourceChain, targetChain, orderPath,
|
|
|
292
309
|
targetChain: targetChain.id,
|
|
293
310
|
};
|
|
294
311
|
}
|
|
312
|
+
async function getValidatorAccount(config, signers, publicClient, chain) {
|
|
313
|
+
if (!signers) {
|
|
314
|
+
return undefined;
|
|
315
|
+
}
|
|
316
|
+
const withSession = signers.type === 'session' ? signers.session : null;
|
|
317
|
+
const withGuardians = signers.type === 'guardians' ? signers : null;
|
|
318
|
+
return withSession
|
|
319
|
+
? await (0, accounts_1.getSmartSessionSmartAccount)(config, publicClient, chain, withSession)
|
|
320
|
+
: withGuardians
|
|
321
|
+
? await (0, accounts_1.getGuardianSmartAccount)(config, publicClient, chain, {
|
|
322
|
+
type: 'ecdsa',
|
|
323
|
+
accounts: withGuardians.guardians,
|
|
324
|
+
})
|
|
325
|
+
: null;
|
|
326
|
+
}
|
|
327
|
+
function getValidator(config, signers) {
|
|
328
|
+
if (!signers) {
|
|
329
|
+
return undefined;
|
|
330
|
+
}
|
|
331
|
+
const withSession = signers.type === 'session' ? signers.session : null;
|
|
332
|
+
const withGuardians = signers.type === 'guardians' ? signers : null;
|
|
333
|
+
return withSession
|
|
334
|
+
? (0, validators_1.getSmartSessionValidator)(config)
|
|
335
|
+
: withGuardians
|
|
336
|
+
? (0, core_1.getSocialRecoveryValidator)(withGuardians.guardians)
|
|
337
|
+
: undefined;
|
|
338
|
+
}
|
|
339
|
+
function getOwners(signers) {
|
|
340
|
+
if (!signers) {
|
|
341
|
+
return undefined;
|
|
342
|
+
}
|
|
343
|
+
const withSession = signers.type === 'session' ? signers.session : null;
|
|
344
|
+
const withGuardians = signers.type === 'guardians' ? signers : null;
|
|
345
|
+
return withSession
|
|
346
|
+
? withSession.owners.type === 'ecdsa'
|
|
347
|
+
? withSession.owners
|
|
348
|
+
: undefined
|
|
349
|
+
: withGuardians
|
|
350
|
+
? {
|
|
351
|
+
type: 'ecdsa',
|
|
352
|
+
accounts: withGuardians.guardians,
|
|
353
|
+
}
|
|
354
|
+
: undefined;
|
|
355
|
+
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,38 +1,29 @@
|
|
|
1
1
|
import type { Address, Chain } from 'viem';
|
|
2
|
+
import { UserOperationReceipt } from 'viem/account-abstraction';
|
|
3
|
+
import { addOwner, recover, removeOwner, setThreshold, setUpRecovery } from './actions';
|
|
2
4
|
import type { TransactionResult } from './execution';
|
|
3
5
|
import { BundleData, PreparedTransactionData, SignedTransactionData } from './execution/utils';
|
|
4
|
-
import type { BundleStatus, MetaIntent, MultiChainCompact, PostOrderBundleResult, SignedMultiChainCompact } from './orchestrator';
|
|
6
|
+
import type { BundleResult, BundleStatus, MetaIntent, MultiChainCompact, PostOrderBundleResult, SignedMultiChainCompact, UserTokenBalance } from './orchestrator';
|
|
5
7
|
import type { Call, Execution, RhinestoneAccountConfig, Session, Transaction } from './types';
|
|
6
|
-
|
|
7
|
-
* Initialize a Rhinestone account
|
|
8
|
-
* Note: accounts are deployed onchain only when the first transaction is sent.
|
|
9
|
-
* @param config Account config (e.g. implementation vendor, owner signers, smart sessions)
|
|
10
|
-
* @returns account
|
|
11
|
-
*/
|
|
12
|
-
declare function createRhinestoneAccount(config: RhinestoneAccountConfig): Promise<{
|
|
8
|
+
interface RhinestoneAccount {
|
|
13
9
|
config: RhinestoneAccountConfig;
|
|
14
10
|
deploy: (chain: Chain, session?: Session) => Promise<void>;
|
|
15
11
|
prepareTransaction: (transaction: Transaction) => Promise<PreparedTransactionData>;
|
|
16
12
|
signTransaction: (preparedTransaction: PreparedTransactionData) => Promise<SignedTransactionData>;
|
|
17
13
|
submitTransaction: (signedTransaction: SignedTransactionData) => Promise<TransactionResult>;
|
|
18
14
|
sendTransaction: (transaction: Transaction) => Promise<TransactionResult>;
|
|
19
|
-
waitForExecution: (result: TransactionResult, acceptsPreconfirmations?: boolean) => Promise<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
entryPoint: Address;
|
|
23
|
-
logs: import("viem").Log<bigint, number, false>[];
|
|
24
|
-
nonce: bigint;
|
|
25
|
-
paymaster?: `0x${string}` | undefined;
|
|
26
|
-
reason?: string | undefined | undefined;
|
|
27
|
-
receipt: import("viem").TransactionReceipt<bigint, number, "success" | "reverted">;
|
|
28
|
-
sender: Address;
|
|
29
|
-
success: boolean;
|
|
30
|
-
userOpHash: import("viem").Hash;
|
|
31
|
-
} | import("./orchestrator").BundleResult>;
|
|
32
|
-
getAddress: () => `0x${string}`;
|
|
33
|
-
getPortfolio: (onTestnets?: boolean) => Promise<import("./orchestrator").UserTokenBalance[]>;
|
|
15
|
+
waitForExecution: (result: TransactionResult, acceptsPreconfirmations?: boolean) => Promise<BundleResult | UserOperationReceipt>;
|
|
16
|
+
getAddress: () => Address;
|
|
17
|
+
getPortfolio: (onTestnets?: boolean) => Promise<UserTokenBalance[]>;
|
|
34
18
|
getMaxSpendableAmount: (chain: Chain, tokenAddress: Address, gasUnits: bigint) => Promise<bigint>;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Initialize a Rhinestone account
|
|
22
|
+
* Note: accounts are deployed onchain only when the first transaction is sent.
|
|
23
|
+
* @param config Account config (e.g. implementation vendor, owner signers, smart sessions)
|
|
24
|
+
* @returns account
|
|
25
|
+
*/
|
|
26
|
+
declare function createRhinestoneAccount(config: RhinestoneAccountConfig): Promise<RhinestoneAccount>;
|
|
27
|
+
export { createRhinestoneAccount, addOwner, recover, removeOwner, setThreshold, setUpRecovery, };
|
|
28
|
+
export type { RhinestoneAccount, BundleStatus, Session, Call, Execution, MetaIntent, MultiChainCompact, PostOrderBundleResult, SignedMultiChainCompact, BundleData, PreparedTransactionData, SignedTransactionData, TransactionResult, };
|
|
38
29
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAA;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAK/D,OAAO,EACL,QAAQ,EACR,OAAO,EACP,WAAW,EACX,YAAY,EACZ,aAAa,EACd,MAAM,WAAW,CAAA;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAOpD,OAAO,EACL,UAAU,EACV,uBAAuB,EAEvB,qBAAqB,EAGtB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EACV,IAAI,EACJ,SAAS,EACT,uBAAuB,EACvB,OAAO,EACP,WAAW,EACZ,M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B,EACvB,UAAU,EACV,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,GAClB,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setUpRecovery = exports.setThreshold = exports.removeOwner = exports.recover = exports.addOwner = void 0;
|
|
3
4
|
exports.createRhinestoneAccount = createRhinestoneAccount;
|
|
4
5
|
const accounts_1 = require("./accounts");
|
|
6
|
+
const actions_1 = require("./actions");
|
|
7
|
+
Object.defineProperty(exports, "addOwner", { enumerable: true, get: function () { return actions_1.addOwner; } });
|
|
8
|
+
Object.defineProperty(exports, "recover", { enumerable: true, get: function () { return actions_1.recover; } });
|
|
9
|
+
Object.defineProperty(exports, "removeOwner", { enumerable: true, get: function () { return actions_1.removeOwner; } });
|
|
10
|
+
Object.defineProperty(exports, "setThreshold", { enumerable: true, get: function () { return actions_1.setThreshold; } });
|
|
11
|
+
Object.defineProperty(exports, "setUpRecovery", { enumerable: true, get: function () { return actions_1.setUpRecovery; } });
|
|
5
12
|
const execution_1 = require("./execution");
|
|
6
13
|
const utils_1 = require("./execution/utils");
|
|
7
14
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAEZ,KAAK,KAAK,EAEV,KAAK,GAAG,EAET,MAAM,MAAM,CAAA;AAYb,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAEvD,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,YAAY,EAMb,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAA4B,MAAM,cAAc,CAAA;
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ED,iBAAS,yBAAyB,CAAC,KAAK,EAAE,KAAK,WAa9C;AAaD,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,6BAA6B,EAC7B,yBAAyB,GAC1B,CAAA"}
|
|
@@ -14,6 +14,7 @@ Object.defineProperty(exports, "getTrustAttesterCall", { enumerable: true, get:
|
|
|
14
14
|
Object.defineProperty(exports, "getTrustedAttesters", { enumerable: true, get: function () { return registry_1.getTrustedAttesters; } });
|
|
15
15
|
const validators_1 = require("./validators");
|
|
16
16
|
Object.defineProperty(exports, "getOwnerValidator", { enumerable: true, get: function () { return validators_1.getOwnerValidator; } });
|
|
17
|
+
const core_1 = require("./validators/core");
|
|
17
18
|
const SMART_SESSION_COMPATIBILITY_FALLBACK_ADDRESS = '0x12cae64c42f362e7d5a847c2d33388373f629177';
|
|
18
19
|
function getSetup(config) {
|
|
19
20
|
const ownerValidator = (0, validators_1.getOwnerValidator)(config);
|
|
@@ -22,6 +23,10 @@ function getSetup(config) {
|
|
|
22
23
|
if (smartSessionValidator) {
|
|
23
24
|
validators.push(smartSessionValidator);
|
|
24
25
|
}
|
|
26
|
+
if (config.recovery) {
|
|
27
|
+
const socialRecoveryValidator = (0, core_1.getSocialRecoveryValidator)(config.recovery.guardians, config.recovery.threshold);
|
|
28
|
+
validators.push(socialRecoveryValidator);
|
|
29
|
+
}
|
|
25
30
|
const executors = [
|
|
26
31
|
{
|
|
27
32
|
address: omni_account_1.SAME_CHAIN_MODULE_ADDRESS,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { type Hex } from 'viem';
|
|
1
|
+
import { Account, type Address, type Hex } from 'viem';
|
|
2
2
|
import type { OwnerSet, RhinestoneAccountConfig } from '../../types';
|
|
3
3
|
import { type Module } from '../common';
|
|
4
|
+
declare const OWNABLE_VALIDATOR_ADDRESS: Address;
|
|
4
5
|
declare function getOwnerValidator(config: RhinestoneAccountConfig): Module;
|
|
5
6
|
declare function getMockSignature(ownerSet: OwnerSet): Hex;
|
|
6
7
|
declare function getValidator(owners: OwnerSet): Module;
|
|
7
|
-
|
|
8
|
+
declare function getSocialRecoveryValidator(guardians: Account[], threshold?: number): Module;
|
|
9
|
+
export { OWNABLE_VALIDATOR_ADDRESS, getOwnerValidator, getSocialRecoveryValidator, getValidator, getMockSignature, };
|
|
8
10
|
//# sourceMappingURL=core.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../modules/validators/core.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../modules/validators/core.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,KAAK,OAAO,EAIZ,KAAK,GAAG,EAIT,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAEpE,OAAO,EAA4B,KAAK,MAAM,EAAE,MAAM,WAAW,CAAA;AAcjE,QAAA,MAAM,yBAAyB,EAAE,OACa,CAAA;AAW9C,iBAAS,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,UAEzD;AAED,iBAAS,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,GAAG,CAUjD;AAED,iBAAS,YAAY,CAAC,MAAM,EAAE,QAAQ,UAarC;AAqFD,iBAAS,0BAA0B,CACjC,SAAS,EAAE,OAAO,EAAE,EACpB,SAAS,SAAI,GACZ,MAAM,CAsBR;AAeD,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,0BAA0B,EAC1B,YAAY,EACZ,gBAAgB,GACjB,CAAA"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OWNABLE_VALIDATOR_ADDRESS = void 0;
|
|
3
4
|
exports.getOwnerValidator = getOwnerValidator;
|
|
5
|
+
exports.getSocialRecoveryValidator = getSocialRecoveryValidator;
|
|
4
6
|
exports.getValidator = getValidator;
|
|
5
7
|
exports.getMockSignature = getMockSignature;
|
|
6
8
|
const viem_1 = require("viem");
|
|
7
9
|
const common_1 = require("../common");
|
|
8
10
|
const OWNABLE_VALIDATOR_ADDRESS = '0x2483DA3A338895199E5e538530213157e931Bf06';
|
|
11
|
+
exports.OWNABLE_VALIDATOR_ADDRESS = OWNABLE_VALIDATOR_ADDRESS;
|
|
9
12
|
const WEBAUTHN_VALIDATOR_ADDRESS = '0x2f167e55d42584f65e2e30a748f41ee75a311414';
|
|
13
|
+
const SOCIAL_RECOVERY_VALIDATOR_ADDRESS = '0xA04D053b3C8021e8D5bF641816c42dAA75D8b597';
|
|
10
14
|
const ECDSA_MOCK_SIGNATURE = '0x81d4b4981670cb18f99f0b4a66446df1bf5b204d24cfcb659bf38ba27a4359b5711649ec2423c5e1247245eba2964679b6a1dbb85c992ae40b9b00c6935b02ff1b';
|
|
11
15
|
const WEBAUTHN_MOCK_SIGNATURE = '0x00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001635bc6d0f68ff895cae8a288ecf7542a6a9cd555df784b73e1e2ea7e9104b1db15e9015d280cb19527881c625fee43fd3a405d5b0d199a8c8e6589a7381209e40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002549960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97631d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f47b2274797065223a22776562617574686e2e676574222c226368616c6c656e6765223a22746278584e465339585f3442797231634d77714b724947422d5f3330613051685a36793775634d30424f45222c226f726967696e223a22687474703a2f2f6c6f63616c686f73743a33303030222c2263726f73734f726967696e223a66616c73652c20226f746865725f6b6579735f63616e5f62655f61646465645f68657265223a22646f206e6f7420636f6d7061726520636c69656e74446174614a534f4e20616761696e737420612074656d706c6174652e205365652068747470733a2f2f676f6f2e676c2f796162506578227d000000000000000000000000';
|
|
12
16
|
function getOwnerValidator(config) {
|
|
@@ -103,6 +107,26 @@ function getWebAuthnValidator(webAuthnCredential) {
|
|
|
103
107
|
type: common_1.MODULE_TYPE_ID_VALIDATOR,
|
|
104
108
|
};
|
|
105
109
|
}
|
|
110
|
+
function getSocialRecoveryValidator(guardians, threshold = 1) {
|
|
111
|
+
const guardianAddresses = guardians.map((guardian) => guardian.address);
|
|
112
|
+
guardianAddresses.sort();
|
|
113
|
+
return {
|
|
114
|
+
type: common_1.MODULE_TYPE_ID_VALIDATOR,
|
|
115
|
+
address: SOCIAL_RECOVERY_VALIDATOR_ADDRESS,
|
|
116
|
+
initData: (0, viem_1.encodeAbiParameters)([
|
|
117
|
+
{
|
|
118
|
+
type: 'uint256',
|
|
119
|
+
name: 'threshold',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
type: 'address[]',
|
|
123
|
+
name: 'guardians',
|
|
124
|
+
},
|
|
125
|
+
], [BigInt(threshold), guardianAddresses]),
|
|
126
|
+
deInitData: '0x',
|
|
127
|
+
additionalContext: '0x',
|
|
128
|
+
};
|
|
129
|
+
}
|
|
106
130
|
function parsePublicKey(publicKey) {
|
|
107
131
|
const bytes = typeof publicKey === 'string' ? (0, viem_1.hexToBytes)(publicKey) : publicKey;
|
|
108
132
|
const offset = bytes.length === 65 ? 1 : 0;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -64,12 +64,17 @@ interface Session {
|
|
|
64
64
|
actions?: [Action, ...Action[]];
|
|
65
65
|
salt?: Hex;
|
|
66
66
|
}
|
|
67
|
+
interface Recovery {
|
|
68
|
+
guardians: Account[];
|
|
69
|
+
threshold?: number;
|
|
70
|
+
}
|
|
67
71
|
interface RhinestoneAccountConfig {
|
|
68
72
|
account?: AccountProviderConfig;
|
|
69
73
|
owners: OwnerSet;
|
|
70
74
|
rhinestoneApiKey: string;
|
|
71
75
|
deployerAccount?: Account;
|
|
72
76
|
sessions?: Session[];
|
|
77
|
+
recovery?: Recovery;
|
|
73
78
|
eoa?: Account;
|
|
74
79
|
provider?: {
|
|
75
80
|
type: 'alchemy';
|
|
@@ -94,7 +99,11 @@ interface SessionSignerSet {
|
|
|
94
99
|
type: 'session';
|
|
95
100
|
session: Session;
|
|
96
101
|
}
|
|
97
|
-
|
|
102
|
+
interface GuardiansSignerSet {
|
|
103
|
+
type: 'guardians';
|
|
104
|
+
guardians: Account[];
|
|
105
|
+
}
|
|
106
|
+
type SignerSet = SessionSignerSet | GuardiansSignerSet;
|
|
98
107
|
interface BaseTransaction {
|
|
99
108
|
calls: Call[];
|
|
100
109
|
tokenRequests: TokenRequest[];
|
|
@@ -109,5 +118,5 @@ interface CrossChainTransaction extends BaseTransaction {
|
|
|
109
118
|
targetChain: Chain;
|
|
110
119
|
}
|
|
111
120
|
type Transaction = SameChainTransaction | CrossChainTransaction;
|
|
112
|
-
export type { RhinestoneAccountConfig, AccountProviderConfig, BundlerConfig, Transaction, Call, Execution, TokenRequest, OwnerSet, SignerSet, Session, Policy, UniversalActionPolicyParamCondition, };
|
|
121
|
+
export type { RhinestoneAccountConfig, AccountProviderConfig, BundlerConfig, Transaction, Call, Execution, TokenRequest, OwnerSet, OwnableValidatorConfig, WebauthnValidatorConfig, SignerSet, Session, Recovery, Policy, UniversalActionPolicyParamCondition, };
|
|
113
122
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE/D,UAAU,qBAAqB;IAC7B,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAA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AQ,EACR,MAAM,EACN,mCAAmC,GACpC,CAAA"}
|
package/dist/test/consts.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { Account } from 'viem/accounts';
|
|
|
3
3
|
declare const accountA: Account;
|
|
4
4
|
declare const accountB: Account;
|
|
5
5
|
declare const accountC: Account;
|
|
6
|
+
declare const accountD: Account;
|
|
6
7
|
declare const passkeyAccount: WebAuthnAccount;
|
|
7
8
|
declare const MOCK_API_KEY = "MOCK_KEY";
|
|
8
|
-
export { accountA, accountB, accountC, passkeyAccount, MOCK_API_KEY };
|
|
9
|
+
export { accountA, accountB, accountC, accountD, passkeyAccount, MOCK_API_KEY };
|
|
9
10
|
//# sourceMappingURL=consts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../test/consts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,EAAE,OAAO,EAAuB,MAAM,eAAe,CAAA;AAE5D,QAAA,MAAM,QAAQ,EAAE,OAEf,CAAA;AACD,QAAA,MAAM,QAAQ,EAAE,OAEf,CAAA;AACD,QAAA,MAAM,QAAQ,EAAE,OAEf,CAAA;AACD,QAAA,MAAM,cAAc,EAAE,eAMpB,CAAA;AAEF,QAAA,MAAM,YAAY,aAAa,CAAA;AAE/B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,CAAA"}
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../../test/consts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,EAAE,OAAO,EAAuB,MAAM,eAAe,CAAA;AAE5D,QAAA,MAAM,QAAQ,EAAE,OAEf,CAAA;AACD,QAAA,MAAM,QAAQ,EAAE,OAEf,CAAA;AACD,QAAA,MAAM,QAAQ,EAAE,OAEf,CAAA;AACD,QAAA,MAAM,QAAQ,EAAE,OAEf,CAAA;AACD,QAAA,MAAM,cAAc,EAAE,eAMpB,CAAA;AAEF,QAAA,MAAM,YAAY,aAAa,CAAA;AAE/B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,CAAA"}
|
package/dist/test/consts.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MOCK_API_KEY = exports.passkeyAccount = exports.accountC = exports.accountB = exports.accountA = void 0;
|
|
3
|
+
exports.MOCK_API_KEY = exports.passkeyAccount = exports.accountD = exports.accountC = exports.accountB = exports.accountA = void 0;
|
|
4
4
|
const account_abstraction_1 = require("viem/account-abstraction");
|
|
5
5
|
const accounts_1 = require("viem/accounts");
|
|
6
6
|
const accountA = (0, accounts_1.privateKeyToAccount)('0x2be89d993f98bbaab8b83f1a2830cb9414e19662967c7ba2a0f43d2a9125bd6d');
|
|
@@ -9,6 +9,8 @@ const accountB = (0, accounts_1.privateKeyToAccount)('0x39e2fec1a04c088f939d81de
|
|
|
9
9
|
exports.accountB = accountB;
|
|
10
10
|
const accountC = (0, accounts_1.privateKeyToAccount)('0xb63c74af219a3949cf95f5e3a3d20b0137425de053bb03e5cc0f46fe0d19f22f');
|
|
11
11
|
exports.accountC = accountC;
|
|
12
|
+
const accountD = (0, accounts_1.privateKeyToAccount)('0xa4aba81871b7b51fff56bfe441ea7f9a4879dd4bc8ce8c15fdb06dc92e63d1d7');
|
|
13
|
+
exports.accountD = accountD;
|
|
12
14
|
const passkeyAccount = (0, account_abstraction_1.toWebAuthnAccount)({
|
|
13
15
|
credential: {
|
|
14
16
|
id: '9IwX9n6cn-l9SzqFzfQXvDHRuTM',
|