@rango-dev/queue-manager-rango-preset 0.1.12-next.1 → 0.1.12-next.4
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/dist/helpers.d.ts +1 -1
- package/dist/helpers.d.ts.map +1 -1
- package/dist/queue-manager-rango-preset.cjs.development.js +12 -2
- package/dist/queue-manager-rango-preset.cjs.development.js.map +1 -1
- package/dist/queue-manager-rango-preset.cjs.production.min.js +1 -1
- package/dist/queue-manager-rango-preset.cjs.production.min.js.map +1 -1
- package/dist/queue-manager-rango-preset.esm.js +12 -2
- package/dist/queue-manager-rango-preset.esm.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +2 -0
- package/src/helpers.ts +19 -5
package/package.json
CHANGED
package/readme.md
CHANGED
package/src/helpers.ts
CHANGED
|
@@ -713,9 +713,14 @@ export function onBlockForChangeNetwork(
|
|
|
713
713
|
if (!!type && !!network) {
|
|
714
714
|
const result = context.switchNetwork(type, network);
|
|
715
715
|
if (result) {
|
|
716
|
-
result
|
|
717
|
-
|
|
718
|
-
|
|
716
|
+
result
|
|
717
|
+
.then(() => {
|
|
718
|
+
queue.unblock();
|
|
719
|
+
})
|
|
720
|
+
.catch((error) => {
|
|
721
|
+
// ignore switch network errors
|
|
722
|
+
console.log({ error });
|
|
723
|
+
});
|
|
719
724
|
}
|
|
720
725
|
}
|
|
721
726
|
}
|
|
@@ -1755,12 +1760,17 @@ export async function throwOnOK(
|
|
|
1755
1760
|
}
|
|
1756
1761
|
}
|
|
1757
1762
|
|
|
1758
|
-
export function cancelSwap(
|
|
1763
|
+
export function cancelSwap(
|
|
1764
|
+
swap: QueueInfo,
|
|
1765
|
+
manager?: Manager
|
|
1766
|
+
): {
|
|
1759
1767
|
swap: PendingSwap;
|
|
1760
1768
|
step: PendingSwapStep | null;
|
|
1761
1769
|
} {
|
|
1770
|
+
const { reset } = claimQueue();
|
|
1762
1771
|
swap.actions.cancel();
|
|
1763
|
-
|
|
1772
|
+
|
|
1773
|
+
const updateResult = updateSwapStatus({
|
|
1764
1774
|
getStorage: swap.actions.getStorage,
|
|
1765
1775
|
setStorage: swap.actions.setStorage,
|
|
1766
1776
|
message: 'Swap canceled by user.',
|
|
@@ -1770,4 +1780,8 @@ export function cancelSwap(swap: QueueInfo): {
|
|
|
1770
1780
|
nextStepStatus: 'failed',
|
|
1771
1781
|
errorCode: 'USER_CANCEL',
|
|
1772
1782
|
});
|
|
1783
|
+
reset();
|
|
1784
|
+
if (manager) manager?.retry();
|
|
1785
|
+
|
|
1786
|
+
return updateResult;
|
|
1773
1787
|
}
|