@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.
- 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 +10 -1
- package/dist/src/execution/error.d.ts.map +1 -1
- package/dist/src/execution/error.js +9 -1
- package/dist/src/execution/index.d.ts +5 -7
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +24 -44
- package/dist/src/execution/utils.d.ts +29 -13
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +174 -122
- package/dist/src/index.d.ts +21 -16
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +15 -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 +7 -0
- package/dist/src/orchestrator/caip2.d.ts.map +1 -0
- package/dist/src/orchestrator/caip2.js +17 -0
- package/dist/src/orchestrator/client.d.ts +11 -11
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/client.js +193 -295
- 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/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 +5 -5
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +3 -3
- package/dist/src/orchestrator/registry.d.ts +1 -8
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +1 -26
- package/dist/src/orchestrator/types.d.ts +97 -232
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/types.d.ts +101 -32
- 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 +1 -5
- 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
|
@@ -6,18 +6,15 @@ import { convertOwnerSetToSignerSet } from '../accounts/signing/common.js';
|
|
|
6
6
|
import { K1_DEFAULT_VALIDATOR_ADDRESS } from '../accounts/startale.js';
|
|
7
7
|
import { createTransport, getBundlerClient, } from '../accounts/utils.js';
|
|
8
8
|
import { createAuthProvider } from '../auth/provider.js';
|
|
9
|
-
import { getIntentExecutor } from '../modules/index.js';
|
|
10
9
|
import { buildMockSignature, DUMMY_PRECLAIMOP_SELECTOR, DUMMY_PRECLAIMOP_TARGET, getOwnerValidator, getPermissionId, getSmartSessionValidator, isSessionEnabled, } from '../modules/validators/index.js';
|
|
11
10
|
import { getMultiFactorValidator, getSocialRecoveryValidator, getWebAuthnValidator, supportsEip712, } from '../modules/validators/core.js';
|
|
12
|
-
import { buildPermit2ClaimPolicyCalldata } from '../modules/validators/policies/claim/permit2.js';
|
|
11
|
+
import { buildPermit2ClaimPolicyCalldata, } from '../modules/validators/policies/claim/permit2.js';
|
|
12
|
+
import { resolvePermit2ClaimPolicy, } from '../modules/validators/smart-sessions.js';
|
|
13
13
|
import { getOrchestrator, } from '../orchestrator/index.js';
|
|
14
14
|
import { getChainById, getTokenAddress, resolveTokenAddress, } from '../orchestrator/registry.js';
|
|
15
15
|
import { SIG_MODE_EMISSARY_EXECUTION_ERC1271, SIG_MODE_ERC1271_EMISSARY, } from '../orchestrator/types.js';
|
|
16
16
|
import { convertBigIntFields } from '../orchestrator/utils.js';
|
|
17
|
-
import {
|
|
18
|
-
import { Eip7702InitSignatureRequiredError, SignerNotSupportedError, } from './error.js';
|
|
19
|
-
import { getTypedData as getPermit2TypedData } from './permit2.js';
|
|
20
|
-
import { getTypedData as getSingleChainOpsTypedData } from './singleChainOps.js';
|
|
17
|
+
import { Eip7702InitSignatureRequiredError, QuoteNotInPreparedTransactionError, SignerNotSupportedError, } from './error.js';
|
|
21
18
|
function isResolvedSessionSignerSet(signers) {
|
|
22
19
|
return (signers?.type === 'experimental_session' && 'verifyExecutions' in signers);
|
|
23
20
|
}
|
|
@@ -28,8 +25,9 @@ async function resolveSignersForChain(config, signers, chainId) {
|
|
|
28
25
|
const resolved = resolveSessionForChain(signers, chainId);
|
|
29
26
|
const enabled = await isSessionEnabled(getAddress(config), config.provider, resolved.session, config.useDevContracts);
|
|
30
27
|
const enableData = enabled ? undefined : resolved.enableData;
|
|
31
|
-
const
|
|
32
|
-
|
|
28
|
+
const verifyExecutions = resolved.verifyExecutions ??
|
|
29
|
+
signers.verifyExecutions ??
|
|
30
|
+
resolved.session.hasExplicitPermissions;
|
|
33
31
|
return {
|
|
34
32
|
type: 'experimental_session',
|
|
35
33
|
session: resolved.session,
|
|
@@ -48,15 +46,15 @@ function resolveSessionForChain(signers, chainId) {
|
|
|
48
46
|
return { session: signers.session, enableData: signers.enableData };
|
|
49
47
|
}
|
|
50
48
|
async function prepareTransaction(config, transaction) {
|
|
51
|
-
const { sourceChains, targetChain, tokenRequests, signers, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset,
|
|
49
|
+
const { sourceChains, targetChain, tokenRequests, signers, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, auxiliaryFunds, account, recipient, } = getTransactionParams(transaction);
|
|
52
50
|
const accountAddress = getAddress(config);
|
|
53
51
|
const isUserOpSigner = signers?.type === 'guardians';
|
|
54
52
|
if (isUserOpSigner) {
|
|
55
53
|
throw new SignerNotSupportedError();
|
|
56
54
|
}
|
|
57
|
-
const prepared = await prepareTransactionAsIntent(config, sourceChains, targetChain, await resolveCallInputs(transaction.calls, config, targetChain, accountAddress), transaction.gasLimit, tokenRequests, recipient, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset,
|
|
55
|
+
const prepared = await prepareTransactionAsIntent(config, sourceChains, targetChain, await resolveCallInputs(transaction.calls, config, targetChain, accountAddress), transaction.gasLimit, tokenRequests, recipient, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, auxiliaryFunds, account, signers);
|
|
58
56
|
return {
|
|
59
|
-
|
|
57
|
+
quotes: prepared.quotes,
|
|
60
58
|
intentInput: prepared.intentInput,
|
|
61
59
|
transaction,
|
|
62
60
|
};
|
|
@@ -93,19 +91,21 @@ async function resolveCallInputs(inputs, config, chain, accountAddress) {
|
|
|
93
91
|
}
|
|
94
92
|
return resolved;
|
|
95
93
|
}
|
|
96
|
-
function getTransactionMessages(
|
|
97
|
-
|
|
94
|
+
function getTransactionMessages(_config, preparedTransaction, options) {
|
|
95
|
+
const quote = resolveQuote(preparedTransaction.quotes, options);
|
|
96
|
+
return getIntentMessages(quote.signData);
|
|
98
97
|
}
|
|
99
|
-
async function signTransaction(config, preparedTransaction) {
|
|
98
|
+
async function signTransaction(config, preparedTransaction, options) {
|
|
100
99
|
const { signers } = getTransactionParams(preparedTransaction.transaction);
|
|
101
|
-
const
|
|
100
|
+
const quote = resolveQuote(preparedTransaction.quotes, options);
|
|
102
101
|
const targetChain = 'targetChain' in preparedTransaction.transaction
|
|
103
102
|
? preparedTransaction.transaction.targetChain
|
|
104
103
|
: preparedTransaction.transaction.chain;
|
|
105
|
-
const { originSignatures, destinationSignature } = await signIntent(config,
|
|
106
|
-
const targetExecutionSignature = await getTargetExecutionSignature(config,
|
|
104
|
+
const { originSignatures, destinationSignature } = await signIntent(config, quote.signData, targetChain, signers, false);
|
|
105
|
+
const targetExecutionSignature = await getTargetExecutionSignature(config, quote.signData, targetChain, signers);
|
|
107
106
|
return {
|
|
108
|
-
|
|
107
|
+
quote,
|
|
108
|
+
quotes: preparedTransaction.quotes,
|
|
109
109
|
intentInput: preparedTransaction.intentInput,
|
|
110
110
|
transaction: preparedTransaction.transaction,
|
|
111
111
|
originSignatures,
|
|
@@ -113,13 +113,22 @@ async function signTransaction(config, preparedTransaction) {
|
|
|
113
113
|
targetExecutionSignature,
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
|
-
|
|
116
|
+
function resolveQuote(quotes, options) {
|
|
117
|
+
if (!options)
|
|
118
|
+
return quotes.best;
|
|
119
|
+
const match = quotes.all.find((q) => q.intentId === options.intentId);
|
|
120
|
+
if (!match) {
|
|
121
|
+
throw new QuoteNotInPreparedTransactionError({
|
|
122
|
+
context: { intentId: options.intentId },
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
return match;
|
|
126
|
+
}
|
|
127
|
+
async function getTargetExecutionSignature(config, signData, targetChain, signers) {
|
|
117
128
|
if (signers?.type !== 'experimental_session') {
|
|
118
129
|
return undefined;
|
|
119
130
|
}
|
|
120
|
-
|
|
121
|
-
const hasIntentExecutorOps = settlementLayers.some((l) => l === 'INTENT_EXECUTOR' || l === 'SAME_CHAIN');
|
|
122
|
-
if (!hasIntentExecutorOps) {
|
|
131
|
+
if (!signData.targetExecution) {
|
|
123
132
|
return undefined;
|
|
124
133
|
}
|
|
125
134
|
const resolvedSigners = await resolveSignersForChain(config, signers, targetChain.id);
|
|
@@ -127,13 +136,13 @@ async function getTargetExecutionSignature(config, intentOp, targetChain, signer
|
|
|
127
136
|
!resolvedSigners.verifyExecutions) {
|
|
128
137
|
return undefined;
|
|
129
138
|
}
|
|
130
|
-
const destination = getTargetExecutionMessage(config, intentOp);
|
|
131
139
|
const validator = getValidator(config, signers);
|
|
132
140
|
if (!validator) {
|
|
133
141
|
throw new Error('Validator not available');
|
|
134
142
|
}
|
|
135
143
|
const ownerValidator = getOwnerValidator(config);
|
|
136
144
|
const isRoot = validator.address === ownerValidator.address;
|
|
145
|
+
const destination = prepareTypedData(signData.targetExecution);
|
|
137
146
|
const signature = await getDestinationSignature(config, resolvedSigners, validator, isRoot, targetChain, destination, [], true);
|
|
138
147
|
return signature;
|
|
139
148
|
}
|
|
@@ -151,7 +160,14 @@ async function signUserOperation(config, preparedUserOperation) {
|
|
|
151
160
|
};
|
|
152
161
|
}
|
|
153
162
|
async function signAuthorizations(config, preparedTransaction) {
|
|
154
|
-
|
|
163
|
+
const transaction = preparedTransaction.transaction;
|
|
164
|
+
const sourceChains = 'chain' in transaction ? [transaction.chain] : transaction.sourceChains;
|
|
165
|
+
const targetChain = 'chain' in transaction ? transaction.chain : transaction.targetChain;
|
|
166
|
+
return await signAuthorizationsInternal(config, {
|
|
167
|
+
sourceChains,
|
|
168
|
+
targetChain,
|
|
169
|
+
eip7702InitSignature: transaction.eip7702InitSignature,
|
|
170
|
+
});
|
|
155
171
|
}
|
|
156
172
|
async function signMessage(config, message, chain, signers) {
|
|
157
173
|
const validator = getValidator(config, signers);
|
|
@@ -239,19 +255,23 @@ async function signTypedDataWithSession(config, chain, validator, session, param
|
|
|
239
255
|
});
|
|
240
256
|
return await toErc6492Signature(config, signature, chain);
|
|
241
257
|
}
|
|
242
|
-
async function signAuthorizationsInternal(config,
|
|
258
|
+
async function signAuthorizationsInternal(config, context) {
|
|
243
259
|
const eoa = config.eoa;
|
|
244
260
|
if (!eoa) {
|
|
245
261
|
throw new Error('EIP-7702 initialization is required for EOA accounts');
|
|
246
262
|
}
|
|
263
|
+
const eip7702InitSignature = context.eip7702InitSignature;
|
|
264
|
+
if (!eip7702InitSignature) {
|
|
265
|
+
return [];
|
|
266
|
+
}
|
|
247
267
|
const accountAddress = getAddress(config);
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
|
|
268
|
+
const { contract: eip7702Contract } = getEip7702InitCall(config, eip7702InitSignature);
|
|
269
|
+
const chains = new Map();
|
|
270
|
+
for (const chain of [...(context.sourceChains ?? []), context.targetChain]) {
|
|
271
|
+
chains.set(chain.id, chain);
|
|
272
|
+
}
|
|
251
273
|
const authorizations = [];
|
|
252
|
-
for (const
|
|
253
|
-
const delegation = requiredDelegations[chainId];
|
|
254
|
-
const chain = getChainById(Number(chainId));
|
|
274
|
+
for (const chain of chains.values()) {
|
|
255
275
|
const walletClient = createWalletClient({
|
|
256
276
|
chain,
|
|
257
277
|
account: eoa,
|
|
@@ -260,23 +280,22 @@ async function signAuthorizationsInternal(config, data) {
|
|
|
260
280
|
const code = await walletClient.getCode({
|
|
261
281
|
address: accountAddress,
|
|
262
282
|
});
|
|
263
|
-
const isDelegated = code === concat(['0xef0100',
|
|
283
|
+
const isDelegated = code === concat(['0xef0100', eip7702Contract.toLowerCase()]);
|
|
264
284
|
if (isDelegated) {
|
|
265
285
|
continue;
|
|
266
286
|
}
|
|
267
287
|
const authorization = await walletClient.signAuthorization({
|
|
268
|
-
contractAddress:
|
|
269
|
-
chainId:
|
|
288
|
+
contractAddress: eip7702Contract,
|
|
289
|
+
chainId: chain.id,
|
|
270
290
|
});
|
|
271
291
|
authorizations.push(authorization);
|
|
272
292
|
}
|
|
273
293
|
return authorizations;
|
|
274
294
|
}
|
|
275
295
|
async function submitTransaction(config, signedTransaction, authorizations, dryRun = false) {
|
|
276
|
-
const {
|
|
296
|
+
const { quote, intentInput, transaction, originSignatures, destinationSignature, targetExecutionSignature, } = signedTransaction;
|
|
277
297
|
const { sourceChains, targetChain } = getTransactionParams(transaction);
|
|
278
|
-
|
|
279
|
-
return await submitIntent(config, sourceChains, targetChain, intentOp, originSignatures, destinationSignature, targetExecutionSignature, authorizations, dryRun, intentInput);
|
|
298
|
+
return await submitIntentInternal(config, sourceChains, targetChain, quote, originSignatures, destinationSignature, targetExecutionSignature, authorizations, dryRun, intentInput);
|
|
280
299
|
}
|
|
281
300
|
async function submitUserOperation(config, signedUserOperation) {
|
|
282
301
|
const chain = signedUserOperation.transaction.chain;
|
|
@@ -296,7 +315,6 @@ function getTransactionParams(transaction) {
|
|
|
296
315
|
const settlementLayers = transaction.settlementLayers;
|
|
297
316
|
const sourceAssets = transaction.sourceAssets;
|
|
298
317
|
const feeAsset = transaction.feeAsset;
|
|
299
|
-
const lockFunds = transaction.lockFunds;
|
|
300
318
|
const auxiliaryFunds = transaction.auxiliaryFunds;
|
|
301
319
|
const account = transaction.experimental_accountOverride;
|
|
302
320
|
const recipient = transaction.recipient;
|
|
@@ -312,7 +330,6 @@ function getTransactionParams(transaction) {
|
|
|
312
330
|
settlementLayers,
|
|
313
331
|
sourceAssets,
|
|
314
332
|
feeAsset,
|
|
315
|
-
lockFunds,
|
|
316
333
|
auxiliaryFunds,
|
|
317
334
|
account,
|
|
318
335
|
recipient,
|
|
@@ -369,7 +386,7 @@ function getIntentAccount(config, eip7702InitSignature, account) {
|
|
|
369
386
|
delegations,
|
|
370
387
|
};
|
|
371
388
|
}
|
|
372
|
-
async function prepareTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipientInput, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset,
|
|
389
|
+
async function prepareTransactionAsIntent(config, sourceChains, targetChain, callInputs, gasLimit, tokenRequests, recipientInput, sponsored, eip7702InitSignature, settlementLayers, sourceAssets, feeAsset, auxiliaryFunds, account, signers) {
|
|
373
390
|
const calls = parseCalls(callInputs, targetChain.id);
|
|
374
391
|
const accountAccessList = createAccountAccessList(sourceChains, sourceAssets);
|
|
375
392
|
function getRecipient(recipient) {
|
|
@@ -390,8 +407,6 @@ async function prepareTransactionAsIntent(config, sourceChains, targetChain, cal
|
|
|
390
407
|
const intentAccount = {
|
|
391
408
|
...getIntentAccount(config, eip7702InitSignature, account),
|
|
392
409
|
...(signers?.type === 'experimental_session' && {
|
|
393
|
-
// Global fallback: target-chain sig for backward-compat with older orchestrators
|
|
394
|
-
mockSignature: buildMockSignature(resolveSessionForChain(signers, targetChain.id).session, config.useDevContracts, sourceChains?.length ?? 1),
|
|
395
410
|
// Per-chain map: enables accurate per-chain session validation gas simulation
|
|
396
411
|
mockSignatures: Object.fromEntries([
|
|
397
412
|
...new Set([
|
|
@@ -446,19 +461,18 @@ async function prepareTransactionAsIntent(config, sourceChains, targetChain, cal
|
|
|
446
461
|
destinationGasUnits: gasLimit,
|
|
447
462
|
accountAccessList,
|
|
448
463
|
options: {
|
|
449
|
-
topupCompact: lockFunds ?? false,
|
|
450
464
|
feeToken: feeAsset,
|
|
451
465
|
sponsorSettings: sponsored
|
|
452
466
|
? typeof sponsored === 'object'
|
|
453
467
|
? {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
468
|
+
gas: sponsored.gas,
|
|
469
|
+
bridgeFees: sponsored.bridging,
|
|
470
|
+
swapFees: sponsored.swaps,
|
|
457
471
|
}
|
|
458
472
|
: {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
473
|
+
gas: sponsored,
|
|
474
|
+
bridgeFees: sponsored,
|
|
475
|
+
swapFees: sponsored,
|
|
462
476
|
}
|
|
463
477
|
: undefined,
|
|
464
478
|
settlementLayers,
|
|
@@ -469,11 +483,18 @@ async function prepareTransactionAsIntent(config, sourceChains, targetChain, cal
|
|
|
469
483
|
};
|
|
470
484
|
const serializedIntent = convertBigIntFields(metaIntent);
|
|
471
485
|
const orchestrator = getOrchestrator(config._authProvider ?? createAuthProvider(config), config.endpointUrl, config.headers);
|
|
472
|
-
const
|
|
473
|
-
|
|
486
|
+
const { routes } = await orchestrator.createQuote(metaIntent);
|
|
487
|
+
const best = routes[0];
|
|
488
|
+
if (!best) {
|
|
489
|
+
throw new Error('Orchestrator returned no quote');
|
|
490
|
+
}
|
|
491
|
+
return {
|
|
492
|
+
quotes: { best, all: routes },
|
|
493
|
+
intentInput: serializedIntent,
|
|
494
|
+
};
|
|
474
495
|
}
|
|
475
|
-
async function signIntent(config,
|
|
476
|
-
const { origin, destination } = getIntentMessages(
|
|
496
|
+
async function signIntent(config, signData, targetChain, signers, targetExecution) {
|
|
497
|
+
const { origin, destination } = getIntentMessages(signData);
|
|
477
498
|
if (config.account?.type === 'eoa') {
|
|
478
499
|
const eoa = config.eoa;
|
|
479
500
|
if (!eoa) {
|
|
@@ -541,49 +562,62 @@ async function signDestinationSeparately(config, signers, validator, isRoot, tar
|
|
|
541
562
|
? destinationSignatures.preClaimSig
|
|
542
563
|
: (destinationSignatures ?? '0x');
|
|
543
564
|
}
|
|
544
|
-
function getIntentMessages(
|
|
545
|
-
const address = getAddress(config);
|
|
546
|
-
const intentExecutor = getIntentExecutor(config);
|
|
547
|
-
const withPermit2 = intentOp.elements.some((element) => element.mandate.qualifier.settlementContext.fundingMethod === 'PERMIT2');
|
|
548
|
-
const withIntentExecutorOps = intentOp.elements.some((element) => element.mandate.qualifier.settlementContext.settlementLayer ===
|
|
549
|
-
'INTENT_EXECUTOR');
|
|
550
|
-
const origin = [];
|
|
551
|
-
for (const element of intentOp.elements) {
|
|
552
|
-
if (withIntentExecutorOps) {
|
|
553
|
-
const typedData = getSingleChainOpsTypedData(address, intentExecutor.address, element, BigInt(intentOp.nonce));
|
|
554
|
-
origin.push(typedData);
|
|
555
|
-
}
|
|
556
|
-
else if (withPermit2) {
|
|
557
|
-
const typedData = getPermit2TypedData(element, BigInt(intentOp.nonce), BigInt(intentOp.expires));
|
|
558
|
-
origin.push(typedData);
|
|
559
|
-
}
|
|
560
|
-
else {
|
|
561
|
-
const typedData = getCompactTypedData(intentOp);
|
|
562
|
-
origin.push(typedData);
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
const destination = origin.at(-1);
|
|
565
|
+
function getIntentMessages(signData) {
|
|
566
566
|
return {
|
|
567
|
-
origin,
|
|
568
|
-
destination,
|
|
567
|
+
origin: signData.origin.map(prepareTypedData),
|
|
568
|
+
destination: prepareTypedData(signData.destination),
|
|
569
|
+
targetExecution: signData.targetExecution
|
|
570
|
+
? prepareTypedData(signData.targetExecution)
|
|
571
|
+
: undefined,
|
|
569
572
|
};
|
|
570
573
|
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
const
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
overhead: 0n,
|
|
574
|
+
// Server emits uint*/int* values as decimal strings; viem's hashTypedData
|
|
575
|
+
// expects bigint. Walk the message tree against the type schema and coerce
|
|
576
|
+
// numeric fields back to bigint before signing.
|
|
577
|
+
function prepareTypedData(td) {
|
|
578
|
+
const types = td.types;
|
|
579
|
+
return {
|
|
580
|
+
...td,
|
|
581
|
+
message: coerceTypedDataMessage(types, td.primaryType, td.message),
|
|
580
582
|
};
|
|
581
|
-
|
|
583
|
+
}
|
|
584
|
+
function coerceTypedDataMessage(types, primaryType, message) {
|
|
585
|
+
const fields = types[primaryType];
|
|
586
|
+
if (!fields)
|
|
587
|
+
return message;
|
|
588
|
+
const result = { ...message };
|
|
589
|
+
for (const { name, type } of fields) {
|
|
590
|
+
if (name in message) {
|
|
591
|
+
result[name] = coerceTypedDataValue(types, type, message[name]);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
return result;
|
|
595
|
+
}
|
|
596
|
+
function coerceTypedDataValue(types, type, value) {
|
|
597
|
+
if (value === null || value === undefined)
|
|
598
|
+
return value;
|
|
599
|
+
const arrayMatch = type.match(/^(.+)\[\d*\]$/);
|
|
600
|
+
if (arrayMatch) {
|
|
601
|
+
const elementType = arrayMatch[1];
|
|
602
|
+
if (!Array.isArray(value))
|
|
603
|
+
return value;
|
|
604
|
+
return value.map((v) => coerceTypedDataValue(types, elementType, v));
|
|
605
|
+
}
|
|
606
|
+
if (/^u?int\d*$/.test(type)) {
|
|
607
|
+
if (typeof value === 'string' || typeof value === 'number') {
|
|
608
|
+
return BigInt(value);
|
|
609
|
+
}
|
|
610
|
+
return value;
|
|
611
|
+
}
|
|
612
|
+
if (types[type]) {
|
|
613
|
+
return coerceTypedDataMessage(types, type, value);
|
|
614
|
+
}
|
|
615
|
+
return value;
|
|
582
616
|
}
|
|
583
617
|
/** Computes claim policy calldata when parameters are Permit2 typed data with claim policies. */
|
|
584
618
|
function resolveClaimPolicyData(signers, parameters) {
|
|
585
619
|
if (parameters.primaryType !== 'PermitBatchWitnessTransferFrom' ||
|
|
586
|
-
!signers.session.claimPolicies
|
|
620
|
+
!signers.session.claimPolicies.length) {
|
|
587
621
|
return undefined;
|
|
588
622
|
}
|
|
589
623
|
const msg = parameters.message;
|
|
@@ -594,7 +628,7 @@ function resolveClaimPolicyData(signers, parameters) {
|
|
|
594
628
|
typeof msg.deadline !== 'bigint') {
|
|
595
629
|
return undefined;
|
|
596
630
|
}
|
|
597
|
-
return buildPermit2ClaimPolicyCalldata(signers.session.claimPolicies[0], parameters.message);
|
|
631
|
+
return buildPermit2ClaimPolicyCalldata(resolvePermit2ClaimPolicy(signers.session.claimPolicies[0]), parameters.message);
|
|
598
632
|
}
|
|
599
633
|
async function signIntentTypedData(config, signers, validator, isRoot, parameters, chain, targetExecution) {
|
|
600
634
|
if (supportsEip712(validator)) {
|
|
@@ -710,38 +744,36 @@ async function submitUserOp(config, chain, userOp, signature) {
|
|
|
710
744
|
chain: chain.id,
|
|
711
745
|
};
|
|
712
746
|
}
|
|
713
|
-
async function
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
747
|
+
async function submitIntentInternal(config, sourceChains, targetChain, quote, originSignatures, destinationSignature, targetExecutionSignature, authorizations, dryRun, intentInput) {
|
|
748
|
+
const request = {
|
|
749
|
+
intentId: quote.intentId,
|
|
750
|
+
signatures: {
|
|
751
|
+
origin: originSignatures,
|
|
752
|
+
destination: destinationSignature,
|
|
753
|
+
...(targetExecutionSignature !== undefined && {
|
|
754
|
+
targetExecution: targetExecutionSignature,
|
|
755
|
+
}),
|
|
756
|
+
},
|
|
757
|
+
...(authorizations.length > 0 && {
|
|
758
|
+
authorizations: {
|
|
759
|
+
sponsor: authorizations.map((authorization) => ({
|
|
760
|
+
chainId: authorization.chainId,
|
|
761
|
+
address: authorization.address,
|
|
762
|
+
nonce: authorization.nonce,
|
|
763
|
+
yParity: authorization.yParity ?? 0,
|
|
764
|
+
r: authorization.r,
|
|
765
|
+
s: authorization.s,
|
|
766
|
+
})),
|
|
767
|
+
},
|
|
768
|
+
}),
|
|
769
|
+
...(dryRun && { options: { dryRun: true } }),
|
|
732
770
|
};
|
|
733
|
-
}
|
|
734
|
-
async function submitIntentInternal(config, sourceChains, targetChain, intentOp, originSignatures, destinationSignature, targetExecutionSignature, authorizations, dryRun, intentInput) {
|
|
735
|
-
const signedIntentOp = createSignedIntentOp(intentOp, originSignatures, destinationSignature, targetExecutionSignature, authorizations);
|
|
736
771
|
const isSponsored = !!intentInput?.options?.sponsorSettings;
|
|
737
772
|
const orchestrator = getOrchestrator(config._authProvider ?? createAuthProvider(config), config.endpointUrl, config.headers);
|
|
738
|
-
const
|
|
739
|
-
// Some settlement paths (e.g. SAME_CHAIN) may not return a result.id — fall
|
|
740
|
-
// back to the nonce which the orchestrator also accepts as an intent identifier.
|
|
741
|
-
const intentId = intentResults.result.id ?? intentOp.nonce;
|
|
773
|
+
const response = await orchestrator.createIntent(request, intentInput ? { intentInput, isSponsored } : undefined);
|
|
742
774
|
return {
|
|
743
775
|
type: 'intent',
|
|
744
|
-
id:
|
|
776
|
+
id: response.intentId,
|
|
745
777
|
sourceChains: sourceChains?.map((chain) => chain.id),
|
|
746
778
|
targetChain: targetChain.id,
|
|
747
779
|
};
|
|
@@ -816,12 +848,32 @@ function createAccountAccessList(sourceChains, sourceAssets) {
|
|
|
816
848
|
if (Array.isArray(sourceAssets)) {
|
|
817
849
|
const isExactConfig = sourceAssets.length > 0 && typeof sourceAssets[0] !== 'string';
|
|
818
850
|
if (isExactConfig) {
|
|
819
|
-
const
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
851
|
+
const chainTokens = {};
|
|
852
|
+
const chainTokenAmounts = {};
|
|
853
|
+
for (const config of sourceAssets) {
|
|
854
|
+
const chainId = config.chain.id;
|
|
855
|
+
const tokenAddress = resolveTokenAddress(config.address, config.chain.id);
|
|
856
|
+
if (config.amount !== undefined) {
|
|
857
|
+
if (!chainTokenAmounts[chainId])
|
|
858
|
+
chainTokenAmounts[chainId] = {};
|
|
859
|
+
chainTokenAmounts[chainId][tokenAddress] = config.amount;
|
|
860
|
+
}
|
|
861
|
+
else {
|
|
862
|
+
if (!chainTokens[chainId])
|
|
863
|
+
chainTokens[chainId] = [];
|
|
864
|
+
chainTokens[chainId].push(tokenAddress);
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
const out = {};
|
|
868
|
+
if (Object.keys(chainTokens).length > 0) {
|
|
869
|
+
out.chainTokens =
|
|
870
|
+
chainTokens;
|
|
871
|
+
}
|
|
872
|
+
if (Object.keys(chainTokenAmounts).length > 0) {
|
|
873
|
+
out.chainTokenAmounts =
|
|
874
|
+
chainTokenAmounts;
|
|
875
|
+
}
|
|
876
|
+
return out;
|
|
825
877
|
}
|
|
826
878
|
return chainIds
|
|
827
879
|
? { chainIds, tokens: sourceAssets }
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import type { Address, Chain, HashTypedDataParameters, Hex, SignableMessage, SignedAuthorizationList, TypedData, TypedDataDefinition } from 'viem';
|
|
2
2
|
import type { UserOperationReceipt } from 'viem/account-abstraction';
|
|
3
|
-
import { walletClientToAccount, wrapParaAccount } from './accounts/walletClient.js';
|
|
4
|
-
import { deployAccountsForOwners } from './actions/deployment.js';
|
|
5
3
|
import { type TransactionResult, type TransactionStatus, type UserOperationResult } from './execution/index.js';
|
|
6
|
-
import { type
|
|
7
|
-
import { type IntentRoute, type PreparedTransactionData, type PreparedUserOperationData, type SignedTransactionData, type SignedUserOperationData } from './execution/utils.js';
|
|
4
|
+
import { type PreparedQuotes, type PreparedTransactionData, type PreparedUserOperationData, type QuoteSelection, type SignedTransactionData, type SignedUserOperationData } from './execution/utils.js';
|
|
8
5
|
import { MULTI_FACTOR_VALIDATOR_ADDRESS, OWNABLE_VALIDATOR_ADDRESS, SMART_SESSION_EMISSARY_ADDRESS, WEBAUTHN_VALIDATOR_ADDRESS } from './modules/index.js';
|
|
9
6
|
import { type SessionDetails } from './modules/validators/smart-sessions.js';
|
|
10
|
-
import {
|
|
11
|
-
import type { AccountProviderConfig, AccountType, BundlerConfig, Call, CallInput, ChainSessionConfig, MultiFactorValidatorConfig, OwnableValidatorConfig, OwnerSet, PaymasterConfig, Permit2ClaimPolicy, Policy, ProviderConfig, Recovery, RhinestoneAccountConfig, RhinestoneConfig, RhinestoneSDKConfig, Session, SignerSet, TokenRequest, TokenSymbol, Transaction, UniversalActionPolicyParamCondition, UserOperationTransaction, WebauthnValidatorConfig } from './types.js';
|
|
7
|
+
import type { ApprovalRequired, AuxiliaryFunds, IntentInput, IntentOpStatus, Portfolio, SettlementLayer, SplitIntentsInput, SplitIntentsResult, TokenRequirements, WrapRequired } from './orchestrator/index.js';
|
|
8
|
+
import type { AccountProviderConfig, AccountType, BundlerConfig, Call, CallInput, ChainSessionConfig, MultiFactorValidatorConfig, OwnableValidatorConfig, OwnerSet, ParamConstraint, PaymasterConfig, Permission, PermissionFunctionConfig, Permit2ClaimPolicy, Policy, ProviderConfig, Recovery, RhinestoneAccountConfig, RhinestoneConfig, RhinestoneSDKConfig, Session, SessionDefinition, SignerSet, TokenRequest, TokenSymbol, Transaction, UniversalActionPolicyParamCondition, UserOperationTransaction, WebauthnValidatorConfig } from './types.js';
|
|
9
|
+
interface SubmitTransactionOptions {
|
|
10
|
+
authorizations?: SignedAuthorizationList;
|
|
11
|
+
/**
|
|
12
|
+
* When `true`, the orchestrator validates the intent without executing it
|
|
13
|
+
* onchain. Internal use only; the `internal_` prefix marks it as not part
|
|
14
|
+
* of the supported public API.
|
|
15
|
+
*/
|
|
16
|
+
internal_dryRun?: boolean;
|
|
17
|
+
}
|
|
12
18
|
interface RhinestoneAccount {
|
|
13
19
|
config: RhinestoneAccountConfig;
|
|
14
20
|
deploy: (chain: Chain, params?: {
|
|
@@ -23,22 +29,22 @@ interface RhinestoneAccount {
|
|
|
23
29
|
};
|
|
24
30
|
signEip7702InitData: () => Promise<Hex>;
|
|
25
31
|
prepareTransaction: (transaction: Transaction) => Promise<PreparedTransactionData>;
|
|
26
|
-
getTransactionMessages: (preparedTransaction: PreparedTransactionData) => {
|
|
32
|
+
getTransactionMessages: (preparedTransaction: PreparedTransactionData, options?: QuoteSelection) => {
|
|
27
33
|
origin: TypedDataDefinition[];
|
|
28
34
|
destination: TypedDataDefinition;
|
|
35
|
+
targetExecution?: TypedDataDefinition;
|
|
29
36
|
};
|
|
30
|
-
signTransaction: (preparedTransaction: PreparedTransactionData) => Promise<SignedTransactionData>;
|
|
37
|
+
signTransaction: (preparedTransaction: PreparedTransactionData, options?: QuoteSelection) => Promise<SignedTransactionData>;
|
|
31
38
|
signAuthorizations: (preparedTransaction: PreparedTransactionData) => Promise<SignedAuthorizationList>;
|
|
32
39
|
signMessage: (message: SignableMessage, chain: Chain, signers: SignerSet | undefined) => Promise<Hex>;
|
|
33
40
|
signTypedData: <typedData extends TypedData | Record<string, unknown> = TypedData, primaryType extends keyof typedData | 'EIP712Domain' = keyof typedData>(parameters: HashTypedDataParameters<typedData, primaryType>, chain: Chain, signers: SignerSet | undefined) => Promise<Hex>;
|
|
34
|
-
submitTransaction: (signedTransaction: SignedTransactionData,
|
|
35
|
-
sendTransaction: (transaction: Transaction) => Promise<TransactionResult>;
|
|
41
|
+
submitTransaction: (signedTransaction: SignedTransactionData, options?: SubmitTransactionOptions) => Promise<TransactionResult>;
|
|
36
42
|
prepareUserOperation: (transaction: UserOperationTransaction) => Promise<PreparedUserOperationData>;
|
|
37
43
|
signUserOperation: (preparedUserOperation: PreparedUserOperationData) => Promise<SignedUserOperationData>;
|
|
38
44
|
submitUserOperation: (signedUserOperation: SignedUserOperationData) => Promise<UserOperationResult>;
|
|
39
45
|
sendUserOperation: (transaction: UserOperationTransaction) => Promise<UserOperationResult>;
|
|
40
|
-
waitForExecution(result: TransactionResult
|
|
41
|
-
waitForExecution(result: UserOperationResult
|
|
46
|
+
waitForExecution(result: TransactionResult): Promise<TransactionStatus>;
|
|
47
|
+
waitForExecution(result: UserOperationResult): Promise<UserOperationReceipt>;
|
|
42
48
|
getAddress: () => Address;
|
|
43
49
|
getPortfolio: (onTestnets?: boolean) => Promise<Portfolio>;
|
|
44
50
|
experimental_getSessionDetails: (sessions: Session[]) => Promise<SessionDetails>;
|
|
@@ -50,7 +56,6 @@ interface RhinestoneAccount {
|
|
|
50
56
|
} | null>;
|
|
51
57
|
getValidators: (chain: Chain) => Promise<Address[]>;
|
|
52
58
|
getExecutors: (chain: Chain) => Promise<Address[]>;
|
|
53
|
-
checkERC20Allowance: (tokenAddress: Address, chain: Chain) => Promise<bigint>;
|
|
54
59
|
}
|
|
55
60
|
/**
|
|
56
61
|
* Initialize a Rhinestone account
|
|
@@ -69,11 +74,11 @@ declare class RhinestoneSDK {
|
|
|
69
74
|
private headers?;
|
|
70
75
|
constructor(options: RhinestoneSDKConfig);
|
|
71
76
|
createAccount(config: RhinestoneAccountConfig): Promise<RhinestoneAccount>;
|
|
72
|
-
getIntentStatus(intentId:
|
|
77
|
+
getIntentStatus(intentId: string): Promise<TransactionStatus & {
|
|
73
78
|
status: IntentOpStatus["status"];
|
|
74
79
|
}>;
|
|
75
80
|
splitIntents(input: SplitIntentsInput): Promise<SplitIntentsResult>;
|
|
76
81
|
}
|
|
77
|
-
export { RhinestoneSDK, createRhinestoneAccount,
|
|
78
|
-
export type { RhinestoneAccount, AccountType, RhinestoneAccountConfig, AccountProviderConfig, ProviderConfig, BundlerConfig, PaymasterConfig, Transaction, TokenSymbol, CallInput, Call, TokenRequest, OwnerSet, OwnableValidatorConfig, WebauthnValidatorConfig, MultiFactorValidatorConfig, SignerSet, ChainSessionConfig, Session, Recovery, Policy, Permit2ClaimPolicy, UniversalActionPolicyParamCondition, PreparedTransactionData, SignedTransactionData, TransactionResult, PreparedUserOperationData, SignedUserOperationData, UserOperationResult, AuxiliaryFunds, IntentInput,
|
|
82
|
+
export { RhinestoneSDK, createRhinestoneAccount, OWNABLE_VALIDATOR_ADDRESS, WEBAUTHN_VALIDATOR_ADDRESS, MULTI_FACTOR_VALIDATOR_ADDRESS, SMART_SESSION_EMISSARY_ADDRESS, };
|
|
83
|
+
export type { RhinestoneAccount, AccountType, RhinestoneAccountConfig, AccountProviderConfig, ProviderConfig, BundlerConfig, PaymasterConfig, Transaction, TokenSymbol, CallInput, Call, TokenRequest, OwnerSet, OwnableValidatorConfig, WebauthnValidatorConfig, MultiFactorValidatorConfig, SignerSet, ChainSessionConfig, Session, SessionDefinition, Recovery, Permission, PermissionFunctionConfig, ParamConstraint, Policy, Permit2ClaimPolicy, UniversalActionPolicyParamCondition, PreparedQuotes, PreparedTransactionData, QuoteSelection, SignedTransactionData, TransactionResult, PreparedUserOperationData, SignedUserOperationData, UserOperationResult, AuxiliaryFunds, IntentInput, IntentOpStatus, SettlementLayer, SplitIntentsInput, SplitIntentsResult, Portfolio, TokenRequirements, WrapRequired, ApprovalRequired, };
|
|
79
84
|
//# 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,EACT,mBAAmB,EACpB,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AA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