@chainstream-io/sdk 2.0.3 → 2.0.5

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.
@@ -3419,6 +3419,14 @@ interface SwapRouteInput {
3419
3419
  tipFee?: string;
3420
3420
  /** DTO.DEX.BASE.IS_ANTI_MEV */
3421
3421
  isAntiMev?: boolean;
3422
+ /** DTO.DEX.SWAP.MAX_FEE_PER_GAS */
3423
+ maxFeePerGas?: string;
3424
+ /** DTO.DEX.SWAP.MAX_PRIORITY_FEE_PER_GAS */
3425
+ maxPriorityFeePerGas?: string;
3426
+ /** DTO.DEX.SWAP.GAS_PRICE */
3427
+ gasPrice?: string;
3428
+ /** DTO.DEX.SWAP.GAS_LIMIT */
3429
+ gasLimit?: string;
3422
3430
  }
3423
3431
  /**
3424
3432
  * DTO.DEX.SWAP.ROUTE_INFO
@@ -3419,6 +3419,14 @@ interface SwapRouteInput {
3419
3419
  tipFee?: string;
3420
3420
  /** DTO.DEX.BASE.IS_ANTI_MEV */
3421
3421
  isAntiMev?: boolean;
3422
+ /** DTO.DEX.SWAP.MAX_FEE_PER_GAS */
3423
+ maxFeePerGas?: string;
3424
+ /** DTO.DEX.SWAP.MAX_PRIORITY_FEE_PER_GAS */
3425
+ maxPriorityFeePerGas?: string;
3426
+ /** DTO.DEX.SWAP.GAS_PRICE */
3427
+ gasPrice?: string;
3428
+ /** DTO.DEX.SWAP.GAS_LIMIT */
3429
+ gasLimit?: string;
3422
3430
  }
3423
3431
  /**
3424
3432
  * DTO.DEX.SWAP.ROUTE_INFO
@@ -2374,13 +2374,21 @@ var ChainStreamClient = class {
2374
2374
  try {
2375
2375
  console.log("event.data: ", event.data);
2376
2376
  const data = JSON.parse(event.data);
2377
+ if (data.status === "pending") return;
2378
+ clearTimeout(timeoutId);
2379
+ sse.close();
2377
2380
  if (data.status === "error") {
2378
- sse.close();
2379
- reject(new Error(`Error: ${data.message}`));
2381
+ reject(new Error(data.error || data.message || "Unknown error"));
2382
+ } else if (data.status === "failed") {
2383
+ reject(new Error(data.error || "Job failed"));
2380
2384
  } else if (data.status === "completed") {
2381
- clearTimeout(timeoutId);
2382
- sse.close();
2383
- resolve(data);
2385
+ if (data.success === false) {
2386
+ reject(new Error(data.error || "Transaction failed"));
2387
+ } else {
2388
+ resolve(data);
2389
+ }
2390
+ } else {
2391
+ reject(new Error(`Unexpected job status: ${data.status}`));
2384
2392
  }
2385
2393
  } catch {
2386
2394
  clearTimeout(timeoutId);