@rango-dev/widget-embedded 0.14.1-next.13 → 0.14.1-next.15

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/src/utils/swap.ts CHANGED
@@ -131,7 +131,7 @@ export function LimitErrorMessage(bestRoute: BestRouteResponse | null): {
131
131
  symbol: swap.from.symbol,
132
132
  },
133
133
  });
134
- recommendation = errorMessages.bridgeLimitErrors.increaseAmount;
134
+ recommendation = errorMessages().bridgeLimitErrors.increaseAmount;
135
135
  } else if (isExclusive && !!minimum && minimum.gte(swap.fromAmount)) {
136
136
  fromAmountRangeError = i18n.t({
137
137
  id: 'requiredMin',
@@ -145,7 +145,7 @@ export function LimitErrorMessage(bestRoute: BestRouteResponse | null): {
145
145
  symbol: swap.from.symbol,
146
146
  },
147
147
  });
148
- recommendation = errorMessages.bridgeLimitErrors.increaseAmount;
148
+ recommendation = errorMessages().bridgeLimitErrors.increaseAmount;
149
149
  }
150
150
 
151
151
  if (!isExclusive && !!maximum && maximum.lt(swap.fromAmount)) {
@@ -161,7 +161,7 @@ export function LimitErrorMessage(bestRoute: BestRouteResponse | null): {
161
161
  symbol: swap.from.symbol,
162
162
  },
163
163
  });
164
- recommendation = errorMessages.bridgeLimitErrors.decreaseAmount;
164
+ recommendation = errorMessages().bridgeLimitErrors.decreaseAmount;
165
165
  } else if (isExclusive && !!maximum && maximum.lte(swap.fromAmount)) {
166
166
  fromAmountRangeError = i18n.t({
167
167
  id: 'requiredMax',
@@ -175,7 +175,7 @@ export function LimitErrorMessage(bestRoute: BestRouteResponse | null): {
175
175
  symbol: swap.from.symbol,
176
176
  },
177
177
  });
178
- recommendation = errorMessages.bridgeLimitErrors.decreaseAmount;
178
+ recommendation = errorMessages().bridgeLimitErrors.decreaseAmount;
179
179
  }
180
180
 
181
181
  return { swap, fromAmountRangeError, recommendation };
@@ -194,14 +194,14 @@ export function getSwapButtonState(
194
194
  ): SwapButtonState {
195
195
  if (loadingMetaStatus !== 'success') {
196
196
  return {
197
- title: swapButtonTitles.connectWallet,
197
+ title: swapButtonTitles().connectWallet,
198
198
  state: ButtonState.WAITFORCONNECTING,
199
199
  disabled: true,
200
200
  };
201
201
  }
202
202
  if (connectedWallets.length == 0) {
203
203
  return {
204
- title: swapButtonTitles.connectWallet,
204
+ title: swapButtonTitles().connectWallet,
205
205
  state: ButtonState.WAITFORCONNECTING,
206
206
  disabled: false,
207
207
  };
@@ -215,27 +215,27 @@ export function getSwapButtonState(
215
215
  inputAmount === '0'
216
216
  ) {
217
217
  return {
218
- title: swapButtonTitles.swap,
218
+ title: swapButtonTitles().swap,
219
219
  disabled: true,
220
220
  state: ButtonState.SWAP,
221
221
  };
222
222
  } else if (highValueLoss || priceImpactCanNotBeComputed) {
223
223
  return {
224
- title: swapButtonTitles.swapAnyway,
224
+ title: swapButtonTitles().swapAnyway,
225
225
  disabled: false,
226
226
  hasWarning: true,
227
227
  state: ButtonState.NEEDTOCONFIRM,
228
228
  };
229
229
  } else if (needsToWarnEthOnPath) {
230
230
  return {
231
- title: swapButtonTitles.ethRouteWarning,
231
+ title: swapButtonTitles().ethRouteWarning,
232
232
  disabled: false,
233
233
  hasWarning: true,
234
234
  state: ButtonState.WARNING,
235
235
  };
236
236
  }
237
237
  return {
238
- title: swapButtonTitles.swap,
238
+ title: swapButtonTitles().swap,
239
239
  disabled: false,
240
240
  state: ButtonState.SWAP,
241
241
  };