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

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.0",
3
+ "version": "0.1.12-next.2",
4
4
  "license": "MIT",
5
5
  "module": "dist/queue-manager-rango-preset.esm.js",
6
6
  "main": "dist/index.js",
@@ -56,7 +56,7 @@ async function checkTransactionStatus({
56
56
  const outputAmount: string | null =
57
57
  status?.outputAmount ||
58
58
  (!!currentStep.outputAmount ? currentStep.outputAmount : null);
59
- const prevOutputAmount = currentStep.outputAmount;
59
+ const prevOutputAmount = currentStep.outputAmount || null;
60
60
  swap.extraMessage = status?.extraMessage || swap.extraMessage;
61
61
  swap.extraMessageSeverity = MessageSeverity.info;
62
62
  swap.extraMessageDetail = '';
package/src/helpers.ts CHANGED
@@ -1755,12 +1755,17 @@ export async function throwOnOK(
1755
1755
  }
1756
1756
  }
1757
1757
 
1758
- export function cancelSwap(swap: QueueInfo): {
1758
+ export function cancelSwap(
1759
+ swap: QueueInfo,
1760
+ manager?: Manager
1761
+ ): {
1759
1762
  swap: PendingSwap;
1760
1763
  step: PendingSwapStep | null;
1761
1764
  } {
1765
+ const { reset } = claimQueue();
1762
1766
  swap.actions.cancel();
1763
- return updateSwapStatus({
1767
+
1768
+ const updateResult = updateSwapStatus({
1764
1769
  getStorage: swap.actions.getStorage,
1765
1770
  setStorage: swap.actions.setStorage,
1766
1771
  message: 'Swap canceled by user.',
@@ -1770,4 +1775,8 @@ export function cancelSwap(swap: QueueInfo): {
1770
1775
  nextStepStatus: 'failed',
1771
1776
  errorCode: 'USER_CANCEL',
1772
1777
  });
1778
+ reset();
1779
+ if (manager) manager?.retry();
1780
+
1781
+ return updateResult;
1773
1782
  }