@rango-dev/queue-manager-rango-preset 0.1.12 → 0.1.13-next.0

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.
@@ -2114,7 +2114,7 @@ function retryOn(wallet_network, notifier, manager, options) {
2114
2114
  We only run one request at a time (In parallel mode).
2115
2115
  */
2116
2116
  function isNeedBlockQueueForParallel(step) {
2117
- return !!step.evmTransaction || !!step.evmApprovalTransaction || !!step.cosmosTransaction;
2117
+ return !!step.evmTransaction || !!step.evmApprovalTransaction;
2118
2118
  }
2119
2119
  /*
2120
2120
  Create transaction endpoint doesn't return error code on http status code,
@@ -2215,6 +2215,12 @@ function _checkTransactionStatus() {
2215
2215
  retry();
2216
2216
  return _context.abrupt("return");
2217
2217
  case 17:
2218
+ if (!((currentStep == null ? void 0 : currentStep.status) === 'failed')) {
2219
+ _context.next = 19;
2220
+ break;
2221
+ }
2222
+ return _context.abrupt("return");
2223
+ case 19:
2218
2224
  outputAmount = ((_status = status) == null ? void 0 : _status.outputAmount) || (!!currentStep.outputAmount ? currentStep.outputAmount : null);
2219
2225
  prevOutputAmount = currentStep.outputAmount || null;
2220
2226
  swap.extraMessage = ((_status2 = status) == null ? void 0 : _status2.extraMessage) || swap.extraMessage;
@@ -2279,19 +2285,19 @@ function _checkTransactionStatus() {
2279
2285
  swapDetails: swap
2280
2286
  }));
2281
2287
  if (!(((_status8 = status) == null ? void 0 : _status8.status) === 'failed' || ((_status9 = status) == null ? void 0 : _status9.status) === 'success' || ((_status10 = status) == null ? void 0 : _status10.status) === 'running' && !!status.newTx)) {
2282
- _context.next = 37;
2288
+ _context.next = 39;
2283
2289
  break;
2284
2290
  }
2285
2291
  schedule(SwapActionTypes.SCHEDULE_NEXT_STEP);
2286
2292
  next();
2287
- _context.next = 40;
2293
+ _context.next = 42;
2288
2294
  break;
2289
- case 37:
2290
- _context.next = 39;
2291
- return delay(INTERVAL_FOR_CHECK);
2292
2295
  case 39:
2296
+ _context.next = 41;
2297
+ return delay(INTERVAL_FOR_CHECK);
2298
+ case 41:
2293
2299
  retry();
2294
- case 40:
2300
+ case 42:
2295
2301
  case "end":
2296
2302
  return _context.stop();
2297
2303
  }
@@ -2317,14 +2323,7 @@ function _checkApprovalStatus() {
2317
2323
  while (1) switch (_context2.prev = _context2.next) {
2318
2324
  case 0:
2319
2325
  getStorage = _ref2.getStorage, setStorage = _ref2.setStorage, next = _ref2.next, schedule = _ref2.schedule, retry = _ref2.retry, failed = _ref2.failed, context = _ref2.context;
2320
- swap = getStorage().swapDetails; // double check it after fixing parallel
2321
- // const onFinish = () => {
2322
- // // TODO resetClaimedBy is undefined here
2323
- // if (context.resetClaimedBy) {
2324
- // context.resetClaimedBy();
2325
- // }
2326
- // };
2327
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
2326
+ swap = getStorage().swapDetails; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
2328
2327
  currentStep = getCurrentStep(swap);
2329
2328
  isApproved = false;
2330
2329
  _context2.prev = 4;
@@ -2332,6 +2331,12 @@ function _checkApprovalStatus() {
2332
2331
  return httpService().checkApproval(swap.requestId, currentStep.executedTransactionId || '');
2333
2332
  case 7:
2334
2333
  response = _context2.sent;
2334
+ if (!((currentStep == null ? void 0 : currentStep.status) === 'failed')) {
2335
+ _context2.next = 10;
2336
+ break;
2337
+ }
2338
+ return _context2.abrupt("return");
2339
+ case 10:
2335
2340
  isApproved = response.isApproved;
2336
2341
  if (!isApproved && response.txStatus === 'failed') {
2337
2342
  // approve transaction failed on
@@ -2358,15 +2363,15 @@ function _checkApprovalStatus() {
2358
2363
  step: currentStep
2359
2364
  });
2360
2365
  }
2361
- _context2.next = 15;
2366
+ _context2.next = 17;
2362
2367
  break;
2363
- case 12:
2364
- _context2.prev = 12;
2368
+ case 14:
2369
+ _context2.prev = 14;
2365
2370
  _context2.t0 = _context2["catch"](4);
2366
2371
  isApproved = false;
2367
- case 15:
2372
+ case 17:
2368
2373
  if (!isApproved) {
2369
- _context2.next = 31;
2374
+ _context2.next = 33;
2370
2375
  break;
2371
2376
  }
2372
2377
  currentStep.status = 'approved';
@@ -2388,18 +2393,18 @@ function _checkApprovalStatus() {
2388
2393
  });
2389
2394
  schedule(SwapActionTypes.SCHEDULE_NEXT_STEP);
2390
2395
  next();
2391
- _context2.next = 34;
2396
+ _context2.next = 36;
2392
2397
  break;
2393
- case 31:
2394
- _context2.next = 33;
2395
- return delay(2000);
2396
2398
  case 33:
2399
+ _context2.next = 35;
2400
+ return delay(2000);
2401
+ case 35:
2397
2402
  retry();
2398
- case 34:
2403
+ case 36:
2399
2404
  case "end":
2400
2405
  return _context2.stop();
2401
2406
  }
2402
- }, _callee2, null, [[4, 12]]);
2407
+ }, _callee2, null, [[4, 14]]);
2403
2408
  }));
2404
2409
  return _checkApprovalStatus.apply(this, arguments);
2405
2410
  }