@rhea-finance/cross-chain-aggregation-dex 2.0.8 → 2.0.9
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/README.md +1 -1
- package/dist/executors/aptos.d.mts +1 -1
- package/dist/executors/aptos.d.ts +1 -1
- package/dist/executors/bitcoin.d.mts +1 -1
- package/dist/executors/bitcoin.d.ts +1 -1
- package/dist/executors/evm.d.mts +1 -1
- package/dist/executors/evm.d.ts +1 -1
- package/dist/executors/near.d.mts +1 -1
- package/dist/executors/near.d.ts +1 -1
- package/dist/executors/solana.d.mts +1 -1
- package/dist/executors/solana.d.ts +1 -1
- package/dist/executors/sui.d.mts +1 -1
- package/dist/executors/sui.d.ts +1 -1
- package/dist/executors/tron.d.mts +1 -1
- package/dist/executors/tron.d.ts +1 -1
- package/dist/executors/zcash.d.mts +1 -1
- package/dist/executors/zcash.d.ts +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -6
- package/dist/index.mjs.map +1 -1
- package/dist/{shared-BWv_QHdw.d.mts → shared-DpC8G2U4.d.mts} +4 -2
- package/dist/{shared-BWv_QHdw.d.ts → shared-DpC8G2U4.d.ts} +4 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -29,8 +29,15 @@ function asSwapSdkError(error, stage) {
|
|
|
29
29
|
// src/utils/orderStatus.ts
|
|
30
30
|
function resolveSwapReportRecordId(reportData) {
|
|
31
31
|
if (!reportData || typeof reportData !== "object") return "";
|
|
32
|
-
const
|
|
33
|
-
|
|
32
|
+
const record = reportData;
|
|
33
|
+
for (const key of ["id", "recordId", "record_id"]) {
|
|
34
|
+
const value = record[key];
|
|
35
|
+
if (value !== void 0 && value !== null) {
|
|
36
|
+
const normalized = String(value).trim();
|
|
37
|
+
if (normalized) return normalized;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return "";
|
|
34
41
|
}
|
|
35
42
|
function buildOrderStatusQuery(params) {
|
|
36
43
|
const normalizedRecordId = String(params.recordId ?? "").trim();
|
|
@@ -2295,8 +2302,10 @@ var McaSwapService = class {
|
|
|
2295
2302
|
raw
|
|
2296
2303
|
};
|
|
2297
2304
|
emit({ type: "submitted", executionId, orderId });
|
|
2305
|
+
const mustReportForStatus = input.waitFor === "completed";
|
|
2306
|
+
const shouldReportNow = this.reportMode !== "disabled" && (this.reportMode === "auto" || mustReportForStatus);
|
|
2298
2307
|
let reportRecordId;
|
|
2299
|
-
if (
|
|
2308
|
+
if (shouldReportNow) {
|
|
2300
2309
|
try {
|
|
2301
2310
|
const reportData = await this.client.reportRaw(reportRequest, {
|
|
2302
2311
|
signal: input.signal
|
|
@@ -2597,12 +2606,16 @@ var SwapClient = class {
|
|
|
2597
2606
|
executionId: build.executionId
|
|
2598
2607
|
});
|
|
2599
2608
|
}
|
|
2609
|
+
const waitsForCompletion = (input.waitFor ?? "submitted") === "completed";
|
|
2610
|
+
const requiresOrderStatus = build.isCrossChain || build.request?.confidentiality === "basic";
|
|
2600
2611
|
const reportRequest = this.createReportRequest(build, result);
|
|
2601
2612
|
if (reportRequest) {
|
|
2602
2613
|
this.reportRequests.set(build.executionId, reportRequest);
|
|
2603
2614
|
}
|
|
2615
|
+
const mustReportForStatus = waitsForCompletion && requiresOrderStatus && Boolean(reportRequest);
|
|
2616
|
+
const shouldReportNow = Boolean(reportRequest) && this.reportMode !== "disabled" && (this.reportMode === "auto" || mustReportForStatus);
|
|
2604
2617
|
let reportRecordId;
|
|
2605
|
-
if (
|
|
2618
|
+
if (shouldReportNow && reportRequest) {
|
|
2606
2619
|
try {
|
|
2607
2620
|
const reportData = await this.api.report(reportRequest, {
|
|
2608
2621
|
signal: input.signal
|
|
@@ -2622,8 +2635,6 @@ var SwapClient = class {
|
|
|
2622
2635
|
emit({ type: "warning", executionId: build.executionId, warning });
|
|
2623
2636
|
}
|
|
2624
2637
|
}
|
|
2625
|
-
const waitsForCompletion = (input.waitFor ?? "submitted") === "completed";
|
|
2626
|
-
const requiresOrderStatus = build.isCrossChain || build.request?.confidentiality === "basic";
|
|
2627
2638
|
const statusLookup = resolveOrderStatusLookup({
|
|
2628
2639
|
recordId: reportRecordId ?? result.report?.recordId,
|
|
2629
2640
|
orderId,
|