@ensofinance/checkout-widget 0.0.10 → 0.0.12
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/checkout-widget.es.js +544 -546
- package/dist/checkout-widget.es.js.map +1 -1
- package/dist/checkout-widget.umd.js +12 -12
- package/dist/checkout-widget.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Checkout.tsx +1 -0
- package/src/components/steps/ExchangeFlow.tsx +3 -1
- package/src/util/common.tsx +17 -5
package/package.json
CHANGED
|
@@ -837,7 +837,9 @@ const SignUserOpStep = ({
|
|
|
837
837
|
console.log("signedUserOp", JSON.stringify(signedUserOp));
|
|
838
838
|
|
|
839
839
|
setUserOp(signedUserOp);
|
|
840
|
-
|
|
840
|
+
if (sessionStorage.getItem("sendUserOp"))
|
|
841
|
+
setStep(WithdrawalStep.TrackUserOp);
|
|
842
|
+
else setStep(WithdrawalStep.InitiateWithdrawal);
|
|
841
843
|
} catch (error) {
|
|
842
844
|
console.error("Failed to sign userOperation:", error);
|
|
843
845
|
} finally {
|
package/src/util/common.tsx
CHANGED
|
@@ -253,8 +253,19 @@ export const useTokenFromList = (
|
|
|
253
253
|
);
|
|
254
254
|
};
|
|
255
255
|
|
|
256
|
-
const
|
|
257
|
-
|
|
256
|
+
const getAlternativeMeshSymbol = (
|
|
257
|
+
symbol: string,
|
|
258
|
+
chainId: SupportedChainId,
|
|
259
|
+
) => {
|
|
260
|
+
if (symbol === "USDT") {
|
|
261
|
+
if (chainId === SupportedChainId.BSC) {
|
|
262
|
+
return "BSC-USD";
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
return "USDT0";
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return symbol;
|
|
258
269
|
};
|
|
259
270
|
|
|
260
271
|
export const useTokenFromListBySymbols = (
|
|
@@ -266,9 +277,11 @@ export const useTokenFromListBySymbols = (
|
|
|
266
277
|
? tokenSymbols
|
|
267
278
|
: [tokenSymbols];
|
|
268
279
|
|
|
269
|
-
return arrayData.map((
|
|
280
|
+
return arrayData.map((meshSymbol) =>
|
|
270
281
|
data?.find(
|
|
271
|
-
(token) =>
|
|
282
|
+
(token) =>
|
|
283
|
+
token.symbol ==
|
|
284
|
+
getAlternativeMeshSymbol(meshSymbol, priorityChainId),
|
|
272
285
|
),
|
|
273
286
|
);
|
|
274
287
|
};
|
|
@@ -305,7 +318,6 @@ export const getChainName = (chainId: SupportedChainId) => {
|
|
|
305
318
|
return capitalize(geckoName).split("-")[0];
|
|
306
319
|
};
|
|
307
320
|
|
|
308
|
-
// Hook to get chain name from wagmi config
|
|
309
321
|
export const useChainName = (chainId: number) => {
|
|
310
322
|
const config = useConfig();
|
|
311
323
|
const chain = config.chains.find((c) => c.id === chainId);
|