@rhinestone/sdk 2.0.0-beta.0 → 2.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -2
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +6 -34
- package/dist/src/accounts/json-rpc/providers.d.ts.map +1 -1
- package/dist/src/accounts/json-rpc/providers.js +3 -2
- package/dist/src/actions/smart-sessions.d.ts.map +1 -1
- package/dist/src/actions/smart-sessions.js +3 -3
- package/dist/src/errors/index.d.ts +3 -3
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/errors/index.js +6 -4
- package/dist/src/execution/compact.d.ts +1 -144
- package/dist/src/execution/compact.d.ts.map +1 -1
- package/dist/src/execution/compact.js +1 -109
- package/dist/src/execution/error.d.ts +11 -2
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +11 -3
- package/dist/src/execution/index.d.ts +10 -11
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +37 -47
- package/dist/src/execution/utils.d.ts +34 -16
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +259 -144
- package/dist/src/index.d.ts +22 -16
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +18 -45
- package/dist/src/modules/index.d.ts +2 -2
- package/dist/src/modules/index.d.ts.map +1 -1
- package/dist/src/modules/index.js +2 -2
- package/dist/src/modules/read.d.ts.map +1 -1
- package/dist/src/modules/read.js +2 -4
- package/dist/src/modules/validators/index.d.ts +2 -2
- package/dist/src/modules/validators/index.d.ts.map +1 -1
- package/dist/src/modules/validators/index.js +2 -2
- package/dist/src/modules/validators/permissions.d.ts +5 -0
- package/dist/src/modules/validators/permissions.d.ts.map +1 -0
- package/dist/src/modules/validators/permissions.js +111 -0
- package/dist/src/modules/validators/policies/claim/permit2.d.ts +29 -3
- package/dist/src/modules/validators/policies/claim/permit2.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.d.ts +14 -27
- package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.js +74 -22
- package/dist/src/orchestrator/caip2.d.ts +13 -0
- package/dist/src/orchestrator/caip2.d.ts.map +1 -0
- package/dist/src/orchestrator/caip2.js +52 -0
- package/dist/src/orchestrator/client.d.ts +12 -11
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +217 -296
- package/dist/src/orchestrator/consts.d.ts +2 -2
- package/dist/src/orchestrator/consts.d.ts.map +1 -1
- package/dist/src/orchestrator/consts.js +2 -2
- package/dist/src/orchestrator/destinations.d.ts +23 -0
- package/dist/src/orchestrator/destinations.d.ts.map +1 -0
- package/dist/src/orchestrator/destinations.js +36 -0
- package/dist/src/orchestrator/error.d.ts +72 -217
- package/dist/src/orchestrator/error.d.ts.map +1 -1
- package/dist/src/orchestrator/error.js +117 -195
- package/dist/src/orchestrator/index.d.ts +6 -5
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +4 -3
- package/dist/src/orchestrator/registry.d.ts +3 -9
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +11 -26
- package/dist/src/orchestrator/types.d.ts +136 -239
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/types.d.ts +126 -37
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/index.d.ts +2 -1
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +2 -1
- package/dist/src/utils/walletClient.d.ts.map +1 -0
- package/dist/src/{accounts → utils}/walletClient.js +1 -1
- package/package.json +2 -6
- package/dist/src/accounts/passport.d.ts +0 -9
- package/dist/src/accounts/passport.d.ts.map +0 -1
- package/dist/src/accounts/passport.js +0 -78
- package/dist/src/accounts/walletClient.d.ts.map +0 -1
- package/dist/src/actions/compact.d.ts +0 -15
- package/dist/src/actions/compact.d.ts.map +0 -1
- package/dist/src/actions/compact.js +0 -200
- package/dist/src/actions/deployment.d.ts +0 -19
- package/dist/src/actions/deployment.d.ts.map +0 -1
- package/dist/src/actions/deployment.js +0 -76
- package/dist/src/execution/permit2.d.ts +0 -143
- package/dist/src/execution/permit2.d.ts.map +0 -1
- package/dist/src/execution/permit2.js +0 -280
- package/dist/src/execution/singleChainOps.d.ts +0 -41
- package/dist/src/execution/singleChainOps.d.ts.map +0 -1
- package/dist/src/execution/singleChainOps.js +0 -42
- package/dist/src/execution/types.d.ts +0 -36
- package/dist/src/execution/types.d.ts.map +0 -1
- package/dist/src/execution/types.js +0 -1
- /package/dist/src/{accounts → utils}/walletClient.d.ts +0 -0
|
@@ -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
|