@rhinestone/sdk 2.0.0-beta.0 → 2.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +43 -2
  2. package/dist/src/accounts/index.d.ts.map +1 -1
  3. package/dist/src/accounts/index.js +6 -34
  4. package/dist/src/accounts/json-rpc/providers.d.ts.map +1 -1
  5. package/dist/src/accounts/json-rpc/providers.js +3 -2
  6. package/dist/src/actions/smart-sessions.d.ts.map +1 -1
  7. package/dist/src/actions/smart-sessions.js +3 -3
  8. package/dist/src/errors/index.d.ts +3 -3
  9. package/dist/src/errors/index.d.ts.map +1 -1
  10. package/dist/src/errors/index.js +6 -4
  11. package/dist/src/execution/compact.d.ts +1 -144
  12. package/dist/src/execution/compact.d.ts.map +1 -1
  13. package/dist/src/execution/compact.js +1 -109
  14. package/dist/src/execution/error.d.ts +10 -1
  15. package/dist/src/execution/error.d.ts.map +1 -1
  16. package/dist/src/execution/error.js +9 -1
  17. package/dist/src/execution/index.d.ts +5 -7
  18. package/dist/src/execution/index.d.ts.map +1 -1
  19. package/dist/src/execution/index.js +24 -44
  20. package/dist/src/execution/utils.d.ts +29 -13
  21. package/dist/src/execution/utils.d.ts.map +1 -1
  22. package/dist/src/execution/utils.js +174 -122
  23. package/dist/src/index.d.ts +21 -16
  24. package/dist/src/index.d.ts.map +1 -1
  25. package/dist/src/index.js +15 -45
  26. package/dist/src/modules/index.d.ts +2 -2
  27. package/dist/src/modules/index.d.ts.map +1 -1
  28. package/dist/src/modules/index.js +2 -2
  29. package/dist/src/modules/read.d.ts.map +1 -1
  30. package/dist/src/modules/read.js +2 -4
  31. package/dist/src/modules/validators/index.d.ts +2 -2
  32. package/dist/src/modules/validators/index.d.ts.map +1 -1
  33. package/dist/src/modules/validators/index.js +2 -2
  34. package/dist/src/modules/validators/permissions.d.ts +5 -0
  35. package/dist/src/modules/validators/permissions.d.ts.map +1 -0
  36. package/dist/src/modules/validators/permissions.js +111 -0
  37. package/dist/src/modules/validators/policies/claim/permit2.d.ts +29 -3
  38. package/dist/src/modules/validators/policies/claim/permit2.d.ts.map +1 -1
  39. package/dist/src/modules/validators/smart-sessions.d.ts +14 -27
  40. package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
  41. package/dist/src/modules/validators/smart-sessions.js +74 -22
  42. package/dist/src/orchestrator/caip2.d.ts +7 -0
  43. package/dist/src/orchestrator/caip2.d.ts.map +1 -0
  44. package/dist/src/orchestrator/caip2.js +17 -0
  45. package/dist/src/orchestrator/client.d.ts +11 -11
  46. package/dist/src/orchestrator/client.d.ts.map +1 -1
  47. package/dist/src/orchestrator/client.js +193 -295
  48. package/dist/src/orchestrator/consts.d.ts +2 -2
  49. package/dist/src/orchestrator/consts.d.ts.map +1 -1
  50. package/dist/src/orchestrator/consts.js +2 -2
  51. package/dist/src/orchestrator/error.d.ts +72 -217
  52. package/dist/src/orchestrator/error.d.ts.map +1 -1
  53. package/dist/src/orchestrator/error.js +117 -195
  54. package/dist/src/orchestrator/index.d.ts +5 -5
  55. package/dist/src/orchestrator/index.d.ts.map +1 -1
  56. package/dist/src/orchestrator/index.js +3 -3
  57. package/dist/src/orchestrator/registry.d.ts +1 -8
  58. package/dist/src/orchestrator/registry.d.ts.map +1 -1
  59. package/dist/src/orchestrator/registry.js +1 -26
  60. package/dist/src/orchestrator/types.d.ts +97 -232
  61. package/dist/src/orchestrator/types.d.ts.map +1 -1
  62. package/dist/src/types.d.ts +101 -32
  63. package/dist/src/types.d.ts.map +1 -1
  64. package/dist/src/utils/index.d.ts +2 -1
  65. package/dist/src/utils/index.d.ts.map +1 -1
  66. package/dist/src/utils/index.js +2 -1
  67. package/dist/src/utils/walletClient.d.ts.map +1 -0
  68. package/dist/src/{accounts → utils}/walletClient.js +1 -1
  69. package/package.json +1 -5
  70. package/dist/src/accounts/passport.d.ts +0 -9
  71. package/dist/src/accounts/passport.d.ts.map +0 -1
  72. package/dist/src/accounts/passport.js +0 -78
  73. package/dist/src/accounts/walletClient.d.ts.map +0 -1
  74. package/dist/src/actions/compact.d.ts +0 -15
  75. package/dist/src/actions/compact.d.ts.map +0 -1
  76. package/dist/src/actions/compact.js +0 -200
  77. package/dist/src/actions/deployment.d.ts +0 -19
  78. package/dist/src/actions/deployment.d.ts.map +0 -1
  79. package/dist/src/actions/deployment.js +0 -76
  80. package/dist/src/execution/permit2.d.ts +0 -143
  81. package/dist/src/execution/permit2.d.ts.map +0 -1
  82. package/dist/src/execution/permit2.js +0 -280
  83. package/dist/src/execution/singleChainOps.d.ts +0 -41
  84. package/dist/src/execution/singleChainOps.d.ts.map +0 -1
  85. package/dist/src/execution/singleChainOps.js +0 -42
  86. package/dist/src/execution/types.d.ts +0 -36
  87. package/dist/src/execution/types.d.ts.map +0 -1
  88. package/dist/src/execution/types.js +0 -1
  89. /package/dist/src/{accounts → utils}/walletClient.d.ts +0 -0
@@ -1,143 +0,0 @@
1
- import { type Address, type Chain } from 'viem';
2
- import type { IntentOpElement } from '../orchestrator/types.js';
3
- import type { RhinestoneConfig } from '../types.js';
4
- import type { BatchPermit2Result, MultiChainPermit2Config, MultiChainPermit2Result, TokenPermissions } from './types.js';
5
- declare function getTypedData(element: IntentOpElement, nonce: bigint, expires: bigint): {
6
- readonly domain: {
7
- readonly name: "Permit2";
8
- readonly chainId: number;
9
- readonly verifyingContract: "0x000000000022D473030F116dDEE9F6B43aC78BA3";
10
- };
11
- readonly types: {
12
- readonly TokenPermissions: readonly [{
13
- readonly name: "token";
14
- readonly type: "address";
15
- }, {
16
- readonly name: "amount";
17
- readonly type: "uint256";
18
- }];
19
- readonly Token: readonly [{
20
- readonly name: "token";
21
- readonly type: "address";
22
- }, {
23
- readonly name: "amount";
24
- readonly type: "uint256";
25
- }];
26
- readonly Target: readonly [{
27
- readonly name: "recipient";
28
- readonly type: "address";
29
- }, {
30
- readonly name: "tokenOut";
31
- readonly type: "Token[]";
32
- }, {
33
- readonly name: "targetChain";
34
- readonly type: "uint256";
35
- }, {
36
- readonly name: "fillExpiry";
37
- readonly type: "uint256";
38
- }];
39
- readonly Ops: readonly [{
40
- readonly name: "to";
41
- readonly type: "address";
42
- }, {
43
- readonly name: "value";
44
- readonly type: "uint256";
45
- }, {
46
- readonly name: "data";
47
- readonly type: "bytes";
48
- }];
49
- readonly Op: readonly [{
50
- readonly name: "vt";
51
- readonly type: "bytes32";
52
- }, {
53
- readonly name: "ops";
54
- readonly type: "Ops[]";
55
- }];
56
- readonly Mandate: readonly [{
57
- readonly name: "target";
58
- readonly type: "Target";
59
- }, {
60
- readonly name: "minGas";
61
- readonly type: "uint128";
62
- }, {
63
- readonly name: "originOps";
64
- readonly type: "Op";
65
- }, {
66
- readonly name: "destOps";
67
- readonly type: "Op";
68
- }, {
69
- readonly name: "q";
70
- readonly type: "bytes32";
71
- }];
72
- readonly PermitBatchWitnessTransferFrom: readonly [{
73
- readonly name: "permitted";
74
- readonly type: "TokenPermissions[]";
75
- }, {
76
- readonly name: "spender";
77
- readonly type: "address";
78
- }, {
79
- readonly name: "nonce";
80
- readonly type: "uint256";
81
- }, {
82
- readonly name: "deadline";
83
- readonly type: "uint256";
84
- }, {
85
- readonly name: "mandate";
86
- readonly type: "Mandate";
87
- }];
88
- };
89
- readonly primaryType: "PermitBatchWitnessTransferFrom";
90
- readonly message: {
91
- readonly permitted: TokenPermissions[];
92
- readonly spender: `0x${string}`;
93
- readonly nonce: bigint;
94
- readonly deadline: bigint;
95
- readonly mandate: {
96
- readonly target: {
97
- readonly recipient: `0x${string}`;
98
- readonly tokenOut: {
99
- token: `0x${string}`;
100
- amount: bigint;
101
- }[];
102
- readonly targetChain: bigint;
103
- readonly fillExpiry: bigint;
104
- };
105
- readonly minGas: bigint;
106
- readonly originOps: import("../orchestrator/types.js").Op;
107
- readonly destOps: import("../orchestrator/types.js").Op;
108
- readonly q: `0x${string}`;
109
- };
110
- };
111
- };
112
- declare function checkERC20AllowanceDirect(owner: Address, spender: Address, tokenAddress: Address, publicClient: any): Promise<bigint>;
113
- declare function checkERC20Allowance(tokenAddress: Address, chain: Chain, config: RhinestoneConfig): Promise<bigint>;
114
- /**
115
- * Get the Permit2 contract address
116
- * @returns The Permit2 contract address
117
- */
118
- declare function getPermit2Address(): Address;
119
- /**
120
- * Signs permit2 calls across multiple chains using batch approach.
121
- * Collects all signatures first, then returns them all at once.
122
- *
123
- * This approach is efficient for backend signers but may be memory-intensive
124
- * for frontend applications with many chains.
125
- *
126
- * @param configs - Array of permit2 signing configurations for different chains
127
- * @returns Promise<BatchPermit2Result> - All signatures collected
128
- */
129
- declare function signPermit2Batch(configs: MultiChainPermit2Config[]): Promise<BatchPermit2Result>;
130
- /**
131
- * Signs permit2 calls across multiple chains sequentially.
132
- * Signs one by one, useful for frontend applications to avoid memory issues.
133
- *
134
- * This approach is more memory-efficient for frontend applications but slower
135
- * due to sequential processing.
136
- *
137
- * @param configs - Array of permit2 signing configurations for different chains
138
- * @param onProgress - Optional callback for progress updates
139
- * @returns Promise<BatchPermit2Result> - All signatures collected
140
- */
141
- declare function signPermit2Sequential(configs: MultiChainPermit2Config[], onProgress?: (completed: number, total: number, current: MultiChainPermit2Result) => void): Promise<BatchPermit2Result>;
142
- export { getTypedData, checkERC20Allowance, checkERC20AllowanceDirect, getPermit2Address, signPermit2Batch, signPermit2Sequential, type MultiChainPermit2Config, type MultiChainPermit2Result, type BatchPermit2Result, };
143
- //# sourceMappingURL=permit2.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"permit2.d.ts","sourceRoot":"","sources":["../../../execution/permit2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAIX,MAAM,MAAM,CAAA;AAEb,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAQhB,iBAAS,YAAY,CACnB,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwFhB;AAED,iBAAe,yBAAyB,CACtC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,OAAO,EACrB,YAAY,EAAE,GAAG,GAChB,OAAO,CAAC,MAAM,CAAC,CAyBjB;AAED,iBAAe,mBAAmB,CAChC,YAAY,EAAE,OAAO,EACrB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,MAAM,CAAC,CAuBjB;AAED;;;GAGG;AACH,iBAAS,iBAAiB,IAAI,OAAO,CAEpC;AAED;;;;;;;;;GASG;AACH,iBAAe,gBAAgB,CAC7B,OAAO,EAAE,uBAAuB,EAAE,GACjC,OAAO,CAAC,kBAAkB,CAAC,CAyE7B;AAED;;;;;;;;;;GAUG;AACH,iBAAe,qBAAqB,CAClC,OAAO,EAAE,uBAAuB,EAAE,EAClC,UAAU,CAAC,EAAE,CACX,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,uBAAuB,KAC7B,IAAI,GACR,OAAO,CAAC,kBAAkB,CAAC,CA8D7B;AAED,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EAEjB,gBAAgB,EAChB,qBAAqB,EAErB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,GACxB,CAAA"}
@@ -1,280 +0,0 @@
1
- import { createPublicClient, keccak256, } from 'viem';
2
- import { createTransport } from '../accounts/utils.js';
3
- const PERMIT2_ADDRESS = '0x000000000022D473030F116dDEE9F6B43aC78BA3';
4
- function toToken(id) {
5
- return `0x${(id & ((1n << 160n) - 1n)).toString(16).padStart(40, '0')}`;
6
- }
7
- function getTypedData(element, nonce, expires) {
8
- const tokens = element.idsAndAmounts.map(([id, amount]) => [
9
- BigInt(id),
10
- BigInt(amount),
11
- ]);
12
- const tokenPermissions = tokens.reduce((permissions, [id, amountIn]) => {
13
- const token = toToken(BigInt(id));
14
- const amount = BigInt(amountIn);
15
- const permission = { token, amount };
16
- permissions.push(permission);
17
- return permissions;
18
- }, []);
19
- const spender = element.arbiter;
20
- const mandate = element.mandate;
21
- const typedData = {
22
- domain: {
23
- name: 'Permit2',
24
- chainId: Number(element.chainId),
25
- verifyingContract: PERMIT2_ADDRESS,
26
- },
27
- types: {
28
- TokenPermissions: [
29
- { name: 'token', type: 'address' },
30
- { name: 'amount', type: 'uint256' },
31
- ],
32
- Token: [
33
- { name: 'token', type: 'address' },
34
- { name: 'amount', type: 'uint256' },
35
- ],
36
- Target: [
37
- { name: 'recipient', type: 'address' },
38
- { name: 'tokenOut', type: 'Token[]' },
39
- { name: 'targetChain', type: 'uint256' },
40
- { name: 'fillExpiry', type: 'uint256' },
41
- ],
42
- Ops: [
43
- { name: 'to', type: 'address' },
44
- { name: 'value', type: 'uint256' },
45
- { name: 'data', type: 'bytes' },
46
- ],
47
- Op: [
48
- { name: 'vt', type: 'bytes32' },
49
- { name: 'ops', type: 'Ops[]' },
50
- ],
51
- Mandate: [
52
- { name: 'target', type: 'Target' },
53
- { name: 'minGas', type: 'uint128' },
54
- { name: 'originOps', type: 'Op' },
55
- { name: 'destOps', type: 'Op' },
56
- { name: 'q', type: 'bytes32' },
57
- ],
58
- PermitBatchWitnessTransferFrom: [
59
- { name: 'permitted', type: 'TokenPermissions[]' },
60
- { name: 'spender', type: 'address' },
61
- { name: 'nonce', type: 'uint256' },
62
- { name: 'deadline', type: 'uint256' },
63
- { name: 'mandate', type: 'Mandate' },
64
- ],
65
- },
66
- primaryType: 'PermitBatchWitnessTransferFrom',
67
- message: {
68
- permitted: tokenPermissions,
69
- spender: spender,
70
- nonce: nonce,
71
- deadline: expires,
72
- mandate: {
73
- target: {
74
- recipient: mandate.recipient,
75
- tokenOut: mandate.tokenOut.map((token) => ({
76
- token: toToken(BigInt(token[0])),
77
- amount: BigInt(token[1]),
78
- })),
79
- targetChain: BigInt(mandate.destinationChainId),
80
- fillExpiry: BigInt(mandate.fillDeadline),
81
- },
82
- minGas: BigInt(mandate.minGas),
83
- originOps: mandate.preClaimOps,
84
- destOps: mandate.destinationOps,
85
- q: keccak256(mandate.qualifier.encodedVal),
86
- },
87
- },
88
- };
89
- return typedData;
90
- }
91
- async function checkERC20AllowanceDirect(owner, spender, tokenAddress, publicClient) {
92
- try {
93
- const allowance = await publicClient.readContract({
94
- address: tokenAddress,
95
- abi: [
96
- {
97
- name: 'allowance',
98
- type: 'function',
99
- stateMutability: 'view',
100
- inputs: [
101
- { name: 'owner', type: 'address' },
102
- { name: 'spender', type: 'address' },
103
- ],
104
- outputs: [{ name: '', type: 'uint256' }],
105
- },
106
- ],
107
- functionName: 'allowance',
108
- args: [owner, spender],
109
- });
110
- return BigInt(allowance.toString());
111
- }
112
- catch (error) {
113
- console.error('Error checking ERC20 allowance:', error);
114
- throw new Error('Failed to check ERC20 allowance');
115
- }
116
- }
117
- async function checkERC20Allowance(tokenAddress, chain, config) {
118
- try {
119
- const publicClient = createPublicClient({
120
- chain,
121
- transport: createTransport(chain, config.provider),
122
- });
123
- // Get the account owner from the config
124
- const owner = config.eoa?.address;
125
- if (!owner) {
126
- throw new Error('No EOA address found in account config');
127
- }
128
- return await checkERC20AllowanceDirect(owner, PERMIT2_ADDRESS, tokenAddress, publicClient);
129
- }
130
- catch (error) {
131
- console.error('Error checking ERC20 allowance:', error);
132
- throw new Error('Failed to check ERC20 allowance');
133
- }
134
- }
135
- /**
136
- * Get the Permit2 contract address
137
- * @returns The Permit2 contract address
138
- */
139
- function getPermit2Address() {
140
- return PERMIT2_ADDRESS;
141
- }
142
- /**
143
- * Signs permit2 calls across multiple chains using batch approach.
144
- * Collects all signatures first, then returns them all at once.
145
- *
146
- * This approach is efficient for backend signers but may be memory-intensive
147
- * for frontend applications with many chains.
148
- *
149
- * @param configs - Array of permit2 signing configurations for different chains
150
- * @returns Promise<BatchPermit2Result> - All signatures collected
151
- */
152
- async function signPermit2Batch(configs) {
153
- const results = [];
154
- let successfulSignatures = 0;
155
- let failedSignatures = 0;
156
- // Process all signing operations in parallel
157
- const signingPromises = configs.map(async (config) => {
158
- try {
159
- // sign each element individually for this chain sequentially to preserve order
160
- if (!config.eoaAccount.signTypedData) {
161
- throw new Error('EOA account does not support typed data signing');
162
- }
163
- const originSignatures = [];
164
- for (const element of config.intentOp.elements) {
165
- const typedData = getTypedData(element, BigInt(config.intentOp.nonce), BigInt(config.intentOp.expires));
166
- const sig = await config.eoaAccount.signTypedData(typedData);
167
- originSignatures.push(sig);
168
- }
169
- const result = {
170
- chainId: config.chain.id,
171
- originSignatures,
172
- destinationSignature: originSignatures[0] ?? '0x',
173
- success: true,
174
- };
175
- successfulSignatures++;
176
- return result;
177
- }
178
- catch (error) {
179
- const result = {
180
- chainId: config.chain.id,
181
- originSignatures: [],
182
- destinationSignature: '0x',
183
- success: false,
184
- error: error instanceof Error ? error : new Error(String(error)),
185
- };
186
- failedSignatures++;
187
- return result;
188
- }
189
- });
190
- // Wait for all signing operations to complete
191
- const signingResults = await Promise.allSettled(signingPromises);
192
- for (const result of signingResults) {
193
- if (result.status === 'fulfilled') {
194
- results.push(result.value);
195
- }
196
- else {
197
- // This shouldn't happen since we catch errors in the promise
198
- failedSignatures++;
199
- results.push({
200
- chainId: 0,
201
- originSignatures: [],
202
- destinationSignature: '0x',
203
- success: false,
204
- error: result.reason,
205
- });
206
- }
207
- }
208
- return {
209
- results,
210
- totalChains: configs.length,
211
- successfulSignatures,
212
- failedSignatures,
213
- allSuccessful: failedSignatures === 0,
214
- };
215
- }
216
- /**
217
- * Signs permit2 calls across multiple chains sequentially.
218
- * Signs one by one, useful for frontend applications to avoid memory issues.
219
- *
220
- * This approach is more memory-efficient for frontend applications but slower
221
- * due to sequential processing.
222
- *
223
- * @param configs - Array of permit2 signing configurations for different chains
224
- * @param onProgress - Optional callback for progress updates
225
- * @returns Promise<BatchPermit2Result> - All signatures collected
226
- */
227
- async function signPermit2Sequential(configs, onProgress) {
228
- const results = [];
229
- let successfulSignatures = 0;
230
- let failedSignatures = 0;
231
- // Process signing operations sequentially
232
- for (let i = 0; i < configs.length; i++) {
233
- const config = configs[i];
234
- try {
235
- // sign each element for this chain sequentially to preserve order
236
- if (!config.eoaAccount.signTypedData) {
237
- throw new Error('EOA account does not support typed data signing');
238
- }
239
- const originSignatures = [];
240
- for (const element of config.intentOp.elements) {
241
- const typedData = getTypedData(element, BigInt(config.intentOp.nonce), BigInt(config.intentOp.expires));
242
- const sig = await config.eoaAccount.signTypedData(typedData);
243
- originSignatures.push(sig);
244
- }
245
- const result = {
246
- chainId: config.chain.id,
247
- originSignatures,
248
- destinationSignature: originSignatures[0] ?? '0x',
249
- success: true,
250
- };
251
- results.push(result);
252
- successfulSignatures++;
253
- // Call progress callback if provided
254
- onProgress?.(i + 1, configs.length, result);
255
- }
256
- catch (error) {
257
- const result = {
258
- chainId: config.chain.id,
259
- originSignatures: [],
260
- destinationSignature: '0x',
261
- success: false,
262
- error: error instanceof Error ? error : new Error(String(error)),
263
- };
264
- results.push(result);
265
- failedSignatures++;
266
- // Call progress callback if provided
267
- onProgress?.(i + 1, configs.length, result);
268
- }
269
- }
270
- return {
271
- results,
272
- totalChains: configs.length,
273
- successfulSignatures,
274
- failedSignatures,
275
- allSuccessful: failedSignatures === 0,
276
- };
277
- }
278
- export { getTypedData, checkERC20Allowance, checkERC20AllowanceDirect, getPermit2Address,
279
- // Multi-chain permit2 signing methods
280
- signPermit2Batch, signPermit2Sequential, };
@@ -1,41 +0,0 @@
1
- import type { Address } from 'viem';
2
- import type { IntentOpElement } from '../orchestrator/types.js';
3
- declare function getTypedData(account: Address, intentExecutorAddress: Address, element: IntentOpElement, nonce: bigint): {
4
- domain: {
5
- name: string;
6
- version: string;
7
- chainId: number;
8
- verifyingContract: `0x${string}`;
9
- };
10
- types: {
11
- SingleChainOps: {
12
- name: string;
13
- type: string;
14
- }[];
15
- Op: {
16
- name: string;
17
- type: string;
18
- }[];
19
- GasRefund: {
20
- name: string;
21
- type: string;
22
- }[];
23
- Ops: {
24
- name: string;
25
- type: string;
26
- }[];
27
- };
28
- primaryType: "SingleChainOps";
29
- message: {
30
- account: `0x${string}`;
31
- nonce: bigint;
32
- op: import("../orchestrator/types.js").Op;
33
- gasRefund: {
34
- token: Address;
35
- exchangeRate: bigint;
36
- overhead: bigint;
37
- } | undefined;
38
- };
39
- };
40
- export { getTypedData };
41
- //# sourceMappingURL=singleChainOps.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"singleChainOps.d.ts","sourceRoot":"","sources":["../../../execution/singleChainOps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAE5D,iBAAS,YAAY,CACnB,OAAO,EAAE,OAAO,EAChB,qBAAqB,EAAE,OAAO,EAC9B,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0Cd;AAED,OAAO,EAAE,YAAY,EAAE,CAAA"}
@@ -1,42 +0,0 @@
1
- function getTypedData(account, intentExecutorAddress, element, nonce) {
2
- const { destinationChainId, destinationOps } = element.mandate;
3
- const gasRefund = element.mandate.qualifier.settlementContext.gasRefund;
4
- return {
5
- domain: {
6
- name: 'IntentExecutor',
7
- version: 'v0.0.1',
8
- chainId: Number(destinationChainId),
9
- verifyingContract: intentExecutorAddress,
10
- },
11
- types: {
12
- SingleChainOps: [
13
- { name: 'account', type: 'address' },
14
- { name: 'nonce', type: 'uint256' },
15
- { name: 'op', type: 'Op' },
16
- { name: 'gasRefund', type: 'GasRefund' },
17
- ],
18
- Op: [
19
- { name: 'vt', type: 'bytes32' },
20
- { name: 'ops', type: 'Ops[]' },
21
- ],
22
- GasRefund: [
23
- { name: 'token', type: 'address' },
24
- { name: 'exchangeRate', type: 'uint256' },
25
- { name: 'overhead', type: 'uint256' },
26
- ],
27
- Ops: [
28
- { name: 'to', type: 'address' },
29
- { name: 'value', type: 'uint256' },
30
- { name: 'data', type: 'bytes' },
31
- ],
32
- },
33
- primaryType: 'SingleChainOps',
34
- message: {
35
- account,
36
- nonce,
37
- op: destinationOps,
38
- gasRefund,
39
- },
40
- };
41
- }
42
- export { getTypedData };
@@ -1,36 +0,0 @@
1
- import type { Account, Address, Chain, Hex } from 'viem';
2
- import type { IntentOp } from '../orchestrator/types.js';
3
- interface TokenPermissions {
4
- token: Address;
5
- amount: bigint;
6
- }
7
- /**
8
- * Multi-chain permit2 signing configuration
9
- */
10
- interface MultiChainPermit2Config {
11
- chain: Chain;
12
- intentOp: IntentOp;
13
- eoaAccount: Account;
14
- }
15
- /**
16
- * Result of a multi-chain permit2 signing operation
17
- */
18
- interface MultiChainPermit2Result {
19
- chainId: number;
20
- originSignatures: Hex[];
21
- destinationSignature: Hex;
22
- success: boolean;
23
- error?: Error;
24
- }
25
- /**
26
- * Batch permit2 signing result
27
- */
28
- interface BatchPermit2Result {
29
- results: MultiChainPermit2Result[];
30
- totalChains: number;
31
- successfulSignatures: number;
32
- failedSignatures: number;
33
- allSuccessful: boolean;
34
- }
35
- export type { TokenPermissions, MultiChainPermit2Config, MultiChainPermit2Result, BatchPermit2Result, };
36
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../execution/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAErD,UAAU,gBAAgB;IACxB,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,UAAU,uBAAuB;IAC/B,KAAK,EAAE,KAAK,CAAA;IACZ,QAAQ,EAAE,QAAQ,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED;;GAEG;AACH,UAAU,uBAAuB;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,GAAG,EAAE,CAAA;IACvB,oBAAoB,EAAE,GAAG,CAAA;IACzB,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd;AAED;;GAEG;AACH,UAAU,kBAAkB;IAC1B,OAAO,EAAE,uBAAuB,EAAE,CAAA;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,OAAO,CAAA;CACvB;AAED,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,kBAAkB,GACnB,CAAA"}
@@ -1 +0,0 @@
1
- export {};
File without changes