@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.
@@ -1898,7 +1898,7 @@ function retryOn(wallet_network, manager, options) {
1898
1898
  var currentStep = getCurrentStep(swap);
1899
1899
  if (currentStep) {
1900
1900
  var _queueStorage$swapDet2, _queueStorage$swapDet3;
1901
- if (currentStep.fromBlockchain == network && (queueStorage == null ? void 0 : (_queueStorage$swapDet2 = queueStorage.swapDetails.wallets[network]) == null ? void 0 : _queueStorage$swapDet2.walletType) === wallet) {
1901
+ if (getCurrentBlockchainOfOrNull(swap, currentStep) == network && (queueStorage == null ? void 0 : (_queueStorage$swapDet2 = queueStorage.swapDetails.wallets[network]) == null ? void 0 : _queueStorage$swapDet2.walletType) === wallet) {
1902
1902
  walletAndNetworkMatched.push(q.list);
1903
1903
  } else if ((queueStorage == null ? void 0 : (_queueStorage$swapDet3 = queueStorage.swapDetails.wallets[currentStep.fromBlockchain]) == null ? void 0 : _queueStorage$swapDet3.walletType) === wallet) {
1904
1904
  onlyWalletMatched.push(q.list);
@@ -1969,6 +1969,18 @@ function _throwOnOK() {
1969
1969
  }));
1970
1970
  return _throwOnOK.apply(this, arguments);
1971
1971
  }
1972
+ function cancelSwap(swap) {
1973
+ swap.actions.cancel();
1974
+ return updateSwapStatus({
1975
+ getStorage: swap.actions.getStorage,
1976
+ setStorage: swap.actions.setStorage,
1977
+ message: 'Swap canceled by user.',
1978
+ details: "Warning: If you've already signed and sent a transaction, it won't be affected, but next swap steps will not be executed.",
1979
+ nextStatus: 'failed',
1980
+ nextStepStatus: 'failed',
1981
+ errorCode: 'USER_CANCEL'
1982
+ });
1983
+ }
1972
1984
 
1973
1985
  var INTERVAL_FOR_CHECK = 2000;
1974
1986
  /**
@@ -2037,7 +2049,6 @@ function _checkTransactionStatus() {
2037
2049
  currentStep.starknetTransaction = null;
2038
2050
  currentStep.tronApprovalTransaction = null;
2039
2051
  currentStep.tronTransaction = null;
2040
- currentStep.fromBlockchain = newTransaction.blockChain;
2041
2052
  if (isEvmTransaction(newTransaction)) {
2042
2053
  if (newTransaction.isApprovalTx) currentStep.evmApprovalTransaction = newTransaction;else currentStep.evmTransaction = newTransaction;
2043
2054
  } else if (isCosmosTransaction(newTransaction)) {
@@ -2682,5 +2693,5 @@ var swapQueueDef = {
2682
2693
  }
2683
2694
  };
2684
2695
 
2685
- export { checkWaitingForNetworkChange, getCurrentStep, getEvmProvider, getRelatedWallet$1 as getRelatedWallet, swapQueueDef, updateSwapStatus, useMigration, useQueueManager };
2696
+ export { cancelSwap, checkWaitingForNetworkChange, getCurrentStep, getEvmProvider, getRelatedWallet$1 as getRelatedWallet, swapQueueDef, updateSwapStatus, useMigration, useQueueManager };
2686
2697
  //# sourceMappingURL=queue-manager-rango-preset.esm.js.map