@rhinestone/sdk 0.0.0-dev-20261009082022 → 0.0.0-dev-20261009113356
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/api/account.d.ts.map +1 -1
- package/dist/src/api/account.js +89 -16
- package/dist/src/clients/orchestrator/client.js +1 -1
- package/dist/src/config/account.d.ts +163 -67
- package/dist/src/config/account.d.ts.map +1 -1
- package/dist/src/modules/validators/policies/claim/permit2.d.ts +15 -0
- package/dist/src/modules/validators/policies/claim/permit2.d.ts.map +1 -1
- package/dist/src/modules/validators/policies/claim/permit2.js +27 -5
- package/dist/src/modules/validators/smart-sessions/cross-chain-permits.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions/cross-chain-permits.js +2 -0
- package/dist/src/modules/validators/smart-sessions/policies/claim.d.ts +5 -3
- package/dist/src/modules/validators/smart-sessions/policies/claim.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions/policies/claim.js +20 -5
- package/dist/src/modules/validators/smart-sessions/policies/permit2-approval.d.ts +20 -0
- package/dist/src/modules/validators/smart-sessions/policies/permit2-approval.d.ts.map +1 -0
- package/dist/src/modules/validators/smart-sessions/policies/permit2-approval.js +61 -0
- package/dist/src/modules/validators/smart-sessions/refusals.d.ts +14 -4
- package/dist/src/modules/validators/smart-sessions/refusals.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions/refusals.js +14 -4
- package/dist/src/modules/validators/smart-sessions/resolve.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions/resolve.js +136 -41
- package/dist/src/modules/validators/smart-sessions/settlement/fees.d.ts +11 -9
- package/dist/src/modules/validators/smart-sessions/settlement/fees.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions/settlement/fees.js +43 -8
- package/dist/src/modules/validators/smart-sessions/settlement/same-chain.d.ts +1 -0
- package/dist/src/modules/validators/smart-sessions/settlement/same-chain.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions/settlement/same-chain.js +1 -1
- package/dist/src/modules/validators/smart-sessions/settlement/scope.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions/settlement/scope.js +2 -3
- package/dist/src/modules/validators/smart-sessions/swap/stable-floor.d.ts +1 -0
- package/dist/src/modules/validators/smart-sessions/swap/stable-floor.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions/swap/stable-floor.js +1 -1
- package/dist/src/modules/validators/smart-sessions/types.d.ts +21 -1
- package/dist/src/modules/validators/smart-sessions/types.d.ts.map +1 -1
- package/dist/src/transactions/intents/session-signing.d.ts.map +1 -1
- package/dist/src/transactions/intents/session-signing.js +6 -1
- package/dist/src/transactions/intents/sessions.d.ts.map +1 -1
- package/dist/src/transactions/intents/sessions.js +12 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../api/account.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;AAGpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzD,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,SAAS,EAET,QAAQ,EACT,MAAM,gCAAgC,CAAA;AAKvC,OAAO,KAAK,EAEV,uBAAuB,EACvB,OAAO,EACP,SAAS,EAIT,WAAW,EACX,wBAAwB,EACzB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAK3D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAWlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,K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AAA;IAC/D;;;;OAIG;IACH,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;IACpD;;;;OAIG;IACH,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;IACxD;;;;;OAKG;IACH,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC;QAC/B,QAAQ,EAAE,OAAO,EAAE,CAAA;QACnB,SAAS,EAAE,MAAM,CAAA;KAClB,GAAG,IAAI,CAAC,CAAA;IACT;;;;OAIG;IACH,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;IAC/C;;;;OAIG;IACH,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAA;CAC/C;AA4GD,wBAAgB,mBAAmB,CACjC,mBAAmB,EAAE,mBAAmB,CAAC,OAAO,CAAC,EACjD,WAAW,EAAE,eAAe,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,GACzD,iBAAiB,CAoYnB;AAgVD,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,wBAAwB,CAAC,MAAM,CAAC,EACzC,WAAW,EAAE,WAAW,EACxB,eAAe,CAAC,EAAE,eAAe,GAChC,WAAW,CAsJb;AA0CD,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,WAAW,GACjB,SAAS,WAAW,CAAC,aAAa,CAAC,EAAE,CAQvC"}
|
package/dist/src/api/account.js
CHANGED
|
@@ -550,23 +550,88 @@ const PERMIT2_LAYERS = new Set([
|
|
|
550
550
|
]);
|
|
551
551
|
/**
|
|
552
552
|
* The settlement layers a session admits, narrowed by any explicit filter. A
|
|
553
|
-
* settlement-scoped session admits only its own layers.
|
|
554
|
-
*
|
|
553
|
+
* settlement-scoped or scoped Permit2-route session admits only its own layers.
|
|
554
|
+
* A Permit2 session with a `fallback` admits every route except the Permit2
|
|
555
555
|
* arbiters its permit does not name. Like the quoter pin, an explicit filter
|
|
556
556
|
* can only narrow.
|
|
557
557
|
*/
|
|
558
|
-
function
|
|
558
|
+
function signingSessions(signers, chainIds) {
|
|
559
559
|
if (signers?.type !== 'session')
|
|
560
|
-
return
|
|
561
|
-
|
|
562
|
-
const sessions = 'session' in signers
|
|
560
|
+
return [];
|
|
561
|
+
return 'session' in signers
|
|
563
562
|
? [signers.session]
|
|
564
563
|
: Object.entries(signers.sessions ?? {})
|
|
565
|
-
.filter(([chainId]) =>
|
|
564
|
+
.filter(([chainId]) => chainIds.includes(Number(chainId)))
|
|
566
565
|
.map(([, s]) => s.session);
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* The source assets a scoped Permit2-route session can fund, narrowed by any
|
|
569
|
+
* explicit `sourceAssets`: its claim moves only the permit's `from` tokens, so
|
|
570
|
+
* an origin swap or a native wrap of anything else would not settle. A capped
|
|
571
|
+
* token goes in `chainTokenAmounts`, which the orchestrator treats as a cap,
|
|
572
|
+
* so it never plans a spend above `maxAmount`.
|
|
573
|
+
*/
|
|
574
|
+
function sourceAssetPin(signers, chainIds, explicit, sameChain) {
|
|
575
|
+
const legs = signingSessions(signers, chainIds).flatMap((session) => session.permit2Sources ?? []);
|
|
576
|
+
if (legs.length === 0)
|
|
577
|
+
return explicit;
|
|
578
|
+
// The orchestrator settles a smart account's same-chain intent through the
|
|
579
|
+
// IntentExecutor, which a scoped Permit2 session cannot sign for.
|
|
580
|
+
if (sameChain) {
|
|
581
|
+
throw new Error('A scoped Permit2 session settles cross-chain intents only; sign a same-chain intent with a SAME_CHAIN_IE session, or set `fallback`');
|
|
582
|
+
}
|
|
583
|
+
const leg = (chainId, token) => legs.find((l) => l.chain.id === chainId && l.token.toLowerCase() === token.toLowerCase());
|
|
584
|
+
const listed = (chainId, token) => (!explicit?.chainIds || explicit.chainIds.includes(chainId)) &&
|
|
585
|
+
(!explicit?.tokens ||
|
|
586
|
+
explicit.tokens.some((t) => t.toLowerCase() === token.toLowerCase()));
|
|
587
|
+
// The explicit tokens (with any amounts), else every leg.
|
|
588
|
+
const wanted = explicit?.chainTokens || explicit?.chainTokenAmounts
|
|
589
|
+
? [
|
|
590
|
+
...Object.entries(explicit.chainTokens ?? {}).flatMap(([chainId, tokens]) => tokens.map((token) => [
|
|
591
|
+
Number(chainId),
|
|
592
|
+
token,
|
|
593
|
+
undefined,
|
|
594
|
+
])),
|
|
595
|
+
...Object.entries(explicit.chainTokenAmounts ?? {}).flatMap(([chainId, amounts]) => Object.entries(amounts).map(([token, amount]) => [
|
|
596
|
+
Number(chainId),
|
|
597
|
+
token,
|
|
598
|
+
amount,
|
|
599
|
+
])),
|
|
600
|
+
]
|
|
601
|
+
: legs.map(({ chain, token }) => [chain.id, token, undefined]);
|
|
602
|
+
const chainTokens = {};
|
|
603
|
+
const chainTokenAmounts = {};
|
|
604
|
+
for (const [chainId, token, amount] of wanted) {
|
|
605
|
+
const cap = leg(chainId, token);
|
|
606
|
+
if (!cap || !listed(chainId, token))
|
|
607
|
+
continue;
|
|
608
|
+
const bound = cap.maxAmount === undefined ||
|
|
609
|
+
(amount !== undefined && amount < cap.maxAmount)
|
|
610
|
+
? amount
|
|
611
|
+
: cap.maxAmount;
|
|
612
|
+
if (bound === undefined) {
|
|
613
|
+
if (!chainTokens[chainId]?.includes(token))
|
|
614
|
+
(chainTokens[chainId] ??= []).push(token);
|
|
615
|
+
}
|
|
616
|
+
else
|
|
617
|
+
(chainTokenAmounts[chainId] ??= {})[token] = bound;
|
|
618
|
+
}
|
|
619
|
+
const pinned = {
|
|
620
|
+
...(Object.keys(chainTokens).length && { chainTokens }),
|
|
621
|
+
...(Object.keys(chainTokenAmounts).length && { chainTokenAmounts }),
|
|
622
|
+
};
|
|
623
|
+
if (Object.keys(pinned).length === 0) {
|
|
624
|
+
throw new Error("No source asset is left for the intent: a scoped Permit2 session funds it only from its permit's `from` tokens on the intent's source chains");
|
|
625
|
+
}
|
|
626
|
+
return pinned;
|
|
627
|
+
}
|
|
628
|
+
function settlementLayerPin(signers, chainIds, explicit) {
|
|
629
|
+
if (signers?.type !== 'session')
|
|
630
|
+
return explicit;
|
|
631
|
+
const sessions = signingSessions(signers, chainIds);
|
|
567
632
|
// The orchestrator layers that settle through a Permit2 arbiter. Permit2's
|
|
568
|
-
//
|
|
569
|
-
//
|
|
633
|
+
// ECO is a retired arbiter (the orchestrator's ECO is ECO_IE's solver
|
|
634
|
+
// network), and SAME_CHAIN takes no bridge, so neither is filtered.
|
|
570
635
|
const permit2Arbiters = ['ACROSS'];
|
|
571
636
|
// The session's layer names are the SDK's; the filter speaks the
|
|
572
637
|
// orchestrator's, where Eco's solver network is `ECO`. SAME_CHAIN_IE takes
|
|
@@ -577,14 +642,17 @@ function settlementLayerPin(signers, chainIds, explicit) {
|
|
|
577
642
|
for (const session of sessions) {
|
|
578
643
|
const named = session.settlementLayers ?? [];
|
|
579
644
|
// A Permit2 permit never shares a session with IntentExecutor layers.
|
|
580
|
-
if (named.some((layer) => PERMIT2_LAYERS.has(layer))
|
|
645
|
+
if (named.some((layer) => PERMIT2_LAYERS.has(layer)) &&
|
|
646
|
+
session.access?.kind !== 'scoped') {
|
|
581
647
|
for (const arbiter of permit2Arbiters) {
|
|
582
648
|
if (!named.includes(arbiter))
|
|
583
649
|
excluded.add(arbiter);
|
|
584
650
|
}
|
|
585
651
|
continue;
|
|
586
652
|
}
|
|
587
|
-
|
|
653
|
+
// A scoped Permit2-route session names its live arbiters; Permit2's
|
|
654
|
+
// SAME_CHAIN, like SAME_CHAIN_IE, narrows nothing.
|
|
655
|
+
const layers = named.flatMap((layer) => layer === 'SAME_CHAIN_IE' || layer === 'SAME_CHAIN'
|
|
588
656
|
? []
|
|
589
657
|
: [layer === 'ECO_IE' ? 'ECO' : layer]);
|
|
590
658
|
if (layers.length)
|
|
@@ -650,11 +718,16 @@ export function adaptTransaction(context, transaction, hyperCoreAction) {
|
|
|
650
718
|
...(transaction.eip7702InitSignature
|
|
651
719
|
? { eip7702InitSignature: transaction.eip7702InitSignature }
|
|
652
720
|
: {}),
|
|
653
|
-
...(
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
721
|
+
...(() => {
|
|
722
|
+
const accountAccessList = sourceAssetPin(transaction.signers, [
|
|
723
|
+
...(destinationChainId === undefined ? [] : [destinationChainId]),
|
|
724
|
+
...(evmSources?.map(({ id }) => id) ?? []),
|
|
725
|
+
], transaction.sourceAssets || sourceChains
|
|
726
|
+
? adaptSourceAssets(transaction.sourceAssets, evmSources?.map(({ id }) => id))
|
|
727
|
+
: undefined, Boolean(evmSources?.length &&
|
|
728
|
+
evmSources.every(({ id }) => id === destinationChainId)));
|
|
729
|
+
return accountAccessList ? { accountAccessList } : {};
|
|
730
|
+
})(),
|
|
658
731
|
options: {
|
|
659
732
|
...(transaction.appFees ? { appFees: transaction.appFees } : {}),
|
|
660
733
|
...(transaction.protocolFees
|
|
@@ -3,7 +3,7 @@ import { createOrchestratorAuth } from './auth.js';
|
|
|
3
3
|
import { ChainCatalog, parseChains } from './chain-catalog.js';
|
|
4
4
|
import { fetchOrchestratorJson } from './fetch.js';
|
|
5
5
|
import { mapIntentRequestToWire, mapIntentStatusFromWire, mapPortfolioFromWire, mapQuoteResponseFromWire, mapSignedIntentToWire, mapSplitRequestToWire, mapSplitResultFromWire, } from './mappers.js';
|
|
6
|
-
const SDK_VERSION = '0.0.0-dev-
|
|
6
|
+
const SDK_VERSION = '0.0.0-dev-20261009113356';
|
|
7
7
|
const API_VERSION = '2026-04.blanc';
|
|
8
8
|
// Bounds how long a killed layer or pulled settlement address stays pinnable.
|
|
9
9
|
const CHAIN_CATALOG_TTL_MS = 10 * 60 * 1000;
|
|
@@ -204,15 +204,22 @@ interface Permit2ClaimPolicy {
|
|
|
204
204
|
min?: bigint;
|
|
205
205
|
max?: bigint;
|
|
206
206
|
}[];
|
|
207
|
+
/** Whether a claim must (`true`) or may not (`false`) carry pre-claim calls, per origin chain */
|
|
208
|
+
originOps?: {
|
|
209
|
+
chain: Chain;
|
|
210
|
+
required: boolean;
|
|
211
|
+
}[];
|
|
207
212
|
}
|
|
208
213
|
/**
|
|
209
214
|
* Settlement layers supported by the cross-chain session abstraction.
|
|
210
215
|
*
|
|
211
|
-
* - `SAME_CHAIN
|
|
212
|
-
* more arbiter addresses from the SDK's bundled allow-set
|
|
213
|
-
*
|
|
214
|
-
* `
|
|
215
|
-
*
|
|
216
|
+
* - `SAME_CHAIN` and `ACROSS` settle through Permit2: each maps to one or
|
|
217
|
+
* more arbiter addresses from the SDK's bundled allow-set. A smart account
|
|
218
|
+
* settles cross-chain through `ACROSS` and same-chain through
|
|
219
|
+
* `SAME_CHAIN_IE`, so a permit without `fallback` must name only `ACROSS`
|
|
220
|
+
* (or no layer).
|
|
221
|
+
* `ECO` is the retired Standard Eco arbiter and a permit naming it is
|
|
222
|
+
* refused: use `ECO_IE` instead.
|
|
216
223
|
* - `CCTP` (USDC), `OFT` (USDT0, with an optional `to.minAmount` floor),
|
|
217
224
|
* `ECO_IE` (Eco's solver network: the USD stablecoins the orchestrator
|
|
218
225
|
* serves for it), `SAME_CHAIN_IE` (a transfer, or a Rhinestone Swapper swap
|
|
@@ -288,9 +295,10 @@ type CrossChainSettlementLayer = 'SAME_CHAIN' | 'ECO' | 'ACROSS' | 'CCTP' | 'OFT
|
|
|
288
295
|
* A high-level permit that authorises a session key to move funds
|
|
289
296
|
* between two chains via Permit2 arbiter settlement. The SDK expands
|
|
290
297
|
* one `CrossChainPermit` into a {@link Permit2ClaimPolicy} (claim-side)
|
|
291
|
-
* plus
|
|
292
|
-
*
|
|
293
|
-
*
|
|
298
|
+
* plus a capped `approve(Permit2, amount)` per `from` token. The claim
|
|
299
|
+
* policy itself doesn't check amounts, and the cap bounds only what the
|
|
300
|
+
* session approves: an allowance the account already holds for Permit2 is
|
|
301
|
+
* not bounded by it.
|
|
294
302
|
*
|
|
295
303
|
* Resolved from {@link CrossChainPermissionInput} by the SDK; consumers
|
|
296
304
|
* normally set `SessionDefinition.crossChainPermits` with the input shape,
|
|
@@ -302,7 +310,7 @@ interface CrossChainPermit {
|
|
|
302
310
|
* Omit for no source-token restriction (any token on any chain may be
|
|
303
311
|
* pulled) — only the arbiter whitelist, deadline, and bridge-to-self
|
|
304
312
|
* flag then constrain the source side. On a Permit2-route permit,
|
|
305
|
-
* `maxAmount` requires `oneTimeUse
|
|
313
|
+
* `maxAmount` requires `oneTimeUse`, and a native token is refused.
|
|
306
314
|
*/
|
|
307
315
|
from?: {
|
|
308
316
|
chain: Chain;
|
|
@@ -337,24 +345,24 @@ interface CrossChainPermit {
|
|
|
337
345
|
recipientIsAccount?: boolean;
|
|
338
346
|
/**
|
|
339
347
|
* Settlement layers this session is permitted to use. Omit (or pass
|
|
340
|
-
* `[]`) for
|
|
341
|
-
* every arbiter in its bundled allow-set.
|
|
348
|
+
* `[]`) for `ACROSS`.
|
|
342
349
|
*
|
|
343
350
|
* `CCTP`, `OFT`, `ECO_IE`, `SAME_CHAIN_IE` and `LZ` are IntentExecutor layers: naming them scopes the
|
|
344
351
|
* session to those layers' calls instead, and `'all'` to every bridging one
|
|
345
352
|
* that can settle the permit (see {@link CrossChainSettlementLayer}).
|
|
346
353
|
*
|
|
347
|
-
* `
|
|
348
|
-
* `
|
|
354
|
+
* `ECO` is the retired Permit2 Eco arbiter: a permit naming it is refused,
|
|
355
|
+
* with or without `fallback`. Use `ECO_IE`.
|
|
349
356
|
*
|
|
350
357
|
* Intents signed with the session never offer the orchestrator a route the
|
|
351
358
|
* session would refuse. IntentExecutor layers restrict them to the layers
|
|
352
|
-
* the session kept
|
|
353
|
-
*
|
|
354
|
-
* `
|
|
355
|
-
*
|
|
356
|
-
* `settlementLayers
|
|
357
|
-
*
|
|
359
|
+
* the session kept, and a Permit2-layer permit that admits `ACROSS` to
|
|
360
|
+
* `ACROSS` (`SAME_CHAIN` takes no bridge, so it adds no filter). With
|
|
361
|
+
* `fallback` set, Permit2 layers instead exclude only the Permit2 arbiters
|
|
362
|
+
* the permit does not name (a permit without `ACROSS` sends
|
|
363
|
+
* `settlementLayers: { exclude: ['ACROSS'] }`), so other routes stay open.
|
|
364
|
+
* An intent's own `settlementLayers` can only narrow this, and one that
|
|
365
|
+
* leaves no layer throws.
|
|
358
366
|
*/
|
|
359
367
|
settlementLayers?: CrossChainSettlementLayer[] | 'all';
|
|
360
368
|
/**
|
|
@@ -365,34 +373,57 @@ interface CrossChainPermit {
|
|
|
365
373
|
*/
|
|
366
374
|
maxFeeBps?: number;
|
|
367
375
|
/**
|
|
368
|
-
*
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
*
|
|
376
|
+
* Also let the session pay the intent's app fee (and a user-paid protocol
|
|
377
|
+
* fee) to the orchestrator's fee collector, and approve and call its
|
|
378
|
+
* paymaster for unsponsored gas. Defaults to `false`: an intent that carries
|
|
379
|
+
* an app fee or a protocol fee taken from the `from` token does not settle,
|
|
380
|
+
* nor, on IntentExecutor layers, one with unsponsored gas. On a Permit2
|
|
381
|
+
* layer it also needs a `from` token on the session's chain, even with
|
|
382
|
+
* `fallback`, and cannot be combined with `preClaimOps: 'none'`.
|
|
372
383
|
*
|
|
373
|
-
* - Each fee call has its own cumulative 5 USD
|
|
374
|
-
*
|
|
375
|
-
*
|
|
376
|
-
*
|
|
384
|
+
* - Each fee call has its own cumulative cap of 5 USD (30 USD on Ethereum
|
|
385
|
+
* mainnet), not one per session: the collector transfer and the paymaster
|
|
386
|
+
* approve one per `from` token, the paymaster callback one shared across
|
|
387
|
+
* tokens. So one token can pay up to about twice the cap (app fee plus
|
|
388
|
+
* gas), and N tokens up to N times the cap of app fee.
|
|
377
389
|
* - Every `from` token on the session's chain must be one the orchestrator
|
|
378
|
-
* serves for these layers (USD stablecoins today)
|
|
390
|
+
* serves for these layers (USD stablecoins today) and lists in
|
|
391
|
+
* `settlement.usdStablecoins` with 6 or 18 decimals; the cap is scaled to
|
|
392
|
+
* them. All `from` tokens on the chain must have the same decimals.
|
|
379
393
|
* - The fee addresses come from the orchestrator's `GET /chains`, so create
|
|
380
394
|
* the session with `sdk.createSession`.
|
|
381
395
|
* - The orchestrator sizes the paymaster approve and callback at the refund
|
|
382
396
|
* ceiling (about 1.8x the gas estimate) and the fee transfer at the full
|
|
383
397
|
* fee. An intent whose ceiling or fee exceeds the remaining cap (e.g.
|
|
384
|
-
* Ethereum mainnet gas at high prices, an app fee over
|
|
398
|
+
* Ethereum mainnet gas at high prices, an app fee over the cap, or a reusable
|
|
385
399
|
* session that has used its budget) is refused: it fails closed.
|
|
386
400
|
*/
|
|
387
401
|
allowFees?: boolean;
|
|
402
|
+
/**
|
|
403
|
+
* Permit2 layers only: the claim may not carry pre-claim calls. This bounds
|
|
404
|
+
* a session without `oneTimeUse`, so it can be scoped and reusable. The
|
|
405
|
+
* session then settles only intents that need no pre-claim call: the
|
|
406
|
+
* account already holds enough Permit2 allowance for the `from` token, no
|
|
407
|
+
* fee is taken from it, and no native token is wrapped; one that needs a
|
|
408
|
+
* pre-claim call is refused before signing. Intents must list their
|
|
409
|
+
* `sourceChains`. It cannot be combined with `oneTimeUse`, whose burn is
|
|
410
|
+
* itself a pre-claim call, or with `allowFees`.
|
|
411
|
+
*
|
|
412
|
+
* The session must be enabled before its first intent, since an enable
|
|
413
|
+
* rides a pre-claim call: sign `account.getSessionDetails([session])` with
|
|
414
|
+
* `account.signEnableSession`, then send `enableSession` from
|
|
415
|
+
* `@rhinestone/sdk/actions/smart-sessions` as an owner-signed transaction.
|
|
416
|
+
*/
|
|
417
|
+
preClaimOps?: 'none';
|
|
388
418
|
}
|
|
389
419
|
interface FromLeg {
|
|
390
420
|
chain: Chain;
|
|
391
421
|
token: Address;
|
|
392
422
|
/**
|
|
393
423
|
* Cap on the amount the session may move from this leg. On a Permit2-route
|
|
394
|
-
* permit (`SAME_CHAIN`, `
|
|
395
|
-
* requires `oneTimeUse
|
|
424
|
+
* permit (`SAME_CHAIN`, `ACROSS`, or `settlementLayers` omitted) it
|
|
425
|
+
* requires `oneTimeUse`, and caps what the session approves to Permit2: an
|
|
426
|
+
* allowance the account already holds is not bounded by it.
|
|
396
427
|
*/
|
|
397
428
|
maxAmount?: bigint;
|
|
398
429
|
}
|
|
@@ -444,8 +475,8 @@ interface ToLeg {
|
|
|
444
475
|
* `SessionDefinition.crossChainPermits`; token fields are per-chain ERC-20
|
|
445
476
|
* addresses (v2 no longer accepts symbols) and the SDK resolves `Date`s to
|
|
446
477
|
* on-chain deadlines, then expands
|
|
447
|
-
* each entry into a {@link Permit2ClaimPolicy} (claim-side) plus
|
|
448
|
-
*
|
|
478
|
+
* each entry into a {@link Permit2ClaimPolicy} (claim-side) plus the capped
|
|
479
|
+
* Permit2 approve its settlement needs.
|
|
449
480
|
*/
|
|
450
481
|
interface CrossChainPermissionInput {
|
|
451
482
|
/**
|
|
@@ -453,13 +484,23 @@ interface CrossChainPermissionInput {
|
|
|
453
484
|
* or an array for multi-leg permits. Omit for no source-token
|
|
454
485
|
* restriction (any token on any chain may be pulled) — the arbiter
|
|
455
486
|
* whitelist, deadline, and bridge-to-self flag still apply.
|
|
487
|
+
*
|
|
488
|
+
* On a Permit2 layer, each `from` token on the session's chain gets the
|
|
489
|
+
* `approve(Permit2, amount)` its settlement needs, capped at the largest
|
|
490
|
+
* `maxAmount` of its legs (uncapped if any leg sets none). A Permit2-layer
|
|
491
|
+
* permit must name an ERC-20 `from` token on the session's chain unless the
|
|
492
|
+
* session sets `fallback`. A wrapped native `from` leg with a `maxAmount`
|
|
493
|
+
* also gets the wrapped native `deposit()`, its value capped at that amount,
|
|
494
|
+
* so native funds can be wrapped; the wrapped native address comes from
|
|
495
|
+
* the orchestrator's `GET /chains`, which `sdk.createSession` reads.
|
|
456
496
|
*/
|
|
457
497
|
from?: FromLeg | FromLeg[];
|
|
458
498
|
/**
|
|
459
499
|
* Destination chain + token (+ optional recipient pin). Pass a single
|
|
460
500
|
* leg or an array for fan-out destinations. Omit for no
|
|
461
501
|
* destination-token restriction; `recipientIsAccount` still constrains
|
|
462
|
-
* the recipient.
|
|
502
|
+
* the recipient. On a Permit2 layer without `fallback`, a native token is
|
|
503
|
+
* refused: name the wrapped native token.
|
|
463
504
|
*/
|
|
464
505
|
to?: ToLeg | ToLeg[];
|
|
465
506
|
/**
|
|
@@ -492,25 +533,24 @@ interface CrossChainPermissionInput {
|
|
|
492
533
|
allowRecipientNotAccount?: boolean;
|
|
493
534
|
/**
|
|
494
535
|
* Settlement layers this session is permitted to use. Omit (or pass
|
|
495
|
-
* `[]`)
|
|
496
|
-
* resolves to the union of every arbiter in its bundled allow-set. Pass
|
|
497
|
-
* a subset (e.g. `['ACROSS']`) to narrow.
|
|
536
|
+
* `[]`) for `ACROSS`. A permit without `fallback` may name only `ACROSS`.
|
|
498
537
|
*
|
|
499
538
|
* `CCTP`, `OFT`, `ECO_IE`, `SAME_CHAIN_IE` and `LZ` are IntentExecutor layers: naming them scopes the
|
|
500
539
|
* session to those layers' calls instead, and `'all'` to every bridging one
|
|
501
540
|
* that can settle the permit (see {@link CrossChainSettlementLayer}).
|
|
502
541
|
*
|
|
503
|
-
* `
|
|
504
|
-
* `
|
|
542
|
+
* `ECO` is the retired Permit2 Eco arbiter: a permit naming it is refused,
|
|
543
|
+
* with or without `fallback`. Use `ECO_IE`.
|
|
505
544
|
*
|
|
506
545
|
* Intents signed with the session never offer the orchestrator a route the
|
|
507
546
|
* session would refuse. IntentExecutor layers restrict them to the layers
|
|
508
|
-
* the session kept
|
|
509
|
-
*
|
|
510
|
-
* `
|
|
511
|
-
*
|
|
512
|
-
* `settlementLayers
|
|
513
|
-
*
|
|
547
|
+
* the session kept, and a Permit2-layer permit that admits `ACROSS` to
|
|
548
|
+
* `ACROSS` (`SAME_CHAIN` takes no bridge, so it adds no filter). With
|
|
549
|
+
* `fallback` set, Permit2 layers instead exclude only the Permit2 arbiters
|
|
550
|
+
* the permit does not name (a permit without `ACROSS` sends
|
|
551
|
+
* `settlementLayers: { exclude: ['ACROSS'] }`), so other routes stay open.
|
|
552
|
+
* An intent's own `settlementLayers` can only narrow this, and one that
|
|
553
|
+
* leaves no layer throws.
|
|
514
554
|
*/
|
|
515
555
|
settlementLayers?: CrossChainSettlementLayer[] | 'all';
|
|
516
556
|
/**
|
|
@@ -521,26 +561,48 @@ interface CrossChainPermissionInput {
|
|
|
521
561
|
*/
|
|
522
562
|
maxFeeBps?: number;
|
|
523
563
|
/**
|
|
524
|
-
*
|
|
525
|
-
*
|
|
526
|
-
*
|
|
527
|
-
*
|
|
564
|
+
* Also let the session pay the intent's app fee (and a user-paid protocol
|
|
565
|
+
* fee) to the orchestrator's fee collector, and approve and call its
|
|
566
|
+
* paymaster for unsponsored gas. Defaults to `false`: an intent that carries
|
|
567
|
+
* an app fee or a protocol fee taken from the `from` token does not settle,
|
|
568
|
+
* nor, on IntentExecutor layers, one with unsponsored gas. On a Permit2
|
|
569
|
+
* layer it also needs a `from` token on the session's chain, even with
|
|
570
|
+
* `fallback`, and cannot be combined with `preClaimOps: 'none'`.
|
|
528
571
|
*
|
|
529
|
-
* - Each fee call has its own cumulative 5 USD
|
|
530
|
-
*
|
|
531
|
-
*
|
|
532
|
-
*
|
|
572
|
+
* - Each fee call has its own cumulative cap of 5 USD (30 USD on Ethereum
|
|
573
|
+
* mainnet), not one per session: the collector transfer and the paymaster
|
|
574
|
+
* approve one per `from` token, the paymaster callback one shared across
|
|
575
|
+
* tokens. So one token can pay up to about twice the cap (app fee plus
|
|
576
|
+
* gas), and N tokens up to N times the cap of app fee.
|
|
533
577
|
* - Every `from` token on the session's chain must be one the orchestrator
|
|
534
|
-
* serves for these layers (USD stablecoins today)
|
|
578
|
+
* serves for these layers (USD stablecoins today) and lists in
|
|
579
|
+
* `settlement.usdStablecoins` with 6 or 18 decimals; the cap is scaled to
|
|
580
|
+
* them. All `from` tokens on the chain must have the same decimals.
|
|
535
581
|
* - The fee addresses come from the orchestrator's `GET /chains`, so create
|
|
536
582
|
* the session with `sdk.createSession`.
|
|
537
583
|
* - The orchestrator sizes the paymaster approve and callback at the refund
|
|
538
584
|
* ceiling (about 1.8x the gas estimate) and the fee transfer at the full
|
|
539
585
|
* fee. An intent whose ceiling or fee exceeds the remaining cap (e.g.
|
|
540
|
-
* Ethereum mainnet gas at high prices, an app fee over
|
|
586
|
+
* Ethereum mainnet gas at high prices, an app fee over the cap, or a reusable
|
|
541
587
|
* session that has used its budget) is refused: it fails closed.
|
|
542
588
|
*/
|
|
543
589
|
allowFees?: boolean;
|
|
590
|
+
/**
|
|
591
|
+
* Permit2 layers only: the claim may not carry pre-claim calls. This bounds
|
|
592
|
+
* a session without `oneTimeUse`, so it can be scoped and reusable. The
|
|
593
|
+
* session then settles only intents that need no pre-claim call: the
|
|
594
|
+
* account already holds enough Permit2 allowance for the `from` token, no
|
|
595
|
+
* fee is taken from it, and no native token is wrapped; one that needs a
|
|
596
|
+
* pre-claim call is refused before signing. Intents must list their
|
|
597
|
+
* `sourceChains`. It cannot be combined with `oneTimeUse`, whose burn is
|
|
598
|
+
* itself a pre-claim call, or with `allowFees`.
|
|
599
|
+
*
|
|
600
|
+
* The session must be enabled before its first intent, since an enable
|
|
601
|
+
* rides a pre-claim call: sign `account.getSessionDetails([session])` with
|
|
602
|
+
* `account.signEnableSession`, then send `enableSession` from
|
|
603
|
+
* `@rhinestone/sdk/actions/smart-sessions` as an owner-signed transaction.
|
|
604
|
+
*/
|
|
605
|
+
preClaimOps?: 'none';
|
|
544
606
|
}
|
|
545
607
|
type Policy = SudoPolicy | UniversalActionPolicy | ArgPolicy | SpendingLimitsPolicy | TimeFramePolicy | UsageLimitPolicy | ValueLimitPolicy | IntentExecutionPolicy;
|
|
546
608
|
/** @internal */
|
|
@@ -877,8 +939,8 @@ interface SessionDefinition<TAbis extends readonly Abi[] = readonly Abi[], TChai
|
|
|
877
939
|
chain: TChain;
|
|
878
940
|
/**
|
|
879
941
|
* Venue-scoped swap permissions. See {@link SwapScope}. Implies
|
|
880
|
-
* `restrictToActions`, and is mutually exclusive with
|
|
881
|
-
* `
|
|
942
|
+
* `restrictToActions`, and is mutually exclusive with `claimPolicies` and
|
|
943
|
+
* `fallback`.
|
|
882
944
|
*/
|
|
883
945
|
swap?: SwapScope<TChain['id']>;
|
|
884
946
|
owners: OwnerSet;
|
|
@@ -900,8 +962,9 @@ interface SessionDefinition<TAbis extends readonly Abi[] = readonly Abi[], TChai
|
|
|
900
962
|
claimPolicies?: readonly Permit2ClaimPolicy[];
|
|
901
963
|
/**
|
|
902
964
|
* Cross-chain permits expanded by the SDK into matching
|
|
903
|
-
* {@link Permit2ClaimPolicy} (claim-side) plus
|
|
904
|
-
*
|
|
965
|
+
* {@link Permit2ClaimPolicy} (claim-side) plus the scoped actions their
|
|
966
|
+
* settlement needs. A session holding one is scoped to those actions (see
|
|
967
|
+
* `fallback`).
|
|
905
968
|
* See {@link CrossChainPermissionInput}. A permit naming `CCTP`, `OFT`,
|
|
906
969
|
* `ECO_IE` or `LZ` needs `sdk.createSession`, which supplies the addresses
|
|
907
970
|
* it pins from the orchestrator's `GET /chains`. To see every refusal at
|
|
@@ -918,10 +981,34 @@ interface SessionDefinition<TAbis extends readonly Abi[] = readonly Abi[], TChai
|
|
|
918
981
|
* Drop the wildcard intent-execution fallback so the session's explicit
|
|
919
982
|
* permissions/actions are the ONLY ops it can run — any other (target,
|
|
920
983
|
* selector) reverts. Requires at least one permission or action, and is
|
|
921
|
-
* mutually exclusive with `
|
|
922
|
-
*
|
|
984
|
+
* mutually exclusive with `claimPolicies` (which rely on the fallback for
|
|
985
|
+
* their guardrails) and with `fallback`. A session with `crossChainPermits`
|
|
986
|
+
* is already scoped unless it sets `fallback`.
|
|
923
987
|
*/
|
|
924
988
|
restrictToActions?: boolean;
|
|
989
|
+
/**
|
|
990
|
+
* Add a wildcard action to a session holding a Permit2-layer
|
|
991
|
+
* `crossChainPermits` entry. Without it, such a session is scoped to the
|
|
992
|
+
* calls its settlement needs, and needs `oneTimeUse` or the permit's
|
|
993
|
+
* `preClaimOps: 'none'` (refused with `PERMIT2_ROUTE_NEEDS_BOUND`
|
|
994
|
+
* otherwise).
|
|
995
|
+
*
|
|
996
|
+
* - `'intentExecution'`: the session key may also make the calls
|
|
997
|
+
* Rhinestone's intent-execution policy admits, with the permit's
|
|
998
|
+
* `maxAmount` as a spending limit. That policy is set by Rhinestone and
|
|
999
|
+
* may admit more over time.
|
|
1000
|
+
* - `'sudo'`: the session key may call any contract, any function, with any
|
|
1001
|
+
* arguments and native value.
|
|
1002
|
+
*
|
|
1003
|
+
* Either one reports `access.kind: 'open'`, admits a permit without `from`,
|
|
1004
|
+
* one naming `SAME_CHAIN` or one with a native `to` token, and leaves
|
|
1005
|
+
* intents free to take routes other than `ACROSS` and to fund them from any
|
|
1006
|
+
* asset. A scoped session settles cross-chain intents only, and a
|
|
1007
|
+
* destination call or leftover sweep on the destination chain needs the
|
|
1008
|
+
* destination session to declare those actions or set a fallback. Refused with `FALLBACK_NOT_APPLICABLE` on a session
|
|
1009
|
+
* without a Permit2-layer permit, and with `restrictToActions` or `swap`.
|
|
1010
|
+
*/
|
|
1011
|
+
fallback?: 'intentExecution' | 'sudo';
|
|
925
1012
|
/**
|
|
926
1013
|
* Configure ERC-1271 signing. Omission is unrestricted for backwards
|
|
927
1014
|
* compatibility; use `disabled` to remove signing capability explicitly.
|
|
@@ -1025,12 +1112,12 @@ interface Session {
|
|
|
1025
1112
|
/** The venue scope this session was built from. Metadata only — it lets the
|
|
1026
1113
|
* SDK derive the matching quoter pin when transacting with the session. */
|
|
1027
1114
|
swap?: SwapScope;
|
|
1028
|
-
/** The layers the session's cross-chain permit
|
|
1029
|
-
*
|
|
1030
|
-
*
|
|
1031
|
-
*
|
|
1032
|
-
*
|
|
1033
|
-
* arbiters
|
|
1115
|
+
/** The layers the session's cross-chain permit settles through. For a
|
|
1116
|
+
* settlement-scoped permit, the IntentExecutor layers kept
|
|
1117
|
+
* (`SAME_CHAIN_IE` adds no bridge filter); for a scoped Permit2 permit,
|
|
1118
|
+
* `['ACROSS']`, which intents are limited to. With `fallback`, the Permit2 layers the permit lists
|
|
1119
|
+
* (absent when it lists none), and intents exclude only the Permit2
|
|
1120
|
+
* arbiters it does not name. Metadata only. */
|
|
1034
1121
|
settlementLayers?: readonly CrossChainSettlementLayer[];
|
|
1035
1122
|
/** The layers `settlementLayers: 'all'` left out of a settlement-scoped permit
|
|
1036
1123
|
* on the session's chain, each with the refusal that dropped it; the kept
|
|
@@ -1038,6 +1125,15 @@ interface Session {
|
|
|
1038
1125
|
* permission id. Absent on sessions without such a permit and on sessions
|
|
1039
1126
|
* stored before this field existed. */
|
|
1040
1127
|
settlementCoverage?: SettlementCoverage;
|
|
1128
|
+
/** A scoped Permit2-route session's `from` tokens per chain, each with the
|
|
1129
|
+
* largest `maxAmount` of its legs (none if one leg sets none). Intents
|
|
1130
|
+
* signed with the session take them as their source assets, capped at that
|
|
1131
|
+
* amount. Metadata only — it does not change the permission id. */
|
|
1132
|
+
permit2Sources?: readonly {
|
|
1133
|
+
readonly chain: Chain;
|
|
1134
|
+
readonly token: Address;
|
|
1135
|
+
readonly maxAmount?: bigint;
|
|
1136
|
+
}[];
|
|
1041
1137
|
/** Whether the session's key is held to its own actions (`'scoped'`) or keeps
|
|
1042
1138
|
* the wildcard fallback action (`'open'`), with a human-readable reason that
|
|
1043
1139
|
* is not a stable contract. Metadata only — it does not change the
|