@rhinestone/sdk 1.0.0-alpha.14 → 1.0.0-alpha.16
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/custom.d.ts +18 -0
- package/dist/src/accounts/custom.d.ts.map +1 -0
- package/dist/src/accounts/custom.js +121 -0
- package/dist/src/accounts/custom.test.d.ts +2 -0
- package/dist/src/accounts/custom.test.d.ts.map +1 -0
- package/dist/src/accounts/custom.test.js +64 -0
- package/dist/src/accounts/index.d.ts +1 -1
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +37 -6
- package/dist/src/accounts/index.test.js +3 -3
- package/dist/src/accounts/json-rpc/index.d.ts +5 -0
- package/dist/src/accounts/json-rpc/index.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/index.js +16 -0
- package/dist/src/accounts/json-rpc/index.test.d.ts +2 -0
- package/dist/src/accounts/json-rpc/index.test.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/index.test.js +16 -0
- package/dist/src/accounts/json-rpc/providers.d.ts +4 -0
- package/dist/src/accounts/json-rpc/providers.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/providers.js +14 -0
- package/dist/src/accounts/json-rpc/providers.test.d.ts +2 -0
- package/dist/src/accounts/json-rpc/providers.test.d.ts.map +1 -0
- package/dist/src/accounts/json-rpc/providers.test.js +15 -0
- package/dist/src/accounts/kernel.test.js +8 -8
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/nexus.js +34 -8
- package/dist/src/accounts/nexus.test.js +12 -12
- package/dist/src/accounts/safe.d.ts.map +1 -1
- package/dist/src/accounts/safe.js +2 -0
- package/dist/src/accounts/safe.test.js +8 -8
- package/dist/src/accounts/signing/common.d.ts +10 -6
- package/dist/src/accounts/signing/common.d.ts.map +1 -1
- package/dist/src/accounts/signing/common.js +41 -12
- package/dist/src/accounts/signing/message.d.ts +2 -2
- package/dist/src/accounts/signing/message.d.ts.map +1 -1
- package/dist/src/accounts/signing/message.js +7 -11
- package/dist/src/accounts/signing/passkeys.d.ts +29 -0
- package/dist/src/accounts/signing/passkeys.d.ts.map +1 -0
- package/dist/src/accounts/signing/passkeys.js +90 -0
- package/dist/src/accounts/signing/passkeys.test.d.ts +2 -0
- package/dist/src/accounts/signing/passkeys.test.d.ts.map +1 -0
- package/dist/src/accounts/signing/passkeys.test.js +73 -0
- package/dist/src/accounts/signing/typedData.d.ts +2 -2
- package/dist/src/accounts/signing/typedData.d.ts.map +1 -1
- package/dist/src/accounts/signing/typedData.js +7 -11
- package/dist/src/accounts/startale.test.js +8 -8
- package/dist/src/accounts/utils.d.ts +3 -3
- package/dist/src/accounts/utils.d.ts.map +1 -1
- package/dist/src/accounts/utils.js +3 -40
- package/dist/src/actions/index.d.ts +45 -1
- package/dist/src/actions/index.d.ts.map +1 -1
- package/dist/src/actions/index.js +174 -9
- package/dist/src/actions/index.test.js +16 -16
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +3 -6
- package/dist/src/execution/utils.d.ts +1 -1
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +17 -16
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -1
- package/dist/src/modules/index.d.ts +2 -17
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +4 -55
- package/dist/src/modules/index.test.js +2 -16
- package/dist/src/modules/omni-account.d.ts +2 -1
- package/dist/src/modules/omni-account.d.ts.map +1 -1
- package/dist/src/modules/omni-account.js +3 -1
- package/dist/src/modules/read.d.ts.map +1 -1
- package/dist/src/modules/read.js +1 -0
- package/dist/src/modules/validators/core.d.ts +4 -3
- package/dist/src/modules/validators/core.d.ts.map +1 -1
- package/dist/src/modules/validators/core.js +46 -37
- package/dist/src/modules/validators/core.test.js +6 -6
- package/dist/src/modules/validators/smart-sessions.test.js +4 -4
- package/dist/src/orchestrator/consts.d.ts +2 -1
- package/dist/src/orchestrator/consts.d.ts.map +1 -1
- package/dist/src/orchestrator/consts.js +3 -1
- package/dist/src/orchestrator/registry.d.ts +1 -23
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +22 -24
- package/dist/src/orchestrator/registry.test.js +4 -4
- package/dist/src/orchestrator/types.d.ts +1 -6
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/types.d.ts +29 -7
- package/dist/src/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/src/orchestrator/registry.json +0 -365
|
@@ -10,7 +10,7 @@ const MOCK_OWNER_A = '0xd1aefebdceefc094f1805b241fa5e6db63a9181a';
|
|
|
10
10
|
const MOCK_OWNER_B = '0xeddfcb50d18f6d3d51c4f7cbca5ed6bdebc59817';
|
|
11
11
|
const MOCK_OWNER_C = '0xb31e76f19defe76edc4b7eceeb4b0a2d6ddaca39';
|
|
12
12
|
const MOCK_ACCOUNT_ADDRESS = '0x1234567890123456789012345678901234567890';
|
|
13
|
-
const accountAddress = '
|
|
13
|
+
const accountAddress = '0x36c03e7d593f7b2c6b06fc18b5f4e9a4a29c99b0';
|
|
14
14
|
// Mock viem
|
|
15
15
|
vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
16
16
|
const actual = await importOriginal();
|
|
@@ -37,7 +37,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
37
37
|
{
|
|
38
38
|
to: accountAddress,
|
|
39
39
|
value: 0n,
|
|
40
|
-
data: '
|
|
40
|
+
data: '0x9517e29f0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000013fdb5234e4e3162a810f54d9f7e9800000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a',
|
|
41
41
|
},
|
|
42
42
|
]);
|
|
43
43
|
});
|
|
@@ -49,7 +49,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
49
49
|
{
|
|
50
50
|
to: accountAddress,
|
|
51
51
|
value: 0n,
|
|
52
|
-
data: '
|
|
52
|
+
data: '0x9517e29f0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000013fdb5234e4e3162a810f54d9f7e98000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a000000000000000000000000eddfcb50d18f6d3d51c4f7cbca5ed6bdebc59817',
|
|
53
53
|
},
|
|
54
54
|
]);
|
|
55
55
|
});
|
|
@@ -62,7 +62,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
62
62
|
{
|
|
63
63
|
to: accountAddress,
|
|
64
64
|
value: 0n,
|
|
65
|
-
data: '
|
|
65
|
+
data: '0x9517e29f0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000013fdb5234e4e3162a810f54d9f7e98000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000003000000000000000000000000b31e76f19defe76edc4b7eceeb4b0a2d6ddaca39000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a000000000000000000000000eddfcb50d18f6d3d51c4f7cbca5ed6bdebc59817',
|
|
66
66
|
},
|
|
67
67
|
]);
|
|
68
68
|
});
|
|
@@ -84,7 +84,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
84
84
|
{
|
|
85
85
|
to: accountAddress,
|
|
86
86
|
value: 0n,
|
|
87
|
-
data: '
|
|
87
|
+
data: '0x9517e29f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000578c4cb0e472a5462da43c495c3f33000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d10000000000000000000000000000000000000000000000000000000000000000',
|
|
88
88
|
},
|
|
89
89
|
]);
|
|
90
90
|
});
|
|
@@ -104,7 +104,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
104
104
|
{
|
|
105
105
|
to: accountAddress,
|
|
106
106
|
value: 0n,
|
|
107
|
-
data: '
|
|
107
|
+
data: '0xa71763a80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000013fdb5234e4e3162a810f54d9f7e9800000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000',
|
|
108
108
|
},
|
|
109
109
|
]);
|
|
110
110
|
});
|
|
@@ -132,7 +132,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
132
132
|
(0, vitest_1.describe)('Add Owner', () => {
|
|
133
133
|
(0, vitest_1.test)('', () => {
|
|
134
134
|
(0, vitest_1.expect)((0, _1.addOwner)(MOCK_OWNER_A)).toEqual({
|
|
135
|
-
to: '
|
|
135
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
136
136
|
value: 0n,
|
|
137
137
|
data: '0x7065cb48000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a',
|
|
138
138
|
});
|
|
@@ -141,7 +141,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
141
141
|
(0, vitest_1.describe)('Remove Owner', () => {
|
|
142
142
|
(0, vitest_1.test)('', () => {
|
|
143
143
|
(0, vitest_1.expect)((0, _1.removeOwner)(MOCK_OWNER_A, MOCK_OWNER_B)).toEqual({
|
|
144
|
-
to: '
|
|
144
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
145
145
|
value: 0n,
|
|
146
146
|
data: '0xfbe5ce0a000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a000000000000000000000000eddfcb50d18f6d3d51c4f7cbca5ed6bdebc59817',
|
|
147
147
|
});
|
|
@@ -150,7 +150,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
150
150
|
(0, vitest_1.describe)('Set Threshold', () => {
|
|
151
151
|
(0, vitest_1.test)('', () => {
|
|
152
152
|
(0, vitest_1.expect)((0, _1.changeThreshold)(1)).toEqual({
|
|
153
|
-
to: '
|
|
153
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
154
154
|
value: 0n,
|
|
155
155
|
data: '0x960bfe040000000000000000000000000000000000000000000000000000000000000001',
|
|
156
156
|
});
|
|
@@ -216,12 +216,12 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
216
216
|
(0, vitest_1.expect)(mockPublicClient.multicall).toHaveBeenCalledTimes(1);
|
|
217
217
|
(0, vitest_1.expect)(result).toEqual([
|
|
218
218
|
{
|
|
219
|
-
to: '
|
|
219
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
220
220
|
value: 0n,
|
|
221
221
|
data: '0x7065cb480000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7',
|
|
222
222
|
},
|
|
223
223
|
{
|
|
224
|
-
to: '
|
|
224
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
225
225
|
value: 0n,
|
|
226
226
|
data: '0xfbe5ce0a0000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da099486936',
|
|
227
227
|
},
|
|
@@ -249,12 +249,12 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
249
249
|
(0, vitest_1.expect)(mockPublicClient.multicall).toHaveBeenCalledTimes(1);
|
|
250
250
|
(0, vitest_1.expect)(result).toEqual([
|
|
251
251
|
{
|
|
252
|
-
to: '
|
|
252
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
253
253
|
value: 0n,
|
|
254
254
|
data: '0x7065cb48000000000000000000000000c5587d912c862252599b61926adaef316ba06da0',
|
|
255
255
|
},
|
|
256
256
|
{
|
|
257
|
-
to: '
|
|
257
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
258
258
|
value: 0n,
|
|
259
259
|
data: '0xfbe5ce0a000000000000000000000000c5587d912c862252599b61926adaef316ba06da0000000000000000000000000f6c02c78ded62973b43bfa523b247da099486936',
|
|
260
260
|
},
|
|
@@ -282,17 +282,17 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
282
282
|
(0, vitest_1.expect)(mockPublicClient.multicall).toHaveBeenCalledTimes(1);
|
|
283
283
|
(0, vitest_1.expect)(result).toEqual([
|
|
284
284
|
{
|
|
285
|
-
to: '
|
|
285
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
286
286
|
value: 0n,
|
|
287
287
|
data: '0x7065cb48000000000000000000000000c5587d912c862252599b61926adaef316ba06da0',
|
|
288
288
|
},
|
|
289
289
|
{
|
|
290
|
-
to: '
|
|
290
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
291
291
|
value: 0n,
|
|
292
292
|
data: '0xfbe5ce0a000000000000000000000000c5587d912c862252599b61926adaef316ba06da0000000000000000000000000f6c02c78ded62973b43bfa523b247da099486936',
|
|
293
293
|
},
|
|
294
294
|
{
|
|
295
|
-
to: '
|
|
295
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
296
296
|
value: 0n,
|
|
297
297
|
data: '0xfbe5ce0a0000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000c27b7578151c5ef713c62c65db09763d57ac3596',
|
|
298
298
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../execution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAmC,MAAM,MAAM,CAAA;AAKhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAQrD,OAAO,KAAK,EAEV,uBAAuB,EAGvB,WAAW,EACZ,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,0CAA0C,EAC1C,0CAA0C,EAC3C,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAa5D,iBAAe,eAAe,CAC5B,MAAM,EAAE,uBAAuB,EAC/B,WAAW,EAAE,WAAW,8BA2BzB;AAyID,iBAAe,gBAAgB,CAC7B,MAAM,EAAE,uBAAuB,EAC/B,MAAM,EAAE,iBAAiB,EACzB,uBAAuB,EAAE,OAAO;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../execution/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAmC,MAAM,MAAM,CAAA;AAKhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAQrD,OAAO,KAAK,EAEV,uBAAuB,EAGvB,WAAW,EACZ,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,gCAAgC,EAChC,yBAAyB,EACzB,0CAA0C,EAC1C,0CAA0C,EAC3C,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAa5D,iBAAe,eAAe,CAC5B,MAAM,EAAE,uBAAuB,EAC/B,WAAW,EAAE,WAAW,8BA2BzB;AAyID,iBAAe,gBAAgB,CAC7B,MAAM,EAAE,uBAAuB,EAC/B,MAAM,EAAE,iBAAiB,EACzB,uBAAuB,EAAE,OAAO;;;;;;;;;;;;GAyCjC;AAED,iBAAe,qBAAqB,CAClC,MAAM,EAAE,uBAAuB,EAC/B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,OAAO,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CAajB;AAED,iBAAe,YAAY,CACzB,MAAM,EAAE,uBAAuB,EAC/B,UAAU,EAAE,OAAO,gDAUpB;AAED,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,YAAY,EAEZ,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,0CAA0C,EAC1C,0CAA0C,EAC1C,gCAAgC,EAChC,yBAAyB,GAC1B,CAAA;AACD,YAAY,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAA"}
|
|
@@ -110,7 +110,7 @@ async function waitForExecution(config, result, acceptsPreconfirmations) {
|
|
|
110
110
|
case 'intent': {
|
|
111
111
|
let intentStatus = null;
|
|
112
112
|
while (intentStatus === null || !validStatuses.has(intentStatus.status)) {
|
|
113
|
-
const orchestrator = (0, utils_2.getOrchestratorByChain)(result.targetChain, config.rhinestoneApiKey);
|
|
113
|
+
const orchestrator = (0, utils_2.getOrchestratorByChain)(result.targetChain, config.rhinestoneApiKey, config.useDev);
|
|
114
114
|
intentStatus = await orchestrator.getIntentOpStatus(result.id);
|
|
115
115
|
await new Promise((resolve) => setTimeout(resolve, POLLING_INTERVAL));
|
|
116
116
|
}
|
|
@@ -121,9 +121,6 @@ async function waitForExecution(config, result, acceptsPreconfirmations) {
|
|
|
121
121
|
}
|
|
122
122
|
case 'userop': {
|
|
123
123
|
const targetChain = (0, registry_1.getChainById)(result.chain);
|
|
124
|
-
if (!targetChain) {
|
|
125
|
-
throw new Error(`Unsupported chain ID: ${result.chain}`);
|
|
126
|
-
}
|
|
127
124
|
const publicClient = (0, viem_1.createPublicClient)({
|
|
128
125
|
chain: targetChain,
|
|
129
126
|
transport: (0, utils_1.createTransport)(targetChain, config.provider),
|
|
@@ -138,12 +135,12 @@ async function waitForExecution(config, result, acceptsPreconfirmations) {
|
|
|
138
135
|
}
|
|
139
136
|
async function getMaxSpendableAmount(config, chain, tokenAddress, gasUnits) {
|
|
140
137
|
const address = (0, accounts_1.getAddress)(config);
|
|
141
|
-
const orchestrator = (0, utils_2.getOrchestratorByChain)(chain.id, config.rhinestoneApiKey);
|
|
138
|
+
const orchestrator = (0, utils_2.getOrchestratorByChain)(chain.id, config.rhinestoneApiKey, config.useDev);
|
|
142
139
|
return orchestrator.getMaxTokenAmount(address, chain.id, tokenAddress, gasUnits);
|
|
143
140
|
}
|
|
144
141
|
async function getPortfolio(config, onTestnets) {
|
|
145
142
|
const address = (0, accounts_1.getAddress)(config);
|
|
146
143
|
const chainId = onTestnets ? chains_1.sepolia.id : chains_1.mainnet.id;
|
|
147
|
-
const orchestrator = (0, utils_2.getOrchestratorByChain)(chainId, config.rhinestoneApiKey);
|
|
144
|
+
const orchestrator = (0, utils_2.getOrchestratorByChain)(chainId, config.rhinestoneApiKey, config.useDev);
|
|
148
145
|
return orchestrator.getPortfolio(address);
|
|
149
146
|
}
|
|
@@ -37,7 +37,7 @@ declare function signAuthorizationsInternal(config: RhinestoneAccountConfig, dat
|
|
|
37
37
|
declare function submitTransaction(config: RhinestoneAccountConfig, signedTransaction: SignedTransactionData, authorizations: SignedAuthorizationList): Promise<TransactionResult>;
|
|
38
38
|
declare function prepareTransactionAsIntent(config: RhinestoneAccountConfig, sourceChains: Chain[] | undefined, targetChain: Chain, callInputs: CallInput[], gasLimit: bigint | undefined, tokenRequests: TokenRequest[], accountAddress: Address, isSponsored: boolean, eip7702InitSignature?: Hex): Promise<IntentData>;
|
|
39
39
|
declare function signIntent(config: RhinestoneAccountConfig, targetChain: Chain, intentOp: IntentOp, signers?: SignerSet): Promise<`0x${string}`>;
|
|
40
|
-
declare function getOrchestratorByChain(chainId: number, apiKey
|
|
40
|
+
declare function getOrchestratorByChain(chainId: number, apiKey: string | undefined, useDev: boolean | undefined): import("../orchestrator").Orchestrator;
|
|
41
41
|
declare function submitIntentInternal(config: RhinestoneAccountConfig, sourceChains: Chain[] | undefined, targetChain: Chain, intentOp: IntentOp, signature: Hex, authorizations: SignedAuthorizationList): Promise<TransactionResult>;
|
|
42
42
|
declare function getValidatorAccount(config: RhinestoneAccountConfig, signers: SignerSet | undefined, publicClient: PublicClient, chain: Chain): Promise<import("viem/account-abstraction").SmartAccount<import("viem/account-abstraction").SmartAccountImplementation<import("viem").Abi, "0.7">> | null | undefined>;
|
|
43
43
|
declare function parseCalls(calls: CallInput[], chainId: number): Call[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../execution/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAIV,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EAER,KAAK,YAAY,EAEjB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EAGf,MAAM,MAAM,CAAA;AACb,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAA;AAuBjC,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,WAAW,EAGjB,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../execution/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAIV,KAAK,uBAAuB,EAC5B,KAAK,GAAG,EAER,KAAK,YAAY,EAEjB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,SAAS,EAGf,MAAM,MAAM,CAAA;AACb,OAAO,EAGL,KAAK,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ACjC,MAAM,EAAE,uBAAuB,EAC/B,YAAY,EAAE,KAAK,EAAE,GAAG,SAAS,EACjC,WAAW,EAAE,KAAK,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,GAAG,EACd,cAAc,EAAE,uBAAuB,8BA8BxC;AAED,iBAAe,mBAAmB,CAChC,MAAM,EAAE,uBAAuB,EAC/B,OAAO,EAAE,SAAS,GAAG,SAAS,EAC9B,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,KAAK,yKA6Bb;AAmDD,iBAAS,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,CAM/D;AAmDD,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,0BAA0B,EAC1B,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,sBAAsB,EACtB,UAAU,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,UAAU,GACX,CAAA;AACD,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,GACtB,CAAA"}
|
|
@@ -34,7 +34,7 @@ async function prepareTransaction(config, transaction) {
|
|
|
34
34
|
throw new error_1.SourceChainsNotAvailableForUserOpFlowError();
|
|
35
35
|
}
|
|
36
36
|
// Smart sessions require a UserOp flow
|
|
37
|
-
data = await prepareTransactionAsUserOp(config, targetChain, transaction.calls, signers);
|
|
37
|
+
data = await prepareTransactionAsUserOp(config, targetChain, transaction.calls, signers, transaction.gasLimit);
|
|
38
38
|
}
|
|
39
39
|
else {
|
|
40
40
|
data = await prepareTransactionAsIntent(config, sourceChains, targetChain, transaction.calls, transaction.gasLimit, tokenRequests, accountAddress, sponsored ?? false, eip7702InitSignature);
|
|
@@ -111,9 +111,6 @@ async function signAuthorizationsInternal(config, data) {
|
|
|
111
111
|
for (const chainId in requiredDelegations) {
|
|
112
112
|
const delegation = requiredDelegations[chainId];
|
|
113
113
|
const chain = (0, registry_1.getChainById)(Number(chainId));
|
|
114
|
-
if (!chain) {
|
|
115
|
-
throw new Error(`Chain not supported: ${chainId}`);
|
|
116
|
-
}
|
|
117
114
|
const walletClient = (0, viem_1.createWalletClient)({
|
|
118
115
|
chain,
|
|
119
116
|
account: eoa,
|
|
@@ -162,6 +159,7 @@ function getTransactionParams(transaction) {
|
|
|
162
159
|
const signers = transaction.signers;
|
|
163
160
|
const eip7702InitSignature = transaction.eip7702InitSignature;
|
|
164
161
|
const sponsored = transaction.sponsored;
|
|
162
|
+
const gasLimit = transaction.gasLimit;
|
|
165
163
|
// Across requires passing some value to repay the solvers
|
|
166
164
|
const tokenRequests = !initialTokenRequests || initialTokenRequests.length === 0
|
|
167
165
|
? [
|
|
@@ -178,9 +176,10 @@ function getTransactionParams(transaction) {
|
|
|
178
176
|
signers,
|
|
179
177
|
sponsored,
|
|
180
178
|
eip7702InitSignature,
|
|
179
|
+
gasLimit,
|
|
181
180
|
};
|
|
182
181
|
}
|
|
183
|
-
async function prepareTransactionAsUserOp(config, chain, callInputs, signers) {
|
|
182
|
+
async function prepareTransactionAsUserOp(config, chain, callInputs, signers, gasLimit) {
|
|
184
183
|
const publicClient = (0, viem_1.createPublicClient)({
|
|
185
184
|
chain,
|
|
186
185
|
transport: (0, utils_1.createTransport)(chain, config.provider),
|
|
@@ -194,6 +193,7 @@ async function prepareTransactionAsUserOp(config, chain, callInputs, signers) {
|
|
|
194
193
|
const userOp = await bundlerClient.prepareUserOperation({
|
|
195
194
|
account: validatorAccount,
|
|
196
195
|
calls,
|
|
196
|
+
callGasLimit: gasLimit,
|
|
197
197
|
});
|
|
198
198
|
return {
|
|
199
199
|
type: 'userop',
|
|
@@ -238,7 +238,7 @@ async function prepareTransactionAsIntent(config, sourceChains, targetChain, cal
|
|
|
238
238
|
},
|
|
239
239
|
},
|
|
240
240
|
};
|
|
241
|
-
const orchestrator = getOrchestratorByChain(targetChain.id, config.rhinestoneApiKey);
|
|
241
|
+
const orchestrator = getOrchestratorByChain(targetChain.id, config.rhinestoneApiKey, config.useDev);
|
|
242
242
|
const intentRoute = await orchestrator.getIntentRoute(metaIntent);
|
|
243
243
|
return {
|
|
244
244
|
type: 'intent',
|
|
@@ -316,10 +316,12 @@ async function submitUserOp(config, chain, userOp, signature) {
|
|
|
316
316
|
async function submitIntent(config, sourceChains, targetChain, intentOp, signature, authorizations) {
|
|
317
317
|
return submitIntentInternal(config, sourceChains, targetChain, intentOp, signature, authorizations);
|
|
318
318
|
}
|
|
319
|
-
function getOrchestratorByChain(chainId, apiKey) {
|
|
320
|
-
const orchestratorUrl = (
|
|
321
|
-
? consts_1.
|
|
322
|
-
:
|
|
319
|
+
function getOrchestratorByChain(chainId, apiKey, useDev) {
|
|
320
|
+
const orchestratorUrl = (useDev ?? false)
|
|
321
|
+
? consts_1.DEV_ORCHESTRATOR_URL
|
|
322
|
+
: (0, registry_1.isTestnet)(chainId)
|
|
323
|
+
? consts_1.STAGING_ORCHESTRATOR_URL
|
|
324
|
+
: consts_1.PROD_ORCHESTRATOR_URL;
|
|
323
325
|
return (0, orchestrator_1.getOrchestrator)(apiKey, orchestratorUrl);
|
|
324
326
|
}
|
|
325
327
|
async function submitIntentInternal(config, sourceChains, targetChain, intentOp, signature, authorizations) {
|
|
@@ -338,7 +340,7 @@ async function submitIntentInternal(config, sourceChains, targetChain, intentOp,
|
|
|
338
340
|
}))
|
|
339
341
|
: undefined,
|
|
340
342
|
};
|
|
341
|
-
const orchestrator = getOrchestratorByChain(targetChain.id, config.rhinestoneApiKey);
|
|
343
|
+
const orchestrator = getOrchestratorByChain(targetChain.id, config.rhinestoneApiKey, config.useDev);
|
|
342
344
|
const intentResults = await orchestrator.submitIntent(signedIntentOp);
|
|
343
345
|
return {
|
|
344
346
|
type: 'intent',
|
|
@@ -380,11 +382,10 @@ function getValidator(config, signers) {
|
|
|
380
382
|
}
|
|
381
383
|
// Passkeys (WebAuthn)
|
|
382
384
|
if (withOwner.kind === 'passkey') {
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
});
|
|
385
|
+
return (0, core_1.getWebAuthnValidator)(1, withOwner.accounts.map((account) => ({
|
|
386
|
+
pubKey: account.publicKey,
|
|
387
|
+
authenticatorId: account.id,
|
|
388
|
+
})));
|
|
388
389
|
}
|
|
389
390
|
// Multi-factor
|
|
390
391
|
if (withOwner.kind === 'multi-factor') {
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Address, Chain, HashTypedDataParameters, Hex, SignableMessage, SignedAuthorizationList, TypedData } from 'viem';
|
|
2
2
|
import type { UserOperationReceipt } from 'viem/account-abstraction';
|
|
3
3
|
import { AccountError, Eip7702AccountMustHaveEoaError, Eip7702NotSupportedForAccountError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, isAccountError, SigningNotSupportedForAccountError, SignMessageNotSupportedByAccountError, SmartSessionsNotEnabledError } from './accounts';
|
|
4
|
-
import { addOwner, changeMultiFactorThreshold, changeThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, recover, removeOwner, removeSubValidator, setSubValidator, setUpRecovery } from './actions';
|
|
4
|
+
import { addOwner, addPasskeyOwner, changeMultiFactorThreshold, changePasskeyThreshold, changeThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, recover, recoverEcdsaOwnership, recoverPasskeyOwnership, removeOwner, removePasskeyOwner, removeSubValidator, setSubValidator, setUpRecovery } from './actions';
|
|
5
5
|
import type { TransactionResult } from './execution';
|
|
6
6
|
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError } from './execution';
|
|
7
7
|
import { type SessionDetails } from './execution/smart-session';
|
|
@@ -37,6 +37,6 @@ interface RhinestoneAccount {
|
|
|
37
37
|
* @returns account
|
|
38
38
|
*/
|
|
39
39
|
declare function createRhinestoneAccount(config: RhinestoneAccountConfig): Promise<RhinestoneAccount>;
|
|
40
|
-
export { createRhinestoneAccount, addOwner, changeMultiFactorThreshold, changeThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, recover, removeOwner, removeSubValidator, setSubValidator, setUpRecovery, isAccountError, AccountError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, SignMessageNotSupportedByAccountError, Eip7702NotSupportedForAccountError, isExecutionError, IntentFailedError, ExecutionError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError, OrderPathRequiredForIntentsError, SessionChainRequiredError, isOrchestratorError, AuthenticationRequiredError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, getSupportedTokens, getTokenAddress, };
|
|
40
|
+
export { createRhinestoneAccount, addOwner, addPasskeyOwner, changeMultiFactorThreshold, changeThreshold, changePasskeyThreshold, disableEcdsa, disableMultiFactor, disablePasskeys, enableEcdsa, enableMultiFactor, enablePasskeys, encodeSmartSessionSignature, recover, recoverEcdsaOwnership, recoverPasskeyOwnership, removeOwner, removePasskeyOwner, removeSubValidator, setSubValidator, setUpRecovery, isAccountError, AccountError, Eip7702AccountMustHaveEoaError, ExistingEip7702AccountsNotSupportedError, FactoryArgsNotAvailableError, SmartSessionsNotEnabledError, SigningNotSupportedForAccountError, SignMessageNotSupportedByAccountError, Eip7702NotSupportedForAccountError, isExecutionError, IntentFailedError, ExecutionError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError, OrderPathRequiredForIntentsError, SessionChainRequiredError, isOrchestratorError, AuthenticationRequiredError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, getSupportedTokens, getTokenAddress, };
|
|
41
41
|
export type { RhinestoneAccount, Session, Call, IntentData, PreparedTransactionData, SignedTransactionData, TransactionResult, IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, SettlementSystem, SignedIntentOp, Portfolio, };
|
|
42
42
|
//# 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,EACV,OAAO,EACP,KAAK,EACL,uBAAuB,EACvB,GAAG,EACH,eAAe,EACf,uBAAuB,EACvB,SAAS,EACV,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EACL,YAAY,EAEZ,8BAA8B,EAC9B,kCAAkC,EAClC,wCAAwC,EACxC,4BAA4B,EAE5B,cAAc,EACd,kCAAkC,EAClC,qCAAqC,EACrC,4BAA4B,EAE7B,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,QAAQ,EACR,0BAA0B,EAC1B,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,2BAA2B,EAC3B,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,aAAa,EACd,MAAM,WAAW,CAAA;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EACL,cAAc,EAGd,iBAAiB,EACjB,gBAAgB,EAChB,gCAAgC,EAChC,yBAA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AAO,EAAE,CAAA;QACnB,SAAS,EAAE,MAAM,CAAA;KAClB,GAAG,IAAI,CAAC,CAAA;IACT,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;CACpD;AAED;;;;;GAKG;AACH,iBAAe,uBAAuB,CACpC,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,iBAAiB,CAAC,CA8M5B;AAED,OAAO,EACL,uBAAuB,EAEvB,QAAQ,EACR,0BAA0B,EAC1B,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,2BAA2B,EAC3B,OAAO,EACP,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,aAAa,EAEb,cAAc,EACd,YAAY,EACZ,8BAA8B,EAC9B,wCAAwC,EACxC,4BAA4B,EAC5B,4BAA4B,EAC5B,kCAAkC,EAClC,qCAAqC,EACrC,kCAAkC,EAElC,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,0CAA0C,EAC1C,0CAA0C,EAC1C,gCAAgC,EAChC,yBAAyB,EAEzB,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EAErB,kBAAkB,EAClB,eAAe,GAChB,CAAA;AACD,YAAY,EACV,iBAAiB,EACjB,OAAO,EACP,IAAI,EACJ,UAAU,EACV,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,SAAS,GACV,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AA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BAAqB,EACrB,uBAAuB,EACvB,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,aAAa,EAEb,cAAc,EACd,YAAY,EACZ,8BAA8B,EAC9B,wCAAwC,EACxC,4BAA4B,EAC5B,4BAA4B,EAC5B,kCAAkC,EAClC,qCAAqC,EACrC,kCAAkC,EAElC,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,0CAA0C,EAC1C,0CAA0C,EAC1C,gCAAgC,EAChC,yBAAyB,EAEzB,mBAAmB,EACnB,2BAA2B,EAC3B,wBAAwB,EACxB,kBAAkB,EAClB,2BAA2B,EAC3B,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EAErB,kBAAkB,EAClB,eAAe,GAChB,CAAA;AACD,YAAY,EACV,iBAAiB,EACjB,OAAO,EACP,IAAI,EACJ,UAAU,EACV,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,SAAS,GACV,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getSupportedTokens = exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.AuthenticationRequiredError = exports.isOrchestratorError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.UserOperationRequiredForSmartSessionsError = exports.SourceChainsNotAvailableForUserOpFlowError = exports.ExecutionError = exports.IntentFailedError = exports.isExecutionError = exports.Eip7702NotSupportedForAccountError = exports.SignMessageNotSupportedByAccountError = exports.SigningNotSupportedForAccountError = exports.SmartSessionsNotEnabledError = exports.FactoryArgsNotAvailableError = exports.ExistingEip7702AccountsNotSupportedError = exports.Eip7702AccountMustHaveEoaError = exports.AccountError = exports.isAccountError = exports.setUpRecovery = exports.setSubValidator = exports.removeSubValidator = exports.removePasskeyOwner = exports.removeOwner = exports.recoverPasskeyOwnership = exports.recoverEcdsaOwnership = exports.recover = exports.encodeSmartSessionSignature = exports.enablePasskeys = exports.enableMultiFactor = exports.enableEcdsa = exports.disablePasskeys = exports.disableMultiFactor = exports.disableEcdsa = exports.changePasskeyThreshold = exports.changeThreshold = exports.changeMultiFactorThreshold = exports.addPasskeyOwner = exports.addOwner = void 0;
|
|
4
|
+
exports.getTokenAddress = void 0;
|
|
4
5
|
exports.createRhinestoneAccount = createRhinestoneAccount;
|
|
5
6
|
const accounts_1 = require("./accounts");
|
|
6
7
|
Object.defineProperty(exports, "AccountError", { enumerable: true, get: function () { return accounts_1.AccountError; } });
|
|
@@ -14,7 +15,9 @@ Object.defineProperty(exports, "SignMessageNotSupportedByAccountError", { enumer
|
|
|
14
15
|
Object.defineProperty(exports, "SmartSessionsNotEnabledError", { enumerable: true, get: function () { return accounts_1.SmartSessionsNotEnabledError; } });
|
|
15
16
|
const actions_1 = require("./actions");
|
|
16
17
|
Object.defineProperty(exports, "addOwner", { enumerable: true, get: function () { return actions_1.addOwner; } });
|
|
18
|
+
Object.defineProperty(exports, "addPasskeyOwner", { enumerable: true, get: function () { return actions_1.addPasskeyOwner; } });
|
|
17
19
|
Object.defineProperty(exports, "changeMultiFactorThreshold", { enumerable: true, get: function () { return actions_1.changeMultiFactorThreshold; } });
|
|
20
|
+
Object.defineProperty(exports, "changePasskeyThreshold", { enumerable: true, get: function () { return actions_1.changePasskeyThreshold; } });
|
|
18
21
|
Object.defineProperty(exports, "changeThreshold", { enumerable: true, get: function () { return actions_1.changeThreshold; } });
|
|
19
22
|
Object.defineProperty(exports, "disableEcdsa", { enumerable: true, get: function () { return actions_1.disableEcdsa; } });
|
|
20
23
|
Object.defineProperty(exports, "disableMultiFactor", { enumerable: true, get: function () { return actions_1.disableMultiFactor; } });
|
|
@@ -24,7 +27,10 @@ Object.defineProperty(exports, "enableMultiFactor", { enumerable: true, get: fun
|
|
|
24
27
|
Object.defineProperty(exports, "enablePasskeys", { enumerable: true, get: function () { return actions_1.enablePasskeys; } });
|
|
25
28
|
Object.defineProperty(exports, "encodeSmartSessionSignature", { enumerable: true, get: function () { return actions_1.encodeSmartSessionSignature; } });
|
|
26
29
|
Object.defineProperty(exports, "recover", { enumerable: true, get: function () { return actions_1.recover; } });
|
|
30
|
+
Object.defineProperty(exports, "recoverEcdsaOwnership", { enumerable: true, get: function () { return actions_1.recoverEcdsaOwnership; } });
|
|
31
|
+
Object.defineProperty(exports, "recoverPasskeyOwnership", { enumerable: true, get: function () { return actions_1.recoverPasskeyOwnership; } });
|
|
27
32
|
Object.defineProperty(exports, "removeOwner", { enumerable: true, get: function () { return actions_1.removeOwner; } });
|
|
33
|
+
Object.defineProperty(exports, "removePasskeyOwner", { enumerable: true, get: function () { return actions_1.removePasskeyOwner; } });
|
|
28
34
|
Object.defineProperty(exports, "removeSubValidator", { enumerable: true, get: function () { return actions_1.removeSubValidator; } });
|
|
29
35
|
Object.defineProperty(exports, "setSubValidator", { enumerable: true, get: function () { return actions_1.setSubValidator; } });
|
|
30
36
|
Object.defineProperty(exports, "setUpRecovery", { enumerable: true, get: function () { return actions_1.setUpRecovery; } });
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import { type Chain
|
|
1
|
+
import { type Chain } from 'viem';
|
|
2
2
|
import type { RhinestoneAccountConfig } from '../types';
|
|
3
3
|
import { type Module } from './common';
|
|
4
4
|
import { HOOK_ADDRESS } from './omni-account';
|
|
5
5
|
import { getOwners, getValidators } from './read';
|
|
6
6
|
import { getOwnerValidator } from './validators';
|
|
7
|
-
interface WebAuthnData {
|
|
8
|
-
authenticatorData: Hex;
|
|
9
|
-
clientDataJSON: string;
|
|
10
|
-
typeIndex: number | bigint;
|
|
11
|
-
}
|
|
12
|
-
interface WebauthnValidatorSignature {
|
|
13
|
-
webauthn: WebAuthnData;
|
|
14
|
-
signature: WebauthnSignature | Hex | Uint8Array;
|
|
15
|
-
usePrecompiled?: boolean;
|
|
16
|
-
}
|
|
17
|
-
interface WebauthnSignature {
|
|
18
|
-
r: bigint;
|
|
19
|
-
s: bigint;
|
|
20
|
-
}
|
|
21
7
|
interface ModeleSetup {
|
|
22
8
|
validators: Module[];
|
|
23
9
|
executors: Module[];
|
|
@@ -25,7 +11,6 @@ interface ModeleSetup {
|
|
|
25
11
|
hooks: Module[];
|
|
26
12
|
}
|
|
27
13
|
declare function getSetup(config: RhinestoneAccountConfig): ModeleSetup;
|
|
28
|
-
declare function getWebauthnValidatorSignature({ webauthn, signature, usePrecompiled, }: WebauthnValidatorSignature): `0x${string}`;
|
|
29
14
|
declare function isRip7212SupportedNetwork(chain: Chain): boolean;
|
|
30
|
-
export { HOOK_ADDRESS, getSetup, getOwnerValidator,
|
|
15
|
+
export { HOOK_ADDRESS, getSetup, getOwnerValidator, getOwners, getValidators, isRip7212SupportedNetwork, };
|
|
31
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,KAAK,EAAuB,MAAM,MAAM,CAAA;AAWpE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAEvD,OAAO,EAGL,KAAK,MAAM,EACZ,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,YAAY,EAGb,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAA4B,MAAM,cAAc,CAAA;AAM1E,UAAU,WAAW;IACnB,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,iBAAS,QAAQ,CAAC,MAAM,EAAE,uBAAuB,GAAG,WAAW,CA2D9D;AAED,iBAAS,yBAAyB,CAAC,KAAK,EAAE,KAAK,WAW9C;AAED,OAAO,EACL,YAAY,EACZ,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,yBAAyB,GAC1B,CAAA"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getValidators = exports.getOwners = exports.getOwnerValidator = exports.HOOK_ADDRESS = void 0;
|
|
4
4
|
exports.getSetup = getSetup;
|
|
5
|
-
exports.getWebauthnValidatorSignature = getWebauthnValidatorSignature;
|
|
6
5
|
exports.isRip7212SupportedNetwork = isRip7212SupportedNetwork;
|
|
7
6
|
const viem_1 = require("viem");
|
|
8
7
|
const chains_1 = require("viem/chains");
|
|
@@ -27,9 +26,12 @@ function getSetup(config) {
|
|
|
27
26
|
const socialRecoveryValidator = (0, core_1.getSocialRecoveryValidator)(config.recovery.guardians, config.recovery.threshold);
|
|
28
27
|
validators.push(socialRecoveryValidator);
|
|
29
28
|
}
|
|
29
|
+
const intentExecutorAddress = config.useDev
|
|
30
|
+
? omni_account_1.INTENT_EXECUTOR_ADDRESS_DEV
|
|
31
|
+
: omni_account_1.INTENT_EXECUTOR_ADDRESS;
|
|
30
32
|
const executors = [
|
|
31
33
|
{
|
|
32
|
-
address:
|
|
34
|
+
address: intentExecutorAddress,
|
|
33
35
|
initData: '0x',
|
|
34
36
|
deInitData: '0x',
|
|
35
37
|
additionalContext: '0x',
|
|
@@ -61,50 +63,6 @@ function getSetup(config) {
|
|
|
61
63
|
hooks,
|
|
62
64
|
};
|
|
63
65
|
}
|
|
64
|
-
function getWebauthnValidatorSignature({ webauthn, signature, usePrecompiled = false, }) {
|
|
65
|
-
const { authenticatorData, clientDataJSON, typeIndex } = webauthn;
|
|
66
|
-
let r;
|
|
67
|
-
let s;
|
|
68
|
-
if (typeof signature === 'string' || signature instanceof Uint8Array) {
|
|
69
|
-
const parsedSignature = parseSignature(signature);
|
|
70
|
-
r = parsedSignature.r;
|
|
71
|
-
s = parsedSignature.s;
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
r = signature.r;
|
|
75
|
-
s = signature.s;
|
|
76
|
-
}
|
|
77
|
-
return (0, viem_1.encodeAbiParameters)([
|
|
78
|
-
{ type: 'bytes', name: 'authenticatorData' },
|
|
79
|
-
{
|
|
80
|
-
type: 'string',
|
|
81
|
-
name: 'clientDataJSON',
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
type: 'uint256',
|
|
85
|
-
name: 'responseTypeLocation',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
type: 'uint256',
|
|
89
|
-
name: 'r',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
type: 'uint256',
|
|
93
|
-
name: 's',
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
type: 'bool',
|
|
97
|
-
name: 'usePrecompiled',
|
|
98
|
-
},
|
|
99
|
-
], [
|
|
100
|
-
authenticatorData,
|
|
101
|
-
clientDataJSON,
|
|
102
|
-
typeof typeIndex === 'bigint' ? typeIndex : BigInt(typeIndex),
|
|
103
|
-
r,
|
|
104
|
-
s,
|
|
105
|
-
usePrecompiled,
|
|
106
|
-
]);
|
|
107
|
-
}
|
|
108
66
|
function isRip7212SupportedNetwork(chain) {
|
|
109
67
|
const supportedChains = [
|
|
110
68
|
chains_1.optimism,
|
|
@@ -117,12 +75,3 @@ function isRip7212SupportedNetwork(chain) {
|
|
|
117
75
|
];
|
|
118
76
|
return supportedChains.includes(chain);
|
|
119
77
|
}
|
|
120
|
-
function parseSignature(signature) {
|
|
121
|
-
const bytes = typeof signature === 'string' ? (0, viem_1.hexToBytes)(signature) : signature;
|
|
122
|
-
const r = bytes.slice(0, 32);
|
|
123
|
-
const s = bytes.slice(32, 64);
|
|
124
|
-
return {
|
|
125
|
-
r: BigInt((0, viem_1.bytesToHex)(r)),
|
|
126
|
-
s: BigInt((0, viem_1.bytesToHex)(s)),
|
|
127
|
-
};
|
|
128
|
-
}
|
|
@@ -15,7 +15,7 @@ const index_1 = require("./index");
|
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
17
|
const setup = (0, index_1.getSetup)(config);
|
|
18
|
-
(0, vitest_1.expect)(setup.validators[0].address).toBe('
|
|
18
|
+
(0, vitest_1.expect)(setup.validators[0].address).toBe('0x000000000013fdB5234E4E3162a810F54d9f7E98');
|
|
19
19
|
(0, vitest_1.expect)(setup.validators[0].type).toBe(1n);
|
|
20
20
|
});
|
|
21
21
|
(0, vitest_1.test)('should use webauthn validator for passkey owners', () => {
|
|
@@ -23,7 +23,7 @@ const index_1 = require("./index");
|
|
|
23
23
|
rhinestoneApiKey: consts_1.MOCK_API_KEY,
|
|
24
24
|
owners: {
|
|
25
25
|
type: 'passkey',
|
|
26
|
-
|
|
26
|
+
accounts: [consts_1.passkeyAccount],
|
|
27
27
|
},
|
|
28
28
|
};
|
|
29
29
|
const setup = (0, index_1.getSetup)(config);
|
|
@@ -87,18 +87,4 @@ const index_1 = require("./index");
|
|
|
87
87
|
});
|
|
88
88
|
vitest_1.test.todo('using the omni account should install the necessary modules');
|
|
89
89
|
});
|
|
90
|
-
(0, vitest_1.describe)('WebAuthn Validator Signature', () => {
|
|
91
|
-
(0, vitest_1.test)('default', () => {
|
|
92
|
-
const signature = (0, index_1.getWebauthnValidatorSignature)({
|
|
93
|
-
webauthn: {
|
|
94
|
-
authenticatorData: '0x49960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97631d00000000',
|
|
95
|
-
clientDataJSON: '{"type":"webauthn.get","challenge":"tbxXNFS9X_4Byr1cMwqKrIGB-_30a0QhZ6y7ucM0BOE","origin":"http://localhost:3000","crossOrigin":false, "other_keys_can_be_added_here":"do not compare clientDataJSON against a template. See https://goo.gl/yabPex"}',
|
|
96
|
-
typeIndex: 44941127272049826721201904734628716258498742255959991581049806490182030242267n,
|
|
97
|
-
},
|
|
98
|
-
signature: '0x00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001635bc6d0f68ff895cae8a288ecf7542a6a9cd555df784b73e1e2ea7e9104b1db15e9015d280cb19527881c625fee43fd3a405d5b0d199a8c8e6589a7381209e40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002549960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97631d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f47b2274797065223a22776562617574686e2e676574222c226368616c6c656e6765223a22746278584e465339585f3442797231634d77714b724947422d5f3330613051685a36793775634d30424f45222c226f726967696e223a22687474703a2f2f6c6f63616c686f73743a33303030222c2263726f73734f726967696e223a66616c73652c20226f746865725f6b6579735f63616e5f62655f61646465645f68657265223a22646f206e6f7420636f6d7061726520636c69656e74446174614a534f4e20616761696e737420612074656d706c6174652e205365652068747470733a2f2f676f6f2e676c2f796162506578227d000000000000000000000000',
|
|
99
|
-
usePrecompiled: true,
|
|
100
|
-
});
|
|
101
|
-
(0, vitest_1.expect)(signature).toEqual('0x00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000120635bc6d0f68ff895cae8a288ecf7542a6a9cd555df784b73e1e2ea7e9104b1db00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002549960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97631d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f47b2274797065223a22776562617574686e2e676574222c226368616c6c656e6765223a22746278584e465339585f3442797231634d77714b724947422d5f3330613051685a36793775634d30424f45222c226f726967696e223a22687474703a2f2f6c6f63616c686f73743a33303030222c2263726f73734f726967696e223a66616c73652c20226f746865725f6b6579735f63616e5f62655f61646465645f68657265223a22646f206e6f7420636f6d7061726520636c69656e74446174614a534f4e20616761696e737420612074656d706c6174652e205365652068747470733a2f2f676f6f2e676c2f796162506578227d000000000000000000000000');
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
90
|
});
|
|
@@ -3,5 +3,6 @@ declare const HOOK_ADDRESS: Address;
|
|
|
3
3
|
declare const TARGET_MODULE_ADDRESS: Address;
|
|
4
4
|
declare const SAME_CHAIN_MODULE_ADDRESS: Address;
|
|
5
5
|
declare const INTENT_EXECUTOR_ADDRESS: Address;
|
|
6
|
-
|
|
6
|
+
declare const INTENT_EXECUTOR_ADDRESS_DEV: Address;
|
|
7
|
+
export { HOOK_ADDRESS, TARGET_MODULE_ADDRESS, SAME_CHAIN_MODULE_ADDRESS, INTENT_EXECUTOR_ADDRESS, INTENT_EXECUTOR_ADDRESS_DEV, };
|
|
7
8
|
//# sourceMappingURL=omni-account.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"omni-account.d.ts","sourceRoot":"","sources":["../../../modules/omni-account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,QAAA,MAAM,YAAY,EAAE,OAAsD,CAAA;AAC1E,QAAA,MAAM,qBAAqB,EAAE,OACiB,CAAA;AAC9C,QAAA,MAAM,yBAAyB,EAAE,OACa,CAAA;AAE9C,QAAA,MAAM,uBAAuB,EAAE,OACe,CAAA;AAE9C,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"omni-account.d.ts","sourceRoot":"","sources":["../../../modules/omni-account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,QAAA,MAAM,YAAY,EAAE,OAAsD,CAAA;AAC1E,QAAA,MAAM,qBAAqB,EAAE,OACiB,CAAA;AAC9C,QAAA,MAAM,yBAAyB,EAAE,OACa,CAAA;AAE9C,QAAA,MAAM,uBAAuB,EAAE,OACe,CAAA;AAC9C,QAAA,MAAM,2BAA2B,EAAE,OACW,CAAA;AAE9C,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,EACvB,2BAA2B,GAC5B,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.INTENT_EXECUTOR_ADDRESS = exports.SAME_CHAIN_MODULE_ADDRESS = exports.TARGET_MODULE_ADDRESS = exports.HOOK_ADDRESS = void 0;
|
|
3
|
+
exports.INTENT_EXECUTOR_ADDRESS_DEV = exports.INTENT_EXECUTOR_ADDRESS = exports.SAME_CHAIN_MODULE_ADDRESS = exports.TARGET_MODULE_ADDRESS = exports.HOOK_ADDRESS = void 0;
|
|
4
4
|
const HOOK_ADDRESS = '0x0000000000f6Ed8Be424d673c63eeFF8b9267420';
|
|
5
5
|
exports.HOOK_ADDRESS = HOOK_ADDRESS;
|
|
6
6
|
const TARGET_MODULE_ADDRESS = '0x0000000000E5a37279A001301A837a91b5de1D5E';
|
|
@@ -9,3 +9,5 @@ const SAME_CHAIN_MODULE_ADDRESS = '0x000000000043ff16d5776c7F0f65Ec485C17Ca04';
|
|
|
9
9
|
exports.SAME_CHAIN_MODULE_ADDRESS = SAME_CHAIN_MODULE_ADDRESS;
|
|
10
10
|
const INTENT_EXECUTOR_ADDRESS = '0x00000000005aD9ce1f5035FD62CA96CEf16AdAAF';
|
|
11
11
|
exports.INTENT_EXECUTOR_ADDRESS = INTENT_EXECUTOR_ADDRESS;
|
|
12
|
+
const INTENT_EXECUTOR_ADDRESS_DEV = '0xbf9b5b917a83f8adac17b0752846d41d8d7b7e17';
|
|
13
|
+
exports.INTENT_EXECUTOR_ADDRESS_DEV = INTENT_EXECUTOR_ADDRESS_DEV;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../modules/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAsB,MAAM,MAAM,CAAA;AAEnE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG3D,iBAAe,aAAa,CAC1B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,CAAC,EAAE,cAAc,GACxB,OAAO,CAAC,OAAO,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../modules/read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAsB,MAAM,MAAM,CAAA;AAEnE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG3D,iBAAe,aAAa,CAC1B,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,CAAC,EAAE,cAAc,GACxB,OAAO,CAAC,OAAO,EAAE,CAAC,CA+CpB;AAED,iBAAe,SAAS,CACtB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,CAAC,EAAE,cAAc,GACxB,OAAO,CAAC;IACT,QAAQ,EAAE,OAAO,EAAE,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB,GAAG,IAAI,CAAC,CAkER;AAED,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,CAAA"}
|
package/dist/src/modules/read.js
CHANGED
|
@@ -13,13 +13,14 @@ interface WebauthnCredential {
|
|
|
13
13
|
declare const OWNABLE_VALIDATOR_ADDRESS: Address;
|
|
14
14
|
declare const WEBAUTHN_VALIDATOR_ADDRESS: Address;
|
|
15
15
|
declare const MULTI_FACTOR_VALIDATOR_ADDRESS: Address;
|
|
16
|
+
declare const OWNABLE_V0_VALIDATOR_ADDRESS: Address;
|
|
16
17
|
declare function getOwnerValidator(config: RhinestoneAccountConfig): Module;
|
|
17
18
|
declare function getMockSignature(ownerSet: OwnerSet): Hex;
|
|
18
19
|
declare function getValidator(owners: OwnerSet): Module;
|
|
19
|
-
declare function getOwnableValidator(threshold: number, owners: Address[]): Module;
|
|
20
|
-
declare function getWebAuthnValidator(
|
|
20
|
+
declare function getOwnableValidator(threshold: number, owners: Address[], address?: Address): Module;
|
|
21
|
+
declare function getWebAuthnValidator(threshold: number, webAuthnCredentials: WebauthnCredential[]): Module;
|
|
21
22
|
declare function getMultiFactorValidator(threshold: number, validators: (OwnableValidatorConfig | WebauthnValidatorConfig | null)[]): Module;
|
|
22
23
|
declare function getSocialRecoveryValidator(guardians: Account[], threshold?: number): Module;
|
|
23
|
-
export { OWNABLE_VALIDATOR_ADDRESS, WEBAUTHN_VALIDATOR_ADDRESS, MULTI_FACTOR_VALIDATOR_ADDRESS, getOwnerValidator, getOwnableValidator, getWebAuthnValidator, getMultiFactorValidator, getSocialRecoveryValidator, getValidator, getMockSignature, };
|
|
24
|
+
export { OWNABLE_VALIDATOR_ADDRESS, WEBAUTHN_VALIDATOR_ADDRESS, MULTI_FACTOR_VALIDATOR_ADDRESS, OWNABLE_V0_VALIDATOR_ADDRESS, getOwnerValidator, getOwnableValidator, getWebAuthnValidator, getMultiFactorValidator, getSocialRecoveryValidator, getValidator, getMockSignature, };
|
|
24
25
|
export type { WebauthnCredential };
|
|
25
26
|
//# sourceMappingURL=core.d.ts.map
|