@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.
@@ -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.3';
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 the orchestrator's quoters.jsonnet. A chain is
19
- * listed only when the router is whitelisted in `IntentExecutionPolicy`, since a
20
- * quoter enabled without a whitelisted target produces quotes that revert.
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
- * TychoRouter `singleSwap`, the entrypoint fynd's encoded quotes call.
25
+ * TychoRouterV3 `singleSwap`, the entrypoint fynd's encoded quotes call.
25
26
  *
26
- * Only the argument TYPES determine the selector and the head layout, and those
27
- * are pinned by {@link FYND_SWAP_SELECTOR}'s assertion in the test suite. The
28
- * NAMES of the first five are corroborated by observed fynd calldata; the
29
- * trailing tuple's component names are our own labels and carry no guarantee —
30
- * we never address them, since a tuple containing `bytes` is dynamic and sits
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: "permit";
56
+ readonly name: "clientFeeParams";
54
57
  readonly type: "tuple";
55
58
  readonly components: readonly [{
56
- readonly name: "nonce";
57
- readonly type: "uint16";
59
+ readonly name: "clientFeeBps";
60
+ readonly type: "uint32";
58
61
  }, {
59
- readonly name: "token";
62
+ readonly name: "clientFeeReceiver";
60
63
  readonly type: "address";
61
64
  }, {
62
- readonly name: "amount";
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: "signature";
71
+ readonly name: "clientSignature";
69
72
  readonly type: "bytes";
70
73
  }];
71
74
  }, {
72
- readonly name: "swap";
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;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAQrD,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BH,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"}
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 the orchestrator's quoters.jsonnet. A chain is
18
- * listed only when the router is whitelisted in `IntentExecutionPolicy`, since a
19
- * quoter enabled without a whitelisted target produces quotes that revert.
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: '0xda892c989d07a18b5dd3f392d949f00df15c5736',
23
- 56: '0x99748cbd931cb367dad265c5b2b4bd306d448e99',
24
- 130: '0x764bc67b1036b00bc91221e988261f971a1c7ce4',
25
- 137: '0x7cb3e87095f6cf95982dc6f57445171a6d3b511c',
26
- 8453: '0x2d3524b9b5dae34b646614eebb1e038d403e4cac',
27
- 9745: '0x8f9b3b0451efff0ae8100428aee35fa3cbc0b769',
28
- 42161: '0xc1f838a5382bbb5729a0801c8ba73dfc861c4d34',
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
- * TychoRouter `singleSwap`, the entrypoint fynd's encoded quotes call.
32
+ * TychoRouterV3 `singleSwap`, the entrypoint fynd's encoded quotes call.
32
33
  *
33
- * Only the argument TYPES determine the selector and the head layout, and those
34
- * are pinned by {@link FYND_SWAP_SELECTOR}'s assertion in the test suite. The
35
- * NAMES of the first five are corroborated by observed fynd calldata; the
36
- * trailing tuple's component names are our own labels and carry no guarantee —
37
- * we never address them, since a tuple containing `bytes` is dynamic and sits
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: 'permit',
53
+ name: 'clientFeeParams',
53
54
  type: 'tuple',
54
55
  components: [
55
- { name: 'nonce', type: 'uint16' },
56
- { name: 'token', type: 'address' },
57
- { name: 'amount', type: 'uint256' },
56
+ { name: 'clientFeeBps', type: 'uint32' },
57
+ { name: 'clientFeeReceiver', type: 'address' },
58
+ { name: 'maxClientContribution', type: 'uint256' },
58
59
  { name: 'deadline', type: 'uint256' },
59
- { name: 'signature', type: 'bytes' },
60
+ { name: 'clientSignature', type: 'bytes' },
60
61
  ],
61
62
  },
62
- { name: 'swap', type: 'bytes' },
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: `swap(amountIn, tokenIn, tokenOut, minOut, receiver)`.
150
- * Verified against production calldata — the receiver is the Swapper itself,
151
- * which collects the output and forwards it to the scope's recipient, so that
152
- * is what gets pinned rather than the end recipient.
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 = 836n;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rhinestone/sdk",
3
- "version": "2.16.3",
3
+ "version": "2.16.4",
4
4
  "description": "Smart wallets and multichain transactions for your application",
5
5
  "author": {
6
6
  "name": "Rhinestone",