@rhinestone/sdk 1.0.0-alpha.2 → 1.0.0-alpha.21
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/error.d.ts.map +1 -1
- package/dist/src/accounts/error.js +2 -0
- package/dist/src/accounts/index.d.ts +22 -13
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +192 -186
- 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.d.ts +9 -10
- package/dist/src/accounts/kernel.d.ts.map +1 -1
- package/dist/src/accounts/kernel.js +3 -14
- package/dist/src/accounts/kernel.test.js +10 -15
- package/dist/src/accounts/nexus.d.ts +14 -13
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/nexus.js +121 -93
- package/dist/src/accounts/nexus.test.js +13 -14
- package/dist/src/accounts/safe.d.ts +5 -7
- package/dist/src/accounts/safe.d.ts.map +1 -1
- package/dist/src/accounts/safe.js +25 -35
- package/dist/src/accounts/safe.test.js +9 -10
- package/dist/src/accounts/signing/common.d.ts +27 -0
- package/dist/src/accounts/signing/common.d.ts.map +1 -0
- package/dist/src/accounts/signing/common.js +142 -0
- package/dist/src/accounts/signing/message.d.ts +5 -0
- package/dist/src/accounts/signing/message.d.ts.map +1 -0
- package/dist/src/accounts/signing/message.js +47 -0
- 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 +5 -0
- package/dist/src/accounts/signing/typedData.d.ts.map +1 -0
- package/dist/src/accounts/signing/typedData.js +35 -0
- package/dist/src/accounts/startale.d.ts +20 -0
- package/dist/src/accounts/startale.d.ts.map +1 -0
- package/dist/src/accounts/startale.js +100 -0
- package/dist/src/accounts/startale.test.d.ts +2 -0
- package/dist/src/accounts/startale.test.d.ts.map +1 -0
- package/dist/src/accounts/startale.test.js +96 -0
- package/dist/src/accounts/utils.d.ts +2 -1
- package/dist/src/accounts/utils.d.ts.map +1 -1
- package/dist/src/accounts/utils.js +7 -0
- package/dist/src/actions/index.d.ts +145 -7
- package/dist/src/actions/index.d.ts.map +1 -1
- package/dist/src/actions/index.js +373 -23
- package/dist/src/actions/index.test.js +35 -17
- package/dist/src/actions/smart-session.d.ts +8 -2
- package/dist/src/actions/smart-session.d.ts.map +1 -1
- package/dist/src/actions/smart-session.js +6 -0
- package/dist/src/execution/compact.d.ts +130 -3
- package/dist/src/execution/compact.d.ts.map +1 -1
- package/dist/src/execution/compact.js +94 -1
- package/dist/src/execution/error.d.ts +2 -9
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +4 -13
- package/dist/src/execution/index.d.ts +3 -4
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +35 -80
- package/dist/src/execution/smart-session.d.ts +1 -1
- package/dist/src/execution/smart-session.d.ts.map +1 -1
- package/dist/src/execution/smart-session.js +12 -17
- package/dist/src/execution/utils.d.ts +19 -14
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +222 -97
- package/dist/src/index.d.ts +17 -15
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +108 -21
- package/dist/src/modules/index.d.ts +3 -22
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +5 -65
- package/dist/src/modules/index.test.js +3 -17
- package/dist/src/modules/omni-account.d.ts +2 -4
- package/dist/src/modules/omni-account.d.ts.map +1 -1
- package/dist/src/modules/omni-account.js +4 -8
- package/dist/src/modules/read.d.ts +5 -6
- package/dist/src/modules/read.d.ts.map +1 -1
- package/dist/src/modules/read.js +7 -37
- package/dist/src/modules/validators/core.d.ts +8 -8
- package/dist/src/modules/validators/core.d.ts.map +1 -1
- package/dist/src/modules/validators/core.js +126 -42
- package/dist/src/modules/validators/core.test.js +7 -7
- package/dist/src/modules/validators/smart-sessions.d.ts +3 -3
- package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.js +10 -9
- package/dist/src/modules/validators/smart-sessions.test.js +4 -4
- package/dist/src/orchestrator/client.d.ts +5 -3
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +159 -95
- package/dist/src/orchestrator/consts.d.ts +3 -2
- package/dist/src/orchestrator/consts.d.ts.map +1 -1
- package/dist/src/orchestrator/consts.js +4 -2
- package/dist/src/orchestrator/index.d.ts +3 -4
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +1 -9
- package/dist/src/orchestrator/registry.d.ts +10 -13
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +75 -395
- package/dist/src/orchestrator/registry.test.d.ts.map +1 -0
- package/dist/src/orchestrator/registry.test.js +137 -0
- package/dist/src/orchestrator/types.d.ts +78 -16
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/orchestrator/utils.d.ts +1 -3
- package/dist/src/orchestrator/utils.d.ts.map +1 -1
- package/dist/src/orchestrator/utils.js +0 -102
- package/dist/src/types.d.ts +69 -26
- package/dist/src/types.d.ts.map +1 -1
- package/dist/test/consts.d.ts +2 -2
- package/dist/test/consts.d.ts.map +1 -1
- package/package.json +2 -1
- package/dist/src/actions/registry.d.ts +0 -7
- package/dist/src/actions/registry.d.ts.map +0 -1
- package/dist/src/actions/registry.js +0 -7
- package/dist/src/actions/registry.test.d.ts.map +0 -1
- package/dist/src/actions/registry.test.js +0 -25
- package/dist/src/modules/registry.d.ts +0 -13
- package/dist/src/modules/registry.d.ts.map +0 -1
- package/dist/src/modules/registry.js +0 -67
- /package/dist/src/{actions → orchestrator}/registry.test.d.ts +0 -0
|
@@ -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();
|
|
@@ -36,7 +36,8 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
36
36
|
})).toEqual([
|
|
37
37
|
{
|
|
38
38
|
to: accountAddress,
|
|
39
|
-
|
|
39
|
+
value: 0n,
|
|
40
|
+
data: '0x9517e29f0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000013fdb5234e4e3162a810f54d9f7e9800000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a',
|
|
40
41
|
},
|
|
41
42
|
]);
|
|
42
43
|
});
|
|
@@ -47,7 +48,8 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
47
48
|
})).toEqual([
|
|
48
49
|
{
|
|
49
50
|
to: accountAddress,
|
|
50
|
-
|
|
51
|
+
value: 0n,
|
|
52
|
+
data: '0x9517e29f0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000013fdb5234e4e3162a810f54d9f7e98000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a000000000000000000000000eddfcb50d18f6d3d51c4f7cbca5ed6bdebc59817',
|
|
51
53
|
},
|
|
52
54
|
]);
|
|
53
55
|
});
|
|
@@ -59,7 +61,8 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
59
61
|
})).toEqual([
|
|
60
62
|
{
|
|
61
63
|
to: accountAddress,
|
|
62
|
-
|
|
64
|
+
value: 0n,
|
|
65
|
+
data: '0x9517e29f0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000013fdb5234e4e3162a810f54d9f7e98000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000003000000000000000000000000b31e76f19defe76edc4b7eceeb4b0a2d6ddaca39000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a000000000000000000000000eddfcb50d18f6d3d51c4f7cbca5ed6bdebc59817',
|
|
63
66
|
},
|
|
64
67
|
]);
|
|
65
68
|
});
|
|
@@ -80,7 +83,8 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
80
83
|
})).toEqual([
|
|
81
84
|
{
|
|
82
85
|
to: accountAddress,
|
|
83
|
-
|
|
86
|
+
value: 0n,
|
|
87
|
+
data: '0x9517e29f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000578c4cb0e472a5462da43c495c3f33000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000001580a9af0569ad3905b26a703201b358aa0904236642ebe79b22a19d00d3737637d46f725a5427ae45a9569259bf67e1e16b187d7b3ad1ed70138c4f0409677d10000000000000000000000000000000000000000000000000000000000000000',
|
|
84
88
|
},
|
|
85
89
|
]);
|
|
86
90
|
});
|
|
@@ -99,7 +103,8 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
99
103
|
})).toEqual([
|
|
100
104
|
{
|
|
101
105
|
to: accountAddress,
|
|
102
|
-
|
|
106
|
+
value: 0n,
|
|
107
|
+
data: '0xa71763a80000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000013fdb5234e4e3162a810f54d9f7e9800000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000',
|
|
103
108
|
},
|
|
104
109
|
]);
|
|
105
110
|
});
|
|
@@ -118,7 +123,8 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
118
123
|
})).toEqual([
|
|
119
124
|
{
|
|
120
125
|
to: accountAddress,
|
|
121
|
-
|
|
126
|
+
value: 0n,
|
|
127
|
+
data: '0xa71763a800000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000578c4cb0e472a5462da43c495c3f3300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000',
|
|
122
128
|
},
|
|
123
129
|
]);
|
|
124
130
|
});
|
|
@@ -126,7 +132,8 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
126
132
|
(0, vitest_1.describe)('Add Owner', () => {
|
|
127
133
|
(0, vitest_1.test)('', () => {
|
|
128
134
|
(0, vitest_1.expect)((0, _1.addOwner)(MOCK_OWNER_A)).toEqual({
|
|
129
|
-
to: '
|
|
135
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
136
|
+
value: 0n,
|
|
130
137
|
data: '0x7065cb48000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a',
|
|
131
138
|
});
|
|
132
139
|
});
|
|
@@ -134,7 +141,8 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
134
141
|
(0, vitest_1.describe)('Remove Owner', () => {
|
|
135
142
|
(0, vitest_1.test)('', () => {
|
|
136
143
|
(0, vitest_1.expect)((0, _1.removeOwner)(MOCK_OWNER_A, MOCK_OWNER_B)).toEqual({
|
|
137
|
-
to: '
|
|
144
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
145
|
+
value: 0n,
|
|
138
146
|
data: '0xfbe5ce0a000000000000000000000000d1aefebdceefc094f1805b241fa5e6db63a9181a000000000000000000000000eddfcb50d18f6d3d51c4f7cbca5ed6bdebc59817',
|
|
139
147
|
});
|
|
140
148
|
});
|
|
@@ -142,7 +150,8 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
142
150
|
(0, vitest_1.describe)('Set Threshold', () => {
|
|
143
151
|
(0, vitest_1.test)('', () => {
|
|
144
152
|
(0, vitest_1.expect)((0, _1.changeThreshold)(1)).toEqual({
|
|
145
|
-
to: '
|
|
153
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
154
|
+
value: 0n,
|
|
146
155
|
data: '0x960bfe040000000000000000000000000000000000000000000000000000000000000001',
|
|
147
156
|
});
|
|
148
157
|
});
|
|
@@ -163,6 +172,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
163
172
|
})).toEqual([
|
|
164
173
|
{
|
|
165
174
|
to: accountAddress,
|
|
175
|
+
value: 0n,
|
|
166
176
|
data: '0x9517e29f0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a04d053b3c8021e8d5bf641816c42daa75d8b597000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7',
|
|
167
177
|
},
|
|
168
178
|
]);
|
|
@@ -175,6 +185,7 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
175
185
|
})).toEqual([
|
|
176
186
|
{
|
|
177
187
|
to: accountAddress,
|
|
188
|
+
value: 0n,
|
|
178
189
|
data: '0x9517e29f0000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a04d053b3c8021e8d5bf641816c42daa75d8b597000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000030000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000c27b7578151c5ef713c62c65db09763d57ac3596000000000000000000000000c5587d912c862252599b61926adaef316ba06da0',
|
|
179
190
|
},
|
|
180
191
|
]);
|
|
@@ -205,11 +216,13 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
205
216
|
(0, vitest_1.expect)(mockPublicClient.multicall).toHaveBeenCalledTimes(1);
|
|
206
217
|
(0, vitest_1.expect)(result).toEqual([
|
|
207
218
|
{
|
|
208
|
-
to: '
|
|
219
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
220
|
+
value: 0n,
|
|
209
221
|
data: '0x7065cb480000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7',
|
|
210
222
|
},
|
|
211
223
|
{
|
|
212
|
-
to: '
|
|
224
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
225
|
+
value: 0n,
|
|
213
226
|
data: '0xfbe5ce0a0000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000f6c02c78ded62973b43bfa523b247da099486936',
|
|
214
227
|
},
|
|
215
228
|
]);
|
|
@@ -236,11 +249,13 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
236
249
|
(0, vitest_1.expect)(mockPublicClient.multicall).toHaveBeenCalledTimes(1);
|
|
237
250
|
(0, vitest_1.expect)(result).toEqual([
|
|
238
251
|
{
|
|
239
|
-
to: '
|
|
252
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
253
|
+
value: 0n,
|
|
240
254
|
data: '0x7065cb48000000000000000000000000c5587d912c862252599b61926adaef316ba06da0',
|
|
241
255
|
},
|
|
242
256
|
{
|
|
243
|
-
to: '
|
|
257
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
258
|
+
value: 0n,
|
|
244
259
|
data: '0xfbe5ce0a000000000000000000000000c5587d912c862252599b61926adaef316ba06da0000000000000000000000000f6c02c78ded62973b43bfa523b247da099486936',
|
|
245
260
|
},
|
|
246
261
|
]);
|
|
@@ -267,15 +282,18 @@ vitest_1.vi.mock('viem', async (importOriginal) => {
|
|
|
267
282
|
(0, vitest_1.expect)(mockPublicClient.multicall).toHaveBeenCalledTimes(1);
|
|
268
283
|
(0, vitest_1.expect)(result).toEqual([
|
|
269
284
|
{
|
|
270
|
-
to: '
|
|
285
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
286
|
+
value: 0n,
|
|
271
287
|
data: '0x7065cb48000000000000000000000000c5587d912c862252599b61926adaef316ba06da0',
|
|
272
288
|
},
|
|
273
289
|
{
|
|
274
|
-
to: '
|
|
290
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
291
|
+
value: 0n,
|
|
275
292
|
data: '0xfbe5ce0a000000000000000000000000c5587d912c862252599b61926adaef316ba06da0000000000000000000000000f6c02c78ded62973b43bfa523b247da099486936',
|
|
276
293
|
},
|
|
277
294
|
{
|
|
278
|
-
to: '
|
|
295
|
+
to: '0x000000000013fdB5234E4E3162a810F54d9f7E98',
|
|
296
|
+
value: 0n,
|
|
279
297
|
data: '0xfbe5ce0a0000000000000000000000006092086a3dc0020cd604a68fcf5d430007d51bb7000000000000000000000000c27b7578151c5ef713c62c65db09763d57ac3596',
|
|
280
298
|
},
|
|
281
299
|
]);
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { Hex } from 'viem';
|
|
2
|
-
import { SessionDetails } from '../execution/smart-session';
|
|
1
|
+
import type { Hex } from 'viem';
|
|
2
|
+
import type { SessionDetails } from '../execution/smart-session';
|
|
3
|
+
/**
|
|
4
|
+
* Encode a smart session signature
|
|
5
|
+
* @param sessionDetails Session details
|
|
6
|
+
* @param sessionSignature Session signature
|
|
7
|
+
* @returns Encoded smart session signature
|
|
8
|
+
*/
|
|
3
9
|
declare function encodeSmartSessionSignature(sessionDetails: SessionDetails, sessionSignature: Hex): `0x${string}`;
|
|
4
10
|
export { encodeSmartSessionSignature };
|
|
5
11
|
//# sourceMappingURL=smart-session.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smart-session.d.ts","sourceRoot":"","sources":["../../../actions/smart-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"smart-session.d.ts","sourceRoot":"","sources":["../../../actions/smart-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAGhE;;;;;GAKG;AACH,iBAAS,2BAA2B,CAClC,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,GAAG,iBAQtB;AAED,OAAO,EAAE,2BAA2B,EAAE,CAAA"}
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.encodeSmartSessionSignature = encodeSmartSessionSignature;
|
|
4
4
|
const smart_sessions_1 = require("../modules/validators/smart-sessions");
|
|
5
|
+
/**
|
|
6
|
+
* Encode a smart session signature
|
|
7
|
+
* @param sessionDetails Session details
|
|
8
|
+
* @param sessionSignature Session signature
|
|
9
|
+
* @returns Encoded smart session signature
|
|
10
|
+
*/
|
|
5
11
|
function encodeSmartSessionSignature(sessionDetails, sessionSignature) {
|
|
6
12
|
return (0, smart_sessions_1.encodeSmartSessionSignature)(sessionDetails.mode, sessionDetails.enableSessionData.permissionId, sessionSignature, sessionDetails.enableSessionData);
|
|
7
13
|
}
|
|
@@ -1,8 +1,135 @@
|
|
|
1
|
-
import { Address } from 'viem';
|
|
2
|
-
import {
|
|
1
|
+
import { type Address } from 'viem';
|
|
2
|
+
import type { IntentOp } from '../orchestrator/types';
|
|
3
|
+
import type { Call } from '../types';
|
|
3
4
|
declare const COMPACT_ADDRESS = "0xa2E6C7Ba8613E1534dCB990e7e4962216C0a5d58";
|
|
4
5
|
declare function getDepositEtherCall(account: Address, value: bigint): Call;
|
|
5
6
|
declare function getDepositErc20Call(account: Address, tokenAddress: Address, amount: bigint): Call;
|
|
6
7
|
declare function getApproveErc20Call(tokenAddress: Address, amount: bigint): Call;
|
|
7
|
-
|
|
8
|
+
declare function getIntentData(intentOp: IntentOp): {
|
|
9
|
+
readonly domain: {
|
|
10
|
+
readonly name: "The Compact";
|
|
11
|
+
readonly version: "1";
|
|
12
|
+
readonly chainId: bigint;
|
|
13
|
+
readonly verifyingContract: "0x73d2dc0c21fca4ec1601895d50df7f5624f07d3f";
|
|
14
|
+
};
|
|
15
|
+
readonly types: {
|
|
16
|
+
readonly MultichainCompact: readonly [{
|
|
17
|
+
readonly name: "sponsor";
|
|
18
|
+
readonly type: "address";
|
|
19
|
+
}, {
|
|
20
|
+
readonly name: "nonce";
|
|
21
|
+
readonly type: "uint256";
|
|
22
|
+
}, {
|
|
23
|
+
readonly name: "expires";
|
|
24
|
+
readonly type: "uint256";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "elements";
|
|
27
|
+
readonly type: "Element[]";
|
|
28
|
+
}];
|
|
29
|
+
readonly Element: readonly [{
|
|
30
|
+
readonly name: "arbiter";
|
|
31
|
+
readonly type: "address";
|
|
32
|
+
}, {
|
|
33
|
+
readonly name: "chainId";
|
|
34
|
+
readonly type: "uint256";
|
|
35
|
+
}, {
|
|
36
|
+
readonly name: "commitments";
|
|
37
|
+
readonly type: "Lock[]";
|
|
38
|
+
}, {
|
|
39
|
+
readonly name: "mandate";
|
|
40
|
+
readonly type: "Mandate";
|
|
41
|
+
}];
|
|
42
|
+
readonly Lock: readonly [{
|
|
43
|
+
readonly name: "lockTag";
|
|
44
|
+
readonly type: "bytes12";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "token";
|
|
47
|
+
readonly type: "address";
|
|
48
|
+
}, {
|
|
49
|
+
readonly name: "amount";
|
|
50
|
+
readonly type: "uint256";
|
|
51
|
+
}];
|
|
52
|
+
readonly Mandate: readonly [{
|
|
53
|
+
readonly name: "target";
|
|
54
|
+
readonly type: "Target";
|
|
55
|
+
}, {
|
|
56
|
+
readonly name: "originOps";
|
|
57
|
+
readonly type: "Op[]";
|
|
58
|
+
}, {
|
|
59
|
+
readonly name: "destOps";
|
|
60
|
+
readonly type: "Op[]";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "q";
|
|
63
|
+
readonly type: "bytes32";
|
|
64
|
+
}];
|
|
65
|
+
readonly Target: readonly [{
|
|
66
|
+
readonly name: "recipient";
|
|
67
|
+
readonly type: "address";
|
|
68
|
+
}, {
|
|
69
|
+
readonly name: "tokenOut";
|
|
70
|
+
readonly type: "Token[]";
|
|
71
|
+
}, {
|
|
72
|
+
readonly name: "targetChain";
|
|
73
|
+
readonly type: "uint256";
|
|
74
|
+
}, {
|
|
75
|
+
readonly name: "fillExpiry";
|
|
76
|
+
readonly type: "uint256";
|
|
77
|
+
}];
|
|
78
|
+
readonly Token: readonly [{
|
|
79
|
+
readonly name: "token";
|
|
80
|
+
readonly type: "address";
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: "amount";
|
|
83
|
+
readonly type: "uint256";
|
|
84
|
+
}];
|
|
85
|
+
readonly Op: readonly [{
|
|
86
|
+
readonly name: "to";
|
|
87
|
+
readonly type: "address";
|
|
88
|
+
}, {
|
|
89
|
+
readonly name: "value";
|
|
90
|
+
readonly type: "uint256";
|
|
91
|
+
}, {
|
|
92
|
+
readonly name: "data";
|
|
93
|
+
readonly type: "bytes";
|
|
94
|
+
}];
|
|
95
|
+
};
|
|
96
|
+
readonly primaryType: "MultichainCompact";
|
|
97
|
+
readonly message: {
|
|
98
|
+
readonly sponsor: `0x${string}`;
|
|
99
|
+
readonly nonce: bigint;
|
|
100
|
+
readonly expires: bigint;
|
|
101
|
+
readonly elements: {
|
|
102
|
+
arbiter: `0x${string}`;
|
|
103
|
+
chainId: bigint;
|
|
104
|
+
commitments: {
|
|
105
|
+
lockTag: `0x${string}`;
|
|
106
|
+
token: `0x${string}`;
|
|
107
|
+
amount: bigint;
|
|
108
|
+
}[];
|
|
109
|
+
mandate: {
|
|
110
|
+
target: {
|
|
111
|
+
recipient: `0x${string}`;
|
|
112
|
+
tokenOut: {
|
|
113
|
+
token: `0x${string}`;
|
|
114
|
+
amount: bigint;
|
|
115
|
+
}[];
|
|
116
|
+
targetChain: bigint;
|
|
117
|
+
fillExpiry: bigint;
|
|
118
|
+
};
|
|
119
|
+
originOps: {
|
|
120
|
+
to: `0x${string}`;
|
|
121
|
+
value: bigint;
|
|
122
|
+
data: `0x${string}`;
|
|
123
|
+
}[];
|
|
124
|
+
destOps: {
|
|
125
|
+
to: `0x${string}`;
|
|
126
|
+
value: bigint;
|
|
127
|
+
data: `0x${string}`;
|
|
128
|
+
}[];
|
|
129
|
+
q: `0x${string}`;
|
|
130
|
+
};
|
|
131
|
+
}[];
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
export { COMPACT_ADDRESS, getDepositEtherCall, getDepositErc20Call, getApproveErc20Call, getIntentData, };
|
|
8
135
|
//# sourceMappingURL=compact.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compact.d.ts","sourceRoot":"","sources":["../../../execution/compact.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"compact.d.ts","sourceRoot":"","sources":["../../../execution/compact.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAOb,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAcpC,QAAA,MAAM,eAAe,+CAA+C,CAAA;AAKpE,iBAAS,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAqBlE;AAED,iBAAS,mBAAmB,CAC1B,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,OAAO,EACrB,MAAM,EAAE,MAAM,GACb,IAAI,CA2BN;AAED,iBAAS,mBAAmB,CAAC,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAUxE;AA8ED,iBAAS,aAAa,CAAC,QAAQ,EAAE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiDxC;AAED,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,GACd,CAAA"}
|
|
@@ -4,6 +4,7 @@ exports.COMPACT_ADDRESS = void 0;
|
|
|
4
4
|
exports.getDepositEtherCall = getDepositEtherCall;
|
|
5
5
|
exports.getDepositErc20Call = getDepositErc20Call;
|
|
6
6
|
exports.getApproveErc20Call = getApproveErc20Call;
|
|
7
|
+
exports.getIntentData = getIntentData;
|
|
7
8
|
const viem_1 = require("viem");
|
|
8
9
|
const COMPACT_ADDRESS = '0xa2E6C7Ba8613E1534dCB990e7e4962216C0a5d58';
|
|
9
10
|
exports.COMPACT_ADDRESS = COMPACT_ADDRESS;
|
|
@@ -35,6 +36,7 @@ function getDepositEtherCall(account, value) {
|
|
|
35
36
|
function getDepositErc20Call(account, tokenAddress, amount) {
|
|
36
37
|
return {
|
|
37
38
|
to: COMPACT_ADDRESS,
|
|
39
|
+
value: 0n,
|
|
38
40
|
data: (0, viem_1.encodeFunctionData)({
|
|
39
41
|
abi: [
|
|
40
42
|
{
|
|
@@ -62,6 +64,7 @@ function getDepositErc20Call(account, tokenAddress, amount) {
|
|
|
62
64
|
function getApproveErc20Call(tokenAddress, amount) {
|
|
63
65
|
return {
|
|
64
66
|
to: tokenAddress,
|
|
67
|
+
value: 0n,
|
|
65
68
|
data: (0, viem_1.encodeFunctionData)({
|
|
66
69
|
abi: viem_1.erc20Abi,
|
|
67
70
|
functionName: 'approve',
|
|
@@ -90,7 +93,7 @@ function toCompactFlag(allocator) {
|
|
|
90
93
|
}
|
|
91
94
|
function usingAllocatorId(allocator = ALLOCATOR_ADDRESS) {
|
|
92
95
|
const compactFlag = BigInt(toCompactFlag(allocator));
|
|
93
|
-
const last88Bits = BigInt(
|
|
96
|
+
const last88Bits = BigInt(`0x${allocator.slice(-22)}`); // Extract last 88 bits (11 bytes * 2 hex chars per byte)
|
|
94
97
|
return (compactFlag << 88n) | last88Bits;
|
|
95
98
|
}
|
|
96
99
|
function lockTag() {
|
|
@@ -101,3 +104,93 @@ function lockTag() {
|
|
|
101
104
|
const hex = tagBig.toString(16).slice(0, 24);
|
|
102
105
|
return `0x${hex}`;
|
|
103
106
|
}
|
|
107
|
+
// Define the typed data structure as const to preserve type safety
|
|
108
|
+
const COMPACT_TYPED_DATA_TYPES = {
|
|
109
|
+
MultichainCompact: [
|
|
110
|
+
{ name: 'sponsor', type: 'address' },
|
|
111
|
+
{ name: 'nonce', type: 'uint256' },
|
|
112
|
+
{ name: 'expires', type: 'uint256' },
|
|
113
|
+
{ name: 'elements', type: 'Element[]' },
|
|
114
|
+
],
|
|
115
|
+
Element: [
|
|
116
|
+
{ name: 'arbiter', type: 'address' },
|
|
117
|
+
{ name: 'chainId', type: 'uint256' },
|
|
118
|
+
{ name: 'commitments', type: 'Lock[]' },
|
|
119
|
+
{ name: 'mandate', type: 'Mandate' },
|
|
120
|
+
],
|
|
121
|
+
Lock: [
|
|
122
|
+
{ name: 'lockTag', type: 'bytes12' },
|
|
123
|
+
{ name: 'token', type: 'address' },
|
|
124
|
+
{ name: 'amount', type: 'uint256' },
|
|
125
|
+
],
|
|
126
|
+
Mandate: [
|
|
127
|
+
{ name: 'target', type: 'Target' },
|
|
128
|
+
{ name: 'originOps', type: 'Op[]' },
|
|
129
|
+
{ name: 'destOps', type: 'Op[]' },
|
|
130
|
+
{ name: 'q', type: 'bytes32' },
|
|
131
|
+
],
|
|
132
|
+
Target: [
|
|
133
|
+
{ name: 'recipient', type: 'address' },
|
|
134
|
+
{ name: 'tokenOut', type: 'Token[]' },
|
|
135
|
+
{ name: 'targetChain', type: 'uint256' },
|
|
136
|
+
{ name: 'fillExpiry', type: 'uint256' },
|
|
137
|
+
],
|
|
138
|
+
Token: [
|
|
139
|
+
{ name: 'token', type: 'address' },
|
|
140
|
+
{ name: 'amount', type: 'uint256' },
|
|
141
|
+
],
|
|
142
|
+
Op: [
|
|
143
|
+
{ name: 'to', type: 'address' },
|
|
144
|
+
{ name: 'value', type: 'uint256' },
|
|
145
|
+
{ name: 'data', type: 'bytes' },
|
|
146
|
+
],
|
|
147
|
+
};
|
|
148
|
+
function getIntentData(intentOp) {
|
|
149
|
+
const typedData = {
|
|
150
|
+
domain: {
|
|
151
|
+
name: 'The Compact',
|
|
152
|
+
version: '1',
|
|
153
|
+
chainId: BigInt(intentOp.elements[0].chainId),
|
|
154
|
+
verifyingContract: '0x73d2dc0c21fca4ec1601895d50df7f5624f07d3f',
|
|
155
|
+
},
|
|
156
|
+
types: COMPACT_TYPED_DATA_TYPES,
|
|
157
|
+
primaryType: 'MultichainCompact',
|
|
158
|
+
message: {
|
|
159
|
+
sponsor: intentOp.sponsor,
|
|
160
|
+
nonce: BigInt(intentOp.nonce),
|
|
161
|
+
expires: BigInt(intentOp.expires),
|
|
162
|
+
elements: intentOp.elements.map((element) => ({
|
|
163
|
+
arbiter: element.arbiter,
|
|
164
|
+
chainId: BigInt(element.chainId),
|
|
165
|
+
commitments: element.idsAndAmounts.map((token) => ({
|
|
166
|
+
lockTag: (0, viem_1.slice)((0, viem_1.toHex)(BigInt(token[0])), 0, 12),
|
|
167
|
+
token: (0, viem_1.slice)((0, viem_1.toHex)(BigInt(token[0])), 12, 32),
|
|
168
|
+
amount: BigInt(token[1]),
|
|
169
|
+
})),
|
|
170
|
+
mandate: {
|
|
171
|
+
target: {
|
|
172
|
+
recipient: element.mandate.recipient,
|
|
173
|
+
tokenOut: element.mandate.tokenOut.map((token) => ({
|
|
174
|
+
token: (0, viem_1.slice)((0, viem_1.toHex)(BigInt(token[0])), 12, 32),
|
|
175
|
+
amount: BigInt(token[1]),
|
|
176
|
+
})),
|
|
177
|
+
targetChain: BigInt(element.mandate.destinationChainId),
|
|
178
|
+
fillExpiry: BigInt(element.mandate.fillDeadline),
|
|
179
|
+
},
|
|
180
|
+
originOps: element.mandate.preClaimOps.map((op) => ({
|
|
181
|
+
to: op.to,
|
|
182
|
+
value: BigInt(op.value),
|
|
183
|
+
data: op.data,
|
|
184
|
+
})),
|
|
185
|
+
destOps: element.mandate.destinationOps.map((op) => ({
|
|
186
|
+
to: op.to,
|
|
187
|
+
value: BigInt(op.value),
|
|
188
|
+
data: op.data,
|
|
189
|
+
})),
|
|
190
|
+
q: (0, viem_1.keccak256)(element.mandate.qualifier?.encodedVal ?? '0x'),
|
|
191
|
+
},
|
|
192
|
+
})),
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
return typedData;
|
|
196
|
+
}
|
|
@@ -14,14 +14,7 @@ declare class ExecutionError extends Error {
|
|
|
14
14
|
get errorType(): string;
|
|
15
15
|
get traceId(): string;
|
|
16
16
|
}
|
|
17
|
-
declare class
|
|
18
|
-
constructor(params?: {
|
|
19
|
-
context?: any;
|
|
20
|
-
errorType?: string;
|
|
21
|
-
traceId?: string;
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
declare class SourceTargetChainMismatchError extends ExecutionError {
|
|
17
|
+
declare class SourceChainsNotAvailableForUserOpFlowError extends ExecutionError {
|
|
25
18
|
constructor(params?: {
|
|
26
19
|
context?: any;
|
|
27
20
|
errorType?: string;
|
|
@@ -57,5 +50,5 @@ declare class IntentFailedError extends ExecutionError {
|
|
|
57
50
|
});
|
|
58
51
|
}
|
|
59
52
|
declare function isExecutionError(error: Error): error is ExecutionError;
|
|
60
|
-
export { isExecutionError, ExecutionError,
|
|
53
|
+
export { isExecutionError, ExecutionError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError, OrderPathRequiredForIntentsError, SessionChainRequiredError, IntentFailedError, };
|
|
61
54
|
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../execution/error.ts"],"names":[],"mappings":"AAAA,cAAM,cAAe,SAAQ,KAAK;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAK;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;gBAErB,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;IAQD,IAAI,OAAO,WAEV;IAED,IAAI,OAAO,QAEV;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,OAAO,WAEV;CACF;AAED,cAAM,
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../execution/error.ts"],"names":[],"mappings":"AAAA,cAAM,cAAe,SAAQ,KAAK;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAK;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;gBAErB,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;IAQD,IAAI,OAAO,WAEV;IAED,IAAI,OAAO,QAEV;IAED,IAAI,SAAS,WAEZ;IAED,IAAI,OAAO,WAEV;CACF;AAED,cAAM,0CAA2C,SAAQ,cAAc;gBACzD,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAMF;AAED,cAAM,0CAA2C,SAAQ,cAAc;gBACzD,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAMF;AAED,cAAM,gCAAiC,SAAQ,cAAc;gBAC/C,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAMF;AAED,cAAM,yBAA0B,SAAQ,cAAc;gBACxC,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAOF;AAED,cAAM,iBAAkB,SAAQ,cAAc;gBAChC,MAAM,CAAC,EAAE;QACnB,OAAO,CAAC,EAAE,GAAG,CAAA;QACb,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;CAMF;AAED,iBAAS,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,IAAI,cAAc,CAE/D;AAED,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,0CAA0C,EAC1C,0CAA0C,EAC1C,gCAAgC,EAChC,yBAAyB,EACzB,iBAAiB,GAClB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IntentFailedError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.UserOperationRequiredForSmartSessionsError = exports.
|
|
3
|
+
exports.IntentFailedError = exports.SessionChainRequiredError = exports.OrderPathRequiredForIntentsError = exports.UserOperationRequiredForSmartSessionsError = exports.SourceChainsNotAvailableForUserOpFlowError = exports.ExecutionError = void 0;
|
|
4
4
|
exports.isExecutionError = isExecutionError;
|
|
5
5
|
class ExecutionError extends Error {
|
|
6
6
|
_message;
|
|
@@ -28,24 +28,15 @@ class ExecutionError extends Error {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
exports.ExecutionError = ExecutionError;
|
|
31
|
-
class
|
|
31
|
+
class SourceChainsNotAvailableForUserOpFlowError extends ExecutionError {
|
|
32
32
|
constructor(params) {
|
|
33
33
|
super({
|
|
34
|
-
message: '
|
|
34
|
+
message: "Can't specify the source chains when using user operations",
|
|
35
35
|
...params,
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
exports.
|
|
40
|
-
class SourceTargetChainMismatchError extends ExecutionError {
|
|
41
|
-
constructor(params) {
|
|
42
|
-
super({
|
|
43
|
-
message: 'Source and target chain must be the same when using user operations',
|
|
44
|
-
...params,
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.SourceTargetChainMismatchError = SourceTargetChainMismatchError;
|
|
39
|
+
exports.SourceChainsNotAvailableForUserOpFlowError = SourceChainsNotAvailableForUserOpFlowError;
|
|
49
40
|
class UserOperationRequiredForSmartSessionsError extends ExecutionError {
|
|
50
41
|
constructor(params) {
|
|
51
42
|
super({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Address, type Chain } from 'viem';
|
|
2
2
|
import type { IntentOpStatus } from '../orchestrator';
|
|
3
3
|
import type { RhinestoneAccountConfig, Transaction } from '../types';
|
|
4
|
-
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError,
|
|
4
|
+
import { ExecutionError, IntentFailedError, isExecutionError, OrderPathRequiredForIntentsError, SessionChainRequiredError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError } from './error';
|
|
5
5
|
import type { IntentData, TransactionResult } from './utils';
|
|
6
6
|
declare function sendTransaction(config: RhinestoneAccountConfig, transaction: Transaction): Promise<TransactionResult>;
|
|
7
7
|
declare function waitForExecution(config: RhinestoneAccountConfig, result: TransactionResult, acceptsPreconfirmations: boolean): Promise<IntentOpStatus | {
|
|
@@ -17,9 +17,8 @@ declare function waitForExecution(config: RhinestoneAccountConfig, result: Trans
|
|
|
17
17
|
success: boolean;
|
|
18
18
|
userOpHash: import("viem").Hash;
|
|
19
19
|
}>;
|
|
20
|
-
declare function getMaxSpendableAmount(config: RhinestoneAccountConfig, chain: Chain, tokenAddress: Address, gasUnits: bigint): Promise<bigint>;
|
|
20
|
+
declare function getMaxSpendableAmount(config: RhinestoneAccountConfig, chain: Chain, tokenAddress: Address, gasUnits: bigint, sponsored?: boolean): Promise<bigint>;
|
|
21
21
|
declare function getPortfolio(config: RhinestoneAccountConfig, onTestnets: boolean): Promise<import("../orchestrator").Portfolio>;
|
|
22
|
-
|
|
23
|
-
export { sendTransaction, waitForExecution, getMaxSpendableAmount, getPortfolio, deposit, isExecutionError, IntentFailedError, ExecutionError, SourceChainRequiredForSmartSessionsError, SourceTargetChainMismatchError, UserOperationRequiredForSmartSessionsError, OrderPathRequiredForIntentsError, SessionChainRequiredError, };
|
|
22
|
+
export { sendTransaction, waitForExecution, getMaxSpendableAmount, getPortfolio, isExecutionError, IntentFailedError, ExecutionError, SourceChainsNotAvailableForUserOpFlowError, UserOperationRequiredForSmartSessionsError, OrderPathRequiredForIntentsError, SessionChainRequiredError, };
|
|
24
23
|
export type { IntentData, TransactionResult };
|
|
25
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../execution/index.ts"],"names":[],"mappings":"AAAA,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,EAChB,SAAS,GAAE,OAAe,GACzB,OAAO,CAAC,MAAM,CAAC,CAcjB;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"}
|