@rango-dev/queue-manager-rango-preset 0.1.12-next.4 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/queue-manager-rango-preset",
3
- "version": "0.1.12-next.4",
3
+ "version": "0.1.13-next.0",
4
4
  "license": "MIT",
5
5
  "module": "dist/queue-manager-rango-preset.esm.js",
6
6
  "main": "dist/index.js",
@@ -53,6 +53,9 @@ async function checkTransactionStatus({
53
53
  return;
54
54
  }
55
55
 
56
+ // If user cancel swap during check status api call, we should ignore check status response
57
+ if (currentStep?.status === 'failed') return;
58
+
56
59
  const outputAmount: string | null =
57
60
  status?.outputAmount ||
58
61
  (!!currentStep.outputAmount ? currentStep.outputAmount : null);
@@ -166,13 +169,6 @@ async function checkApprovalStatus({
166
169
  SwapQueueContext
167
170
  >): Promise<void> {
168
171
  const swap = getStorage().swapDetails as SwapStorage['swapDetails'];
169
- // double check it after fixing parallel
170
- // const onFinish = () => {
171
- // // TODO resetClaimedBy is undefined here
172
- // if (context.resetClaimedBy) {
173
- // context.resetClaimedBy();
174
- // }
175
- // };
176
172
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
177
173
  const currentStep = getCurrentStep(swap)!;
178
174
  let isApproved = false;
@@ -181,6 +177,9 @@ async function checkApprovalStatus({
181
177
  swap.requestId,
182
178
  currentStep.executedTransactionId || ''
183
179
  );
180
+ // If user cancel swap during check status api call, we should ignore check approval response
181
+ if (currentStep?.status === 'failed') return;
182
+
184
183
  isApproved = response.isApproved;
185
184
  if (!isApproved && response.txStatus === 'failed') {
186
185
  // approve transaction failed on
package/src/helpers.ts CHANGED
@@ -1733,11 +1733,7 @@ export function retryOn(
1733
1733
  We only run one request at a time (In parallel mode).
1734
1734
  */
1735
1735
  export function isNeedBlockQueueForParallel(step: PendingSwapStep): boolean {
1736
- return (
1737
- !!step.evmTransaction ||
1738
- !!step.evmApprovalTransaction ||
1739
- !!step.cosmosTransaction
1740
- );
1736
+ return !!step.evmTransaction || !!step.evmApprovalTransaction;
1741
1737
  }
1742
1738
 
1743
1739
  /*