@rango-dev/queue-manager-rango-preset 0.1.10-next.96 → 0.1.10-next.98
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/actions/checkStatus.d.ts.map +1 -1
- package/dist/helpers.d.ts +5 -1
- package/dist/helpers.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/queue-manager-rango-preset.cjs.development.js +14 -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 +14 -3
- package/dist/queue-manager-rango-preset.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/actions/checkStatus.ts +0 -2
- package/src/helpers.ts +23 -2
- package/src/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ExecuterActions } from '@rango-dev/queue-manager-core';
|
|
2
|
-
import { Network } from '@rango-dev/wallets-shared';
|
|
3
2
|
import {
|
|
4
3
|
delay,
|
|
5
4
|
getCurrentStep,
|
|
@@ -82,7 +81,6 @@ async function checkTransactionStatus({
|
|
|
82
81
|
currentStep.starknetTransaction = null;
|
|
83
82
|
currentStep.tronApprovalTransaction = null;
|
|
84
83
|
currentStep.tronTransaction = null;
|
|
85
|
-
currentStep.fromBlockchain = newTransaction.blockChain as Network;
|
|
86
84
|
|
|
87
85
|
if (isEvmTransaction(newTransaction)) {
|
|
88
86
|
if (newTransaction.isApprovalTx)
|
package/src/helpers.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ExecuterActions,
|
|
3
|
+
QueueInfo,
|
|
4
|
+
QueueType,
|
|
5
|
+
} from '@rango-dev/queue-manager-core';
|
|
2
6
|
import {
|
|
3
7
|
BlockReason,
|
|
4
8
|
SwapActionTypes,
|
|
@@ -1651,7 +1655,7 @@ export function retryOn(
|
|
|
1651
1655
|
const currentStep = getCurrentStep(swap);
|
|
1652
1656
|
if (currentStep) {
|
|
1653
1657
|
if (
|
|
1654
|
-
currentStep
|
|
1658
|
+
getCurrentBlockchainOfOrNull(swap, currentStep) == network &&
|
|
1655
1659
|
queueStorage?.swapDetails.wallets[network]?.walletType === wallet
|
|
1656
1660
|
) {
|
|
1657
1661
|
walletAndNetworkMatched.push(q.list);
|
|
@@ -1719,3 +1723,20 @@ export async function throwOnOK(
|
|
|
1719
1723
|
throw e;
|
|
1720
1724
|
}
|
|
1721
1725
|
}
|
|
1726
|
+
|
|
1727
|
+
export function cancelSwap(swap: QueueInfo): {
|
|
1728
|
+
swap: PendingSwap;
|
|
1729
|
+
step: PendingSwapStep | null;
|
|
1730
|
+
} {
|
|
1731
|
+
swap.actions.cancel();
|
|
1732
|
+
return updateSwapStatus({
|
|
1733
|
+
getStorage: swap.actions.getStorage,
|
|
1734
|
+
setStorage: swap.actions.setStorage,
|
|
1735
|
+
message: 'Swap canceled by user.',
|
|
1736
|
+
details:
|
|
1737
|
+
"Warning: If you've already signed and sent a transaction, it won't be affected, but next swap steps will not be executed.",
|
|
1738
|
+
nextStatus: 'failed',
|
|
1739
|
+
nextStepStatus: 'failed',
|
|
1740
|
+
errorCode: 'USER_CANCEL',
|
|
1741
|
+
});
|
|
1742
|
+
}
|