@skip-go/widget 2.3.1-alpha.1 → 2.3.1

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/build/index.es.js CHANGED
@@ -2340,7 +2340,15 @@ function useSwapWidget(persistSwapWidgetState = true) {
2340
2340
  return;
2341
2341
  const feeAsset = (_a = srcChain.feeAssets) === null || _a === void 0 ? void 0 : _a[0];
2342
2342
  const gas = `${(_b = feeAsset === null || feeAsset === void 0 ? void 0 : feeAsset.gasPrice) === null || _b === void 0 ? void 0 : _b.average}${feeAsset.denom}`;
2343
- const gasPrice = GasPrice.fromString(gas);
2343
+ const gasPrice = (() => {
2344
+ try {
2345
+ return GasPrice.fromString(gas);
2346
+ }
2347
+ catch (error) {
2348
+ toast.error('Unable to parse gas price asset');
2349
+ return undefined;
2350
+ }
2351
+ })();
2344
2352
  let srcGasPrice = (feeAsset === null || feeAsset === void 0 ? void 0 : feeAsset.gasPrice) && gasPrice;
2345
2353
  if (!srcFeeAsset || srcFeeAsset.chainID !== srcChain.chainID) {
2346
2354
  if (srcGasPrice) {
@@ -2370,7 +2378,19 @@ function useSwapWidget(persistSwapWidgetState = true) {
2370
2378
  toast.error(`Unable to find gas prices for ${srcFeeAsset.denom} on ${srcChain.chainName}`);
2371
2379
  return;
2372
2380
  }
2373
- srcGasPrice = GasPrice.fromString(`${feeDenomPrices.gasPrice.average}${feeDenomPrices.denom}`);
2381
+ const _gasPrice = (() => {
2382
+ try {
2383
+ return GasPrice.fromString(`${feeDenomPrices.gasPrice.average}${feeDenomPrices.denom}`);
2384
+ }
2385
+ catch (error) {
2386
+ return undefined;
2387
+ }
2388
+ })();
2389
+ if (!_gasPrice) {
2390
+ toast.error(`Unable to parse gas price for ${srcFeeAsset.denom} on ${srcChain.chainName}`);
2391
+ return;
2392
+ }
2393
+ srcGasPrice = _gasPrice;
2374
2394
  selectedGasPrice = BigNumber(feeDenomPrices.gasPrice.average);
2375
2395
  }
2376
2396
  const gasRequired = selectedGasPrice
@@ -4045,7 +4065,7 @@ const SetAddressDialog = ({ open, onOpen, chain, index, signRequired, isDestinat
4045
4065
  : wallet.walletInfo.logo.major, "aria-hidden": "true" })), jsx("p", { className: "flex-1 text-left font-semibold", children: wallet.walletPrettyName === 'Leap Cosmos MetaMask'
4046
4066
  ? 'Metamask (Leap Snap)'
4047
4067
  : wallet.walletPrettyName }), wallet.walletName === 'prax' && (jsx(PraxWalletIndex, { praxWalletIndex: praxWalletIndex, setPraxWalletIndex: setPraxWalletIndex }))] }), chainType === 'svm' && wallet.isAvailable !== true && (jsx("div", { className: "absolute right-4 top-1/2 flex -translate-y-1/2 items-center gap-1 rounded-lg bg-[#c2c2c2]/20 px-2.5 py-1 text-xs font-semibold text-[#909090] transition-colors focus:outline-none group-hover:bg-[#c2c2c2]/30", children: "Not Installed" }))] }, wallet.walletName));
4048
- }), !signRequired && (jsx("div", { className: "group relative mb-2 data-[unsupported=true]:opacity-30", children: isEditing ? (jsxs("div", { className: "flex items-center space-x-2 py-2 px-1", children: [jsx(StyledBorderDiv, { as: "input", type: "text", className: cn(`w-full rounded-md border px-2 py-1`, !isValid && 'border-red-500'), placeholder: placeholder, value: address, onChange: (e) => setAddress(e.target.value) }), jsx(StyledApproveButton, { as: "button", className: cn('flex w-12 items-center justify-center rounded-md border-2 text-sm text-white', 'disabled:cursor-not-allowed'), onClick: () => save(), disabled: !isValid, children: jsx(MdCheck, { className: "size-6" }) }), jsx(StyledCancelButton, { className: cn('flex w-12 items-center justify-center rounded-md border-2'), onClick: () => cancel(), children: jsx(MdClose, { className: "size-6" }) })] })) : (jsxs(StyledThemedButton, { onClick: () => setIsEditing(true), className: cn('flex w-full items-center gap-2 rounded-lg p-2 py-3 transition-colors focus:-outline-offset-2'), children: [jsx(FaKeyboard, { className: "mx-[6px] h-[24px] w-[24px] text-neutral-400" }), jsx("p", { className: "flex-1 text-left font-semibold", children: "Set Manually" })] })) }))] }), jsx(ScrollArea.Scrollbar, { className: "z-20 flex touch-none select-none py-4 transition-colors ease-out data-[orientation=horizontal]:h-2 data-[orientation=vertical]:w-2 data-[orientation=horizontal]:flex-col", orientation: "vertical", children: jsx(ScrollArea.Thumb, { className: "relative flex-1 rounded-[10px] bg-neutral-500/50 transition-colors before:absolute before:left-1/2 before:top-1/2 before:h-2 before:w-2 before:-translate-x-1/2 before:-translate-y-1/2 before:content-[''] hover:bg-neutral-500" }) }), jsx(ScrollArea.Corner, {})] })] }) }) }, chainID));
4068
+ }), !chain.chainID.includes('penumbra') && !signRequired && (jsx("div", { className: "group relative mb-2 data-[unsupported=true]:opacity-30", children: isEditing ? (jsxs("div", { className: "flex items-center space-x-2 py-2 px-1", children: [jsx(StyledBorderDiv, { as: "input", type: "text", className: cn(`w-full rounded-md border px-2 py-1`, !isValid && 'border-red-500'), placeholder: placeholder, value: address, onChange: (e) => setAddress(e.target.value) }), jsx(StyledApproveButton, { as: "button", className: cn('flex w-12 items-center justify-center rounded-md border-2 text-sm text-white', 'disabled:cursor-not-allowed'), onClick: () => save(), disabled: !isValid, children: jsx(MdCheck, { className: "size-6" }) }), jsx(StyledCancelButton, { className: cn('flex w-12 items-center justify-center rounded-md border-2'), onClick: () => cancel(), children: jsx(MdClose, { className: "size-6" }) })] })) : (jsxs(StyledThemedButton, { onClick: () => setIsEditing(true), className: cn('flex w-full items-center gap-2 rounded-lg p-2 py-3 transition-colors focus:-outline-offset-2'), children: [jsx(FaKeyboard, { className: "mx-[6px] h-[24px] w-[24px] text-neutral-400" }), jsx("p", { className: "flex-1 text-left font-semibold", children: "Set Manually" })] })) }))] }), jsx(ScrollArea.Scrollbar, { className: "z-20 flex touch-none select-none py-4 transition-colors ease-out data-[orientation=horizontal]:h-2 data-[orientation=vertical]:w-2 data-[orientation=horizontal]:flex-col", orientation: "vertical", children: jsx(ScrollArea.Thumb, { className: "relative flex-1 rounded-[10px] bg-neutral-500/50 transition-colors before:absolute before:left-1/2 before:top-1/2 before:h-2 before:w-2 before:-translate-x-1/2 before:-translate-y-1/2 before:content-[''] hover:bg-neutral-500" }) }), jsx(ScrollArea.Corner, {})] })] }) }) }, chainID));
4049
4069
  };
4050
4070
 
4051
4071
  function useBridges(args = {}) {