@rhinestone/sdk 2.16.3 → 2.16.4
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/clients/orchestrator/client.js +1 -1
- package/dist/src/modules/validators/smart-sessions/swap/fynd.d.ts +21 -18
- package/dist/src/modules/validators/smart-sessions/swap/fynd.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions/swap/fynd.js +25 -24
- package/dist/src/modules/validators/smart-sessions/swap/rhinestone.js +7 -7
- package/package.json +1 -1
|
@@ -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 = '2.16.
|
|
6
|
+
const SDK_VERSION = '2.16.4';
|
|
7
7
|
const API_VERSION = '2026-04.blanc';
|
|
8
8
|
export function createOrchestratorClient(options) {
|
|
9
9
|
const fetchPort = options.fetch ?? globalThis.fetch;
|
|
@@ -13,22 +13,22 @@ import type { VenueContext, VenueScoping } from './rules.js';
|
|
|
13
13
|
export declare const FYND_CHAIN_IDS: readonly [1, 56, 130, 137, 8453, 9745, 42161];
|
|
14
14
|
export type FyndChainId = (typeof FYND_CHAIN_IDS)[number];
|
|
15
15
|
/**
|
|
16
|
-
* TychoRouter per chain — the contract fynd's encoded fills target.
|
|
16
|
+
* TychoRouter V3 per chain — the contract fynd's encoded fills target.
|
|
17
17
|
*
|
|
18
|
-
* Mirrors `fynd.routers` in
|
|
19
|
-
* listed only when the router is
|
|
20
|
-
*
|
|
18
|
+
* Mirrors the first router of each chain's `fynd.routers` in yeet's
|
|
19
|
+
* `config/quoters.jsonnet`. A chain is listed only when the router is
|
|
20
|
+
* whitelisted in `IntentExecutionPolicy`, since a quoter enabled without a
|
|
21
|
+
* whitelisted target produces quotes that revert.
|
|
21
22
|
*/
|
|
22
23
|
export declare const FYND_ROUTERS: Record<FyndChainId, Address>;
|
|
23
24
|
/**
|
|
24
|
-
*
|
|
25
|
+
* TychoRouterV3 `singleSwap`, the entrypoint fynd's encoded quotes call.
|
|
25
26
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* behind a pointer.
|
|
27
|
+
* Names are upstream's (`TychoRouterV3.sol` and its `ClientFeeParams` struct,
|
|
28
|
+
* propeller-heads/tycho at tag 0.387.0); the types are pinned by
|
|
29
|
+
* {@link FYND_SWAP_SELECTOR}'s assertion in the test suite. We never address
|
|
30
|
+
* `clientFeeParams`: a tuple containing `bytes` is dynamic and sits behind a
|
|
31
|
+
* pointer.
|
|
32
32
|
*/
|
|
33
33
|
export declare const tychoRouterAbi: readonly [{
|
|
34
34
|
readonly type: "function";
|
|
@@ -43,6 +43,9 @@ export declare const tychoRouterAbi: readonly [{
|
|
|
43
43
|
}, {
|
|
44
44
|
readonly name: "tokenOut";
|
|
45
45
|
readonly type: "address";
|
|
46
|
+
}, {
|
|
47
|
+
readonly name: "expectedAmountOut";
|
|
48
|
+
readonly type: "uint256";
|
|
46
49
|
}, {
|
|
47
50
|
readonly name: "minAmountOut";
|
|
48
51
|
readonly type: "uint256";
|
|
@@ -50,26 +53,26 @@ export declare const tychoRouterAbi: readonly [{
|
|
|
50
53
|
readonly name: "receiver";
|
|
51
54
|
readonly type: "address";
|
|
52
55
|
}, {
|
|
53
|
-
readonly name: "
|
|
56
|
+
readonly name: "clientFeeParams";
|
|
54
57
|
readonly type: "tuple";
|
|
55
58
|
readonly components: readonly [{
|
|
56
|
-
readonly name: "
|
|
57
|
-
readonly type: "
|
|
59
|
+
readonly name: "clientFeeBps";
|
|
60
|
+
readonly type: "uint32";
|
|
58
61
|
}, {
|
|
59
|
-
readonly name: "
|
|
62
|
+
readonly name: "clientFeeReceiver";
|
|
60
63
|
readonly type: "address";
|
|
61
64
|
}, {
|
|
62
|
-
readonly name: "
|
|
65
|
+
readonly name: "maxClientContribution";
|
|
63
66
|
readonly type: "uint256";
|
|
64
67
|
}, {
|
|
65
68
|
readonly name: "deadline";
|
|
66
69
|
readonly type: "uint256";
|
|
67
70
|
}, {
|
|
68
|
-
readonly name: "
|
|
71
|
+
readonly name: "clientSignature";
|
|
69
72
|
readonly type: "bytes";
|
|
70
73
|
}];
|
|
71
74
|
}, {
|
|
72
|
-
readonly name: "
|
|
75
|
+
readonly name: "swapData";
|
|
73
76
|
readonly type: "bytes";
|
|
74
77
|
}];
|
|
75
78
|
readonly outputs: readonly [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fynd.d.ts","sourceRoot":"","sources":["../../../../../../modules/validators/smart-sessions/swap/fynd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,OAAO,EAAsB,MAAM,MAAM,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAkC,MAAM,UAAU,CAAA;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAQzD;;;;;;;GAOG;AAEH,uDAAuD;AACvD,eAAO,MAAM,cAAc,+CAAgD,CAAA;AAE3E,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAEzD
|
|
1
|
+
{"version":3,"file":"fynd.d.ts","sourceRoot":"","sources":["../../../../../../modules/validators/smart-sessions/swap/fynd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,OAAO,EAAsB,MAAM,MAAM,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAkC,MAAM,UAAU,CAAA;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAQzD;;;;;;;GAOG;AAEH,uDAAuD;AACvD,eAAO,MAAM,cAAc,+CAAgD,CAAA;AAE3E,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAEzD;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAQrD,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BH,CAAA;AAExB,eAAO,MAAM,kBAAkB,eAAwC,CAAA;AAQvE;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,SAAS,CAKnE;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CA2BzD"}
|
|
@@ -12,30 +12,30 @@ import { cumulativeCap, pin, sellPinsGoInAlternatives, swapAction, } from './rul
|
|
|
12
12
|
/** Chains with a deployed, whitelisted TychoRouter. */
|
|
13
13
|
export const FYND_CHAIN_IDS = [1, 56, 130, 137, 8453, 9745, 42161];
|
|
14
14
|
/**
|
|
15
|
-
* TychoRouter per chain — the contract fynd's encoded fills target.
|
|
15
|
+
* TychoRouter V3 per chain — the contract fynd's encoded fills target.
|
|
16
16
|
*
|
|
17
|
-
* Mirrors `fynd.routers` in
|
|
18
|
-
* listed only when the router is
|
|
19
|
-
*
|
|
17
|
+
* Mirrors the first router of each chain's `fynd.routers` in yeet's
|
|
18
|
+
* `config/quoters.jsonnet`. A chain is listed only when the router is
|
|
19
|
+
* whitelisted in `IntentExecutionPolicy`, since a quoter enabled without a
|
|
20
|
+
* whitelisted target produces quotes that revert.
|
|
20
21
|
*/
|
|
21
22
|
export const FYND_ROUTERS = {
|
|
22
|
-
1: '
|
|
23
|
-
56: '
|
|
24
|
-
130: '
|
|
25
|
-
137: '
|
|
26
|
-
8453: '
|
|
27
|
-
9745: '
|
|
28
|
-
42161: '
|
|
23
|
+
1: '0x1644d2477f809cc2c71bccfd6dc9497e3f83210d',
|
|
24
|
+
56: '0x7f3d12bbafb8955e51b3ab9588b34c8ad95bda4e',
|
|
25
|
+
130: '0xcba5574597ad00ea250fd106dab4fc7461949635',
|
|
26
|
+
137: '0xbd4e6011f03355c2a377fd9af939322a7d0a1bc1',
|
|
27
|
+
8453: '0xaba5b53b03eafad1c5fc8bd5fc765fc85bb3de67',
|
|
28
|
+
9745: '0x0953c7e23b44259e5e5630e9b97c31d7278c4c85',
|
|
29
|
+
42161: '0x924f147c50ea59f5180a26031a8b65b2aa1e81cd',
|
|
29
30
|
};
|
|
30
31
|
/**
|
|
31
|
-
*
|
|
32
|
+
* TychoRouterV3 `singleSwap`, the entrypoint fynd's encoded quotes call.
|
|
32
33
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* behind a pointer.
|
|
34
|
+
* Names are upstream's (`TychoRouterV3.sol` and its `ClientFeeParams` struct,
|
|
35
|
+
* propeller-heads/tycho at tag 0.387.0); the types are pinned by
|
|
36
|
+
* {@link FYND_SWAP_SELECTOR}'s assertion in the test suite. We never address
|
|
37
|
+
* `clientFeeParams`: a tuple containing `bytes` is dynamic and sits behind a
|
|
38
|
+
* pointer.
|
|
39
39
|
*/
|
|
40
40
|
export const tychoRouterAbi = [
|
|
41
41
|
{
|
|
@@ -46,20 +46,21 @@ export const tychoRouterAbi = [
|
|
|
46
46
|
{ name: 'amountIn', type: 'uint256' },
|
|
47
47
|
{ name: 'tokenIn', type: 'address' },
|
|
48
48
|
{ name: 'tokenOut', type: 'address' },
|
|
49
|
+
{ name: 'expectedAmountOut', type: 'uint256' },
|
|
49
50
|
{ name: 'minAmountOut', type: 'uint256' },
|
|
50
51
|
{ name: 'receiver', type: 'address' },
|
|
51
52
|
{
|
|
52
|
-
name: '
|
|
53
|
+
name: 'clientFeeParams',
|
|
53
54
|
type: 'tuple',
|
|
54
55
|
components: [
|
|
55
|
-
{ name: '
|
|
56
|
-
{ name: '
|
|
57
|
-
{ name: '
|
|
56
|
+
{ name: 'clientFeeBps', type: 'uint32' },
|
|
57
|
+
{ name: 'clientFeeReceiver', type: 'address' },
|
|
58
|
+
{ name: 'maxClientContribution', type: 'uint256' },
|
|
58
59
|
{ name: 'deadline', type: 'uint256' },
|
|
59
|
-
{ name: '
|
|
60
|
+
{ name: 'clientSignature', type: 'bytes' },
|
|
60
61
|
],
|
|
61
62
|
},
|
|
62
|
-
{ name: '
|
|
63
|
+
{ name: 'swapData', type: 'bytes' },
|
|
63
64
|
],
|
|
64
65
|
outputs: [{ name: 'amountOut', type: 'uint256' }],
|
|
65
66
|
},
|
|
@@ -123,8 +123,7 @@ export function swapperAddresses(environment) {
|
|
|
123
123
|
* pointer, the length, and each element pointer fixes every position, making the
|
|
124
124
|
* target offsets exact.
|
|
125
125
|
*
|
|
126
|
-
* Derived from live Plasma calldata and reproduced by
|
|
127
|
-
* `zeroExRouteRules` in the test suite:
|
|
126
|
+
* Derived from live Plasma calldata and reproduced by `offsets.test.ts`:
|
|
128
127
|
* @224 array pointer = 256 (tail begins right after the head)
|
|
129
128
|
* @256 length = 2 (approve + aggregator call)
|
|
130
129
|
* @288 elem[0] pointer= 64 (element table is 2 words)
|
|
@@ -146,14 +145,15 @@ const CALLS_ELEM0_VALUE_OFFSET = 384n;
|
|
|
146
145
|
const CALLS_ELEM1_VALUE_OFFSET = 608n;
|
|
147
146
|
const NESTED_EXEC_TOKEN_OFFSET = 740n;
|
|
148
147
|
/**
|
|
149
|
-
* The nested fynd call: `
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* is what gets pinned rather than the end
|
|
148
|
+
* The nested fynd call: `singleSwap(amountIn, tokenIn, tokenOut,
|
|
149
|
+
* expectedAmountOut, minAmountOut, receiver, ...)`, its head starting at 708.
|
|
150
|
+
* The receiver is the Swapper itself, which collects the output and forwards
|
|
151
|
+
* it to the scope's recipient, so that is what gets pinned rather than the end
|
|
152
|
+
* recipient.
|
|
153
153
|
*/
|
|
154
154
|
const NESTED_FYND_TOKEN_IN_OFFSET = 740n;
|
|
155
155
|
const NESTED_FYND_TOKEN_OUT_OFFSET = 772n;
|
|
156
|
-
const NESTED_FYND_RECEIVER_OFFSET =
|
|
156
|
+
const NESTED_FYND_RECEIVER_OFFSET = 868n;
|
|
157
157
|
const CALLS_ELEM1_DATA_POINTER_OFFSET = 640n;
|
|
158
158
|
/** Head words of the `AllowanceHolder.exec` nested in `calls[1].data`. */
|
|
159
159
|
const NESTED_EXEC_OPERATOR_OFFSET = 708n;
|