@rhea-finance/cross-chain-aggregation-dex 2.1.0 → 2.1.1

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/index.mjs CHANGED
@@ -28,6 +28,7 @@ function asSwapSdkError(error, stage) {
28
28
 
29
29
  // src/utils/orderStatus.ts
30
30
  function shouldPollSwapOrderStatus(input) {
31
+ if (String(input.reportRecordId ?? "").trim()) return true;
31
32
  const waitMode = input.waitFor ?? "submitted";
32
33
  const requiresOrderStatus = input.isCrossChain || input.confidentiality === "basic";
33
34
  return requiresOrderStatus && waitMode !== "submitted";
@@ -2584,16 +2585,12 @@ var SwapClient = class {
2584
2585
  });
2585
2586
  }
2586
2587
  const waitMode = input.waitFor ?? "submitted";
2587
- const shouldPollOrderStatus = shouldPollSwapOrderStatus({
2588
- waitFor: waitMode,
2589
- isCrossChain: build.isCrossChain,
2590
- confidentiality: build.request?.confidentiality
2591
- });
2588
+ const requiresTrackedStatus = build.isCrossChain || build.request?.confidentiality === "basic";
2592
2589
  const reportRequest = this.createReportRequest(build, result);
2593
2590
  if (reportRequest) {
2594
2591
  this.reportRequests.set(build.executionId, reportRequest);
2595
2592
  }
2596
- const mustReportForStatus = shouldPollOrderStatus && Boolean(reportRequest);
2593
+ const mustReportForStatus = requiresTrackedStatus && waitMode !== "submitted" && Boolean(reportRequest);
2597
2594
  const shouldReportNow = Boolean(reportRequest) && this.reportMode !== "disabled" && (this.reportMode === "auto" || mustReportForStatus);
2598
2595
  let reportRecordId;
2599
2596
  if (shouldReportNow && reportRequest) {
@@ -2616,6 +2613,12 @@ var SwapClient = class {
2616
2613
  emit({ type: "warning", executionId: build.executionId, warning });
2617
2614
  }
2618
2615
  }
2616
+ const shouldPollOrderStatus = shouldPollSwapOrderStatus({
2617
+ waitFor: waitMode,
2618
+ isCrossChain: build.isCrossChain,
2619
+ confidentiality: build.request?.confidentiality,
2620
+ reportRecordId
2621
+ });
2619
2622
  const statusLookup = resolveOrderStatusLookup({
2620
2623
  recordId: reportRecordId ?? result.report?.recordId,
2621
2624
  orderId,