@rango-dev/widget-embedded 0.27.1 → 0.27.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/widget-embedded",
3
- "version": "0.27.1",
3
+ "version": "0.27.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -52,4 +52,4 @@
52
52
  "publishConfig": {
53
53
  "access": "public"
54
54
  }
55
- }
55
+ }
@@ -89,14 +89,6 @@ export function useConfirmSwap(): ConfirmSwap {
89
89
  slippage: userSlippage.toString(),
90
90
  disabledSwappersGroups: disabledLiquiditySources,
91
91
  };
92
- const swap = calculatePendingSwap(
93
- inputAmount.toString(),
94
- result,
95
- getWalletsForNewSwap(selectedWallets),
96
- swapSettings,
97
- false,
98
- { blockchains, tokens }
99
- );
100
92
 
101
93
  const confirmSwapWarnings = generateWarnings(
102
94
  initialQuote ?? undefined,
@@ -114,6 +106,17 @@ export function useConfirmSwap(): ConfirmSwap {
114
106
  }
115
107
  resetAlerts();
116
108
 
109
+ const proceedAnyway = !!confirmSwapWarnings.balance;
110
+
111
+ const swap = calculatePendingSwap(
112
+ inputAmount.toString(),
113
+ result,
114
+ getWalletsForNewSwap(selectedWallets),
115
+ swapSettings,
116
+ proceedAnyway ? false : true,
117
+ { blockchains, tokens }
118
+ );
119
+
117
120
  return {
118
121
  quote: currentQuote,
119
122
  swap,