@gearbox-protocol/sdk 17.1.0-next.1 → 17.1.0-next.3

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.
Files changed (84) hide show
  1. package/dist/cjs/onchain/MultichainSDK.js +2 -27
  2. package/dist/cjs/onchain/OnchainSDK.js +5 -6
  3. package/dist/cjs/onchain/accounts/intents/borrow.js +47 -20
  4. package/dist/cjs/onchain/accounts/intents/guards.js +6 -4
  5. package/dist/cjs/onchain/accounts/intents/index.js +40 -9
  6. package/dist/cjs/onchain/accounts/intents/math.js +4 -10
  7. package/dist/cjs/onchain/accounts/intents/open-strategy.js +49 -17
  8. package/dist/cjs/onchain/accounts/intents/plan.js +8 -1
  9. package/dist/cjs/onchain/accounts/intents/realize.js +55 -24
  10. package/dist/cjs/onchain/index.js +0 -5
  11. package/dist/cjs/onchain/market/credit/CreditSuite.js +6 -5
  12. package/dist/cjs/onchain/market/index.js +0 -5
  13. package/dist/cjs/onchain/market/pricefeeds/feeds/RedstonePriceFeed.js +1 -7
  14. package/dist/cjs/onchain/market/pricefeeds/index.js +0 -5
  15. package/dist/cjs/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.js +5 -5
  16. package/dist/cjs/onchain/market/pricefeeds/updates/index.js +0 -5
  17. package/dist/cjs/onchain/options.js +1 -7
  18. package/dist/cjs/permissionless/index.js +1 -5
  19. package/dist/cjs/permissionless/utils/index.js +1 -5
  20. package/dist/cjs/permissionless/utils/price-update/get-price-update-tx.js +5 -0
  21. package/dist/cjs/permissionless/utils/price-update/get-updatable-feeds.js +6 -4
  22. package/dist/cjs/permissionless/utils/price-update/index.js +1 -5
  23. package/dist/cjs/sdk/prepare/PrepareApi.js +83 -32
  24. package/dist/esm/onchain/MultichainSDK.js +2 -27
  25. package/dist/esm/onchain/OnchainSDK.js +5 -6
  26. package/dist/esm/onchain/accounts/intents/borrow.js +47 -20
  27. package/dist/esm/onchain/accounts/intents/guards.js +6 -4
  28. package/dist/esm/onchain/accounts/intents/index.js +40 -9
  29. package/dist/esm/onchain/accounts/intents/math.js +5 -10
  30. package/dist/esm/onchain/accounts/intents/open-strategy.js +49 -17
  31. package/dist/esm/onchain/accounts/intents/plan.js +8 -1
  32. package/dist/esm/onchain/accounts/intents/realize.js +55 -24
  33. package/dist/esm/onchain/index.js +1 -3
  34. package/dist/esm/onchain/market/credit/CreditSuite.js +6 -5
  35. package/dist/esm/onchain/market/index.js +1 -3
  36. package/dist/esm/onchain/market/pricefeeds/feeds/RedstonePriceFeed.js +1 -7
  37. package/dist/esm/onchain/market/pricefeeds/index.js +1 -3
  38. package/dist/esm/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.js +5 -5
  39. package/dist/esm/onchain/market/pricefeeds/updates/index.js +1 -3
  40. package/dist/esm/onchain/options.js +1 -7
  41. package/dist/esm/permissionless/index.js +2 -3
  42. package/dist/esm/permissionless/utils/index.js +2 -3
  43. package/dist/esm/permissionless/utils/price-update/get-price-update-tx.js +5 -0
  44. package/dist/esm/permissionless/utils/price-update/get-updatable-feeds.js +6 -4
  45. package/dist/esm/permissionless/utils/price-update/index.js +2 -3
  46. package/dist/esm/sdk/prepare/PrepareApi.js +83 -32
  47. package/dist/types/onchain/MultichainSDK.d.ts +0 -10
  48. package/dist/types/onchain/OnchainSDK.d.ts +0 -10
  49. package/dist/types/onchain/accounts/index.d.ts +2 -2
  50. package/dist/types/onchain/accounts/intents/borrow.d.ts +5 -0
  51. package/dist/types/onchain/accounts/intents/guards.d.ts +6 -4
  52. package/dist/types/onchain/accounts/intents/index.d.ts +4 -4
  53. package/dist/types/onchain/accounts/intents/math.d.ts +2 -9
  54. package/dist/types/onchain/accounts/intents/open-strategy.d.ts +5 -0
  55. package/dist/types/onchain/accounts/intents/realize.d.ts +5 -0
  56. package/dist/types/onchain/accounts/intents/types.d.ts +49 -6
  57. package/dist/types/onchain/index.d.ts +4 -6
  58. package/dist/types/onchain/market/credit/CreditSuite.d.ts +10 -0
  59. package/dist/types/onchain/market/index.d.ts +3 -5
  60. package/dist/types/onchain/market/pricefeeds/feeds/RedstonePriceFeed.d.ts +1 -4
  61. package/dist/types/onchain/market/pricefeeds/index.d.ts +3 -5
  62. package/dist/types/onchain/market/pricefeeds/updates/UpdatablePriceFeedRegistry.d.ts +4 -4
  63. package/dist/types/onchain/market/pricefeeds/updates/index.d.ts +3 -5
  64. package/dist/types/onchain/market/pricefeeds/updates/types.d.ts +2 -16
  65. package/dist/types/onchain/options.d.ts +0 -7
  66. package/dist/types/permissionless/index.d.ts +2 -3
  67. package/dist/types/permissionless/utils/index.d.ts +2 -3
  68. package/dist/types/permissionless/utils/price-update/get-price-update-tx.d.ts +5 -0
  69. package/dist/types/permissionless/utils/price-update/get-updatable-feeds.d.ts +9 -3
  70. package/dist/types/permissionless/utils/price-update/index.d.ts +2 -3
  71. package/dist/types/sdk/index.d.ts +2 -2
  72. package/dist/types/sdk/prepare/PrepareApi.d.ts +16 -14
  73. package/dist/types/sdk/prepare/index.d.ts +2 -2
  74. package/dist/types/sdk/prepare/types.d.ts +21 -14
  75. package/package.json +1 -5
  76. package/dist/cjs/onchain/market/pricefeeds/updates/RedstoneUpdater.js +0 -193
  77. package/dist/cjs/onchain/market/pricefeeds/updates/fetchRedstonePayloads.js +0 -95
  78. package/dist/cjs/permissionless/utils/price-update/get-price-feeds.js +0 -60
  79. package/dist/esm/onchain/market/pricefeeds/updates/RedstoneUpdater.js +0 -191
  80. package/dist/esm/onchain/market/pricefeeds/updates/fetchRedstonePayloads.js +0 -94
  81. package/dist/esm/permissionless/utils/price-update/get-price-feeds.js +0 -57
  82. package/dist/types/onchain/market/pricefeeds/updates/RedstoneUpdater.d.ts +0 -37
  83. package/dist/types/onchain/market/pricefeeds/updates/fetchRedstonePayloads.d.ts +0 -62
  84. package/dist/types/permissionless/utils/price-update/get-price-feeds.d.ts +0 -22
@@ -50,48 +50,53 @@ var PrepareApi = class extends MultichainConstruct {
50
50
  * {@inheritDoc IOpportunitiesPrepare.finalize}
51
51
  **/
52
52
  async finalize(position, params) {
53
+ const state = {};
53
54
  try {
54
55
  const sdk = await this.#chain(position.chainId);
55
56
  const at = stateBlock(sdk);
56
57
  const intent = resumable(params.intent ?? params.claimable.intent);
57
- if (!intent) return sdkErr(noRecordedIntent());
58
+ if (!intent) return refused(noRecordedIntent(), state);
58
59
  const creditAccount = await slice$1(sdk, position.creditAccount);
59
- if (!creditAccount) return sdkErr(creditAccountNotFound(position.creditAccount));
60
+ if (!creditAccount) return refused(creditAccountNotFound(position.creditAccount), state);
60
61
  return finalized(await service(sdk).finishIntent({
61
62
  intent,
62
63
  claimable: toClaimableWithdrawal(params.claimable),
63
64
  creditAccount,
64
65
  sdk,
65
66
  slippage: params.slippage,
66
- quotaReserve: params.quotaReserve
67
+ quotaReserve: params.quotaReserve,
68
+ draft: state
67
69
  }), at);
68
70
  } catch (e) {
69
- return sdkErr(unexpectedFailure(e));
71
+ return refused(unexpectedFailure(e), state);
70
72
  }
71
73
  }
72
74
  /**
73
75
  * {@inheritDoc IOpportunitiesPrepare.deposit}
74
76
  **/
75
77
  async deposit(pool, params) {
78
+ const draft = {};
76
79
  try {
77
80
  const chain = await this.#chain(pool.chainId);
78
81
  const { marketRegister, pools } = chain;
82
+ draft.curator = marketRegister.findByPool(pool.pool).curator;
79
83
  const tokenIn = params.tokenIn ?? marketRegister.findByPool(pool.pool).pool.underlying;
80
84
  const tokenOut = lpRoute(params.tokenOut, () => pools.getDepositTokensOut(pool.pool, tokenIn));
81
- if (!tokenOut) return unroutable(chain, tokenIn, void 0);
85
+ if (!tokenOut) return unroutable(chain, tokenIn, void 0, draft);
82
86
  const state = pools.simulateDeposit({
83
87
  pool: pool.pool,
84
88
  amount: params.amount,
85
89
  tokenIn,
86
90
  tokenOut
87
91
  });
92
+ Object.assign(draft, state);
88
93
  const [refusal] = checkPoolOperation({
89
94
  sdk: chain,
90
95
  pool: pool.pool,
91
96
  isDeposit: true,
92
97
  tokenOut: state.tokenOut
93
98
  });
94
- if (refusal) return sdkErr(refusal);
99
+ if (refusal) return refused(refusal, draft);
95
100
  const call = pools.addLiquidity({
96
101
  collateral: {
97
102
  token: state.tokenIn.token.address,
@@ -101,7 +106,7 @@ var PrepareApi = class extends MultichainConstruct {
101
106
  wallet: params.wallet,
102
107
  meta: pools.getDepositMetadata(pool.pool, tokenIn, tokenOut)
103
108
  });
104
- if (!call) return unroutable(chain, tokenIn, tokenOut);
109
+ if (!call) return unroutable(chain, tokenIn, tokenOut, draft);
105
110
  return sdkOk({
106
111
  operations: [],
107
112
  state: await lpState(chain, pool.pool, params.wallet, state, { mints: state.tokenOut.value }),
@@ -109,32 +114,35 @@ var PrepareApi = class extends MultichainConstruct {
109
114
  ...stateBlock(chain)
110
115
  });
111
116
  } catch (e) {
112
- return sdkErr(unexpectedFailure(e));
117
+ return refused(unexpectedFailure(e), draft);
113
118
  }
114
119
  }
115
120
  /**
116
121
  * {@inheritDoc IOpportunitiesPrepare.withdraw}
117
122
  **/
118
123
  async withdraw(pool, params) {
124
+ const draft = {};
119
125
  try {
120
126
  const chain = await this.#chain(pool.chainId);
121
127
  const { pools } = chain;
128
+ draft.curator = chain.marketRegister.findByPool(pool.pool).curator;
122
129
  const tokenIn = params.tokenIn ?? pool.pool;
123
130
  const tokenOut = lpRoute(params.tokenOut, () => pools.getWithdrawalTokensOut(pool.pool, tokenIn));
124
- if (!tokenOut) return unroutable(chain, tokenIn, void 0);
131
+ if (!tokenOut) return unroutable(chain, tokenIn, void 0, draft);
125
132
  const state = pools.simulateWithdraw({
126
133
  pool: pool.pool,
127
134
  amount: params.amount,
128
135
  tokenIn,
129
136
  tokenOut
130
137
  });
138
+ Object.assign(draft, state);
131
139
  const [refusal] = checkPoolOperation({
132
140
  sdk: chain,
133
141
  pool: pool.pool,
134
142
  isDeposit: false,
135
143
  tokenOut: state.tokenOut
136
144
  });
137
- if (refusal) return sdkErr(refusal);
145
+ if (refusal) return refused(refusal, draft);
138
146
  const { calls } = pools.removeLiquidity({
139
147
  pool: pool.pool,
140
148
  amount: params.amount,
@@ -150,32 +158,35 @@ var PrepareApi = class extends MultichainConstruct {
150
158
  ...stateBlock(chain)
151
159
  });
152
160
  } catch (e) {
153
- return sdkErr(unexpectedFailure(e));
161
+ return refused(unexpectedFailure(e), draft);
154
162
  }
155
163
  }
156
164
  /**
157
165
  * {@inheritDoc IOpportunitiesPrepare.redeem}
158
166
  **/
159
167
  async redeem(pool, params) {
168
+ const draft = {};
160
169
  try {
161
170
  const chain = await this.#chain(pool.chainId);
162
171
  const { pools } = chain;
172
+ draft.curator = chain.marketRegister.findByPool(pool.pool).curator;
163
173
  const tokenIn = params.tokenIn ?? pool.pool;
164
174
  const tokenOut = lpRoute(params.tokenOut, () => pools.getWithdrawalTokensOut(pool.pool, tokenIn));
165
- if (!tokenOut) return unroutable(chain, tokenIn, void 0);
175
+ if (!tokenOut) return unroutable(chain, tokenIn, void 0, draft);
166
176
  const state = pools.simulateRedeem({
167
177
  pool: pool.pool,
168
178
  amount: params.amount,
169
179
  tokenIn,
170
180
  tokenOut
171
181
  });
182
+ Object.assign(draft, state);
172
183
  const [refusal] = checkPoolOperation({
173
184
  sdk: chain,
174
185
  pool: pool.pool,
175
186
  isDeposit: false,
176
187
  tokenOut: state.tokenOut
177
188
  });
178
- if (refusal) return sdkErr(refusal);
189
+ if (refusal) return refused(refusal, draft);
179
190
  const { calls } = pools.removeLiquidity({
180
191
  pool: pool.pool,
181
192
  amount: params.amount,
@@ -191,7 +202,7 @@ var PrepareApi = class extends MultichainConstruct {
191
202
  ...stateBlock(chain)
192
203
  });
193
204
  } catch (e) {
194
- return sdkErr(unexpectedFailure(e));
205
+ return refused(unexpectedFailure(e), draft);
195
206
  }
196
207
  }
197
208
  /**
@@ -214,13 +225,15 @@ var PrepareApi = class extends MultichainConstruct {
214
225
  * {@inheritDoc IOpportunitiesPrepare.openNewStrategy}
215
226
  **/
216
227
  async openNewStrategy(strategy, params) {
228
+ const state = {};
217
229
  try {
218
230
  const sdk = await this.#chain(strategy.chainId);
219
231
  const at = stateBlock(sdk);
232
+ Object.assign(state, marketOf(sdk, strategy.creditManager));
220
233
  const targetToken = params.targetToken ?? sdk.marketRegister.findCreditManager(strategy.creditManager).strategyTargetCollateral;
221
- if (!targetToken) return sdkErr(noStrategyTargetCollateral(strategy.creditManager));
234
+ if (!targetToken) return refused(noStrategyTargetCollateral(strategy.creditManager), state);
222
235
  const reused = await reusable(sdk, strategy, params.creditAccount);
223
- if (reused && "error" in reused) return reused;
236
+ if (reused && "error" in reused) return refused(reused.error, state);
224
237
  const creditAccount = reused?.account;
225
238
  return opened(await service(sdk).openStrategyIntent({
226
239
  sdk,
@@ -231,21 +244,24 @@ var PrepareApi = class extends MultichainConstruct {
231
244
  leftoverBalances: params.leftoverBalances,
232
245
  slippage: params.slippage,
233
246
  quotaReserve: params.quotaReserve,
234
- creditAccount
247
+ creditAccount,
248
+ draft: state
235
249
  }), at);
236
250
  } catch (e) {
237
- return sdkErr(unexpectedFailure(e));
251
+ return refused(unexpectedFailure(e), state);
238
252
  }
239
253
  }
240
254
  /**
241
255
  * {@inheritDoc IOpportunitiesPrepare.borrow}
242
256
  **/
243
257
  async borrow(strategy, params) {
258
+ const state = {};
244
259
  try {
245
260
  const sdk = await this.#chain(strategy.chainId);
246
261
  const at = stateBlock(sdk);
262
+ Object.assign(state, marketOf(sdk, strategy.creditManager));
247
263
  const reused = await reusable(sdk, strategy, params.creditAccount);
248
- if (reused && "error" in reused) return reused;
264
+ if (reused && "error" in reused) return refused(reused.error, state);
249
265
  return borrowed(await service(sdk).borrowIntent({
250
266
  sdk,
251
267
  creditManager: strategy.creditManager,
@@ -255,10 +271,11 @@ var PrepareApi = class extends MultichainConstruct {
255
271
  borrowAmount: params.borrowAmount,
256
272
  slippage: params.slippage,
257
273
  quotaReserve: params.quotaReserve,
258
- creditAccount: reused?.account
274
+ creditAccount: reused?.account,
275
+ draft: state
259
276
  }), at);
260
277
  } catch (e) {
261
- return sdkErr(unexpectedFailure(e));
278
+ return refused(unexpectedFailure(e), state);
262
279
  }
263
280
  }
264
281
  /**
@@ -418,20 +435,22 @@ var PrepareApi = class extends MultichainConstruct {
418
435
  * ones, per the engine trace its signature spells out.
419
436
  **/
420
437
  async #startRoutes(position, options, intent) {
438
+ const state = {};
421
439
  try {
422
440
  const sdk = await this.#chain(position.chainId);
423
441
  const at = stateBlock(sdk);
424
442
  const creditAccount = await slice$1(sdk, position.creditAccount);
425
- if (!creditAccount) return neitherRoute(creditAccountNotFound(position.creditAccount));
443
+ if (!creditAccount) return neitherRoute(creditAccountNotFound(position.creditAccount), state);
426
444
  return routed(await service(sdk).intentRoutes({
427
445
  intent,
428
446
  creditAccount,
429
447
  sdk,
430
448
  slippage: options.slippage,
431
- quotaReserve: options.quotaReserve
449
+ quotaReserve: options.quotaReserve,
450
+ draft: state
432
451
  }), at);
433
452
  } catch (e) {
434
- return neitherRoute(unexpectedFailure(e));
453
+ return neitherRoute(unexpectedFailure(e), state);
435
454
  }
436
455
  }
437
456
  /**
@@ -444,20 +463,22 @@ var PrepareApi = class extends MultichainConstruct {
444
463
  * ones, per the engine trace its signature spells out.
445
464
  **/
446
465
  async #startIntent(position, options, intent) {
466
+ const state = {};
447
467
  try {
448
468
  const sdk = await this.#chain(position.chainId);
449
469
  const at = stateBlock(sdk);
450
470
  const creditAccount = await slice$1(sdk, position.creditAccount);
451
- if (!creditAccount) return sdkErr(creditAccountNotFound(position.creditAccount));
471
+ if (!creditAccount) return refused(creditAccountNotFound(position.creditAccount), state);
452
472
  return planned(await service(sdk).startIntent({
453
473
  intent,
454
474
  creditAccount,
455
475
  sdk,
456
476
  slippage: options.slippage,
457
- quotaReserve: options.quotaReserve
477
+ quotaReserve: options.quotaReserve,
478
+ draft: state
458
479
  }), at);
459
480
  } catch (e) {
460
- return sdkErr(unexpectedFailure(e));
481
+ return refused(unexpectedFailure(e), state);
461
482
  }
462
483
  }
463
484
  };
@@ -545,14 +566,44 @@ function methodError(result) {
545
566
  return result;
546
567
  }
547
568
  /**
569
+ * An error the namespace decides on itself, carrying as much of the state as
570
+ * it can say — nothing at all where it stopped before there was a market to
571
+ * name, see {@link WithPartialState}.
572
+ *
573
+ * The engine attaches its own draft on the way out, so this is only for what
574
+ * is raised on this side of it: a chain that would not resolve, an account the
575
+ * markets do not hold, a pool pair with no route.
576
+ **/
577
+ function refused(error, state) {
578
+ return sdkErr({
579
+ ...error,
580
+ state
581
+ });
582
+ }
583
+ /**
584
+ * The market fields of a request that names its credit manager, for what is
585
+ * turned down before the engine has been reached at all.
586
+ *
587
+ * Empty where the SDK holds no such manager, which is itself one of those
588
+ * answers.
589
+ **/
590
+ function marketOf(sdk, creditManager) {
591
+ try {
592
+ return sdk.marketRegister.findCreditManager(creditManager).creditOperationMarket();
593
+ } catch {
594
+ return {};
595
+ }
596
+ }
597
+ /**
548
598
  * A flow with two routes, stopped before either could be quoted: the error is
549
599
  * the same one any other flow would report, with nothing to say about the
550
600
  * routes because neither was reached.
551
601
  **/
552
- function neitherRoute(error) {
602
+ function neitherRoute(error, state) {
553
603
  return sdkErr({
554
604
  ...error,
555
- errors: {}
605
+ errors: {},
606
+ state
556
607
  });
557
608
  }
558
609
  /**
@@ -671,11 +722,11 @@ async function lpState(sdk, pool, wallet, simulation, moved) {
671
722
  * is the usual way of it; both are present where a pair exists but nothing of
672
723
  * ours implements it.
673
724
  **/
674
- function unroutable(sdk, from, to) {
675
- return sdkErr(unsupportedTokenPair({
725
+ function unroutable(sdk, from, to, state) {
726
+ return refused(unsupportedTokenPair({
676
727
  from: toToken(sdk, from),
677
728
  to: to === void 0 ? void 0 : toToken(sdk, to)
678
- }));
729
+ }), state);
679
730
  }
680
731
  /**
681
732
  * Picks the route the operation takes out of `tokenIn`, as a value rather than
@@ -1,8 +1,6 @@
1
1
  import { ILogger } from "./types/logger.js";
2
2
  import { NetworkType } from "./chain/chains.js";
3
3
  import { MultichainStateHuman } from "./types/state-human.js";
4
- import { RedstoneOptions } from "./market/pricefeeds/updates/RedstoneUpdater.js";
5
- import "./market/pricefeeds/updates/index.js";
6
4
  import { PluginFactoriesMap, PluginsMap } from "./plugins/types.js";
7
5
  import "./plugins/index.js";
8
6
  import { MultichainOpportunitiesService } from "./opportunities/MultichainOpportunitiesService.js";
@@ -59,10 +57,6 @@ interface MultichainAttachOptions {
59
57
  * Per-chain attach options.
60
58
  **/
61
59
  perChain?: Partial<Record<NetworkType, AttachOptions>>;
62
- /**
63
- * Options for Redstone price-feed updates (shared cache across chains).
64
- **/
65
- redstone?: RedstoneOptions;
66
60
  }
67
61
  /**
68
62
  * Options for {@link MultichainSDK.hydrate}.
@@ -72,10 +66,6 @@ interface MultichainHydrateOptions {
72
66
  * Per-chain hydrate options.
73
67
  **/
74
68
  perChain?: Partial<Record<NetworkType, HydrateOptions>>;
75
- /**
76
- * Options for Redstone price-feed updates (shared cache across chains).
77
- **/
78
- redstone?: RedstoneOptions;
79
69
  /**
80
70
  * When `true`, chains missing from the serialised state are silently skipped
81
71
  * instead of throwing {@link SdkMissingChainStateError}.
@@ -6,9 +6,7 @@ import { VersionRange } from "./constants/versions.js";
6
6
  import "./constants/index.js";
7
7
  import { RWARegistry } from "./market/rwa/RWARegistry.js";
8
8
  import { GearboxStateHuman } from "./types/state-human.js";
9
- import { RedstoneOptions } from "./market/pricefeeds/updates/RedstoneUpdater.js";
10
9
  import { UpdatablePriceFeedRegistry } from "./market/pricefeeds/updates/UpdatablePriceFeedRegistry.js";
11
- import "./market/pricefeeds/updates/index.js";
12
10
  import "./market/pricefeeds/index.js";
13
11
  import { IRouterContract } from "./router/types.js";
14
12
  import "./router/index.js";
@@ -128,10 +126,6 @@ interface AttachOptions {
128
126
  * Pool addresses whose markets should be skipped.
129
127
  **/
130
128
  ignoreMarkets?: Address[];
131
- /**
132
- * Options for Redstone price-feed updates.
133
- **/
134
- redstone?: RedstoneOptions;
135
129
  }
136
130
  /**
137
131
  * Options accepted by {@link OnchainSDK.hydrate}.
@@ -141,10 +135,6 @@ interface HydrateOptions {
141
135
  * Pool addresses whose markets should be skipped.
142
136
  **/
143
137
  ignoreMarkets?: Address[];
144
- /**
145
- * Options for Redstone price-feed updates.
146
- **/
147
- redstone?: RedstoneOptions;
148
138
  }
149
139
  /**
150
140
  * Options for {@link OnchainSDK.syncState}, controlling which block to
@@ -21,7 +21,7 @@ import "./bots/index.js";
21
21
  import { CreditAccountsServiceV310 } from "./CreditAccountsServiceV310.js";
22
22
  import { CalcDefaultQuotaProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, calcDefaultQuota, calcQuotaUpdate, calcRecommendedQuota, roundUpQuota } from "./quota-utils.js";
23
23
  import { AccountCalculatorOperation } from "./intents/operations.js";
24
- import { AddCollateralIntent, AdjustLeverageIntent, ClaimRemainder, CreditAccountSlice, DelayableIntent, DelayedRoute, DelayedStart, DelayedStartResult, DepositStrategyIntent, ExecutionCost, FinishIntentProps, FinishIntentResult, InstantRoute, IntentPreviewResult, IntentRoutesResult, OperationState, PathLossRate, RepayStrategyIntent, ResumableIntent, RouteErrors, StartIntent, WithdrawAssetIntent, WithdrawCeilings, WithdrawStrategyIntent } from "./intents/types.js";
24
+ import { AddCollateralIntent, AdjustLeverageIntent, ClaimRemainder, CreditAccountSlice, DelayableIntent, DelayedRoute, DelayedStart, DelayedStartResult, DepositStrategyIntent, ExecutionCost, FinishIntentProps, FinishIntentResult, InstantRoute, IntentPreviewResult, IntentRoutesResult, OperationState, PathLossRate, RefusedIntent, RepayStrategyIntent, ResumableIntent, RouteErrors, StartIntent, WithPartialState, WithdrawAssetIntent, WithdrawCeilings, WithdrawStrategyIntent } from "./intents/types.js";
25
25
  import { BorrowProps, BorrowState } from "./intents/borrow.js";
26
26
  import { LeverageBand } from "./intents/leverage-band.js";
27
27
  import { OpenStrategyProps, OpenStrategyState } from "./intents/open-strategy.js";
@@ -33,4 +33,4 @@ import { BuildLiquidationTxProps, BuildLiquidationTxPropsBase, GetLiquidatableAc
33
33
  import { LiquidationsService } from "./liquidations/LiquidationsService.js";
34
34
  import { MultichainLiquidationsService } from "./liquidations/MultichainLiquidationsService.js";
35
35
  import "./liquidations/index.js";
36
- export { AbstractWithdrawalCompressorContract, AccountBotsService, type AccountCalculatorOperation, AccountToCheck, type AddCollateralIntent, type AdjustLeverageIntent, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, BorrowPreviewResult, type BorrowProps, type BorrowState, BotStatusCall, BotsDirectResponse, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, CMSlice, CalcDefaultQuotaProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, ClaimFarmRewardsProps, type ClaimRemainder, ClaimableWithdrawal, CloseCreditAccountResult, ConnectedBotsCall, ConnectedBotsPerAccount, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountDataCall, CreditAccountFilter, CreditAccountOperationResult, CreditAccountOperationsService, CreditAccountReadOptions, type CreditAccountSlice, CreditAccountsCall, CreditAccountsQuery, CreditAccountsReadOptions, CreditAccountsServiceV310, CreditAccountsTarget, CreditManagerFilter, CreditManagerOperationResult, CurrentWithdrawals, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, type DelayableIntent, DelayedIntentExtended, type DelayedRoute, type DelayedStart, type DelayedStartResult, type DepositStrategyIntent, EmptyAccountPreviewResult, EncodableCreditAccountOperation, type ExecutionCost, type FinishIntentProps, type FinishIntentResult, FullyLiquidateProps, FullyLiquidateResult, GetApprovalAddressProps, GetConnectedBotsResponse, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetExternalAccountCurrentWithdrawalsProps, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, GetWithdrawalRequestResultProps, ICreditAccountsService, IRedemptionLoggerContract, IWithdrawalCompressorContract, type InstantRoute, type IntentPreviewResult, type IntentRoutesResult, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, type LeverageBand, LiquidationsService, LoadRWALiquidatorsProps, MulticallWithFailure, MultichainLiquidationsService, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, OnchainRequestableWithdrawal, OpenCAProps, OpenStrategyPreviewResult, type OpenStrategyProps, type OpenStrategyState, type OperationState, PartiallyLiquidateProps, type PathLossRate, PendingWithdrawal, PeripheryCompressorV310Contract, PreviewDelayedWithdrawalProps, RWALiquidatorInfo, RedemptionLog, RedemptionLoggerV310Contract, type RepayStrategyIntent, RequestableWithdrawal, type ResumableIntent, Rewards, type RouteErrors, SetBotProps, SetBotResult, type StartIntent, type WithdrawAssetIntent, type WithdrawCeilings, type WithdrawStrategyIntent, WithdrawableAsset, WithdrawalCompressorLocation, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WithdrawalCompressorVersion, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, calcDefaultQuota, calcQuotaUpdate, calcRecommendedQuota, createRedemptionLogger, createWithdrawalCompressor, decodeDelayedIntent, encodeDelayedIntent, fetchCreditAccountSlice, getWithdrawalCompressorAddress, iCreditAccountAbi, isPhantomToken, roundUpQuota, toClaimableWithdrawal, toCreditAccountSlice, toPendingWithdrawal, toRequestableWithdrawal, toWithdrawalStatus };
36
+ export { AbstractWithdrawalCompressorContract, AccountBotsService, type AccountCalculatorOperation, AccountToCheck, type AddCollateralIntent, type AdjustLeverageIntent, AssembleCaOperationsProps, AssembleClaimDelayedCallsProps, AssembleCloseCreditAccountCallsProps, AssembleRepayCreditAccountCallsProps, AssembleStartDelayedWithdrawalCallsProps, BorrowPreviewResult, type BorrowProps, type BorrowState, BotStatusCall, BotsDirectResponse, BuildLiquidationTxProps, BuildLiquidationTxPropsBase, CMSlice, CalcDefaultQuotaProps, CalcQuotaUpdateProps, CalcRecommendedQuotaProps, ClaimFarmRewardsProps, type ClaimRemainder, ClaimableWithdrawal, CloseCreditAccountResult, ConnectedBotsCall, ConnectedBotsPerAccount, CreditAccountCompressor, CreditAccountCompressorV310Contract, CreditAccountDataCall, CreditAccountFilter, CreditAccountOperationResult, CreditAccountOperationsService, CreditAccountReadOptions, type CreditAccountSlice, CreditAccountsCall, CreditAccountsQuery, CreditAccountsReadOptions, CreditAccountsServiceV310, CreditAccountsTarget, CreditManagerFilter, CreditManagerOperationResult, CurrentWithdrawals, DELAYED_INTENT_TYPES, DELAYED_INTENT_VERSION, type DelayableIntent, DelayedIntentExtended, type DelayedRoute, type DelayedStart, type DelayedStartResult, type DepositStrategyIntent, EmptyAccountPreviewResult, EncodableCreditAccountOperation, type ExecutionCost, type FinishIntentProps, type FinishIntentResult, FullyLiquidateProps, FullyLiquidateResult, GetApprovalAddressProps, GetConnectedBotsResponse, GetConnectedBotsResult, GetConnectedMigrationBotsResult, GetCreditAccountsArgs, GetCreditAccountsOptions, GetExternalAccountCurrentWithdrawalsProps, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidationDetailsPropsBase, GetLiquidationPositionsProps, GetLiquidationPositionsPropsBase, GetWithdrawalRequestResultProps, ICreditAccountsService, IRedemptionLoggerContract, IWithdrawalCompressorContract, type InstantRoute, type IntentPreviewResult, type IntentRoutesResult, LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS, type LeverageBand, LiquidationsService, LoadRWALiquidatorsProps, MulticallWithFailure, MultichainLiquidationsService, OnchainLiquidationCall, OnchainLiquidationData, OnchainLiquidationOutput, OnchainRequestableWithdrawal, OpenCAProps, OpenStrategyPreviewResult, type OpenStrategyProps, type OpenStrategyState, type OperationState, PartiallyLiquidateProps, type PathLossRate, PendingWithdrawal, PeripheryCompressorV310Contract, PreviewDelayedWithdrawalProps, RWALiquidatorInfo, RedemptionLog, RedemptionLoggerV310Contract, type RefusedIntent, type RepayStrategyIntent, RequestableWithdrawal, type ResumableIntent, Rewards, type RouteErrors, SetBotProps, SetBotResult, type StartIntent, type WithPartialState, type WithdrawAssetIntent, type WithdrawCeilings, type WithdrawStrategyIntent, WithdrawableAsset, WithdrawalCompressorLocation, WithdrawalCompressorV310Contract, WithdrawalCompressorV311Contract, WithdrawalCompressorV313Contract, WithdrawalCompressorVersion, WithdrawalOutput, WithdrawalStatus, WithdrawalsState, calcDefaultQuota, calcQuotaUpdate, calcRecommendedQuota, createRedemptionLogger, createWithdrawalCompressor, decodeDelayedIntent, encodeDelayedIntent, fetchCreditAccountSlice, getWithdrawalCompressorAddress, iCreditAccountAbi, isPhantomToken, roundUpQuota, toClaimableWithdrawal, toCreditAccountSlice, toPendingWithdrawal, toRequestableWithdrawal, toWithdrawalStatus };
@@ -45,6 +45,11 @@ interface BorrowProps {
45
45
  * an account that already owes is what the `ADJUST_LEVERAGE` intent is for.
46
46
  **/
47
47
  creditAccount?: CreditAccountSlice;
48
+ /**
49
+ * Where the walk writes the state as it reaches it, see
50
+ * {@link StartIntentProps.draft}. Omitted by a walk nobody reports.
51
+ **/
52
+ draft?: Partial<BorrowState>;
48
53
  }
49
54
  /**
50
55
  * Where a borrow leaves the wallet and the account it opens.
@@ -7,7 +7,8 @@ import { OnchainSDK } from "../../OnchainSDK.js";
7
7
  import "../../index.js";
8
8
  //#region src/onchain/accounts/intents/guards.d.ts
9
9
  /**
10
- * What the market itself refuses, checked before anything is quoted.
10
+ * What the market itself refuses, read from its loaded state rather than
11
+ * learned from a revert.
11
12
  *
12
13
  * The planners answer for the arithmetic of an intent and the ledger for the
13
14
  * balances it moves, but neither can see that the facade is paused or that the
@@ -16,9 +17,10 @@ import "../../index.js";
16
17
  * loaded market and reported as refusals instead.
17
18
  *
18
19
  * Every guard here refuses something the market decides rather than something
19
- * the arithmetic cannot do, which is why all six of their reasons are
20
- * `blocking`: the walk that hit one still reached an end state, and a caller
21
- * gets that state alongside the refusal.
20
+ * the arithmetic cannot do, so where the account would have landed stays a
21
+ * question the walk can answer. The three that judge that end state — growth,
22
+ * quota limits, collateral — therefore run only once the projection exists,
23
+ * which is what lets them hand it back as `state` when they refuse.
22
24
  */
23
25
  /**
24
26
  * The facade takes no multicall while it is paused or past its expiration, so
@@ -3,7 +3,7 @@ import "../../../model/index.js";
3
3
  import { SDKConstruct } from "../../base/SDKConstruct.js";
4
4
  import { IntentValidationError } from "../../validation/raise.js";
5
5
  import { AccountCalculatorOperation } from "./operations.js";
6
- import { AddCollateralIntent, AdjustLeverageIntent, ClaimRemainder, CreditAccountSlice, DelayableIntent, DelayedRoute, DelayedStart, DelayedStartResult, DepositStrategyIntent, ExecutionCost, FinishIntentProps, FinishIntentResult, InstantRoute, IntentPreviewResult, IntentRoutesResult, OperationState, PathLossRate, RepayStrategyIntent, ResumableIntent, RouteErrors, StartIntent, StartIntentProps, WithdrawAssetIntent, WithdrawCeilings, WithdrawStrategyIntent } from "./types.js";
6
+ import { AddCollateralIntent, AdjustLeverageIntent, ClaimRemainder, CreditAccountSlice, DelayableIntent, DelayedRoute, DelayedStart, DelayedStartResult, DepositStrategyIntent, ExecutionCost, FinishIntentProps, FinishIntentResult, InstantRoute, IntentPreviewResult, IntentRoutesResult, OperationState, PathLossRate, RefusedIntent, RepayStrategyIntent, ResumableIntent, RouteErrors, StartIntent, StartIntentProps, WithPartialState, WithdrawAssetIntent, WithdrawCeilings, WithdrawStrategyIntent } from "./types.js";
7
7
  import { BorrowProps, BorrowState } from "./borrow.js";
8
8
  import { LeverageBand, LeverageBandProps } from "./leverage-band.js";
9
9
  import { MaxBorrowProps } from "./maxBorrow.js";
@@ -22,7 +22,7 @@ import { Address } from "viem";
22
22
  type OpenStrategyPreviewResult = {
23
23
  ok: true;
24
24
  state: OpenStrategyState;
25
- } | SDKError<IntentValidationError>;
25
+ } | SDKError<RefusedIntent<OpenStrategyState>>;
26
26
  /**
27
27
  * Borrow preview outcome, shaped like {@link OpenStrategyPreviewResult}: both
28
28
  * open an account, so neither has an operation chain to report.
@@ -30,7 +30,7 @@ type OpenStrategyPreviewResult = {
30
30
  type BorrowPreviewResult = {
31
31
  ok: true;
32
32
  state: BorrowState;
33
- } | SDKError<IntentValidationError>;
33
+ } | SDKError<RefusedIntent<BorrowState>>;
34
34
  /**
35
35
  * Empty-account preview outcome: the thinnest of the three, since an account
36
36
  * that holds nothing has no state to project — only the market's own refusal
@@ -280,4 +280,4 @@ declare class CreditAccountOperationsService extends SDKConstruct {
280
280
  borrowIntent(props: BorrowProps): Promise<BorrowPreviewResult>;
281
281
  }
282
282
  //#endregion
283
- export { type AccountCalculatorOperation, type AddCollateralIntent, type AdjustLeverageIntent, BorrowPreviewResult, type BorrowProps, type BorrowState, type ClaimRemainder, CreditAccountOperationsService, type CreditAccountSlice, type DelayableIntent, type DelayedRoute, type DelayedStart, type DelayedStartResult, type DepositStrategyIntent, EmptyAccountPreviewResult, type ExecutionCost, type FinishIntentProps, type FinishIntentResult, type InstantRoute, type IntentPreviewResult, type IntentRoutesResult, type LeverageBand, OpenStrategyPreviewResult, type OpenStrategyProps, type OpenStrategyState, type OperationState, type PathLossRate, type RepayStrategyIntent, type ResumableIntent, type RouteErrors, type StartIntent, type WithdrawAssetIntent, type WithdrawCeilings, type WithdrawStrategyIntent, fetchCreditAccountSlice, isPhantomToken, toCreditAccountSlice };
283
+ export { type AccountCalculatorOperation, type AddCollateralIntent, type AdjustLeverageIntent, BorrowPreviewResult, type BorrowProps, type BorrowState, type ClaimRemainder, CreditAccountOperationsService, type CreditAccountSlice, type DelayableIntent, type DelayedRoute, type DelayedStart, type DelayedStartResult, type DepositStrategyIntent, EmptyAccountPreviewResult, type ExecutionCost, type FinishIntentProps, type FinishIntentResult, type InstantRoute, type IntentPreviewResult, type IntentRoutesResult, type LeverageBand, OpenStrategyPreviewResult, type OpenStrategyProps, type OpenStrategyState, type OperationState, type PathLossRate, type RefusedIntent, type RepayStrategyIntent, type ResumableIntent, type RouteErrors, type StartIntent, type WithPartialState, type WithdrawAssetIntent, type WithdrawCeilings, type WithdrawStrategyIntent, fetchCreditAccountSlice, isPhantomToken, toCreditAccountSlice };
@@ -28,17 +28,10 @@ declare function debtForLeverage(collateral: bigint, leverage: bigint): bigint;
28
28
  * it, so no rounding is introduced on the way.
29
29
  */
30
30
  declare function proportionalDebt(position: Position, collateralDelta: bigint): bigint;
31
- /**
32
- * Headroom on top of the debt read, in `PERCENTAGE_FACTOR`: enough interest for
33
- * the transaction to sit in the mempool for hours at any sane borrow rate,
34
- * small enough not to matter to the wallet that fronts it.
35
- */
36
- declare const SETTLE_MARGIN = 10n;
37
31
  /**
38
32
  * Largest withdrawal (in underlying) that {@link proportionalDebt} can still
39
33
  * pay for: the repayment it implies leaves debt at or above `minDebt` plus
40
- * {@link SETTLE_MARGIN} of the debt, so the figure survives the interest of the
41
- * blocks before it is sent, and
34
+ * {@link WITHDRAW_DEBT_MARGIN} of the debt, and
42
35
  * strictly less than the collateral goes — the last unit closes the account
43
36
  * rather than shrinks it. `0n` when the debt already sits below `minDebt`.
44
37
  *
@@ -53,4 +46,4 @@ declare function assertLeverageAtLeastOne(leverage: bigint): void;
53
46
  */
54
47
  declare function assertDebtLimits(sdk: OnchainSDK, debt: bigint, debtLimits: DebtLimits, underlying: Address): void;
55
48
  //#endregion
56
- export { DebtLimits, Position, SETTLE_MARGIN, assertDebtLimits, assertLeverageAtLeastOne, debtForLeverage, maxProportionalWithdrawal, proportionalDebt };
49
+ export { DebtLimits, Position, assertDebtLimits, assertLeverageAtLeastOne, debtForLeverage, maxProportionalWithdrawal, proportionalDebt };
@@ -32,6 +32,11 @@ interface OpenStrategyProps {
32
32
  * is what the `DEPOSIT` intent is for.
33
33
  **/
34
34
  creditAccount?: CreditAccountSlice;
35
+ /**
36
+ * Where the walk writes the state as it reaches it, see
37
+ * {@link StartIntentProps.draft}. Omitted by a walk nobody reports.
38
+ **/
39
+ draft?: Partial<OpenStrategyState>;
35
40
  }
36
41
  /**
37
42
  * Projected result of opening a brand-new leveraged position.
@@ -19,6 +19,11 @@ interface RealizeProps {
19
19
  * `createOraclePaths` instead.
20
20
  */
21
21
  paths?: RouterPaths;
22
+ /**
23
+ * Where the walk writes the state as it reaches it, see
24
+ * {@link StartIntentProps.draft}. Omitted by a walk nobody reports.
25
+ */
26
+ draft?: Partial<OperationState>;
22
27
  }
23
28
  interface Realized {
24
29
  operations: AccountCalculatorOperation[];
@@ -86,16 +86,47 @@ interface OperationState extends AccountProjection, SimulationPrices {
86
86
  */
87
87
  executionCost: ExecutionCost | undefined;
88
88
  }
89
+ /**
90
+ * What a refused request carries beside its own code: as much of the state
91
+ * the walk was building as it had reached when it was stopped.
92
+ *
93
+ * The same field under the same name as on the answer beside it, so a screen
94
+ * reads one shape whichever half it got — only here a field it could not
95
+ * arrive at is absent rather than present. What is there depends on how far
96
+ * the walk got: the market from the moment it is resolved, the totals from
97
+ * the moment the oracle has sized the margin and the debt, the whole
98
+ * projection from the moment the balances are settled, and `priceImpact` only
99
+ * from a walk that finished, since measuring depth is a quote of its own and
100
+ * is not paid for by a plan that was turned down.
101
+ *
102
+ * The totals are worth their own step because the flows that open an account
103
+ * weigh the debt before they route anything: a loan refused for its size is
104
+ * refused on arithmetic, and the arithmetic is reportable even though the
105
+ * position it would have bought is not.
106
+ *
107
+ * Absent is not zero and not "unchanged": a walk stopped mid-way says nothing
108
+ * about where the account would have landed, and a caller shows a blank rather
109
+ * than the account as it stands.
110
+ */
111
+ interface WithPartialState<S> {
112
+ state: Partial<S>;
113
+ }
114
+ /**
115
+ * A flow that projects `S`, turned down by the engine: the code and its own
116
+ * numbers, with {@link WithPartialState.state} beside them.
117
+ */
118
+ type RefusedIntent<S> = IntentValidationError & WithPartialState<S>;
89
119
  /**
90
120
  * What planning an intent yields: the operation chain, the state it projects,
91
- * and the calldata that realises it — or the error that stopped the plan.
121
+ * and the calldata that realises it — or the error that stopped the plan,
122
+ * carrying the part of that state the plan did reach.
92
123
  */
93
124
  type IntentPreviewResult = {
94
125
  ok: true;
95
126
  operations: AccountCalculatorOperation[];
96
127
  state: OperationState;
97
128
  calls: MultiCall[];
98
- } | SDKError<IntentValidationError>;
129
+ } | SDKError<RefusedIntent<OperationState>>;
99
130
  /**
100
131
  * What a claim did not bring, when the venue served part of a matured
101
132
  * withdrawal and left the rest of it queued.
@@ -133,7 +164,7 @@ type FinishIntentResult = (Extract<IntentPreviewResult, {
133
164
  * {@link ClaimRemainder}.
134
165
  */
135
166
  remainder: ClaimRemainder | undefined;
136
- }) | SDKError<IntentValidationError>;
167
+ }) | SDKError<RefusedIntent<OperationState>>;
137
168
  /** What the request recorded, and when the tail can be run. */
138
169
  interface DelayedStart {
139
170
  /**
@@ -196,7 +227,7 @@ type DelayedStartResult = {
196
227
  state: OperationState;
197
228
  calls: MultiCall[];
198
229
  delayed: DelayedStart;
199
- } | SDKError<IntentValidationError>;
230
+ } | SDKError<RefusedIntent<OperationState>>;
200
231
  /** An intent previewed through the router: one transaction, settled now. */
201
232
  type InstantRoute = Extract<IntentPreviewResult, {
202
233
  ok: true;
@@ -234,7 +265,7 @@ type IntentRoutesResult = {
234
265
  instant: InstantRoute | undefined;
235
266
  delayed: DelayedRoute | undefined;
236
267
  errors: RouteErrors;
237
- } | (SDKError<IntentValidationError> & {
268
+ } | (SDKError<RefusedIntent<OperationState>> & {
238
269
  /** {@inheritDoc IntentRoutesResult.errors} */
239
270
  errors: RouteErrors;
240
271
  });
@@ -264,6 +295,18 @@ type StartIntentProps = {
264
295
  quotaReserve: number | undefined;
265
296
  /** Router slippage in PERCENTAGE_FORMAT (100% = 10_000). */
266
297
  slippage: number | undefined;
298
+ /**
299
+ * Where the walk writes the state as it reaches it, so a caller stopped
300
+ * part-way is still told what was true up to that point, see
301
+ * {@link WithPartialState}.
302
+ *
303
+ * Filled in place rather than returned, because the two ways a walk ends
304
+ * badly leave by different doors: being refused is the error the engine
305
+ * answers with, a crash is the exception it lets through, and the caller holding
306
+ * this object reads the same draft either way. Omit it and the walk keeps
307
+ * no draft at all.
308
+ */
309
+ draft?: Partial<OperationState>;
267
310
  };
268
311
  /**
269
312
  * Intent 5 — put the position token straight onto the account.
@@ -515,4 +558,4 @@ type FinishIntentProps = StartIntentProps & {
515
558
  claimable: ClaimableWithdrawal;
516
559
  };
517
560
  //#endregion
518
- export { AddCollateralIntent, AdjustLeverageIntent, ClaimRemainder, CreditAccountSlice, DelayableIntent, DelayedRoute, DelayedStart, DelayedStartResult, DepositStrategyIntent, ExecutionCost, FinishIntentProps, FinishIntentResult, InstantRoute, IntentPreviewResult, IntentRoutesResult, OperationState, PathLossRate, RepayStrategyIntent, ResumableIntent, RouteErrors, SimulationPrices, StartIntent, StartIntentProps, WithdrawAssetIntent, WithdrawCeilings, WithdrawStrategyIntent };
561
+ export { AddCollateralIntent, AdjustLeverageIntent, ClaimRemainder, CreditAccountSlice, DelayableIntent, DelayedRoute, DelayedStart, DelayedStartResult, DepositStrategyIntent, ExecutionCost, FinishIntentProps, FinishIntentResult, InstantRoute, IntentPreviewResult, IntentRoutesResult, OperationState, PathLossRate, RefusedIntent, RepayStrategyIntent, ResumableIntent, RouteErrors, SimulationPrices, StartIntent, StartIntentProps, WithPartialState, WithdrawAssetIntent, WithdrawCeilings, WithdrawStrategyIntent };