@keetanetwork/anchor 0.0.94 → 0.0.96

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/lib/chaining.d.ts CHANGED
@@ -4,6 +4,7 @@ import type { AnchorTokenLocationMetadata, AssetLocationLike, AssetFeeLineItemTy
4
4
  import type { Resolver } from "./index.js";
5
5
  import type { ISOCurrencyCode } from '@keetanetwork/currency-info';
6
6
  import type { Account, GenericAccount, TokenAddress } from '@keetanetwork/keetanet-client/lib/account.js';
7
+ import type { PublicRetryOptions } from './utils/retry.js';
7
8
  import KeetaFXAnchorClient from '../services/fx/client.js';
8
9
  import KeetaAssetMovementAnchorClient from '../services/asset-movement/client.js';
9
10
  import type { ExternalChainAsset } from './asset.js';
@@ -81,6 +82,8 @@ export type AnchorChainingPathExecuteResult = {
81
82
  };
82
83
  export type AnchorChainingPathExecuteOptions = {
83
84
  requireSendAuth?: boolean;
85
+ abortSignal?: AbortSignal;
86
+ poll?: PublicRetryOptions;
84
87
  };
85
88
  export type AnchorChainingPathState = {
86
89
  status: 'idle';
@@ -135,6 +138,7 @@ export type AnchorChainingTransactionObservedEvent = {
135
138
  interface RailSupportedOperations {
136
139
  createPersistentForwarding?: boolean;
137
140
  initiateTransfer?: boolean;
141
+ simulateTransfer?: boolean;
138
142
  }
139
143
  interface AnchorChainingAssetAndLocation<AssetType extends AnchorChainingAsset = AnchorChainingAsset, Location extends AssetLocationLike = AssetLocationLike> {
140
144
  asset: AssetType;
@@ -166,6 +170,15 @@ interface BaseGraphNodeLike<Type extends 'fx' | 'assetMovement', AssetType exten
166
170
  interface FXGraphNode extends BaseGraphNodeLike<'fx', Exclude<AnchorChainingAsset, ExternalChainAsset>> {
167
171
  }
168
172
  interface AssetMovementGraphNode extends BaseGraphNodeLike<'assetMovement', AnchorChainingAsset> {
173
+ /**
174
+ * Operations the provider itself publishes, independent of any rail-specific
175
+ * declaration. Mirrors what `provider.isOperationSupported()` answers at plan
176
+ * time, so a pure validation can reach the same verdict as computing a plan.
177
+ *
178
+ * Distinct from the per-side `supportedOperations`, which describes one rail
179
+ * and is absent for providers that publish no rail-level detail.
180
+ */
181
+ providerOperations?: RailSupportedOperations;
169
182
  }
170
183
  export type GraphNodeLike = FXGraphNode | AssetMovementGraphNode;
171
184
  type KeetaLocationLike = Extract<AssetLocationLike, `chain:keeta:${bigint}`> | PickChainLocation<'keeta'>;
@@ -331,6 +344,7 @@ export interface ComputePlanOptions {
331
344
  export interface GetPlansOptions extends Omit<ComputePlanOptions, 'forwardingOnly'> {
332
345
  includeAllOutput?: boolean;
333
346
  forwardingOnly?: boolean | ForwardingOnlyOptions;
347
+ maxPathLength?: number;
334
348
  }
335
349
  /**
336
350
  * Whether a discovered path is eligible for forwarding-only plan resolution:
@@ -372,6 +386,19 @@ export declare function isForwardingPlan(plan: {
372
386
  export declare function getForwardingDepositAddress(plan: {
373
387
  plan: AnchorChainingPathComputedPlan;
374
388
  }): string | null;
389
+ export type AnchorChainingPathValidationResult = {
390
+ valid: true;
391
+ } | {
392
+ valid: false;
393
+ reason: string;
394
+ };
395
+ export interface AnchorChainingPathValidateOptions {
396
+ /**
397
+ * Validate against forwarding-only plan rules (every asset-movement leg must
398
+ * qualify for persistent forwarding), matching ComputePlanOptions.
399
+ */
400
+ forwardingOnly?: boolean;
401
+ }
375
402
  export declare class AnchorChainingPath {
376
403
  readonly request: AnchorChainingPathInput;
377
404
  readonly path: AnchorChainingStepLike[];
@@ -381,7 +408,24 @@ export declare class AnchorChainingPath {
381
408
  path: AnchorChainingStepLike[];
382
409
  parent: AnchorChaining;
383
410
  });
411
+ /**
412
+ * Synchronously check whether this path is structurally and request valid,
413
+ * with no network call. Returns { valid: true } when the request value and
414
+ * affinity are well formed and the path step shape is allowed.
415
+ *
416
+ * Persistent-forwarding rules differ between a default plan and a
417
+ * forwarding-only plan, so pass the same forwardingOnly value you intend to
418
+ * pass to getPlans/AnchorChainingPlan.create. Validating with the wrong mode
419
+ * reports the wrong rules.
420
+ *
421
+ * This does NOT confirm the path will succeed: real feasibility (provider
422
+ * availability, quotes, fees, simulated amounts) is only known when the plan
423
+ * is computed via getPlans. Use it as a cheap check in a UI.
424
+ */
425
+ validate(options?: AnchorChainingPathValidateOptions): AnchorChainingPathValidationResult;
384
426
  get logger(): Logger | undefined;
427
+ /** This client's Keeta chain location, as compared against in #computePlan. */
428
+ protected get keetaLocation(): string;
385
429
  protected getAccountLike(action: GetAccountForActionPayload, override?: AccountLike): Promise<InstanceType<typeof KeetaNetLib.Account>>;
386
430
  protected getAccountsForAction(action: GetAccountForActionPayload, overrides?: AnchorChainingAccountOverrides): Promise<{
387
431
  account: InstanceType<typeof KeetaNetLib.Account>;
@@ -399,10 +443,7 @@ export declare class AnchorChainingPlan extends AnchorChainingPath {
399
443
  on<E extends keyof AnchorChainingPathEventMap>(event: E, listener: (...args: AnchorChainingPathEventMap[E]) => void): void;
400
444
  off<E extends keyof AnchorChainingPathEventMap>(event: E, listener: (...args: AnchorChainingPathEventMap[E]) => void): void;
401
445
  get logger(): Logger | undefined;
402
- execute(options?: {
403
- requireSendAuth?: boolean;
404
- abortSignal?: AbortSignal;
405
- }): Promise<AnchorChainingPathExecuteResult>;
446
+ execute(options?: AnchorChainingPathExecuteOptions): Promise<AnchorChainingPathExecuteResult>;
406
447
  }
407
448
  /**
408
449
  * Forwarding-only chaining plan for persistent-forwarding routes. Resolves deposit
@@ -415,6 +456,11 @@ export declare class AnchorChainingForwardingOnlyPlan extends AnchorChainingPath
415
456
  get plan(): AnchorChainingPathComputedPlan;
416
457
  getDepositAddress(): string | null;
417
458
  listFees(): AnchorChainingPlanFeeBreakdown;
459
+ /**
460
+ * Always validated as forwarding-only, since that is the only mode this
461
+ * class is ever computed under.
462
+ */
463
+ validate(options?: AnchorChainingPathValidateOptions): AnchorChainingPathValidationResult;
418
464
  static create(path: AnchorChainingPath, options?: ComputePlanOptions): Promise<AnchorChainingForwardingOnlyPlan>;
419
465
  }
420
466
  type AnchorChain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}
package/lib/chaining.js CHANGED
@@ -5,6 +5,7 @@ import { Currency } from '@keetanetwork/currency-info';
5
5
  import { isAssetLocationLike } from '../services/asset-movement/lib/location.generated.js';
6
6
  import { isFiatRail, isMovableAssetSearchCanonical, isRail } from '../services/asset-movement/common.generated.js';
7
7
  import { assertNever } from './utils/never.js';
8
+ import { withRetry } from './utils/retry.js';
8
9
  import KeetaFXAnchorClient from '../services/fx/client.js';
9
10
  import KeetaAssetMovementAnchorClient from '../services/asset-movement/client.js';
10
11
  import { isExternalChainAsset, isMovableAssetEqual } from './asset.js';
@@ -66,6 +67,175 @@ export function supportsPersistentForwarding(supportedOperations, method) {
66
67
  }
67
68
  return (supportedOperations.createPersistentForwarding === true);
68
69
  }
70
+ /**
71
+ * Validate request-level invariants (value affinity) before any network call.
72
+ * Pure: derives the amount/affinity and throws the same messages the inline
73
+ * affinity block in #computePlan used to throw, so observable behavior is
74
+ * unchanged.
75
+ */
76
+ function validateRequest(request) {
77
+ if (request.source.value !== undefined && request.destination.value !== undefined) {
78
+ throw (new Error('Must have source.value or destination.value but not both'));
79
+ }
80
+ else if (request.source.value !== undefined) {
81
+ return ({ affinity: 'from', amount: request.source.value });
82
+ }
83
+ else if (request.destination.value !== undefined) {
84
+ return ({ affinity: 'to', amount: request.destination.value });
85
+ }
86
+ else {
87
+ throw (new Error('Must have source.value or destination.value'));
88
+ }
89
+ }
90
+ /**
91
+ * Whether #computePlan's default-mode scan would select persistent forwarding
92
+ * for this step. Mirrors that selection exactly, including the non-Keeta
93
+ * restriction: a Keeta-source leg is always a user-initiated send, never PFR,
94
+ * even when the provider advertises createPersistentForwarding.
95
+ *
96
+ * Only meaningful outside forwarding-only mode, where every leg is forwarded.
97
+ */
98
+ function stepUsesPFR(path, index) {
99
+ const step = path[index];
100
+ if (!step || step.type !== 'assetMovement') {
101
+ return (false);
102
+ }
103
+ const priorStep = index > 0 ? path[index - 1] : null;
104
+ const isAmpToAmpTransition = priorStep?.type === 'assetMovement';
105
+ const pfrSupported = step.from.supportedOperations?.createPersistentForwarding === true;
106
+ const initiateForbidden = step.from.supportedOperations?.initiateTransfer === false;
107
+ const sourceIsKeeta = isChainLocation(toAssetLocation(step.from.location), 'keeta');
108
+ return (!sourceIsKeeta && (initiateForbidden || (isAmpToAmpTransition && pfrSupported)));
109
+ }
110
+ /**
111
+ * Validate structural invariants of a resolved path before any network call,
112
+ * so a structurally-invalid plan fails fast instead of after wasted provider
113
+ * round-trips. Pure: hoists the structural throws that live inline in
114
+ * #computePlan's forwarding-only scan, PFR scan and resolveStep branches,
115
+ * preserving each message verbatim.
116
+ *
117
+ * The three scans run in the same order as #computePlan (forwarding-only, then
118
+ * PFR, then per-step), and each mirrors its selection logic exactly, so the
119
+ * first error thrown here is the same one #computePlan would have thrown.
120
+ *
121
+ * Persistent-forwarding selection depends on the plan options, so callers that
122
+ * intend to compute a forwarding-only plan must pass forwardingOnly:true to get
123
+ * the matching rules. The two modes are mutually exclusive in #computePlan:
124
+ * forwarding-only applies PFR to every leg (chaining each into the next leg's
125
+ * persistent address), while the default mode allows PFR only as the final step.
126
+ */
127
+ function validatePathStructure(path, request, affinity, forwardingOnly, keetaLocation) {
128
+ /*
129
+ * Forwarding-only requires every asset-movement leg to qualify for
130
+ * persistent forwarding. #computePlan walks backwards here because each leg
131
+ * forwards into the next leg's address; the checks below are the
132
+ * order-independent subset, so a forward walk would report the same first
133
+ * failure for a single-issue path. The backwards walk is kept to match.
134
+ */
135
+ if (forwardingOnly) {
136
+ for (let index = path.length - 1; index >= 0; index--) {
137
+ const step = path[index];
138
+ if (!step || step.type !== 'assetMovement') {
139
+ continue;
140
+ }
141
+ const pfrEligible = supportsPersistentForwarding(step.from.supportedOperations, 'implied');
142
+ const sourceIsKeeta = isChainLocation(toAssetLocation(step.from.location), 'keeta');
143
+ if (sourceIsKeeta || !pfrEligible) {
144
+ throw (new Error(`Forwarding-only plan requires persistent forwarding support on every leg, but step ${index} at ${convertAssetLocationToString(step.from.location)} does not qualify`));
145
+ }
146
+ /*
147
+ * Only the final leg forwards to the request recipient; earlier legs
148
+ * forward to the next leg's persistent address, which is not known
149
+ * until the plan is computed.
150
+ */
151
+ if (index === path.length - 1 && typeof request.destination.recipient !== 'string') {
152
+ throw (new Error(`Forwarding-only plan requires the destination recipient to be a resolved address string`));
153
+ }
154
+ }
155
+ }
156
+ if (!forwardingOnly) {
157
+ for (let index = 0; index < path.length; index++) {
158
+ const step = path[index];
159
+ if (!step || step.type !== 'assetMovement') {
160
+ continue;
161
+ }
162
+ const pfrSupported = step.from.supportedOperations?.createPersistentForwarding === true;
163
+ if (!stepUsesPFR(path, index)) {
164
+ continue;
165
+ }
166
+ if (!pfrSupported) {
167
+ throw (new Error(`Asset movement provider ${step.providerID} source rail ${step.from.rail} at ${convertAssetLocationToString(step.from.location)} declares initiateTransfer:false but does not support createPersistentForwarding`));
168
+ }
169
+ if (index !== path.length - 1) {
170
+ throw (new Error(`Persistent-forwarding (PersistentForwardingRelay-only) asset movement steps are currently only supported as the last step in a chain (step ${index} of ${path.length})`));
171
+ }
172
+ if (typeof request.destination.recipient !== 'string') {
173
+ throw (new Error(`Persistent-forwarding step at index ${index} requires the chain's destination recipient to be a resolved address string`));
174
+ }
175
+ }
176
+ }
177
+ for (let index = 0; index < path.length; index++) {
178
+ const step = path[index];
179
+ if (!step) {
180
+ throw (new Error(`Step ${index} is not defined`));
181
+ }
182
+ if (step.type === 'assetMovement') {
183
+ if (affinity === 'to') {
184
+ throw (new Error(`Chaining with affinity 'to' is not currently supported for asset movement steps, as it requires looking up transfer quotes/estimates which is not currently implemented`));
185
+ }
186
+ /*
187
+ * Chaining out of an asset-movement step to a non-Keeta intermediate
188
+ * location requires simulateTransfer to compute the deposit amount.
189
+ * #computePlan only reaches that branch when the step is not last, the
190
+ * next step is not persistent-forwarded (which supplies its own address
191
+ * instead), and the next location is not this network's Keeta chain
192
+ * (where funds are parked in the user's account instead).
193
+ *
194
+ * Only reported when the metadata positively says the operation is
195
+ * absent, and guessing when it is unknown would reject paths that
196
+ * compute fine. Most providers publish no rail-level detail at all, so
197
+ * the provider-level operations are what usually settles it; they are
198
+ * the same source `isOperationSupported` consults when planning.
199
+ */
200
+ const nextPathStep = index !== path.length - 1 ? path[index + 1] : undefined;
201
+ const cannotSimulateTransfer = step.providerOperations?.simulateTransfer === false ||
202
+ step.from.supportedOperations?.simulateTransfer === false;
203
+ if (!forwardingOnly &&
204
+ nextPathStep !== undefined &&
205
+ !stepUsesPFR(path, index + 1) &&
206
+ nextPathStep.from.location !== keetaLocation &&
207
+ cannotSimulateTransfer) {
208
+ throw (new Error(`Asset movement provider ${step.providerID} does not support simulateTransfer, which is required for chaining at non-keeta intermediate location ${convertAssetLocationToString(nextPathStep.from.location)}`));
209
+ }
210
+ }
211
+ else if (step.type === 'keetaSend') {
212
+ if (path.length !== 1) {
213
+ throw (new Error(`Direct same-location/same-asset send steps must be the only step in the path`));
214
+ }
215
+ if (!KeetaNet.lib.Account.isInstance(step.from.asset) || !KeetaNet.lib.Account.isInstance(step.to.asset)) {
216
+ throw (new Error(`Expected assets to be token accounts for KEETA_SEND rail`));
217
+ }
218
+ if (!step.from.asset.comparePublicKey(step.to.asset)) {
219
+ throw (new Error(`For KEETA_SEND step, from and to asset must be the same account`));
220
+ }
221
+ let keetaRecipientDestination = null;
222
+ if (KeetaNet.lib.Account.isInstance(request.destination.recipient)) {
223
+ keetaRecipientDestination = request.destination.recipient;
224
+ }
225
+ else if (typeof request.destination.recipient === 'string') {
226
+ try {
227
+ keetaRecipientDestination = KeetaNet.lib.Account.fromPublicKeyString(request.destination.recipient);
228
+ }
229
+ catch {
230
+ /* ignore errors */
231
+ }
232
+ }
233
+ if (!keetaRecipientDestination) {
234
+ throw (new Error(`Expected destination recipient to be a public key string for KEETA_SEND step`));
235
+ }
236
+ }
237
+ }
238
+ }
69
239
  /**
70
240
  * Whether a graph node is a forwarding-eligible crypto hop (asset-movement,
71
241
  * crypto locations, non-Keeta origin, and createPersistentForwarding per method).
@@ -413,11 +583,19 @@ class AnchorGraph {
413
583
  this.#computeAssetMovementPairSide(pairResolved[0]),
414
584
  this.#computeAssetMovementPairSide(pairResolved[1])
415
585
  ]);
586
+ /**
587
+ * What the provider publishes for itself. An operation the
588
+ * service does not expose cannot be called on any of its rails,
589
+ * which is the same thing `isOperationSupported` reports when a
590
+ * plan is computed.
591
+ */
592
+ const providerOperations = {
593
+ createPersistentForwarding: supportedOperationsMetadata.createPersistentForwarding !== undefined,
594
+ initiateTransfer: supportedOperationsMetadata.initiateTransfer !== undefined,
595
+ simulateTransfer: supportedOperationsMetadata.simulateTransfer !== undefined
596
+ };
416
597
  function getProviderSupportedOperationsForRail(railSpecific) {
417
- const retval = {
418
- createPersistentForwarding: supportedOperationsMetadata.createPersistentForwarding !== undefined,
419
- initiateTransfer: supportedOperationsMetadata.initiateTransfer !== undefined
420
- };
598
+ const retval = { ...providerOperations };
421
599
  if (railSpecific) {
422
600
  retval.createPersistentForwarding = railSpecific.createPersistentForwarding ?? false;
423
601
  retval.initiateTransfer = railSpecific.initiateTransfer ?? false;
@@ -455,6 +633,7 @@ class AnchorGraph {
455
633
  pathNodes.push({
456
634
  type: 'assetMovement',
457
635
  providerID: providerID,
636
+ providerOperations: providerOperations,
458
637
  from: makeFromTo({ asset: src, rail: inboundRail }),
459
638
  to: makeFromTo({ asset: dest, rail: outboundRail })
460
639
  });
@@ -1174,9 +1353,37 @@ export class AnchorChainingPath {
1174
1353
  this.path = input.path;
1175
1354
  this.parent = input.parent;
1176
1355
  }
1356
+ /**
1357
+ * Synchronously check whether this path is structurally and request valid,
1358
+ * with no network call. Returns { valid: true } when the request value and
1359
+ * affinity are well formed and the path step shape is allowed.
1360
+ *
1361
+ * Persistent-forwarding rules differ between a default plan and a
1362
+ * forwarding-only plan, so pass the same forwardingOnly value you intend to
1363
+ * pass to getPlans/AnchorChainingPlan.create. Validating with the wrong mode
1364
+ * reports the wrong rules.
1365
+ *
1366
+ * This does NOT confirm the path will succeed: real feasibility (provider
1367
+ * availability, quotes, fees, simulated amounts) is only known when the plan
1368
+ * is computed via getPlans. Use it as a cheap check in a UI.
1369
+ */
1370
+ validate(options) {
1371
+ try {
1372
+ const { affinity } = validateRequest(this.request);
1373
+ validatePathStructure(this.path, this.request, affinity, options?.forwardingOnly === true, this.keetaLocation);
1374
+ return ({ valid: true });
1375
+ }
1376
+ catch (error) {
1377
+ return ({ valid: false, reason: error instanceof Error ? error.message : String(error) });
1378
+ }
1379
+ }
1177
1380
  get logger() {
1178
1381
  return (this.parent['logger']);
1179
1382
  }
1383
+ /** This client's Keeta chain location, as compared against in #computePlan. */
1384
+ get keetaLocation() {
1385
+ return (`chain:keeta:${this.parent['client'].network}`);
1386
+ }
1180
1387
  async getAccountLike(action, override) {
1181
1388
  let found = undefined;
1182
1389
  if (this.parent['client'].account.isAccount()) {
@@ -1271,32 +1478,15 @@ export class AnchorChainingPlan extends AnchorChainingPath {
1271
1478
  if (this.#_plan) {
1272
1479
  throw (new Error(`Steps have already been computed`));
1273
1480
  }
1481
+ const affinityAndAmount = validateRequest(this.request);
1482
+ const { affinity } = affinityAndAmount;
1483
+ validatePathStructure(this.path, this.request, affinity, this.#options?.forwardingOnly === true, this.keetaLocation);
1274
1484
  const sharedClientOptions = {
1275
1485
  resolver: this.parent['resolver'],
1276
1486
  ...(this.parent['logger'] ? { logger: this.parent['logger'] } : {})
1277
1487
  };
1278
1488
  const fxClient = new KeetaFXAnchorClient(this.parent['client'], sharedClientOptions);
1279
1489
  const assetMovementClient = new KeetaAssetMovementAnchorClient(this.parent['client'], sharedClientOptions);
1280
- let affinityAndAmount = undefined;
1281
- if (this.request.source.value !== undefined && this.request.destination.value !== undefined) {
1282
- throw (new Error('Must have source.value or destination.value but not both'));
1283
- }
1284
- else if (this.request.source.value !== undefined) {
1285
- affinityAndAmount = {
1286
- affinity: 'from',
1287
- amount: this.request.source.value
1288
- };
1289
- }
1290
- else if (this.request.destination.value !== undefined) {
1291
- affinityAndAmount = {
1292
- affinity: 'to',
1293
- amount: this.request.destination.value
1294
- };
1295
- }
1296
- else {
1297
- throw (new Error('Must have source.value or destination.value'));
1298
- }
1299
- const { affinity } = affinityAndAmount;
1300
1490
  const findInstruction = (allInstructions, type) => {
1301
1491
  const found = allInstructions.find((instr) => {
1302
1492
  return (instr.type === type);
@@ -1391,6 +1581,7 @@ export class AnchorChainingPlan extends AnchorChainingPath {
1391
1581
  // (implied). Reject partial ops that omit the flag - those imply false.
1392
1582
  const pfrEligible = supportsPersistentForwarding(scanStep.from.supportedOperations, 'implied');
1393
1583
  const sourceIsKeeta = isChainLocation(toAssetLocation(scanStep.from.location), 'keeta');
1584
+ // Defense in depth: validatePathStructure enforces this before any network call.
1394
1585
  if (sourceIsKeeta || !pfrEligible) {
1395
1586
  throw (new Error(`Forwarding-only plan requires persistent forwarding support on every leg, but step ${scanIndex} at ${convertAssetLocationToString(scanStep.from.location)} does not qualify`));
1396
1587
  }
@@ -1449,6 +1640,12 @@ export class AnchorChainingPlan extends AnchorChainingPath {
1449
1640
  if (!shouldUsePFR) {
1450
1641
  continue;
1451
1642
  }
1643
+ /*
1644
+ * Defense in depth: validatePathStructure enforces these PFR rules before
1645
+ * any network call. They are kept here next to the operation so the
1646
+ * guarantee holds even if the early pass is bypassed. The typeof check
1647
+ * also narrows destinationAddress to string for the call below.
1648
+ */
1452
1649
  if (!pfrSupported) {
1453
1650
  throw (new Error(`Asset movement provider ${scanStep.providerID} source rail ${scanStep.from.rail} at ${convertAssetLocationToString(scanStep.from.location)} declares initiateTransfer:false but does not support createPersistentForwarding`));
1454
1651
  }
@@ -1532,6 +1729,11 @@ export class AnchorChainingPlan extends AnchorChainingPath {
1532
1729
  return ({ type: 'fx', step, valueIn, valueOut, result });
1533
1730
  }
1534
1731
  else if (step.type === 'assetMovement') {
1732
+ /*
1733
+ * Defense in depth: validatePathStructure rejects affinity 'to' on
1734
+ * asset-movement steps before any network call. This guard keeps the
1735
+ * check next to the operation in case the early pass is bypassed.
1736
+ */
1535
1737
  if (affinity === 'to') {
1536
1738
  throw (new Error(`Chaining with affinity 'to' is not currently supported for asset movement steps, as it requires looking up transfer quotes/estimates which is not currently implemented`));
1537
1739
  }
@@ -1638,7 +1840,7 @@ export class AnchorChainingPlan extends AnchorChainingPath {
1638
1840
  }
1639
1841
  resolvedRecipient = pfiAddress;
1640
1842
  }
1641
- else if (nextPathStep.from.location === `chain:keeta:${this.parent['client'].network}`) {
1843
+ else if (nextPathStep.from.location === this.keetaLocation) {
1642
1844
  const { account } = await this.getAccountsForAction({
1643
1845
  type: 'assetMovement',
1644
1846
  providerMethod: 'initiateTransfer'
@@ -1683,6 +1885,7 @@ export class AnchorChainingPlan extends AnchorChainingPath {
1683
1885
  return (isFiatRail(input.type));
1684
1886
  };
1685
1887
  if (foundInstruction.type === 'KEETA_SEND') {
1888
+ // Structurally unreachable now that validatePathStructure requires a keetaSend step to be the sole step; kept as a defensive invariant.
1686
1889
  throw (new Error(`Cannot currently chain from asset movement to KEETA_SEND step, as this implies multiple keeta locations in the path which is not currently supported`));
1687
1890
  }
1688
1891
  else if (isFiatPushRailFoundInstruction(foundInstruction)) {
@@ -1750,6 +1953,7 @@ export class AnchorChainingPlan extends AnchorChainingPath {
1750
1953
  });
1751
1954
  }
1752
1955
  else if (step.type === 'keetaSend') {
1956
+ // Defense in depth: validatePathStructure also enforces this early.
1753
1957
  if (this.path.length !== 1) {
1754
1958
  throw (new Error(`Direct same-location/same-asset send steps must be the only step in the path`));
1755
1959
  }
@@ -1957,6 +2161,19 @@ export class AnchorChainingPlan extends AnchorChainingPath {
1957
2161
  const external = await builder.build();
1958
2162
  return (external);
1959
2163
  }
2164
+ /**
2165
+ * Retry policy for a single status poll.
2166
+ */
2167
+ #pollRetryOptions(scope, deadline, options) {
2168
+ const remainingMs = Math.max(0, deadline - Date.now());
2169
+ return ({
2170
+ ...options?.poll,
2171
+ maxTotalMs: Math.min(options?.poll?.maxTotalMs ?? remainingMs, remainingMs),
2172
+ loggerContext: scope,
2173
+ ...(options?.abortSignal ? { abortSignal: options.abortSignal } : {}),
2174
+ ...(this.logger ? { logger: this.logger } : {})
2175
+ });
2176
+ }
1960
2177
  async #pollTransferStatus(transfer, context, options) {
1961
2178
  const intervalMs = options?.intervalMs ?? 2000;
1962
2179
  const timeoutMs = options?.timeoutMs ?? 300_000;
@@ -1965,7 +2182,9 @@ export class AnchorChainingPlan extends AnchorChainingPath {
1965
2182
  if (options?.abortSignal?.aborted) {
1966
2183
  throw (new Error(`Aborted while waiting for transfer ${transfer.transferID} to complete`));
1967
2184
  }
1968
- const status = await transfer.getTransferStatus();
2185
+ const status = await withRetry(async function () {
2186
+ return (await transfer.getTransferStatus());
2187
+ }, this.#pollRetryOptions('AnchorChainingPlan::pollTransferStatus', deadline, options));
1969
2188
  this.#emit('transactionObserved', {
1970
2189
  stepIndex: context.stepIndex,
1971
2190
  planStep: context.planStep,
@@ -2044,7 +2263,9 @@ export class AnchorChainingPlan extends AnchorChainingPath {
2044
2263
  if (options?.abortSignal?.aborted) {
2045
2264
  throw (new Error(`Aborted while waiting for FX exchange ${exchange.exchange.exchangeID} to complete`));
2046
2265
  }
2047
- const status = await exchange.getExchangeStatus();
2266
+ const status = await withRetry(async function () {
2267
+ return (await exchange.getExchangeStatus());
2268
+ }, this.#pollRetryOptions('AnchorChainingPlan::pollExchangeStatus', deadline, options));
2048
2269
  if (status.status === 'completed') {
2049
2270
  return (status);
2050
2271
  }
@@ -2114,7 +2335,7 @@ export class AnchorChainingPlan extends AnchorChainingPath {
2114
2335
  }
2115
2336
  if (step.type === 'fx') {
2116
2337
  const exchange = await step.result.createExchange(undefined, { inputs: [...publishedInputs] });
2117
- const exchangeStatus = await this.#pollExchangeStatus(exchange);
2338
+ const exchangeStatus = await this.#pollExchangeStatus(exchange, options);
2118
2339
  publishedInputs.push({ blockHash: exchangeStatus.blockhash });
2119
2340
  prevActualValueOut = step.valueOut;
2120
2341
  prevWithdrawTx = null;
@@ -2124,9 +2345,7 @@ export class AnchorChainingPlan extends AnchorChainingPath {
2124
2345
  if (!prevWithdrawTx) {
2125
2346
  throw (new Error(`Forwarded step at index ${index} requires the prior step to produce a withdraw transaction on its destination chain`));
2126
2347
  }
2127
- const observed = await this.#pollForwardedTransaction(step, prevWithdrawTx, pollContext, {
2128
- ...(options?.abortSignal ? { abortSignal: options.abortSignal } : {})
2129
- });
2348
+ const observed = await this.#pollForwardedTransaction(step, prevWithdrawTx, pollContext, options);
2130
2349
  prevActualValueOut = BigInt(observed.to.value);
2131
2350
  prevWithdrawTx = null;
2132
2351
  onStepCompleted({ type: 'forwarded', plan: step, observedTransaction: observed });
@@ -2166,9 +2385,7 @@ export class AnchorChainingPlan extends AnchorChainingPath {
2166
2385
  throw (new Error(`Unsupported instruction type ${step.usingInstruction.type} for user-initiated transfer at step ${index}`));
2167
2386
  }
2168
2387
  if (step.type === 'assetMovement') {
2169
- const status = await this.#pollTransferStatus(step.transfer, pollContext, {
2170
- ...(options?.abortSignal ? { abortSignal: options.abortSignal } : {})
2171
- });
2388
+ const status = await this.#pollTransferStatus(step.transfer, pollContext, options);
2172
2389
  prevActualValueOut = BigInt(status.transaction.to.value);
2173
2390
  const withdraw = status.transaction.to.transactions.withdraw;
2174
2391
  if (withdraw) {
@@ -2249,6 +2466,13 @@ export class AnchorChainingForwardingOnlyPlan extends AnchorChainingPath {
2249
2466
  listFees() {
2250
2467
  return (listChainingPlanFees(this));
2251
2468
  }
2469
+ /**
2470
+ * Always validated as forwarding-only, since that is the only mode this
2471
+ * class is ever computed under.
2472
+ */
2473
+ validate(options) {
2474
+ return (super.validate({ ...options, forwardingOnly: true }));
2475
+ }
2252
2476
  static async create(path, options) {
2253
2477
  const computed = await AnchorChainingPlan.create(path, { ...options, forwardingOnly: true });
2254
2478
  if (!isForwardingPlan(computed)) {
@@ -2335,7 +2559,10 @@ export class AnchorChaining {
2335
2559
  }
2336
2560
  async getPlans(input, options) {
2337
2561
  const forwardingOpts = normalizeForwardingOnlyOptions(options?.forwardingOnly);
2338
- const paths = await this.getPaths(input, options?.forwardingOnly ? { forwardingOnly: options.forwardingOnly } : undefined);
2562
+ const paths = await this.getPaths(input, {
2563
+ ...(options?.forwardingOnly ? { forwardingOnly: options.forwardingOnly } : {}),
2564
+ ...(options?.maxPathLength !== undefined ? { maxPathLength: options.maxPathLength } : {})
2565
+ });
2339
2566
  if (!paths) {
2340
2567
  return (null);
2341
2568
  }