@bze/bze-ui-kit 1.0.9 → 1.0.10

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/index.js CHANGED
@@ -324,6 +324,7 @@ __export(index_exports, {
324
324
  useSigningClient: () => useSigningClient,
325
325
  useToast: () => useToast,
326
326
  useValidatorLogos: () => useValidatorLogos,
327
+ useWalletHealthCheck: () => useWalletHealthCheck,
327
328
  validateBZEBech32Address: () => validateBZEBech32Address,
328
329
  validateBech32Address: () => validateBech32Address,
329
330
  validateEndpoints: () => validateEndpoints,
@@ -3644,13 +3645,41 @@ var useSigningClient = ({ chainName }) => {
3644
3645
  };
3645
3646
  };
3646
3647
 
3647
- // src/hooks/usePrices.ts
3648
+ // src/hooks/useWalletHealthCheck.ts
3648
3649
  var import_react5 = require("react");
3650
+ var import_react6 = require("@interchain-kit/react");
3651
+ var import_core = require("@interchain-kit/core");
3652
+ var SIGNING_CLIENT_TIMEOUT_MS = 5e3;
3653
+ var useWalletHealthCheck = (chainName) => {
3654
+ const { status, getSigningClient, disconnect } = (0, import_react6.useChain)(chainName != null ? chainName : getChainName());
3655
+ (0, import_react5.useEffect)(() => {
3656
+ if (status !== import_core.WalletState.Connected) return;
3657
+ const validate = async () => {
3658
+ try {
3659
+ const client = await Promise.race([
3660
+ getSigningClient(),
3661
+ new Promise(
3662
+ (resolve) => setTimeout(() => resolve(null), SIGNING_CLIENT_TIMEOUT_MS)
3663
+ )
3664
+ ]);
3665
+ if (!client) {
3666
+ disconnect();
3667
+ }
3668
+ } catch (e) {
3669
+ disconnect();
3670
+ }
3671
+ };
3672
+ validate();
3673
+ }, []);
3674
+ };
3675
+
3676
+ // src/hooks/usePrices.ts
3677
+ var import_react7 = require("react");
3649
3678
  function useAssetPrice(denom) {
3650
3679
  const { usdPricesMap, marketsDataMap, isLoadingPrices } = useAssetsContext();
3651
- const usdDenom = (0, import_react5.useMemo)(() => getUSDCDenom(), []);
3652
- const bzeDenom = (0, import_react5.useMemo)(() => getChainNativeAssetDenom(), []);
3653
- const change = (0, import_react5.useMemo)(() => {
3680
+ const usdDenom = (0, import_react7.useMemo)(() => getUSDCDenom(), []);
3681
+ const bzeDenom = (0, import_react7.useMemo)(() => getChainNativeAssetDenom(), []);
3682
+ const change = (0, import_react7.useMemo)(() => {
3654
3683
  const marketData = marketsDataMap.get(createMarketId(denom, usdDenom));
3655
3684
  if (marketData) {
3656
3685
  return marketData.change;
@@ -3661,20 +3690,20 @@ function useAssetPrice(denom) {
3661
3690
  }
3662
3691
  return 0;
3663
3692
  }, [marketsDataMap, denom, usdDenom, bzeDenom]);
3664
- const price = (0, import_react5.useMemo)(() => {
3693
+ const price = (0, import_react7.useMemo)(() => {
3665
3694
  const zeroBN = toBigNumber(0);
3666
3695
  if (denom === "") return zeroBN;
3667
3696
  if (denom === usdDenom) return toBigNumber(1);
3668
3697
  return usdPricesMap.get(denom) || zeroBN;
3669
3698
  }, [usdPricesMap, denom, usdDenom]);
3670
- const totalUsdValue = (0, import_react5.useCallback)((amount) => {
3699
+ const totalUsdValue = (0, import_react7.useCallback)((amount) => {
3671
3700
  return price.multipliedBy(amount);
3672
3701
  }, [price]);
3673
- const uAmountUsdValue = (0, import_react5.useCallback)((amount, decimals) => {
3702
+ const uAmountUsdValue = (0, import_react7.useCallback)((amount, decimals) => {
3674
3703
  return totalUsdValue(uAmountToBigNumberAmount(amount, decimals));
3675
3704
  }, [totalUsdValue]);
3676
- const isUSDC = (0, import_react5.useMemo)(() => denom === usdDenom, [denom, usdDenom]);
3677
- const hasPrice = (0, import_react5.useMemo)(() => price.gt(0), [price]);
3705
+ const isUSDC = (0, import_react7.useMemo)(() => denom === usdDenom, [denom, usdDenom]);
3706
+ const hasPrice = (0, import_react7.useMemo)(() => price.gt(0), [price]);
3678
3707
  return {
3679
3708
  price,
3680
3709
  change,
@@ -3687,36 +3716,36 @@ function useAssetPrice(denom) {
3687
3716
  }
3688
3717
 
3689
3718
  // src/hooks/useSettings.ts
3690
- var import_react6 = require("react");
3719
+ var import_react8 = require("react");
3691
3720
  function useSettings() {
3692
- const [settings, setSettingsState] = (0, import_react6.useState)(DEFAULT_SETTINGS);
3693
- const [isLoaded, setIsLoaded] = (0, import_react6.useState)(false);
3694
- (0, import_react6.useEffect)(() => {
3721
+ const [settings, setSettingsState] = (0, import_react8.useState)(DEFAULT_SETTINGS);
3722
+ const [isLoaded, setIsLoaded] = (0, import_react8.useState)(false);
3723
+ (0, import_react8.useEffect)(() => {
3695
3724
  setSettingsState(getSettings());
3696
3725
  setIsLoaded(true);
3697
3726
  }, []);
3698
- const saveSettings = (0, import_react6.useCallback)((newSettings) => {
3727
+ const saveSettings = (0, import_react8.useCallback)((newSettings) => {
3699
3728
  setSettings(newSettings);
3700
3729
  setSettingsState(newSettings);
3701
3730
  return true;
3702
3731
  }, []);
3703
- const updateEndpoints = (0, import_react6.useCallback)((endpoints) => {
3732
+ const updateEndpoints = (0, import_react8.useCallback)((endpoints) => {
3704
3733
  const newSettings = __spreadProps(__spreadValues({}, settings), { endpoints });
3705
3734
  return saveSettings(newSettings);
3706
3735
  }, [settings, saveSettings]);
3707
- const updatePreferredFeeDenom = (0, import_react6.useCallback)((preferredFeeDenom) => {
3736
+ const updatePreferredFeeDenom = (0, import_react8.useCallback)((preferredFeeDenom) => {
3708
3737
  const newSettings = __spreadProps(__spreadValues({}, settings), { preferredFeeDenom });
3709
3738
  return saveSettings(newSettings);
3710
3739
  }, [settings, saveSettings]);
3711
- const resetToDefaults = (0, import_react6.useCallback)(() => {
3740
+ const resetToDefaults = (0, import_react8.useCallback)(() => {
3712
3741
  saveSettings(DEFAULT_SETTINGS);
3713
3742
  return true;
3714
3743
  }, [saveSettings]);
3715
- const getEndpoints = (0, import_react6.useCallback)(() => {
3744
+ const getEndpoints = (0, import_react8.useCallback)(() => {
3716
3745
  return settings.endpoints;
3717
3746
  }, [settings.endpoints]);
3718
- const defaultSettings = (0, import_react6.useMemo)(() => DEFAULT_SETTINGS, []);
3719
- const feeDenom = (0, import_react6.useMemo)(() => settings.preferredFeeDenom || getChainNativeAssetDenom(), [settings.preferredFeeDenom]);
3747
+ const defaultSettings = (0, import_react8.useMemo)(() => DEFAULT_SETTINGS, []);
3748
+ const feeDenom = (0, import_react8.useMemo)(() => settings.preferredFeeDenom || getChainNativeAssetDenom(), [settings.preferredFeeDenom]);
3720
3749
  return {
3721
3750
  settings,
3722
3751
  isLoaded,
@@ -3732,14 +3761,14 @@ function useSettings() {
3732
3761
 
3733
3762
  // src/hooks/useBalances.ts
3734
3763
  var import_bignumber8 = __toESM(require("bignumber.js"));
3735
- var import_react7 = require("react");
3764
+ var import_react9 = require("react");
3736
3765
  function useBalances() {
3737
3766
  const { balancesMap, isLoading, assetsMap, usdPricesMap } = useAssetsContext();
3738
- const balances = (0, import_react7.useMemo)(() => Array.from(balancesMap.values()), [balancesMap]);
3739
- const getBalanceByDenom = (0, import_react7.useCallback)((denom) => {
3767
+ const balances = (0, import_react9.useMemo)(() => Array.from(balancesMap.values()), [balancesMap]);
3768
+ const getBalanceByDenom = (0, import_react9.useCallback)((denom) => {
3740
3769
  return balancesMap.get(denom) || { denom, amount: (0, import_bignumber8.default)(0) };
3741
3770
  }, [balancesMap]);
3742
- const assetsBalances = (0, import_react7.useMemo)(() => {
3771
+ const assetsBalances = (0, import_react9.useMemo)(() => {
3743
3772
  const result = [];
3744
3773
  balances.map((bal) => {
3745
3774
  const asset = assetsMap.get(bal.denom);
@@ -3769,14 +3798,14 @@ function useBalances() {
3769
3798
  }
3770
3799
  function useBalance(denom) {
3771
3800
  const { balancesMap, isLoading } = useAssetsContext();
3772
- const balance = (0, import_react7.useMemo)(
3801
+ const balance = (0, import_react9.useMemo)(
3773
3802
  () => balancesMap.get(denom) || {
3774
3803
  denom,
3775
3804
  amount: (0, import_bignumber8.default)(0)
3776
3805
  },
3777
3806
  [balancesMap, denom]
3778
3807
  );
3779
- const hasAmount = (0, import_react7.useCallback)((amount) => {
3808
+ const hasAmount = (0, import_react9.useCallback)((amount) => {
3780
3809
  return balance.amount.gte(amount);
3781
3810
  }, [balance]);
3782
3811
  return {
@@ -3787,7 +3816,7 @@ function useBalance(denom) {
3787
3816
  }
3788
3817
 
3789
3818
  // src/hooks/useEpochs.ts
3790
- var import_react8 = require("react");
3819
+ var import_react10 = require("react");
3791
3820
  var import_bignumber9 = __toESM(require("bignumber.js"));
3792
3821
  var EPOCH_HOUR2 = "hour";
3793
3822
  var EPOCH_DAY2 = "day";
@@ -3807,28 +3836,28 @@ function getEpochDurationByIdentifier2(identifier) {
3807
3836
  }
3808
3837
  function useEpochs() {
3809
3838
  const { epochs, isLoading, updateEpochs } = useAssetsContext();
3810
- const getCurrentEpoch2 = (0, import_react8.useCallback)((identifier) => {
3839
+ const getCurrentEpoch2 = (0, import_react10.useCallback)((identifier) => {
3811
3840
  return epochs.get(identifier);
3812
3841
  }, [epochs]);
3813
- const hourEpochInfo = (0, import_react8.useMemo)(() => {
3842
+ const hourEpochInfo = (0, import_react10.useMemo)(() => {
3814
3843
  return epochs.get(EPOCH_HOUR2);
3815
3844
  }, [epochs]);
3816
- const dayEpochInfo = (0, import_react8.useMemo)(() => {
3845
+ const dayEpochInfo = (0, import_react10.useMemo)(() => {
3817
3846
  return epochs.get(EPOCH_DAY2);
3818
3847
  }, [epochs]);
3819
- const weekEpochInfo = (0, import_react8.useMemo)(() => {
3848
+ const weekEpochInfo = (0, import_react10.useMemo)(() => {
3820
3849
  return epochs.get(EPOCH_WEEK2);
3821
3850
  }, [epochs]);
3822
- const getHourEpochInfo2 = (0, import_react8.useCallback)(() => {
3851
+ const getHourEpochInfo2 = (0, import_react10.useCallback)(() => {
3823
3852
  return epochs.get(EPOCH_HOUR2);
3824
3853
  }, [epochs]);
3825
- const getDayEpochInfo = (0, import_react8.useCallback)(() => {
3854
+ const getDayEpochInfo = (0, import_react10.useCallback)(() => {
3826
3855
  return epochs.get(EPOCH_DAY2);
3827
3856
  }, [epochs]);
3828
- const getWeekEpochInfo2 = (0, import_react8.useCallback)(() => {
3857
+ const getWeekEpochInfo2 = (0, import_react10.useCallback)(() => {
3829
3858
  return epochs.get(EPOCH_WEEK2);
3830
3859
  }, [epochs]);
3831
- const getPeriodicEpochEndTime2 = (0, import_react8.useCallback)((identifier, modWeek = 1) => {
3860
+ const getPeriodicEpochEndTime2 = (0, import_react10.useCallback)((identifier, modWeek = 1) => {
3832
3861
  const epoch = epochs.get(identifier);
3833
3862
  if (!epoch || !epoch.current_epoch_start_time) {
3834
3863
  return void 0;
@@ -3843,13 +3872,13 @@ function useEpochs() {
3843
3872
  startAt.setTime(startAt.getTime() + duration + duration * remainingEpochs);
3844
3873
  return startAt;
3845
3874
  }, [epochs]);
3846
- const getCurrentWeekEpochEndTime2 = (0, import_react8.useCallback)(() => {
3875
+ const getCurrentWeekEpochEndTime2 = (0, import_react10.useCallback)(() => {
3847
3876
  return getPeriodicEpochEndTime2(EPOCH_WEEK2);
3848
3877
  }, [getPeriodicEpochEndTime2]);
3849
- const getPeriodicWeekEpochEndTime2 = (0, import_react8.useCallback)((modWeek = 1) => {
3878
+ const getPeriodicWeekEpochEndTime2 = (0, import_react10.useCallback)((modWeek = 1) => {
3850
3879
  return getPeriodicEpochEndTime2(EPOCH_WEEK2, modWeek);
3851
3880
  }, [getPeriodicEpochEndTime2]);
3852
- const epochsList = (0, import_react8.useMemo)(() => Array.from(epochs.values()), [epochs]);
3881
+ const epochsList = (0, import_react10.useMemo)(() => Array.from(epochs.values()), [epochs]);
3853
3882
  return {
3854
3883
  epochs: epochsList,
3855
3884
  epochsMap: epochs,
@@ -3876,22 +3905,22 @@ function useEpochsManager() {
3876
3905
  }
3877
3906
 
3878
3907
  // src/hooks/useLiquidityPools.ts
3879
- var import_react9 = require("react");
3908
+ var import_react11 = require("react");
3880
3909
  var import_bignumber10 = __toESM(require("bignumber.js"));
3881
3910
  function useLiquidityPools() {
3882
3911
  const { poolsMap, poolsDataMap, updateLiquidityPools, isLoading, assetsMap } = useAssetsContext();
3883
- const pools = (0, import_react9.useMemo)(() => {
3912
+ const pools = (0, import_react11.useMemo)(() => {
3884
3913
  return Array.from(poolsMap.values());
3885
3914
  }, [poolsMap]);
3886
3915
  const getPoolByLpDenom = (lpDenom) => {
3887
3916
  const poolId = poolIdFromPoolDenom(lpDenom);
3888
3917
  return poolsMap.get(poolId);
3889
3918
  };
3890
- const getDenomsPool = (0, import_react9.useCallback)((denomA, denomB) => {
3919
+ const getDenomsPool = (0, import_react11.useCallback)((denomA, denomB) => {
3891
3920
  const poolId = createPoolId(denomA, denomB);
3892
3921
  return poolsMap.get(poolId);
3893
3922
  }, [poolsMap]);
3894
- const liquidAssets = (0, import_react9.useMemo)(() => {
3923
+ const liquidAssets = (0, import_react11.useMemo)(() => {
3895
3924
  if (!assetsMap || assetsMap.size === 0) return [];
3896
3925
  const result = /* @__PURE__ */ new Map();
3897
3926
  pools.forEach((pool) => {
@@ -3914,12 +3943,12 @@ function useLiquidityPools() {
3914
3943
  }
3915
3944
  function useAssetLiquidityPools(denom) {
3916
3945
  const { poolsMap, poolsDataMap, isLoading } = useAssetsContext();
3917
- const assetPools = (0, import_react9.useMemo)(() => {
3946
+ const assetPools = (0, import_react11.useMemo)(() => {
3918
3947
  return Array.from(poolsMap.values()).filter(
3919
3948
  (pool) => pool.base === denom || pool.quote === denom
3920
3949
  );
3921
3950
  }, [poolsMap, denom]);
3922
- const assetPoolsData = (0, import_react9.useMemo)(() => {
3951
+ const assetPoolsData = (0, import_react11.useMemo)(() => {
3923
3952
  const newMap = /* @__PURE__ */ new Map();
3924
3953
  if (isLoading || denom === "") return newMap;
3925
3954
  assetPools.forEach((pool) => {
@@ -3930,7 +3959,7 @@ function useAssetLiquidityPools(denom) {
3930
3959
  });
3931
3960
  return newMap;
3932
3961
  }, [assetPools, poolsDataMap, isLoading, denom]);
3933
- const asset24HoursVolume = (0, import_react9.useMemo)(() => {
3962
+ const asset24HoursVolume = (0, import_react11.useMemo)(() => {
3934
3963
  let volume = (0, import_bignumber10.default)(0);
3935
3964
  if (isLoading || denom === "") return volume;
3936
3965
  assetPoolsData.forEach((poolData) => {
@@ -3952,47 +3981,47 @@ function useAssetLiquidityPools(denom) {
3952
3981
  }
3953
3982
  function useLiquidityPool(poolId) {
3954
3983
  const { balancesMap, assetsMap, poolsMap, poolsDataMap, isLoading } = useAssetsContext();
3955
- const pool = (0, import_react9.useMemo)(() => poolsMap.get(poolId), [poolsMap, poolId]);
3956
- const poolData = (0, import_react9.useMemo)(() => poolsDataMap.get(poolId), [poolsDataMap, poolId]);
3957
- const userShares = (0, import_react9.useMemo)(() => {
3984
+ const pool = (0, import_react11.useMemo)(() => poolsMap.get(poolId), [poolsMap, poolId]);
3985
+ const poolData = (0, import_react11.useMemo)(() => poolsDataMap.get(poolId), [poolsDataMap, poolId]);
3986
+ const userShares = (0, import_react11.useMemo)(() => {
3958
3987
  if (!pool) return toBigNumber(0);
3959
3988
  const balance = balancesMap.get(pool.lp_denom);
3960
3989
  if (!balance) return toBigNumber(0);
3961
3990
  return toBigNumber(balance.amount);
3962
3991
  }, [balancesMap, pool]);
3963
- const totalShares = (0, import_react9.useMemo)(() => {
3992
+ const totalShares = (0, import_react11.useMemo)(() => {
3964
3993
  if (!assetsMap || !pool) return toBigNumber(0);
3965
3994
  const sharesAsset = assetsMap.get(pool.lp_denom);
3966
3995
  if (!sharesAsset) return toBigNumber(0);
3967
3996
  return toBigNumber((sharesAsset == null ? void 0 : sharesAsset.supply) || 0);
3968
3997
  }, [assetsMap, pool]);
3969
- const userSharesPercentage = (0, import_react9.useMemo)(() => {
3998
+ const userSharesPercentage = (0, import_react11.useMemo)(() => {
3970
3999
  if (!userShares || !totalShares || totalShares.isZero()) {
3971
4000
  return toBigNumber(0);
3972
4001
  }
3973
4002
  return userShares.dividedBy(totalShares).multipliedBy(100).toFixed(2);
3974
4003
  }, [userShares, totalShares]);
3975
- const userReserveBase = (0, import_react9.useMemo)(() => {
4004
+ const userReserveBase = (0, import_react11.useMemo)(() => {
3976
4005
  if (!pool || !userShares || !totalShares || totalShares.isZero()) {
3977
4006
  return toBigNumber(0);
3978
4007
  }
3979
4008
  const reserveBase = toBigNumber(pool.reserve_base);
3980
4009
  return userShares.dividedBy(totalShares).multipliedBy(reserveBase);
3981
4010
  }, [pool, userShares, totalShares]);
3982
- const userReserveQuote = (0, import_react9.useMemo)(() => {
4011
+ const userReserveQuote = (0, import_react11.useMemo)(() => {
3983
4012
  if (!pool || !userShares || !totalShares || totalShares.isZero()) {
3984
4013
  return toBigNumber(0);
3985
4014
  }
3986
4015
  const reserveQuote = toBigNumber(pool.reserve_quote);
3987
4016
  return userShares.dividedBy(totalShares).multipliedBy(reserveQuote);
3988
4017
  }, [pool, userShares, totalShares]);
3989
- const calculateOppositeAmount = (0, import_react9.useCallback)((amount, isBase) => {
4018
+ const calculateOppositeAmount = (0, import_react11.useCallback)((amount, isBase) => {
3990
4019
  if (!pool) {
3991
4020
  return toBigNumber(0);
3992
4021
  }
3993
4022
  return calculatePoolOppositeAmount(pool, amount, isBase);
3994
4023
  }, [pool]);
3995
- const calculateSharesFromAmounts = (0, import_react9.useCallback)((baseAmount, quoteAmount) => {
4024
+ const calculateSharesFromAmounts = (0, import_react11.useCallback)((baseAmount, quoteAmount) => {
3996
4025
  if (!pool || !totalShares) {
3997
4026
  return toBigNumber(0);
3998
4027
  }
@@ -4027,11 +4056,11 @@ function useLiquidityPool(poolId) {
4027
4056
  }
4028
4057
 
4029
4058
  // src/hooks/useAssetsValue.ts
4030
- var import_react10 = require("react");
4059
+ var import_react12 = require("react");
4031
4060
  var import_bignumber11 = __toESM(require("bignumber.js"));
4032
4061
  function useAssetsValue() {
4033
4062
  const { assetsMap, usdPricesMap, balancesMap, isLoading: isLoadingPrices } = useAssetsContext();
4034
- const totalUsdValue = (0, import_react10.useCallback)((prettyBalances) => {
4063
+ const totalUsdValue = (0, import_react12.useCallback)((prettyBalances) => {
4035
4064
  let usdValue = (0, import_bignumber11.default)(0);
4036
4065
  prettyBalances.map((denomBalance) => {
4037
4066
  const assetPrice = usdPricesMap.get(denomBalance.denom);
@@ -4041,7 +4070,7 @@ function useAssetsValue() {
4041
4070
  });
4042
4071
  return usdValue;
4043
4072
  }, [usdPricesMap]);
4044
- const walletTotalUsdValue = (0, import_react10.useMemo)(() => {
4073
+ const walletTotalUsdValue = (0, import_react12.useMemo)(() => {
4045
4074
  let total = toBigNumber(0);
4046
4075
  balancesMap.forEach((balance, denom) => {
4047
4076
  const price = usdPricesMap.get(denom);
@@ -4052,14 +4081,14 @@ function useAssetsValue() {
4052
4081
  });
4053
4082
  return total;
4054
4083
  }, [balancesMap, usdPricesMap, assetsMap]);
4055
- const denomUsdValue = (0, import_react10.useCallback)((denom, uAmount) => {
4084
+ const denomUsdValue = (0, import_react12.useCallback)((denom, uAmount) => {
4056
4085
  const price = usdPricesMap.get(denom);
4057
4086
  if (!price || !price.gt(0)) return toBigNumber(0);
4058
4087
  const asset = assetsMap.get(denom);
4059
4088
  if (!asset) return toBigNumber(0);
4060
4089
  return price.multipliedBy(uAmountToBigNumberAmount(uAmount, asset.decimals));
4061
4090
  }, [usdPricesMap, assetsMap]);
4062
- const compareValues = (0, import_react10.useCallback)((a, b) => {
4091
+ const compareValues = (0, import_react12.useCallback)((a, b) => {
4063
4092
  var _a2;
4064
4093
  let aValue = (0, import_bignumber11.default)(0);
4065
4094
  const aPrice = usdPricesMap.get(a.denom);
@@ -4083,13 +4112,13 @@ function useAssetsValue() {
4083
4112
  }
4084
4113
 
4085
4114
  // src/hooks/useFeeTokens.ts
4086
- var import_react11 = require("react");
4115
+ var import_react13 = require("react");
4087
4116
  var MIN_LIQUIDITY_FOR_FEE_TOKEN = 5e10;
4088
4117
  function useFeeTokens() {
4089
4118
  const { pools, isLoading: poolsLoading } = useLiquidityPools();
4090
4119
  const { assetsMap, isLoading: assetsLoading } = useAssetsContext();
4091
4120
  const nativeDenom = getChainNativeAssetDenom();
4092
- const feeTokens = (0, import_react11.useMemo)(() => {
4121
+ const feeTokens = (0, import_react13.useMemo)(() => {
4093
4122
  if (poolsLoading || assetsLoading) {
4094
4123
  return [];
4095
4124
  }
@@ -4119,17 +4148,17 @@ function useFeeTokens() {
4119
4148
  }
4120
4149
 
4121
4150
  // src/hooks/useMarkets.ts
4122
- var import_react12 = require("react");
4151
+ var import_react14 = require("react");
4123
4152
  var import_bignumber12 = __toESM(require("bignumber.js"));
4124
4153
  function useMarkets() {
4125
4154
  const { marketsMap, marketsDataMap, updateMarkets, isLoading } = useAssetsContext();
4126
- const markets = (0, import_react12.useMemo)(() => {
4155
+ const markets = (0, import_react14.useMemo)(() => {
4127
4156
  return Array.from(marketsMap.values());
4128
4157
  }, [marketsMap]);
4129
- const marketsData = (0, import_react12.useMemo)(() => Array.from(marketsDataMap.values()), [marketsDataMap]);
4130
- const marketExists = (0, import_react12.useCallback)((marketId) => marketsMap.has(marketId), [marketsMap]);
4131
- const getMarketData = (0, import_react12.useCallback)((marketId) => marketsDataMap.get(marketId), [marketsDataMap]);
4132
- const getMarket = (0, import_react12.useCallback)((marketId) => marketsMap.get(marketId), [marketsMap]);
4158
+ const marketsData = (0, import_react14.useMemo)(() => Array.from(marketsDataMap.values()), [marketsDataMap]);
4159
+ const marketExists = (0, import_react14.useCallback)((marketId) => marketsMap.has(marketId), [marketsMap]);
4160
+ const getMarketData = (0, import_react14.useCallback)((marketId) => marketsDataMap.get(marketId), [marketsDataMap]);
4161
+ const getMarket = (0, import_react14.useCallback)((marketId) => marketsMap.get(marketId), [marketsMap]);
4133
4162
  return {
4134
4163
  markets,
4135
4164
  marketsData,
@@ -4144,9 +4173,9 @@ function useMarkets() {
4144
4173
  }
4145
4174
  function useAssetMarkets(denom) {
4146
4175
  const { isLoading, marketsMap, marketsDataMap } = useAssetsContext();
4147
- const markets = (0, import_react12.useMemo)(() => Array.from(marketsMap.values()), [marketsMap]);
4148
- const marketsData = (0, import_react12.useMemo)(() => Array.from(marketsDataMap.values()), [marketsDataMap]);
4149
- const assetMarkets = (0, import_react12.useMemo)(() => {
4176
+ const markets = (0, import_react14.useMemo)(() => Array.from(marketsMap.values()), [marketsMap]);
4177
+ const marketsData = (0, import_react14.useMemo)(() => Array.from(marketsDataMap.values()), [marketsDataMap]);
4178
+ const assetMarkets = (0, import_react14.useMemo)(() => {
4150
4179
  const baseMatches = [];
4151
4180
  const quoteMatches = [];
4152
4181
  for (const market of markets) {
@@ -4155,7 +4184,7 @@ function useAssetMarkets(denom) {
4155
4184
  }
4156
4185
  return [...baseMatches, ...quoteMatches];
4157
4186
  }, [markets, denom]);
4158
- const assetMarketsData = (0, import_react12.useMemo)(() => {
4187
+ const assetMarketsData = (0, import_react14.useMemo)(() => {
4159
4188
  const baseMatches = [];
4160
4189
  const quoteMatches = [];
4161
4190
  for (const market of marketsData) {
@@ -4164,7 +4193,7 @@ function useAssetMarkets(denom) {
4164
4193
  }
4165
4194
  return [...baseMatches, ...quoteMatches];
4166
4195
  }, [marketsData, denom]);
4167
- const asset24hTradedVolume = (0, import_react12.useMemo)(() => {
4196
+ const asset24hTradedVolume = (0, import_react14.useMemo)(() => {
4168
4197
  return assetMarketsData.reduce((acc, market) => {
4169
4198
  if (denom === market.base) {
4170
4199
  return acc.plus(market.base_volume || 0);
@@ -4183,8 +4212,8 @@ function useAssetMarkets(denom) {
4183
4212
  }
4184
4213
  function useMarket(marketId) {
4185
4214
  const { marketsMap, marketsDataMap, isLoading, assetsMap } = useAssetsContext();
4186
- const market = (0, import_react12.useMemo)(() => marketsMap.get(marketId), [marketsMap, marketId]);
4187
- const marketSymbol = (0, import_react12.useMemo)(() => {
4215
+ const market = (0, import_react14.useMemo)(() => marketsMap.get(marketId), [marketsMap, marketId]);
4216
+ const marketSymbol = (0, import_react14.useMemo)(() => {
4188
4217
  var _a2, _b2;
4189
4218
  if (isLoading) return "";
4190
4219
  if (!market) return "";
@@ -4198,9 +4227,9 @@ function useMarket(marketId) {
4198
4227
  }
4199
4228
  return `${base}/${quote}`;
4200
4229
  }, [market, isLoading, assetsMap]);
4201
- const marketData = (0, import_react12.useMemo)(() => marketsDataMap.get(marketId), [marketsDataMap, marketId]);
4202
- const marketExists = (0, import_react12.useMemo)(() => !!market, [market]);
4203
- const volume24h = (0, import_react12.useMemo)(() => {
4230
+ const marketData = (0, import_react14.useMemo)(() => marketsDataMap.get(marketId), [marketsDataMap, marketId]);
4231
+ const marketExists = (0, import_react14.useMemo)(() => !!market, [market]);
4232
+ const volume24h = (0, import_react14.useMemo)(() => {
4204
4233
  if (!marketData || !market) return toBigNumber(0);
4205
4234
  const quoteAsset = assetsMap.get(market.quote);
4206
4235
  if (!quoteAsset) return toBigNumber(0);
@@ -4225,30 +4254,30 @@ function useMarketsManager() {
4225
4254
  }
4226
4255
 
4227
4256
  // src/hooks/useToast.tsx
4228
- var import_react14 = require("react");
4257
+ var import_react16 = require("react");
4229
4258
 
4230
4259
  // src/components/toaster.tsx
4231
- var import_react13 = require("@chakra-ui/react");
4260
+ var import_react15 = require("@chakra-ui/react");
4232
4261
  var import_jsx_runtime = require("react/jsx-runtime");
4233
- var toaster = (0, import_react13.createToaster)({
4262
+ var toaster = (0, import_react15.createToaster)({
4234
4263
  placement: "top-end",
4235
4264
  pauseOnPageIdle: true
4236
4265
  });
4237
4266
  var Toaster = () => {
4238
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react13.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react13.Toaster, { toaster, insetInline: { mdDown: "4" }, children: (toast) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react13.Toast.Root, { width: { md: "sm" }, children: [
4239
- toast.type === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react13.Spinner, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react13.Toast.Indicator, {}),
4240
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react13.Stack, { gap: "1", flex: "1", maxWidth: "100%", children: [
4241
- toast.title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react13.Toast.Title, { children: toast.title }),
4242
- toast.description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react13.Toast.Description, { children: toast.description })
4267
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react15.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react15.Toaster, { toaster, insetInline: { mdDown: "4" }, children: (toast) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react15.Toast.Root, { width: { md: "sm" }, children: [
4268
+ toast.type === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react15.Spinner, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react15.Toast.Indicator, {}),
4269
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react15.Stack, { gap: "1", flex: "1", maxWidth: "100%", children: [
4270
+ toast.title && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react15.Toast.Title, { children: toast.title }),
4271
+ toast.description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react15.Toast.Description, { children: toast.description })
4243
4272
  ] }),
4244
- toast.action && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react13.Toast.ActionTrigger, { children: toast.action.label }),
4245
- toast.closable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react13.Toast.CloseTrigger, {})
4273
+ toast.action && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react15.Toast.ActionTrigger, { children: toast.action.label }),
4274
+ toast.closable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react15.Toast.CloseTrigger, {})
4246
4275
  ] }) }) });
4247
4276
  };
4248
4277
 
4249
4278
  // src/hooks/useToast.tsx
4250
4279
  var useToast = () => {
4251
- const clickableSuccess = (0, import_react14.useCallback)((title, actionFn, actionLabel, description, duration = 5e3) => {
4280
+ const clickableSuccess = (0, import_react16.useCallback)((title, actionFn, actionLabel, description, duration = 5e3) => {
4252
4281
  toaster.create({
4253
4282
  title,
4254
4283
  description,
@@ -4261,7 +4290,7 @@ var useToast = () => {
4261
4290
  }
4262
4291
  });
4263
4292
  }, []);
4264
- const success = (0, import_react14.useCallback)((title, description, duration = 5e3) => {
4293
+ const success = (0, import_react16.useCallback)((title, description, duration = 5e3) => {
4265
4294
  toaster.create({
4266
4295
  title,
4267
4296
  description,
@@ -4270,7 +4299,7 @@ var useToast = () => {
4270
4299
  closable: true
4271
4300
  });
4272
4301
  }, []);
4273
- const error = (0, import_react14.useCallback)((title, description, duration = 8e3) => {
4302
+ const error = (0, import_react16.useCallback)((title, description, duration = 8e3) => {
4274
4303
  toaster.create({
4275
4304
  title,
4276
4305
  description,
@@ -4279,7 +4308,7 @@ var useToast = () => {
4279
4308
  closable: true
4280
4309
  });
4281
4310
  }, []);
4282
- const warning = (0, import_react14.useCallback)((title, description, duration = 6e3) => {
4311
+ const warning = (0, import_react16.useCallback)((title, description, duration = 6e3) => {
4283
4312
  toaster.create({
4284
4313
  title,
4285
4314
  description,
@@ -4288,7 +4317,7 @@ var useToast = () => {
4288
4317
  closable: true
4289
4318
  });
4290
4319
  }, []);
4291
- const info = (0, import_react14.useCallback)((title, description, duration = 5e3) => {
4320
+ const info = (0, import_react16.useCallback)((title, description, duration = 5e3) => {
4292
4321
  toaster.create({
4293
4322
  title,
4294
4323
  description,
@@ -4297,7 +4326,7 @@ var useToast = () => {
4297
4326
  closable: true
4298
4327
  });
4299
4328
  }, []);
4300
- const loading = (0, import_react14.useCallback)((title, description) => {
4329
+ const loading = (0, import_react16.useCallback)((title, description) => {
4301
4330
  return toaster.create({
4302
4331
  title,
4303
4332
  description,
@@ -4305,10 +4334,10 @@ var useToast = () => {
4305
4334
  closable: false
4306
4335
  });
4307
4336
  }, []);
4308
- const dismiss = (0, import_react14.useCallback)((id) => {
4337
+ const dismiss = (0, import_react16.useCallback)((id) => {
4309
4338
  toaster.dismiss(id);
4310
4339
  }, []);
4311
- const toast = (0, import_react14.useMemo)(() => ({
4340
+ const toast = (0, import_react16.useMemo)(() => ({
4312
4341
  clickableSuccess,
4313
4342
  success,
4314
4343
  error,
@@ -4322,9 +4351,9 @@ var useToast = () => {
4322
4351
 
4323
4352
  // src/hooks/useTx.tsx
4324
4353
  var import_tx13 = require("@bze/bzejs/cosmos/tx/v1beta1/tx");
4325
- var import_react15 = require("@interchain-kit/react");
4354
+ var import_react17 = require("@interchain-kit/react");
4326
4355
  var import_bignumber13 = __toESM(require("bignumber.js"));
4327
- var import_react16 = require("react");
4356
+ var import_react18 = require("react");
4328
4357
  var TxStatus = /* @__PURE__ */ ((TxStatus2) => {
4329
4358
  TxStatus2["Failed"] = "Transaction Failed";
4330
4359
  TxStatus2["Successful"] = "Transaction Successful";
@@ -4357,21 +4386,21 @@ var useIBCTx = (chainName) => {
4357
4386
  };
4358
4387
  };
4359
4388
  var useTx = (chainName) => {
4360
- const { address, disconnect } = (0, import_react15.useChain)(chainName);
4389
+ const { address, disconnect } = (0, import_react17.useChain)(chainName);
4361
4390
  const { toast } = useToast();
4362
4391
  const { signingClient, isSigningClientReady, signingClientError } = useSigningClient({ chainName });
4363
- const [progressTrack, setProgressTrack] = (0, import_react16.useState)("");
4392
+ const [progressTrack, setProgressTrack] = (0, import_react18.useState)("");
4364
4393
  const { getDenomsPool } = useLiquidityPools();
4365
4394
  const { feeDenom } = useSettings();
4366
- const defaultChainName = (0, import_react16.useMemo)(() => getChainName(), []);
4367
- const canUseClient = (0, import_react16.useCallback)(async () => {
4395
+ const defaultChainName = (0, import_react18.useMemo)(() => getChainName(), []);
4396
+ const canUseClient = (0, import_react18.useCallback)(async () => {
4368
4397
  if (!isSigningClientReady) {
4369
4398
  console.error("waiting for signing client to be ready", signingClientError);
4370
4399
  await sleep(1e3);
4371
4400
  }
4372
4401
  return isSigningClientReady;
4373
4402
  }, [isSigningClientReady, signingClientError]);
4374
- const simulateFee = (0, import_react16.useCallback)(async (messages, memo) => {
4403
+ const simulateFee = (0, import_react18.useCallback)(async (messages, memo) => {
4375
4404
  var _a2;
4376
4405
  const gasPrice = 0.02;
4377
4406
  const nativeDenom = getChainNativeAssetDenom();
@@ -4416,7 +4445,7 @@ var useTx = (chainName) => {
4416
4445
  gas: gasAmount.multipliedBy(1.5).toFixed(0)
4417
4446
  };
4418
4447
  }, [signingClient, address, feeDenom, getDenomsPool]);
4419
- const getFee = (0, import_react16.useCallback)(async (messages, options) => {
4448
+ const getFee = (0, import_react18.useCallback)(async (messages, options) => {
4420
4449
  try {
4421
4450
  if (options == null ? void 0 : options.fee) {
4422
4451
  return options.fee;
@@ -4429,7 +4458,7 @@ var useTx = (chainName) => {
4429
4458
  return defaultFee;
4430
4459
  }
4431
4460
  }, [simulateFee]);
4432
- const tx = (0, import_react16.useCallback)(async (msgs, options) => {
4461
+ const tx = (0, import_react18.useCallback)(async (msgs, options) => {
4433
4462
  var _a2;
4434
4463
  if (!address) {
4435
4464
  toast.error("Transaction Failed" /* Failed */, "Please connect the wallet");
@@ -4488,16 +4517,16 @@ var useTx = (chainName) => {
4488
4517
  };
4489
4518
 
4490
4519
  // src/hooks/useValidatorLogos.ts
4491
- var import_react17 = require("react");
4520
+ var import_react19 = require("react");
4492
4521
  var KEYBASE_API_URL = "https://keybase.io/_/api/1.0/user/lookup.json";
4493
4522
  var LOGOS_STORAGE_KEY = "validator_logos";
4494
4523
  var LOGOS_TTL = 24 * 60 * 60 * 1e3;
4495
4524
  var useValidatorLogos = (validators) => {
4496
- const [logos, setLogos] = (0, import_react17.useState)({});
4497
- const [isLoading, setIsLoading] = (0, import_react17.useState)(false);
4498
- const fetchedRef = (0, import_react17.useRef)(false);
4499
- const validatorCountRef = (0, import_react17.useRef)(0);
4500
- const fetchLogos = (0, import_react17.useCallback)(async (identities) => {
4525
+ const [logos, setLogos] = (0, import_react19.useState)({});
4526
+ const [isLoading, setIsLoading] = (0, import_react19.useState)(false);
4527
+ const fetchedRef = (0, import_react19.useRef)(false);
4528
+ const validatorCountRef = (0, import_react19.useRef)(0);
4529
+ const fetchLogos = (0, import_react19.useCallback)(async (identities) => {
4501
4530
  if (identities.length === 0) return {};
4502
4531
  let cached = null;
4503
4532
  try {
@@ -4560,7 +4589,7 @@ var useValidatorLogos = (validators) => {
4560
4589
  }
4561
4590
  return result;
4562
4591
  }, []);
4563
- (0, import_react17.useEffect)(() => {
4592
+ (0, import_react19.useEffect)(() => {
4564
4593
  if (!validators || validators.length === 0) return;
4565
4594
  if (fetchedRef.current && validatorCountRef.current === validators.length) return;
4566
4595
  const identities = validators.map((v) => {
@@ -4583,8 +4612,8 @@ var useValidatorLogos = (validators) => {
4583
4612
  };
4584
4613
 
4585
4614
  // src/components/highlight.tsx
4586
- var import_react18 = require("@chakra-ui/react");
4587
- var import_react19 = require("react");
4615
+ var import_react20 = require("@chakra-ui/react");
4616
+ var import_react21 = require("react");
4588
4617
  var import_jsx_runtime2 = require("react/jsx-runtime");
4589
4618
  var HighlightText = (_a2) => {
4590
4619
  var _b2 = _a2, {
@@ -4600,14 +4629,14 @@ var HighlightText = (_a2) => {
4600
4629
  "highlightIntensity",
4601
4630
  "children"
4602
4631
  ]);
4603
- const [isHighlighted, setIsHighlighted] = (0, import_react19.useState)(false);
4604
- const isMountedRef = (0, import_react19.useRef)(false);
4605
- const timeoutRef = (0, import_react19.useRef)(void 0);
4632
+ const [isHighlighted, setIsHighlighted] = (0, import_react21.useState)(false);
4633
+ const isMountedRef = (0, import_react21.useRef)(false);
4634
+ const timeoutRef = (0, import_react21.useRef)(void 0);
4606
4635
  const childrenString = String(children);
4607
- const previousValueRef = (0, import_react19.useRef)(childrenString);
4636
+ const previousValueRef = (0, import_react21.useRef)(childrenString);
4608
4637
  const highlightOpacity = highlightIntensity === "subtle" ? "15" : "50";
4609
4638
  const boxShadowStrength = highlightIntensity === "subtle" ? "10" : "25";
4610
- (0, import_react19.useEffect)(() => {
4639
+ (0, import_react21.useEffect)(() => {
4611
4640
  if (!isMountedRef.current) {
4612
4641
  isMountedRef.current = true;
4613
4642
  if (highlightOnMount) {
@@ -4636,7 +4665,7 @@ var HighlightText = (_a2) => {
4636
4665
  };
4637
4666
  }, [childrenString, duration, highlightOnMount]);
4638
4667
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
4639
- import_react18.Text,
4668
+ import_react20.Text,
4640
4669
  __spreadProps(__spreadValues({}, textProps), {
4641
4670
  transition: `all ${duration}ms ease-out`,
4642
4671
  bg: isHighlighted ? `${highlightColor}/${highlightOpacity}` : "transparent",
@@ -4651,12 +4680,12 @@ var HighlightText = (_a2) => {
4651
4680
  };
4652
4681
 
4653
4682
  // src/components/sidebar/sidebar.tsx
4654
- var import_react20 = require("@chakra-ui/react");
4683
+ var import_react22 = require("@chakra-ui/react");
4655
4684
  var import_lu2 = require("react-icons/lu");
4656
- var import_react21 = require("react");
4685
+ var import_react23 = require("react");
4657
4686
  var import_jsx_runtime3 = require("react/jsx-runtime");
4658
4687
  var Sidebar = ({ children, trigger, ariaLabel }) => {
4659
- const [isOpen, setIsOpen] = (0, import_react21.useState)(false);
4688
+ const [isOpen, setIsOpen] = (0, import_react23.useState)(false);
4660
4689
  const handleTriggerClick = () => {
4661
4690
  setIsOpen(true);
4662
4691
  };
@@ -4665,7 +4694,7 @@ var Sidebar = ({ children, trigger, ariaLabel }) => {
4665
4694
  };
4666
4695
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
4667
4696
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { onClick: handleTriggerClick, style: { cursor: "pointer" }, children: trigger }),
4668
- isOpen && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react20.Portal, { children: [
4697
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react22.Portal, { children: [
4669
4698
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
4670
4699
  "div",
4671
4700
  {
@@ -4733,13 +4762,13 @@ var Sidebar = ({ children, trigger, ariaLabel }) => {
4733
4762
  }
4734
4763
  ),
4735
4764
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
4736
- import_react20.IconButton,
4765
+ import_react22.IconButton,
4737
4766
  {
4738
4767
  "aria-label": "Close sidebar",
4739
4768
  variant: "ghost",
4740
4769
  size: "sm",
4741
4770
  onClick: handleClose,
4742
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react20.Icon, { size: "md", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lu2.LuX, {}) })
4771
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react22.Icon, { size: "md", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lu2.LuX, {}) })
4743
4772
  }
4744
4773
  )
4745
4774
  ]
@@ -4766,10 +4795,10 @@ var Sidebar = ({ children, trigger, ariaLabel }) => {
4766
4795
  };
4767
4796
 
4768
4797
  // src/components/sidebar/settings-sidebar.tsx
4769
- var import_react22 = require("@chakra-ui/react");
4770
- var import_react23 = require("@chakra-ui/react");
4798
+ var import_react24 = require("@chakra-ui/react");
4799
+ var import_react25 = require("@chakra-ui/react");
4771
4800
  var import_next_themes = require("next-themes");
4772
- var import_react24 = require("react");
4801
+ var import_react26 = require("react");
4773
4802
  var import_jsx_runtime4 = require("react/jsx-runtime");
4774
4803
  var SettingsSidebarContent = ({ accentColor = "blue" }) => {
4775
4804
  const { setTheme, resolvedTheme } = (0, import_next_themes.useTheme)();
@@ -4777,19 +4806,19 @@ var SettingsSidebarContent = ({ accentColor = "blue" }) => {
4777
4806
  const { settings, isLoaded, updateEndpoints, updatePreferredFeeDenom, defaultSettings } = useSettings();
4778
4807
  const { connectionType } = useConnectionType();
4779
4808
  const { feeTokens, isLoading: feeTokensLoading } = useFeeTokens();
4780
- const [restEndpoint, setRestEndpoint] = (0, import_react24.useState)("");
4781
- const [rpcEndpoint, setRpcEndpoint] = (0, import_react24.useState)("");
4782
- const [isValidating, setIsValidating] = (0, import_react24.useState)(false);
4783
- const [validationResults, setValidationResults] = (0, import_react24.useState)({});
4784
- const [preferredFeeDenom, setPreferredFeeDenom] = (0, import_react24.useState)(void 0);
4785
- (0, import_react24.useEffect)(() => {
4809
+ const [restEndpoint, setRestEndpoint] = (0, import_react26.useState)("");
4810
+ const [rpcEndpoint, setRpcEndpoint] = (0, import_react26.useState)("");
4811
+ const [isValidating, setIsValidating] = (0, import_react26.useState)(false);
4812
+ const [validationResults, setValidationResults] = (0, import_react26.useState)({});
4813
+ const [preferredFeeDenom, setPreferredFeeDenom] = (0, import_react26.useState)(void 0);
4814
+ (0, import_react26.useEffect)(() => {
4786
4815
  if (isLoaded) {
4787
4816
  setRestEndpoint(settings.endpoints.restEndpoint);
4788
4817
  setRpcEndpoint(settings.endpoints.rpcEndpoint);
4789
4818
  setPreferredFeeDenom(settings.preferredFeeDenom || getChainNativeAssetDenom());
4790
4819
  }
4791
4820
  }, [isLoaded, settings]);
4792
- const handleValidateEndpoints = (0, import_react24.useCallback)(async (rest, rpc) => {
4821
+ const handleValidateEndpoints = (0, import_react26.useCallback)(async (rest, rpc) => {
4793
4822
  setIsValidating(true);
4794
4823
  setValidationResults({});
4795
4824
  try {
@@ -4809,7 +4838,7 @@ var SettingsSidebarContent = ({ accentColor = "blue" }) => {
4809
4838
  setTimeout(() => setValidationResults({}), 1e4);
4810
4839
  }
4811
4840
  }, []);
4812
- const handleSaveSettings = (0, import_react24.useCallback)(async (rest, rpc, feeDenom) => {
4841
+ const handleSaveSettings = (0, import_react26.useCallback)(async (rest, rpc, feeDenom) => {
4813
4842
  setValidationResults({});
4814
4843
  const results = await validateEndpoints(rest, rpc);
4815
4844
  if (!results.isValid) {
@@ -4829,13 +4858,13 @@ var SettingsSidebarContent = ({ accentColor = "blue" }) => {
4829
4858
  toast.success("Success!", "Settings have been saved.");
4830
4859
  }
4831
4860
  }, []);
4832
- const handleResetToDefaults = (0, import_react24.useCallback)(() => {
4861
+ const handleResetToDefaults = (0, import_react26.useCallback)(() => {
4833
4862
  setRestEndpoint(defaultSettings.endpoints.restEndpoint);
4834
4863
  setRpcEndpoint(defaultSettings.endpoints.rpcEndpoint);
4835
4864
  setPreferredFeeDenom(defaultSettings.preferredFeeDenom);
4836
4865
  setValidationResults({});
4837
4866
  }, []);
4838
- const connectionStatusText = (0, import_react24.useMemo)(() => {
4867
+ const connectionStatusText = (0, import_react26.useMemo)(() => {
4839
4868
  switch (connectionType) {
4840
4869
  case CONNECTION_TYPE_NONE:
4841
4870
  return "Failed";
@@ -4845,7 +4874,7 @@ var SettingsSidebarContent = ({ accentColor = "blue" }) => {
4845
4874
  return "Connected";
4846
4875
  }
4847
4876
  }, [connectionType]);
4848
- const connectionStatusBadgeColor = (0, import_react24.useMemo)(() => {
4877
+ const connectionStatusBadgeColor = (0, import_react26.useMemo)(() => {
4849
4878
  switch (connectionType) {
4850
4879
  case CONNECTION_TYPE_NONE:
4851
4880
  return "red";
@@ -4855,24 +4884,24 @@ var SettingsSidebarContent = ({ accentColor = "blue" }) => {
4855
4884
  return "green";
4856
4885
  }
4857
4886
  }, [connectionType]);
4858
- const feeTokensCollection = (0, import_react24.useMemo)(() => (0, import_react22.createListCollection)({
4887
+ const feeTokensCollection = (0, import_react26.useMemo)(() => (0, import_react24.createListCollection)({
4859
4888
  items: feeTokens.map((token) => ({
4860
4889
  label: token.ticker || token.name,
4861
4890
  value: token.denom,
4862
4891
  name: token.ticker || token.name
4863
4892
  }))
4864
4893
  }), [feeTokens]);
4865
- const handleFeeTokenChange = (0, import_react24.useCallback)((denom) => {
4894
+ const handleFeeTokenChange = (0, import_react26.useCallback)((denom) => {
4866
4895
  setPreferredFeeDenom(denom || void 0);
4867
4896
  }, []);
4868
4897
  const hasUnsavedChanges = restEndpoint !== settings.endpoints.restEndpoint || rpcEndpoint !== settings.endpoints.rpcEndpoint || preferredFeeDenom !== settings.preferredFeeDenom;
4869
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react22.VStack, { gap: "6", align: "stretch", children: [
4870
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react22.Box, { children: [
4871
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Text, { fontSize: "sm", fontWeight: "medium", mb: "3", children: "Appearance" }),
4872
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.VStack, { gap: "3", align: "stretch", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react22.HStack, { justify: "space-between", children: [
4873
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Text, { fontSize: "sm", children: "Dark Mode" }),
4898
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react24.VStack, { gap: "6", align: "stretch", children: [
4899
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react24.Box, { children: [
4900
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Text, { fontSize: "sm", fontWeight: "medium", mb: "3", children: "Appearance" }),
4901
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.VStack, { gap: "3", align: "stretch", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react24.HStack, { justify: "space-between", children: [
4902
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Text, { fontSize: "sm", children: "Dark Mode" }),
4874
4903
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4875
- import_react22.Switch.Root,
4904
+ import_react24.Switch.Root,
4876
4905
  {
4877
4906
  checked: resolvedTheme === "dark",
4878
4907
  onCheckedChange: (details) => {
@@ -4880,19 +4909,19 @@ var SettingsSidebarContent = ({ accentColor = "blue" }) => {
4880
4909
  setTheme(newTheme);
4881
4910
  },
4882
4911
  children: [
4883
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Switch.HiddenInput, {}),
4884
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Switch.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Switch.Thumb, {}) })
4912
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Switch.HiddenInput, {}),
4913
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Switch.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Switch.Thumb, {}) })
4885
4914
  ]
4886
4915
  }
4887
4916
  )
4888
4917
  ] }) })
4889
4918
  ] }),
4890
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Separator, {}),
4891
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react22.Box, { children: [
4892
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Text, { fontSize: "sm", fontWeight: "medium", mb: "3", children: "Fee Token Preference" }),
4893
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.VStack, { gap: "3", align: "stretch", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react22.Box, { children: [
4919
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Separator, {}),
4920
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react24.Box, { children: [
4921
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Text, { fontSize: "sm", fontWeight: "medium", mb: "3", children: "Fee Token Preference" }),
4922
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.VStack, { gap: "3", align: "stretch", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react24.Box, { children: [
4894
4923
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
4895
- import_react23.Select.Root,
4924
+ import_react25.Select.Root,
4896
4925
  {
4897
4926
  collection: feeTokensCollection,
4898
4927
  size: "sm",
@@ -4900,35 +4929,35 @@ var SettingsSidebarContent = ({ accentColor = "blue" }) => {
4900
4929
  onValueChange: (details) => handleFeeTokenChange(details.value[0] || ""),
4901
4930
  disabled: feeTokensLoading,
4902
4931
  children: [
4903
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react23.Select.Label, { children: "Preferred Fee Token" }),
4904
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react23.Select.HiddenSelect, {}),
4905
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react23.Select.Control, { children: [
4906
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react23.Select.Trigger, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react23.Select.ValueText, { placeholder: "Native Token (default)" }) }),
4907
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react23.Select.IndicatorGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react23.Select.Indicator, {}) })
4932
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react25.Select.Label, { children: "Preferred Fee Token" }),
4933
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react25.Select.HiddenSelect, {}),
4934
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react25.Select.Control, { children: [
4935
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react25.Select.Trigger, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react25.Select.ValueText, { placeholder: "Native Token (default)" }) }),
4936
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react25.Select.IndicatorGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react25.Select.Indicator, {}) })
4908
4937
  ] }),
4909
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react23.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react23.Select.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react23.Select.Content, { children: feeTokensCollection.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react23.Select.Item, { item, children: [
4910
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Text, { children: item.label }),
4911
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react23.Select.ItemIndicator, {})
4938
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react25.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react25.Select.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react25.Select.Content, { children: feeTokensCollection.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react25.Select.Item, { item, children: [
4939
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Text, { children: item.label }),
4940
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react25.Select.ItemIndicator, {})
4912
4941
  ] }, item.value)) }) }) })
4913
4942
  ]
4914
4943
  }
4915
4944
  ),
4916
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Text, { fontSize: "xs", color: "fg.muted", mt: "2", children: "Select your preferred token for paying transaction fees. Only tokens with liquidity pools paired with the native token are available." })
4945
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Text, { fontSize: "xs", color: "fg.muted", mt: "2", children: "Select your preferred token for paying transaction fees. Only tokens with liquidity pools paired with the native token are available." })
4917
4946
  ] }) })
4918
4947
  ] }),
4919
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Separator, {}),
4920
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react22.Box, { children: [
4921
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Text, { fontSize: "sm", fontWeight: "medium", mb: "3", children: "BeeZee Endpoints" }),
4922
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react22.VStack, { gap: "4", align: "stretch", children: [
4923
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react22.HStack, { gap: "2", align: "center", justify: "space-between", children: [
4924
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Text, { fontSize: "sm", mb: "1", children: "Status: " }),
4925
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Badge, { colorPalette: connectionStatusBadgeColor, children: connectionStatusText })
4948
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Separator, {}),
4949
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react24.Box, { children: [
4950
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Text, { fontSize: "sm", fontWeight: "medium", mb: "3", children: "BeeZee Endpoints" }),
4951
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react24.VStack, { gap: "4", align: "stretch", children: [
4952
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react24.HStack, { gap: "2", align: "center", justify: "space-between", children: [
4953
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Text, { fontSize: "sm", mb: "1", children: "Status: " }),
4954
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Badge, { colorPalette: connectionStatusBadgeColor, children: connectionStatusText })
4926
4955
  ] }) }),
4927
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react22.Box, { children: [
4928
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Text, { fontSize: "sm", mb: "1", children: "REST Endpoint" }),
4929
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Text, { fontSize: "xs", color: "fg.muted", mb: "2", children: "Note: Endpoint must have CORS enabled to work in browser" }),
4956
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react24.Box, { children: [
4957
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Text, { fontSize: "sm", mb: "1", children: "REST Endpoint" }),
4958
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Text, { fontSize: "xs", color: "fg.muted", mb: "2", children: "Note: Endpoint must have CORS enabled to work in browser" }),
4930
4959
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4931
- import_react22.Input,
4960
+ import_react24.Input,
4932
4961
  {
4933
4962
  size: "sm",
4934
4963
  placeholder: "https://rest.getbze.com",
@@ -4937,7 +4966,7 @@ var SettingsSidebarContent = ({ accentColor = "blue" }) => {
4937
4966
  }
4938
4967
  ),
4939
4968
  validationResults.rest && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4940
- import_react22.Box,
4969
+ import_react24.Box,
4941
4970
  {
4942
4971
  mt: "2",
4943
4972
  p: "3",
@@ -4947,15 +4976,15 @@ var SettingsSidebarContent = ({ accentColor = "blue" }) => {
4947
4976
  borderWidth: "1px",
4948
4977
  borderColor: validationResults.rest.isValid ? "green.500/30" : "red.500/30",
4949
4978
  borderRadius: "md",
4950
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Text, { fontSize: "sm", color: validationResults.rest.isValid ? "green.700" : "red.700", _dark: { color: validationResults.rest.isValid ? "green.300" : "red.300" }, children: validationResults.rest.error || "REST endpoint is valid" })
4979
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Text, { fontSize: "sm", color: validationResults.rest.isValid ? "green.700" : "red.700", _dark: { color: validationResults.rest.isValid ? "green.300" : "red.300" }, children: validationResults.rest.error || "REST endpoint is valid" })
4951
4980
  }
4952
4981
  )
4953
4982
  ] }),
4954
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react22.Box, { children: [
4955
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Text, { fontSize: "sm", mb: "1", children: "RPC Endpoint" }),
4956
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Text, { fontSize: "xs", color: "fg.muted", mb: "2", children: "Note: Must support WebSocket (WS/WSS) connections" }),
4983
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react24.Box, { children: [
4984
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Text, { fontSize: "sm", mb: "1", children: "RPC Endpoint" }),
4985
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Text, { fontSize: "xs", color: "fg.muted", mb: "2", children: "Note: Must support WebSocket (WS/WSS) connections" }),
4957
4986
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4958
- import_react22.Input,
4987
+ import_react24.Input,
4959
4988
  {
4960
4989
  size: "sm",
4961
4990
  placeholder: "wss://rpc.getbze.com",
@@ -4964,7 +4993,7 @@ var SettingsSidebarContent = ({ accentColor = "blue" }) => {
4964
4993
  }
4965
4994
  ),
4966
4995
  validationResults.rpc && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4967
- import_react22.Box,
4996
+ import_react24.Box,
4968
4997
  {
4969
4998
  mt: "2",
4970
4999
  p: "3",
@@ -4974,12 +5003,12 @@ var SettingsSidebarContent = ({ accentColor = "blue" }) => {
4974
5003
  borderWidth: "1px",
4975
5004
  borderColor: validationResults.rpc.isValid ? "green.500/30" : "red.500/30",
4976
5005
  borderRadius: "md",
4977
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Text, { fontSize: "sm", color: validationResults.rpc.isValid ? "green.700" : "red.700", _dark: { color: validationResults.rpc.isValid ? "green.300" : "red.300" }, children: validationResults.rpc.error || "RPC endpoint is valid" })
5006
+ children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Text, { fontSize: "sm", color: validationResults.rpc.isValid ? "green.700" : "red.700", _dark: { color: validationResults.rpc.isValid ? "green.300" : "red.300" }, children: validationResults.rpc.error || "RPC endpoint is valid" })
4978
5007
  }
4979
5008
  )
4980
5009
  ] }),
4981
5010
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4982
- import_react22.Button,
5011
+ import_react24.Button,
4983
5012
  {
4984
5013
  size: "sm",
4985
5014
  variant: "outline",
@@ -4991,9 +5020,9 @@ var SettingsSidebarContent = ({ accentColor = "blue" }) => {
4991
5020
  )
4992
5021
  ] })
4993
5022
  ] }),
4994
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react22.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react22.VStack, { gap: "3", children: [
5023
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react24.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react24.VStack, { gap: "3", children: [
4995
5024
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
4996
- import_react22.Button,
5025
+ import_react24.Button,
4997
5026
  {
4998
5027
  size: "sm",
4999
5028
  width: "full",
@@ -5004,7 +5033,7 @@ var SettingsSidebarContent = ({ accentColor = "blue" }) => {
5004
5033
  }
5005
5034
  ),
5006
5035
  /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
5007
- import_react22.Button,
5036
+ import_react24.Button,
5008
5037
  {
5009
5038
  size: "sm",
5010
5039
  width: "full",
@@ -5019,11 +5048,11 @@ var SettingsSidebarContent = ({ accentColor = "blue" }) => {
5019
5048
 
5020
5049
  // src/components/sidebar/wallet-sidebar.tsx
5021
5050
  var import_styles = require("@interchain-kit/react/styles.css");
5022
- var import_react25 = require("@interchain-kit/react");
5023
- var import_react26 = require("@chakra-ui/react");
5051
+ var import_react27 = require("@interchain-kit/react");
5052
+ var import_react28 = require("@chakra-ui/react");
5024
5053
  var import_lu3 = require("react-icons/lu");
5025
- var import_react27 = require("react");
5026
- var import_core = require("@interchain-kit/core");
5054
+ var import_react29 = require("react");
5055
+ var import_core2 = require("@interchain-kit/core");
5027
5056
  var import_bignumber14 = __toESM(require("bignumber.js"));
5028
5057
  var import_bzejs4 = require("@bze/bzejs");
5029
5058
  var import_jsx_runtime5 = require("react/jsx-runtime");
@@ -5043,16 +5072,16 @@ var validateAmount = (amount, coin2, onError) => {
5043
5072
  }
5044
5073
  };
5045
5074
  var BalanceItem = ({ asset, onClick, accentColor }) => {
5046
- const [showSendButton, setShowSendButton] = (0, import_react27.useState)(false);
5047
- const formattedBalanceAmount = (0, import_react27.useMemo)(() => {
5075
+ const [showSendButton, setShowSendButton] = (0, import_react29.useState)(false);
5076
+ const formattedBalanceAmount = (0, import_react29.useMemo)(() => {
5048
5077
  var _a2;
5049
5078
  return prettyAmount(uAmountToBigNumberAmount(asset.amount, (_a2 = asset.decimals) != null ? _a2 : 0));
5050
5079
  }, [asset.amount, asset.decimals]);
5051
- const formattedBalanceUSDValue = (0, import_react27.useMemo)(() => {
5080
+ const formattedBalanceUSDValue = (0, import_react29.useMemo)(() => {
5052
5081
  return shortNumberFormat(asset.USDValue);
5053
5082
  }, [asset.USDValue]);
5054
5083
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
5055
- import_react26.Box,
5084
+ import_react28.Box,
5056
5085
  {
5057
5086
  p: "3",
5058
5087
  bgGradient: "to-br",
@@ -5070,10 +5099,10 @@ var BalanceItem = ({ asset, onClick, accentColor }) => {
5070
5099
  onMouseLeave: () => setShowSendButton(false),
5071
5100
  onMouseEnter: () => setShowSendButton(true),
5072
5101
  children: [
5073
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.HStack, { justify: "space-between", mb: "2", children: [
5074
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.HStack, { children: [
5102
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.HStack, { justify: "space-between", mb: "2", children: [
5103
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.HStack, { children: [
5075
5104
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5076
- import_react26.Image,
5105
+ import_react28.Image,
5077
5106
  {
5078
5107
  src: asset.logo,
5079
5108
  alt: asset.ticker,
@@ -5082,13 +5111,13 @@ var BalanceItem = ({ asset, onClick, accentColor }) => {
5082
5111
  borderRadius: "full"
5083
5112
  }
5084
5113
  ),
5085
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Text, { fontSize: "sm", fontWeight: "medium", children: asset.ticker }),
5086
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Text, { fontSize: "xs", color: "fg.muted", children: asset.name }),
5087
- isIbcDenom(asset.denom) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Badge, { size: "xs", colorPalette: accentColor, children: "IBC" })
5114
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Text, { fontSize: "sm", fontWeight: "medium", children: asset.ticker }),
5115
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Text, { fontSize: "xs", color: "fg.muted", children: asset.name }),
5116
+ isIbcDenom(asset.denom) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Badge, { size: "xs", colorPalette: accentColor, children: "IBC" })
5088
5117
  ] }),
5089
- showSendButton && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.HStack, { justify: "end", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Button, { size: "2xs", variant: "outline", onClick, children: "Send" }) })
5118
+ showSendButton && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.HStack, { justify: "end", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Button, { size: "2xs", variant: "outline", onClick, children: "Send" }) })
5090
5119
  ] }),
5091
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.HStack, { justify: "space-between", children: [
5120
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.HStack, { justify: "space-between", children: [
5092
5121
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(HighlightText, { fontSize: "sm", fontFamily: "mono", children: formattedBalanceAmount }),
5093
5122
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(HighlightText, { fontSize: "sm", color: "fg.muted", children: [
5094
5123
  "$",
@@ -5100,18 +5129,18 @@ var BalanceItem = ({ asset, onClick, accentColor }) => {
5100
5129
  );
5101
5130
  };
5102
5131
  var SendForm = ({ balances, onClose, selectedTicker, accentColor }) => {
5103
- const [isLoading, setIsLoading] = (0, import_react27.useState)(false);
5104
- const [selectedCoin, setSelectedCoin] = (0, import_react27.useState)();
5105
- const [sendAmount, setSendAmount] = (0, import_react27.useState)("");
5106
- const [sendAmountError, setSendAmountError] = (0, import_react27.useState)("");
5107
- const [recipient, setRecipient] = (0, import_react27.useState)("");
5108
- const [recipientError, setRecipientError] = (0, import_react27.useState)("");
5109
- const [memo, setMemo] = (0, import_react27.useState)("");
5110
- const [memoError, setMemoError] = (0, import_react27.useState)("");
5132
+ const [isLoading, setIsLoading] = (0, import_react29.useState)(false);
5133
+ const [selectedCoin, setSelectedCoin] = (0, import_react29.useState)();
5134
+ const [sendAmount, setSendAmount] = (0, import_react29.useState)("");
5135
+ const [sendAmountError, setSendAmountError] = (0, import_react29.useState)("");
5136
+ const [recipient, setRecipient] = (0, import_react29.useState)("");
5137
+ const [recipientError, setRecipientError] = (0, import_react29.useState)("");
5138
+ const [memo, setMemo] = (0, import_react29.useState)("");
5139
+ const [memoError, setMemoError] = (0, import_react29.useState)("");
5111
5140
  const { toast } = useToast();
5112
- const { status, address } = (0, import_react25.useChain)(getChainName());
5141
+ const { status, address } = (0, import_react27.useChain)(getChainName());
5113
5142
  const { tx } = useSDKTx(getChainName());
5114
- const coinsCollection = (0, import_react26.createListCollection)({
5143
+ const coinsCollection = (0, import_react28.createListCollection)({
5115
5144
  items: balances.map((item) => {
5116
5145
  var _a2;
5117
5146
  return {
@@ -5121,22 +5150,22 @@ var SendForm = ({ balances, onClose, selectedTicker, accentColor }) => {
5121
5150
  };
5122
5151
  })
5123
5152
  });
5124
- const isValidForm = (0, import_react27.useMemo)(() => {
5153
+ const isValidForm = (0, import_react29.useMemo)(() => {
5125
5154
  return selectedCoin && memoError === "" && recipientError === "" && sendAmountError === "" && sendAmount !== "" && recipient !== "";
5126
5155
  }, [selectedCoin, memoError, recipientError, sendAmountError, sendAmount, recipient]);
5127
- const resetSendForm = (0, import_react27.useCallback)(() => {
5156
+ const resetSendForm = (0, import_react29.useCallback)(() => {
5128
5157
  setSelectedCoin(void 0);
5129
5158
  setSendAmount("");
5130
5159
  setRecipient("");
5131
5160
  setMemo("");
5132
5161
  }, []);
5133
- const handleSend = (0, import_react27.useCallback)(async () => {
5162
+ const handleSend = (0, import_react29.useCallback)(async () => {
5134
5163
  var _a2, _b2;
5135
5164
  if (!isValidForm) {
5136
5165
  toast.error("Can not send coins!", "Please check the input data.");
5137
5166
  return;
5138
5167
  }
5139
- if (status !== import_core.WalletState.Connected) {
5168
+ if (status !== import_core2.WalletState.Connected) {
5140
5169
  toast.error("Wallet not connected!", "Please connect your wallet first.");
5141
5170
  return;
5142
5171
  }
@@ -5155,11 +5184,11 @@ var SendForm = ({ balances, onClose, selectedTicker, accentColor }) => {
5155
5184
  setIsLoading(false);
5156
5185
  onClose();
5157
5186
  }, [address, memo, onClose, recipient, selectedCoin, sendAmount, status]);
5158
- const handleCancel = (0, import_react27.useCallback)(() => {
5187
+ const handleCancel = (0, import_react29.useCallback)(() => {
5159
5188
  resetSendForm();
5160
5189
  onClose();
5161
5190
  }, [onClose, resetSendForm]);
5162
- const onRecipientChange = (0, import_react27.useCallback)((recipient2) => {
5191
+ const onRecipientChange = (0, import_react29.useCallback)((recipient2) => {
5163
5192
  setRecipient(recipient2);
5164
5193
  if (recipient2.length === 0) {
5165
5194
  setRecipientError("");
@@ -5172,11 +5201,11 @@ var SendForm = ({ balances, onClose, selectedTicker, accentColor }) => {
5172
5201
  setRecipientError(validate.message);
5173
5202
  }
5174
5203
  }, []);
5175
- const onAmountChange = (0, import_react27.useCallback)((amount) => {
5204
+ const onAmountChange = (0, import_react29.useCallback)((amount) => {
5176
5205
  setSendAmount(sanitizeNumberInput(amount));
5177
5206
  setSendAmountError("");
5178
5207
  }, []);
5179
- const onCoinSelectChange = (0, import_react27.useCallback)((ticker) => {
5208
+ const onCoinSelectChange = (0, import_react29.useCallback)((ticker) => {
5180
5209
  if (ticker === "") return;
5181
5210
  const selectedCoin2 = balances.find((item) => item.ticker === ticker);
5182
5211
  if (selectedCoin2) {
@@ -5184,13 +5213,13 @@ var SendForm = ({ balances, onClose, selectedTicker, accentColor }) => {
5184
5213
  validateAmount(sendAmount, selectedCoin2, setSendAmountError);
5185
5214
  }
5186
5215
  }, [sendAmount, balances]);
5187
- const setMaxAmount = (0, import_react27.useCallback)(() => {
5216
+ const setMaxAmount = (0, import_react29.useCallback)(() => {
5188
5217
  if (!selectedCoin) return;
5189
5218
  const maxAmount = uAmountToBigNumberAmount(selectedCoin.amount, selectedCoin.decimals);
5190
5219
  onAmountChange(maxAmount.toString());
5191
5220
  validateAmount(maxAmount.toString(), selectedCoin, setSendAmountError);
5192
5221
  }, [selectedCoin, onAmountChange]);
5193
- const onMemoChange = (0, import_react27.useCallback)((memo2) => {
5222
+ const onMemoChange = (0, import_react29.useCallback)((memo2) => {
5194
5223
  setMemo(memo2);
5195
5224
  if (memo2.length > 256) {
5196
5225
  setMemoError("Memo must be less than or equal to 256 characters");
@@ -5198,16 +5227,16 @@ var SendForm = ({ balances, onClose, selectedTicker, accentColor }) => {
5198
5227
  setMemoError("");
5199
5228
  }
5200
5229
  }, []);
5201
- (0, import_react27.useEffect)(() => {
5230
+ (0, import_react29.useEffect)(() => {
5202
5231
  if (selectedTicker !== "") {
5203
5232
  onCoinSelectChange(selectedTicker);
5204
5233
  }
5205
5234
  }, [onCoinSelectChange, selectedTicker]);
5206
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.VStack, { gap: "4", align: "stretch", children: [
5207
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.HStack, { justify: "space-between", align: "center", children: [
5208
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Text, { fontSize: "sm", fontWeight: "medium", children: "Send Coins" }),
5235
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.VStack, { gap: "4", align: "stretch", children: [
5236
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.HStack, { justify: "space-between", align: "center", children: [
5237
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Text, { fontSize: "sm", fontWeight: "medium", children: "Send Coins" }),
5209
5238
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5210
- import_react26.Button,
5239
+ import_react28.Button,
5211
5240
  {
5212
5241
  size: "xs",
5213
5242
  variant: "ghost",
@@ -5217,25 +5246,25 @@ var SendForm = ({ balances, onClose, selectedTicker, accentColor }) => {
5217
5246
  }
5218
5247
  )
5219
5248
  ] }),
5220
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.Box, { children: [
5249
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.Box, { children: [
5221
5250
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
5222
- import_react26.Select.Root,
5251
+ import_react28.Select.Root,
5223
5252
  {
5224
5253
  collection: coinsCollection,
5225
5254
  size: "sm",
5226
5255
  value: (selectedCoin == null ? void 0 : selectedCoin.ticker) ? [selectedCoin.ticker] : [],
5227
5256
  onValueChange: (details) => onCoinSelectChange(details.value[0] || ""),
5228
5257
  children: [
5229
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Select.Label, { children: "Coin" }),
5230
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Select.HiddenSelect, {}),
5231
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.Select.Control, { children: [
5232
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Select.Trigger, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Select.ValueText, { placeholder: "Select coin" }) }),
5233
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Select.IndicatorGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Select.Indicator, {}) })
5258
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Select.Label, { children: "Coin" }),
5259
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Select.HiddenSelect, {}),
5260
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.Select.Control, { children: [
5261
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Select.Trigger, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Select.ValueText, { placeholder: "Select coin" }) }),
5262
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Select.IndicatorGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Select.Indicator, {}) })
5234
5263
  ] }),
5235
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Select.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Select.Content, { children: coinsCollection.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.Select.Item, { item, children: [
5236
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.HStack, { gap: "2", children: [
5264
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Select.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Select.Content, { children: coinsCollection.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.Select.Item, { item, children: [
5265
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.HStack, { gap: "2", children: [
5237
5266
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5238
- import_react26.Image,
5267
+ import_react28.Image,
5239
5268
  {
5240
5269
  src: item.logo,
5241
5270
  alt: item.value,
@@ -5244,15 +5273,15 @@ var SendForm = ({ balances, onClose, selectedTicker, accentColor }) => {
5244
5273
  borderRadius: "full"
5245
5274
  }
5246
5275
  ),
5247
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Text, { children: item.label })
5276
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Text, { children: item.label })
5248
5277
  ] }),
5249
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Select.ItemIndicator, {})
5278
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Select.ItemIndicator, {})
5250
5279
  ] }, item.value)) }) }) })
5251
5280
  ]
5252
5281
  }
5253
5282
  ),
5254
5283
  selectedCoin && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5255
- import_react26.Box,
5284
+ import_react28.Box,
5256
5285
  {
5257
5286
  mt: "2",
5258
5287
  p: "3",
@@ -5262,15 +5291,15 @@ var SendForm = ({ balances, onClose, selectedTicker, accentColor }) => {
5262
5291
  borderRadius: "md",
5263
5292
  borderWidth: "1px",
5264
5293
  borderColor: `${accentColor}.500/30`,
5265
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.HStack, { justify: "space-between", children: [
5266
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Text, { fontSize: "xs", color: "fg.muted", children: "Available:" }),
5267
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.VStack, { gap: "0", align: "end", children: [
5268
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.Text, { fontSize: "sm", fontWeight: "medium", children: [
5294
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.HStack, { justify: "space-between", children: [
5295
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Text, { fontSize: "xs", color: "fg.muted", children: "Available:" }),
5296
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.VStack, { gap: "0", align: "end", children: [
5297
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.Text, { fontSize: "sm", fontWeight: "medium", children: [
5269
5298
  uAmountToAmount(selectedCoin.amount, selectedCoin.decimals),
5270
5299
  " ",
5271
5300
  selectedCoin.ticker
5272
5301
  ] }),
5273
- selectedCoin.USDValue.gt(0) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.Text, { fontSize: "xs", color: "fg.muted", children: [
5302
+ selectedCoin.USDValue.gt(0) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.Text, { fontSize: "xs", color: "fg.muted", children: [
5274
5303
  "\u2248 $",
5275
5304
  shortNumberFormat(selectedCoin.USDValue)
5276
5305
  ] })
@@ -5279,11 +5308,11 @@ var SendForm = ({ balances, onClose, selectedTicker, accentColor }) => {
5279
5308
  }
5280
5309
  )
5281
5310
  ] }),
5282
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.Field.Root, { invalid: sendAmountError !== "", children: [
5283
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Field.Label, { children: "Amount" }),
5284
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.Group, { attached: true, w: "full", maxW: "sm", children: [
5311
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.Field.Root, { invalid: sendAmountError !== "", children: [
5312
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Field.Label, { children: "Amount" }),
5313
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.Group, { attached: true, w: "full", maxW: "sm", children: [
5285
5314
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5286
- import_react26.Input,
5315
+ import_react28.Input,
5287
5316
  {
5288
5317
  size: "sm",
5289
5318
  placeholder: "Amount to send",
@@ -5292,14 +5321,14 @@ var SendForm = ({ balances, onClose, selectedTicker, accentColor }) => {
5292
5321
  onBlur: () => validateAmount(sendAmount, selectedCoin, setSendAmountError)
5293
5322
  }
5294
5323
  ),
5295
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Button, { variant: "outline", size: "sm", onClick: setMaxAmount, disabled: isLoading, children: "Max" })
5324
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Button, { variant: "outline", size: "sm", onClick: setMaxAmount, disabled: isLoading, children: "Max" })
5296
5325
  ] }),
5297
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Field.ErrorText, { children: sendAmountError })
5326
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Field.ErrorText, { children: sendAmountError })
5298
5327
  ] }) }),
5299
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.Field.Root, { invalid: recipientError !== "", children: [
5300
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Field.Label, { children: "Recipient Address" }),
5328
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.Field.Root, { invalid: recipientError !== "", children: [
5329
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Field.Label, { children: "Recipient Address" }),
5301
5330
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5302
- import_react26.Input,
5331
+ import_react28.Input,
5303
5332
  {
5304
5333
  size: "sm",
5305
5334
  placeholder: "bze...2a1b",
@@ -5307,20 +5336,20 @@ var SendForm = ({ balances, onClose, selectedTicker, accentColor }) => {
5307
5336
  onChange: (e) => onRecipientChange(e.target.value)
5308
5337
  }
5309
5338
  ),
5310
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Field.ErrorText, { children: recipientError })
5339
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Field.ErrorText, { children: recipientError })
5311
5340
  ] }) }),
5312
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.Field.Root, { invalid: memoError !== "", children: [
5313
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.Field.Label, { children: [
5341
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.Field.Root, { invalid: memoError !== "", children: [
5342
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.Field.Label, { children: [
5314
5343
  "Memo",
5315
5344
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5316
- import_react26.Field.RequiredIndicator,
5345
+ import_react28.Field.RequiredIndicator,
5317
5346
  {
5318
- fallback: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Badge, { size: "xs", variant: "surface", children: "Optional" })
5347
+ fallback: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Badge, { size: "xs", variant: "surface", children: "Optional" })
5319
5348
  }
5320
5349
  )
5321
5350
  ] }),
5322
5351
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5323
- import_react26.Textarea,
5352
+ import_react28.Textarea,
5324
5353
  {
5325
5354
  size: "sm",
5326
5355
  placeholder: "Transaction memo",
@@ -5330,11 +5359,11 @@ var SendForm = ({ balances, onClose, selectedTicker, accentColor }) => {
5330
5359
  resize: "none"
5331
5360
  }
5332
5361
  ),
5333
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Field.ErrorText, { children: memoError })
5362
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Field.ErrorText, { children: memoError })
5334
5363
  ] }) }),
5335
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.HStack, { gap: "2", children: [
5364
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.HStack, { gap: "2", children: [
5336
5365
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5337
- import_react26.Button,
5366
+ import_react28.Button,
5338
5367
  {
5339
5368
  size: "sm",
5340
5369
  flex: "1",
@@ -5347,7 +5376,7 @@ var SendForm = ({ balances, onClose, selectedTicker, accentColor }) => {
5347
5376
  }
5348
5377
  ),
5349
5378
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5350
- import_react26.Button,
5379
+ import_react28.Button,
5351
5380
  {
5352
5381
  size: "sm",
5353
5382
  flex: "1",
@@ -5361,25 +5390,25 @@ var SendForm = ({ balances, onClose, selectedTicker, accentColor }) => {
5361
5390
  ] });
5362
5391
  };
5363
5392
  var WalletSidebarContent = ({ accentColor = "blue" }) => {
5364
- const [viewState, setViewState] = (0, import_react27.useState)("balances");
5365
- const [isDisconnecting, setIsDisconnecting] = (0, import_react27.useState)(false);
5366
- const [showCopiedTooltip, setShowCopiedTooltip] = (0, import_react27.useState)(false);
5367
- const [clickedBalance, setClickedBalance] = (0, import_react27.useState)("");
5368
- const copyButtonRef = (0, import_react27.useRef)(null);
5393
+ const [viewState, setViewState] = (0, import_react29.useState)("balances");
5394
+ const [isDisconnecting, setIsDisconnecting] = (0, import_react29.useState)(false);
5395
+ const [showCopiedTooltip, setShowCopiedTooltip] = (0, import_react29.useState)(false);
5396
+ const [clickedBalance, setClickedBalance] = (0, import_react29.useState)("");
5397
+ const copyButtonRef = (0, import_react29.useRef)(null);
5369
5398
  const {
5370
5399
  status,
5371
5400
  username,
5372
5401
  address,
5373
5402
  disconnect,
5374
5403
  connect
5375
- } = (0, import_react25.useChain)(getChainName());
5404
+ } = (0, import_react27.useChain)(getChainName());
5376
5405
  const { assetsBalances, isLoading: assetsLoading } = useBalances();
5377
- const balancesWithoutLps = (0, import_react27.useMemo)(() => {
5406
+ const balancesWithoutLps = (0, import_react29.useMemo)(() => {
5378
5407
  if (assetsLoading) return [];
5379
5408
  return assetsBalances.filter((asset) => !isLpDenom(asset.denom));
5380
5409
  }, [assetsLoading, assetsBalances]);
5381
5410
  const nativeDenom = getChainNativeAssetDenom();
5382
- const sortedBalances = (0, import_react27.useMemo)(() => {
5411
+ const sortedBalances = (0, import_react29.useMemo)(() => {
5383
5412
  return balancesWithoutLps.sort((a, b) => {
5384
5413
  if (a.denom === nativeDenom) return -1;
5385
5414
  if (b.denom === nativeDenom) return 1;
@@ -5395,21 +5424,21 @@ var WalletSidebarContent = ({ accentColor = "blue" }) => {
5395
5424
  return 0;
5396
5425
  });
5397
5426
  }, [balancesWithoutLps]);
5398
- const walletAddress = (0, import_react27.useMemo)(() => stringTruncateFromCenter(address != null ? address : "", 16), [address]);
5427
+ const walletAddress = (0, import_react29.useMemo)(() => stringTruncateFromCenter(address != null ? address : "", 16), [address]);
5399
5428
  const handleCopyAddress = () => {
5400
5429
  navigator.clipboard.writeText(address);
5401
5430
  setShowCopiedTooltip(true);
5402
5431
  setTimeout(() => setShowCopiedTooltip(false), 2e3);
5403
5432
  };
5404
- const handleCancel = (0, import_react27.useCallback)(() => {
5433
+ const handleCancel = (0, import_react29.useCallback)(() => {
5405
5434
  setViewState("balances");
5406
5435
  setClickedBalance("");
5407
5436
  }, []);
5408
- const onBalanceClick = (0, import_react27.useCallback)((ticker) => {
5437
+ const onBalanceClick = (0, import_react29.useCallback)((ticker) => {
5409
5438
  setClickedBalance(ticker);
5410
5439
  setViewState("send");
5411
5440
  }, []);
5412
- const handleDisconnectAll = (0, import_react27.useCallback)(async () => {
5441
+ const handleDisconnectAll = (0, import_react29.useCallback)(async () => {
5413
5442
  setIsDisconnecting(true);
5414
5443
  try {
5415
5444
  console.log("Disconnected from all chains");
@@ -5420,16 +5449,16 @@ var WalletSidebarContent = ({ accentColor = "blue" }) => {
5420
5449
  setIsDisconnecting(false);
5421
5450
  }
5422
5451
  }, [disconnect]);
5423
- const renderBalancesView = () => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.VStack, { gap: "6", align: "stretch", children: [
5424
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.Box, { children: [
5425
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Text, { fontSize: "sm", fontWeight: "medium", mb: "3", children: "Balances" }),
5426
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.VStack, { gap: "2", align: "stretch", children: sortedBalances.map((bal) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(BalanceItem, { asset: bal, onClick: () => onBalanceClick(bal.ticker), accentColor }, bal.denom)) })
5452
+ const renderBalancesView = () => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.VStack, { gap: "6", align: "stretch", children: [
5453
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.Box, { children: [
5454
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Text, { fontSize: "sm", fontWeight: "medium", mb: "3", children: "Balances" }),
5455
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.VStack, { gap: "2", align: "stretch", children: sortedBalances.map((bal) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(BalanceItem, { asset: bal, onClick: () => onBalanceClick(bal.ticker), accentColor }, bal.denom)) })
5427
5456
  ] }),
5428
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.Box, { children: [
5429
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Text, { fontSize: "sm", fontWeight: "medium", mb: "3", children: "Quick Actions" }),
5430
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.VStack, { gap: "2", align: "stretch", children: [
5457
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.Box, { children: [
5458
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Text, { fontSize: "sm", fontWeight: "medium", mb: "3", children: "Quick Actions" }),
5459
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.VStack, { gap: "2", align: "stretch", children: [
5431
5460
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5432
- import_react26.Button,
5461
+ import_react28.Button,
5433
5462
  {
5434
5463
  size: "sm",
5435
5464
  variant: "outline",
@@ -5440,7 +5469,7 @@ var WalletSidebarContent = ({ accentColor = "blue" }) => {
5440
5469
  }
5441
5470
  ),
5442
5471
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
5443
- import_react26.Button,
5472
+ import_react28.Button,
5444
5473
  {
5445
5474
  size: "sm",
5446
5475
  variant: "outline",
@@ -5453,7 +5482,7 @@ var WalletSidebarContent = ({ accentColor = "blue" }) => {
5453
5482
  }
5454
5483
  ),
5455
5484
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
5456
- import_react26.Button,
5485
+ import_react28.Button,
5457
5486
  {
5458
5487
  size: "sm",
5459
5488
  variant: "outline",
@@ -5467,8 +5496,8 @@ var WalletSidebarContent = ({ accentColor = "blue" }) => {
5467
5496
  )
5468
5497
  ] })
5469
5498
  ] }),
5470
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5471
- import_react26.Button,
5499
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5500
+ import_react28.Button,
5472
5501
  {
5473
5502
  size: "sm",
5474
5503
  width: "full",
@@ -5481,27 +5510,27 @@ var WalletSidebarContent = ({ accentColor = "blue" }) => {
5481
5510
  }
5482
5511
  ) })
5483
5512
  ] });
5484
- const statusColor = (0, import_react27.useMemo)(() => {
5513
+ const statusColor = (0, import_react29.useMemo)(() => {
5485
5514
  switch (status) {
5486
- case import_core.WalletState.Connected:
5515
+ case import_core2.WalletState.Connected:
5487
5516
  return "green";
5488
- case import_core.WalletState.Connecting:
5517
+ case import_core2.WalletState.Connecting:
5489
5518
  return "yellow";
5490
- case import_core.WalletState.Disconnected:
5519
+ case import_core2.WalletState.Disconnected:
5491
5520
  return "red";
5492
5521
  default:
5493
5522
  return "gray";
5494
5523
  }
5495
5524
  }, [status]);
5496
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.VStack, { gap: "6", align: "stretch", children: [
5497
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.Box, { children: [
5498
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react25.InterchainWalletModal, {}),
5499
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.HStack, { justify: "space-between", mb: "3", children: [
5500
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Text, { fontSize: "sm", fontWeight: "medium", children: "Wallet Status" }),
5501
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Badge, { colorPalette: statusColor, size: "sm", children: status })
5525
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.VStack, { gap: "6", align: "stretch", children: [
5526
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.Box, { children: [
5527
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react27.InterchainWalletModal, {}),
5528
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.HStack, { justify: "space-between", mb: "3", children: [
5529
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Text, { fontSize: "sm", fontWeight: "medium", children: "Wallet Status" }),
5530
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Badge, { colorPalette: statusColor, size: "sm", children: status })
5502
5531
  ] }),
5503
- status === import_core.WalletState.Connected && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
5504
- import_react26.Box,
5532
+ status === import_core2.WalletState.Connected && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
5533
+ import_react28.Box,
5505
5534
  {
5506
5535
  p: "3",
5507
5536
  bgGradient: "to-br",
@@ -5511,12 +5540,12 @@ var WalletSidebarContent = ({ accentColor = "blue" }) => {
5511
5540
  borderWidth: "1px",
5512
5541
  borderColor: `${accentColor}.500/20`,
5513
5542
  children: [
5514
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Text, { fontSize: "xs", color: "fg.muted", mb: "1", children: username != null ? username : "Address" }),
5515
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.HStack, { justify: "space-between", children: [
5516
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Text, { fontSize: "sm", fontFamily: "mono", children: walletAddress }),
5517
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react26.Box, { position: "relative", children: [
5543
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Text, { fontSize: "xs", color: "fg.muted", mb: "1", children: username != null ? username : "Address" }),
5544
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.HStack, { justify: "space-between", children: [
5545
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Text, { fontSize: "sm", fontFamily: "mono", children: walletAddress }),
5546
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react28.Box, { position: "relative", children: [
5518
5547
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5519
- import_react26.Button,
5548
+ import_react28.Button,
5520
5549
  {
5521
5550
  ref: copyButtonRef,
5522
5551
  size: "xs",
@@ -5526,7 +5555,7 @@ var WalletSidebarContent = ({ accentColor = "blue" }) => {
5526
5555
  }
5527
5556
  ),
5528
5557
  showCopiedTooltip && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5529
- import_react26.Box,
5558
+ import_react28.Box,
5530
5559
  {
5531
5560
  position: "absolute",
5532
5561
  top: "-35px",
@@ -5551,8 +5580,8 @@ var WalletSidebarContent = ({ accentColor = "blue" }) => {
5551
5580
  ]
5552
5581
  }
5553
5582
  ),
5554
- status !== import_core.WalletState.Connected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5555
- import_react26.Button,
5583
+ status !== import_core2.WalletState.Connected && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
5584
+ import_react28.Button,
5556
5585
  {
5557
5586
  size: "sm",
5558
5587
  variant: "solid",
@@ -5562,14 +5591,14 @@ var WalletSidebarContent = ({ accentColor = "blue" }) => {
5562
5591
  }
5563
5592
  )
5564
5593
  ] }),
5565
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react26.Separator, {}),
5566
- status === import_core.WalletState.Connected && viewState === "balances" && renderBalancesView(),
5567
- status === import_core.WalletState.Connected && viewState === "send" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SendForm, { balances: sortedBalances, onClose: handleCancel, selectedTicker: clickedBalance, accentColor })
5594
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react28.Separator, {}),
5595
+ status === import_core2.WalletState.Connected && viewState === "balances" && renderBalancesView(),
5596
+ status === import_core2.WalletState.Connected && viewState === "send" && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SendForm, { balances: sortedBalances, onClose: handleCancel, selectedTicker: clickedBalance, accentColor })
5568
5597
  ] });
5569
5598
  };
5570
5599
 
5571
5600
  // src/components/settings-toggle.tsx
5572
- var import_react28 = require("@chakra-ui/react");
5601
+ var import_react30 = require("@chakra-ui/react");
5573
5602
  var import_lu4 = require("react-icons/lu");
5574
5603
  var import_jsx_runtime6 = require("react/jsx-runtime");
5575
5604
  function SettingsToggle({ accentColor }) {
@@ -5577,21 +5606,21 @@ function SettingsToggle({ accentColor }) {
5577
5606
  Sidebar,
5578
5607
  {
5579
5608
  ariaLabel: "Settings",
5580
- trigger: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react28.Button, { variant: "subtle", size: { base: "sm", md: "md" }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lu4.LuSettings, {}) }),
5609
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react30.Button, { variant: "subtle", size: { base: "sm", md: "md" }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lu4.LuSettings, {}) }),
5581
5610
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SettingsSidebarContent, { accentColor })
5582
5611
  }
5583
5612
  );
5584
5613
  }
5585
5614
 
5586
5615
  // src/components/testnet-banner.tsx
5587
- var import_react29 = require("@chakra-ui/react");
5616
+ var import_react31 = require("@chakra-ui/react");
5588
5617
  var import_jsx_runtime7 = require("react/jsx-runtime");
5589
5618
  var TestnetBanner = () => {
5590
5619
  if (!isTestnetChain()) {
5591
5620
  return null;
5592
5621
  }
5593
5622
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
5594
- import_react29.Box,
5623
+ import_react31.Box,
5595
5624
  {
5596
5625
  position: "fixed",
5597
5626
  bottom: "0",
@@ -5605,7 +5634,7 @@ var TestnetBanner = () => {
5605
5634
  fontSize: "xs",
5606
5635
  fontWeight: "bold",
5607
5636
  letterSpacing: "wide",
5608
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react29.Text, { children: "YOU ARE ON TESTNET" })
5637
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react31.Text, { children: "YOU ARE ON TESTNET" })
5609
5638
  }
5610
5639
  );
5611
5640
  };
@@ -5876,6 +5905,7 @@ var TestnetBanner = () => {
5876
5905
  useSigningClient,
5877
5906
  useToast,
5878
5907
  useValidatorLogos,
5908
+ useWalletHealthCheck,
5879
5909
  validateBZEBech32Address,
5880
5910
  validateBech32Address,
5881
5911
  validateEndpoints,