@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/README.md
CHANGED
|
@@ -815,7 +815,7 @@ await client.verifyHistoryAuthChallenge(rawVerifyRequest);
|
|
|
815
815
|
await client.getHistoryRaw(rawHistoryRequest);
|
|
816
816
|
```
|
|
817
817
|
|
|
818
|
-
The default reporting mode is `reportMode: "auto"`. If a swap succeeds but reporting fails, `result.report.status` is `"failed"` and a warning is emitted. The SDK does not throw a misleading swap failure. For manual reporting:
|
|
818
|
+
The default reporting mode is `reportMode: "auto"`. If a swap succeeds but reporting fails, `result.report.status` is `"failed"` and a warning is emitted. The SDK does not throw a misleading swap failure. When `waitFor: "completed"` requires order-status polling, the SDK still calls `POST /api/swap/report` first (even in `reportMode: "manual"`) so it can query status by the returned record id. For other manual reporting flows:
|
|
819
819
|
|
|
820
820
|
```ts
|
|
821
821
|
const client = new SwapClient({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-
|
|
1
|
+
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-DpC8G2U4.mjs';
|
|
2
2
|
|
|
3
3
|
interface AptosWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-
|
|
1
|
+
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-DpC8G2U4.js';
|
|
2
2
|
|
|
3
3
|
interface AptosWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-
|
|
1
|
+
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-DpC8G2U4.mjs';
|
|
2
2
|
|
|
3
3
|
interface BitcoinWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-
|
|
1
|
+
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-DpC8G2U4.js';
|
|
2
2
|
|
|
3
3
|
interface BitcoinWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/executors/evm.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as ExecutorErrorAdapter, a4 as EvmTx, ae as TransactionSubmission, a6 as EvmSigningRequest, a5 as EvmApproval, T as TransactionConfirmation, w as ChainExecutor } from '../shared-
|
|
1
|
+
import { ad as ExecutorErrorAdapter, a4 as EvmTx, ae as TransactionSubmission, a6 as EvmSigningRequest, a5 as EvmApproval, T as TransactionConfirmation, w as ChainExecutor } from '../shared-DpC8G2U4.mjs';
|
|
2
2
|
|
|
3
3
|
interface EvmWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
sendTransaction(tx: EvmTx, options: {
|
package/dist/executors/evm.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as ExecutorErrorAdapter, a4 as EvmTx, ae as TransactionSubmission, a6 as EvmSigningRequest, a5 as EvmApproval, T as TransactionConfirmation, w as ChainExecutor } from '../shared-
|
|
1
|
+
import { ad as ExecutorErrorAdapter, a4 as EvmTx, ae as TransactionSubmission, a6 as EvmSigningRequest, a5 as EvmApproval, T as TransactionConfirmation, w as ChainExecutor } from '../shared-DpC8G2U4.js';
|
|
2
2
|
|
|
3
3
|
interface EvmWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
sendTransaction(tx: EvmTx, options: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as ExecutorErrorAdapter, C as ChainRef, N as NearTransaction, T as TransactionConfirmation, w as ChainExecutor } from '../shared-
|
|
1
|
+
import { ad as ExecutorErrorAdapter, C as ChainRef, N as NearTransaction, T as TransactionConfirmation, w as ChainExecutor } from '../shared-DpC8G2U4.mjs';
|
|
2
2
|
|
|
3
3
|
interface NearWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/executors/near.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as ExecutorErrorAdapter, C as ChainRef, N as NearTransaction, T as TransactionConfirmation, w as ChainExecutor } from '../shared-
|
|
1
|
+
import { ad as ExecutorErrorAdapter, C as ChainRef, N as NearTransaction, T as TransactionConfirmation, w as ChainExecutor } from '../shared-DpC8G2U4.js';
|
|
2
2
|
|
|
3
3
|
interface NearWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as ExecutorErrorAdapter, C as ChainRef, a7 as SolanaMetadata, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-
|
|
1
|
+
import { ad as ExecutorErrorAdapter, C as ChainRef, a7 as SolanaMetadata, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-DpC8G2U4.mjs';
|
|
2
2
|
|
|
3
3
|
interface SolanaWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as ExecutorErrorAdapter, C as ChainRef, a7 as SolanaMetadata, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-
|
|
1
|
+
import { ad as ExecutorErrorAdapter, C as ChainRef, a7 as SolanaMetadata, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-DpC8G2U4.js';
|
|
2
2
|
|
|
3
3
|
interface SolanaWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/executors/sui.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-
|
|
1
|
+
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-DpC8G2U4.mjs';
|
|
2
2
|
|
|
3
3
|
interface SuiWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/executors/sui.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-
|
|
1
|
+
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-DpC8G2U4.js';
|
|
2
2
|
|
|
3
3
|
interface SuiWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-
|
|
1
|
+
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-DpC8G2U4.mjs';
|
|
2
2
|
|
|
3
3
|
interface TronWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/executors/tron.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-
|
|
1
|
+
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-DpC8G2U4.js';
|
|
2
2
|
|
|
3
3
|
interface TronWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-
|
|
1
|
+
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-DpC8G2U4.mjs';
|
|
2
2
|
|
|
3
3
|
interface ZcashWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-
|
|
1
|
+
import { ad as ExecutorErrorAdapter, C as ChainRef, ae as TransactionSubmission, T as TransactionConfirmation, w as ChainExecutor } from '../shared-DpC8G2U4.js';
|
|
2
2
|
|
|
3
3
|
interface ZcashWalletAdapter extends ExecutorErrorAdapter {
|
|
4
4
|
getChain(): ChainRef | Promise<ChainRef>;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SwapQuoteRequestRaw, a as SwapQuoteDataRaw, b as SwapBuildRequestRaw, c as SwapBuildDataRaw, d as SwapOrderSubmitRequestRaw, e as SwapOrderSubmitDataRaw, f as SwapOrderStatusParamsRaw, g as SwapOrderStatusDataRaw, h as SwapReportRequestRaw, i as SwapReportDataRaw, j as SwapHistoryParamsRaw, k as SwapHistoryDataRaw, l as SwapHistoryAuthChallengeRequestRaw, m as SwapHistoryAuthChallengeRaw, n as SwapHistoryAuthVerifyRequestRaw, o as SwapHistoryAuthTokenRaw, p as SwapFromTokensDataRaw, q as SwapCrossChainToTokensDataRaw, Q as QuoteRequest, r as Quote, s as SwapMcaPayloadRaw, W as WaitMode, O as OrderPollingOptions, t as SwapLifecycleEvent, u as SwapExecutionResult, C as ChainRef, A as AssetRef, B as BaseUnitAmount, v as SwapHistoryRecordRaw, w as ChainExecutor, E as ExecutorRegistry, x as SwapBuild, y as ExecuteSwapInput, z as SwapInput, D as OrderReference, F as OrderStatusResult, G as WaitForOrderInput, H as SwapHistoryAuthProofRaw, N as NearTransaction, I as SwapMcaRelayerRequestRaw } from './shared-
|
|
2
|
-
export { ac as BuildContext, _ as ChainExecutionResult, a8 as DepositInfo, a5 as EvmApproval, a6 as EvmSigningRequest, a4 as EvmTx, $ as ExecutionContext, a1 as ExecutorIdentityProvider, a2 as ExecutorMessageSigner, a0 as MessageSignOptions, Y as OrderStatus, ab as RouteSummary, X as SignRequestPreview, a7 as SolanaMetadata, J as SwapApiResponse, K as SwapApiTokenMetaRaw, R as SwapBuildApproveRaw, aa as SwapExecution, U as SwapHistoryWalletChainFamilyRaw, M as SwapMcaSignerPayloadRaw, a9 as SwapReportContext, P as SwapSigningRequestRaw, L as SwapTokenListRowRaw, V as SwapWarning, T as TransactionConfirmation, a3 as assertBaseUnitAmount, Z as normalizeOrderStatus } from './shared-
|
|
1
|
+
import { S as SwapQuoteRequestRaw, a as SwapQuoteDataRaw, b as SwapBuildRequestRaw, c as SwapBuildDataRaw, d as SwapOrderSubmitRequestRaw, e as SwapOrderSubmitDataRaw, f as SwapOrderStatusParamsRaw, g as SwapOrderStatusDataRaw, h as SwapReportRequestRaw, i as SwapReportDataRaw, j as SwapHistoryParamsRaw, k as SwapHistoryDataRaw, l as SwapHistoryAuthChallengeRequestRaw, m as SwapHistoryAuthChallengeRaw, n as SwapHistoryAuthVerifyRequestRaw, o as SwapHistoryAuthTokenRaw, p as SwapFromTokensDataRaw, q as SwapCrossChainToTokensDataRaw, Q as QuoteRequest, r as Quote, s as SwapMcaPayloadRaw, W as WaitMode, O as OrderPollingOptions, t as SwapLifecycleEvent, u as SwapExecutionResult, C as ChainRef, A as AssetRef, B as BaseUnitAmount, v as SwapHistoryRecordRaw, w as ChainExecutor, E as ExecutorRegistry, x as SwapBuild, y as ExecuteSwapInput, z as SwapInput, D as OrderReference, F as OrderStatusResult, G as WaitForOrderInput, H as SwapHistoryAuthProofRaw, N as NearTransaction, I as SwapMcaRelayerRequestRaw } from './shared-DpC8G2U4.mjs';
|
|
2
|
+
export { ac as BuildContext, _ as ChainExecutionResult, a8 as DepositInfo, a5 as EvmApproval, a6 as EvmSigningRequest, a4 as EvmTx, $ as ExecutionContext, a1 as ExecutorIdentityProvider, a2 as ExecutorMessageSigner, a0 as MessageSignOptions, Y as OrderStatus, ab as RouteSummary, X as SignRequestPreview, a7 as SolanaMetadata, J as SwapApiResponse, K as SwapApiTokenMetaRaw, R as SwapBuildApproveRaw, aa as SwapExecution, U as SwapHistoryWalletChainFamilyRaw, M as SwapMcaSignerPayloadRaw, a9 as SwapReportContext, P as SwapSigningRequestRaw, L as SwapTokenListRowRaw, V as SwapWarning, T as TransactionConfirmation, a3 as assertBaseUnitAmount, Z as normalizeOrderStatus } from './shared-DpC8G2U4.mjs';
|
|
3
3
|
|
|
4
4
|
type SwapErrorCode = "HTTP_ERROR" | "API_ERROR" | "RATE_LIMITED" | "AUTH_FAILED" | "REQUEST_ABORTED" | "REQUEST_TIMEOUT" | "INVALID_REQUEST" | "INVALID_API_RESPONSE" | "QUOTE_EXPIRED" | "ROUTE_NOT_FOUND" | "EXECUTOR_NOT_FOUND" | "UNSUPPORTED_CHAIN" | "CHAIN_MISMATCH" | "INVALID_TRANSACTION" | "USER_REJECTED" | "INSUFFICIENT_BALANCE" | "APPROVAL_FAILED" | "SIGNING_FAILED" | "BROADCAST_FAILED" | "ORDER_SUBMIT_FAILED" | "ORDER_TIMEOUT" | "REPORT_FAILED";
|
|
5
5
|
type SwapErrorStage = "quote" | "build" | "approve" | "sign" | "broadcast" | "submit" | "report" | "status" | "tokens" | "history";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SwapQuoteRequestRaw, a as SwapQuoteDataRaw, b as SwapBuildRequestRaw, c as SwapBuildDataRaw, d as SwapOrderSubmitRequestRaw, e as SwapOrderSubmitDataRaw, f as SwapOrderStatusParamsRaw, g as SwapOrderStatusDataRaw, h as SwapReportRequestRaw, i as SwapReportDataRaw, j as SwapHistoryParamsRaw, k as SwapHistoryDataRaw, l as SwapHistoryAuthChallengeRequestRaw, m as SwapHistoryAuthChallengeRaw, n as SwapHistoryAuthVerifyRequestRaw, o as SwapHistoryAuthTokenRaw, p as SwapFromTokensDataRaw, q as SwapCrossChainToTokensDataRaw, Q as QuoteRequest, r as Quote, s as SwapMcaPayloadRaw, W as WaitMode, O as OrderPollingOptions, t as SwapLifecycleEvent, u as SwapExecutionResult, C as ChainRef, A as AssetRef, B as BaseUnitAmount, v as SwapHistoryRecordRaw, w as ChainExecutor, E as ExecutorRegistry, x as SwapBuild, y as ExecuteSwapInput, z as SwapInput, D as OrderReference, F as OrderStatusResult, G as WaitForOrderInput, H as SwapHistoryAuthProofRaw, N as NearTransaction, I as SwapMcaRelayerRequestRaw } from './shared-
|
|
2
|
-
export { ac as BuildContext, _ as ChainExecutionResult, a8 as DepositInfo, a5 as EvmApproval, a6 as EvmSigningRequest, a4 as EvmTx, $ as ExecutionContext, a1 as ExecutorIdentityProvider, a2 as ExecutorMessageSigner, a0 as MessageSignOptions, Y as OrderStatus, ab as RouteSummary, X as SignRequestPreview, a7 as SolanaMetadata, J as SwapApiResponse, K as SwapApiTokenMetaRaw, R as SwapBuildApproveRaw, aa as SwapExecution, U as SwapHistoryWalletChainFamilyRaw, M as SwapMcaSignerPayloadRaw, a9 as SwapReportContext, P as SwapSigningRequestRaw, L as SwapTokenListRowRaw, V as SwapWarning, T as TransactionConfirmation, a3 as assertBaseUnitAmount, Z as normalizeOrderStatus } from './shared-
|
|
1
|
+
import { S as SwapQuoteRequestRaw, a as SwapQuoteDataRaw, b as SwapBuildRequestRaw, c as SwapBuildDataRaw, d as SwapOrderSubmitRequestRaw, e as SwapOrderSubmitDataRaw, f as SwapOrderStatusParamsRaw, g as SwapOrderStatusDataRaw, h as SwapReportRequestRaw, i as SwapReportDataRaw, j as SwapHistoryParamsRaw, k as SwapHistoryDataRaw, l as SwapHistoryAuthChallengeRequestRaw, m as SwapHistoryAuthChallengeRaw, n as SwapHistoryAuthVerifyRequestRaw, o as SwapHistoryAuthTokenRaw, p as SwapFromTokensDataRaw, q as SwapCrossChainToTokensDataRaw, Q as QuoteRequest, r as Quote, s as SwapMcaPayloadRaw, W as WaitMode, O as OrderPollingOptions, t as SwapLifecycleEvent, u as SwapExecutionResult, C as ChainRef, A as AssetRef, B as BaseUnitAmount, v as SwapHistoryRecordRaw, w as ChainExecutor, E as ExecutorRegistry, x as SwapBuild, y as ExecuteSwapInput, z as SwapInput, D as OrderReference, F as OrderStatusResult, G as WaitForOrderInput, H as SwapHistoryAuthProofRaw, N as NearTransaction, I as SwapMcaRelayerRequestRaw } from './shared-DpC8G2U4.js';
|
|
2
|
+
export { ac as BuildContext, _ as ChainExecutionResult, a8 as DepositInfo, a5 as EvmApproval, a6 as EvmSigningRequest, a4 as EvmTx, $ as ExecutionContext, a1 as ExecutorIdentityProvider, a2 as ExecutorMessageSigner, a0 as MessageSignOptions, Y as OrderStatus, ab as RouteSummary, X as SignRequestPreview, a7 as SolanaMetadata, J as SwapApiResponse, K as SwapApiTokenMetaRaw, R as SwapBuildApproveRaw, aa as SwapExecution, U as SwapHistoryWalletChainFamilyRaw, M as SwapMcaSignerPayloadRaw, a9 as SwapReportContext, P as SwapSigningRequestRaw, L as SwapTokenListRowRaw, V as SwapWarning, T as TransactionConfirmation, a3 as assertBaseUnitAmount, Z as normalizeOrderStatus } from './shared-DpC8G2U4.js';
|
|
3
3
|
|
|
4
4
|
type SwapErrorCode = "HTTP_ERROR" | "API_ERROR" | "RATE_LIMITED" | "AUTH_FAILED" | "REQUEST_ABORTED" | "REQUEST_TIMEOUT" | "INVALID_REQUEST" | "INVALID_API_RESPONSE" | "QUOTE_EXPIRED" | "ROUTE_NOT_FOUND" | "EXECUTOR_NOT_FOUND" | "UNSUPPORTED_CHAIN" | "CHAIN_MISMATCH" | "INVALID_TRANSACTION" | "USER_REJECTED" | "INSUFFICIENT_BALANCE" | "APPROVAL_FAILED" | "SIGNING_FAILED" | "BROADCAST_FAILED" | "ORDER_SUBMIT_FAILED" | "ORDER_TIMEOUT" | "REPORT_FAILED";
|
|
5
5
|
type SwapErrorStage = "quote" | "build" | "approve" | "sign" | "broadcast" | "submit" | "report" | "status" | "tokens" | "history";
|
package/dist/index.js
CHANGED
|
@@ -31,8 +31,15 @@ function asSwapSdkError(error, stage) {
|
|
|
31
31
|
// src/utils/orderStatus.ts
|
|
32
32
|
function resolveSwapReportRecordId(reportData) {
|
|
33
33
|
if (!reportData || typeof reportData !== "object") return "";
|
|
34
|
-
const
|
|
35
|
-
|
|
34
|
+
const record = reportData;
|
|
35
|
+
for (const key of ["id", "recordId", "record_id"]) {
|
|
36
|
+
const value = record[key];
|
|
37
|
+
if (value !== void 0 && value !== null) {
|
|
38
|
+
const normalized = String(value).trim();
|
|
39
|
+
if (normalized) return normalized;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return "";
|
|
36
43
|
}
|
|
37
44
|
function buildOrderStatusQuery(params) {
|
|
38
45
|
const normalizedRecordId = String(params.recordId ?? "").trim();
|
|
@@ -2297,8 +2304,10 @@ var McaSwapService = class {
|
|
|
2297
2304
|
raw
|
|
2298
2305
|
};
|
|
2299
2306
|
emit({ type: "submitted", executionId, orderId });
|
|
2307
|
+
const mustReportForStatus = input.waitFor === "completed";
|
|
2308
|
+
const shouldReportNow = this.reportMode !== "disabled" && (this.reportMode === "auto" || mustReportForStatus);
|
|
2300
2309
|
let reportRecordId;
|
|
2301
|
-
if (
|
|
2310
|
+
if (shouldReportNow) {
|
|
2302
2311
|
try {
|
|
2303
2312
|
const reportData = await this.client.reportRaw(reportRequest, {
|
|
2304
2313
|
signal: input.signal
|
|
@@ -2599,12 +2608,16 @@ var SwapClient = class {
|
|
|
2599
2608
|
executionId: build.executionId
|
|
2600
2609
|
});
|
|
2601
2610
|
}
|
|
2611
|
+
const waitsForCompletion = (input.waitFor ?? "submitted") === "completed";
|
|
2612
|
+
const requiresOrderStatus = build.isCrossChain || build.request?.confidentiality === "basic";
|
|
2602
2613
|
const reportRequest = this.createReportRequest(build, result);
|
|
2603
2614
|
if (reportRequest) {
|
|
2604
2615
|
this.reportRequests.set(build.executionId, reportRequest);
|
|
2605
2616
|
}
|
|
2617
|
+
const mustReportForStatus = waitsForCompletion && requiresOrderStatus && Boolean(reportRequest);
|
|
2618
|
+
const shouldReportNow = Boolean(reportRequest) && this.reportMode !== "disabled" && (this.reportMode === "auto" || mustReportForStatus);
|
|
2606
2619
|
let reportRecordId;
|
|
2607
|
-
if (
|
|
2620
|
+
if (shouldReportNow && reportRequest) {
|
|
2608
2621
|
try {
|
|
2609
2622
|
const reportData = await this.api.report(reportRequest, {
|
|
2610
2623
|
signal: input.signal
|
|
@@ -2624,8 +2637,6 @@ var SwapClient = class {
|
|
|
2624
2637
|
emit({ type: "warning", executionId: build.executionId, warning });
|
|
2625
2638
|
}
|
|
2626
2639
|
}
|
|
2627
|
-
const waitsForCompletion = (input.waitFor ?? "submitted") === "completed";
|
|
2628
|
-
const requiresOrderStatus = build.isCrossChain || build.request?.confidentiality === "basic";
|
|
2629
2640
|
const statusLookup = resolveOrderStatusLookup({
|
|
2630
2641
|
recordId: reportRecordId ?? result.report?.recordId,
|
|
2631
2642
|
orderId,
|