@bze/bze-ui-kit 0.3.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2602,6 +2602,7 @@ async function mapPendingUnlock(pending) {
2602
2602
  // src/query/staking.ts
2603
2603
  import { PageRequest as PageRequest5 } from "@bze/bzejs/cosmos/base/query/v1beta1/pagination";
2604
2604
  import BigNumber7 from "bignumber.js";
2605
+ import { BondStatus } from "@bze/bzejs/cosmos/staking/v1beta1/staking";
2605
2606
  var getAddressDelegations = async (address) => {
2606
2607
  try {
2607
2608
  const client = await getRestClient();
@@ -2768,6 +2769,65 @@ var getStakingPool = async () => {
2768
2769
  };
2769
2770
  }
2770
2771
  };
2772
+ var getValidators = async (status = BondStatus.BOND_STATUS_BONDED) => {
2773
+ try {
2774
+ const client = await getRestClient();
2775
+ const statusStr = status === BondStatus.BOND_STATUS_BONDED ? "BOND_STATUS_BONDED" : status === BondStatus.BOND_STATUS_UNBONDING ? "BOND_STATUS_UNBONDING" : status === BondStatus.BOND_STATUS_UNBONDED ? "BOND_STATUS_UNBONDED" : "";
2776
+ const resp = await client.cosmos.staking.v1beta1.validators({
2777
+ status: statusStr,
2778
+ pagination: PageRequest5.fromPartial({
2779
+ limit: BigInt(500)
2780
+ })
2781
+ });
2782
+ return resp.validators;
2783
+ } catch (e) {
2784
+ console.error("failed to get validators", e);
2785
+ return [];
2786
+ }
2787
+ };
2788
+ var getDelegatorValidators = async (address) => {
2789
+ try {
2790
+ const client = await getRestClient();
2791
+ const resp = await client.cosmos.staking.v1beta1.delegatorValidators({
2792
+ delegatorAddr: address,
2793
+ pagination: PageRequest5.fromPartial({
2794
+ limit: BigInt(500)
2795
+ })
2796
+ });
2797
+ return resp.validators;
2798
+ } catch (e) {
2799
+ console.error("failed to get delegator validators", e);
2800
+ return [];
2801
+ }
2802
+ };
2803
+ var getDelegatorDelegations = async (address) => {
2804
+ try {
2805
+ const client = await getRestClient();
2806
+ const resp = await client.cosmos.staking.v1beta1.delegatorDelegations({
2807
+ delegatorAddr: address,
2808
+ pagination: PageRequest5.fromPartial({
2809
+ limit: BigInt(1e3)
2810
+ })
2811
+ });
2812
+ return resp.delegation_responses;
2813
+ } catch (e) {
2814
+ console.error("failed to get delegator delegations", e);
2815
+ return [];
2816
+ }
2817
+ };
2818
+ var getValidatorDelegatorRewards = async (address, validatorAddress) => {
2819
+ try {
2820
+ const client = await getRestClient();
2821
+ const resp = await client.cosmos.distribution.v1beta1.delegationRewards({
2822
+ delegatorAddress: address,
2823
+ validatorAddress
2824
+ });
2825
+ return resp.rewards;
2826
+ } catch (e) {
2827
+ console.error("failed to get validator delegator rewards", e);
2828
+ return [];
2829
+ }
2830
+ };
2771
2831
 
2772
2832
  // src/query/aggregator.ts
2773
2833
  var getAllTickersUrl = () => {
@@ -4880,6 +4940,33 @@ function SettingsToggle({ accentColor }) {
4880
4940
  }
4881
4941
  );
4882
4942
  }
4943
+
4944
+ // src/components/testnet-banner.tsx
4945
+ import { Box as Box3, Text as Text4 } from "@chakra-ui/react";
4946
+ import { jsx as jsx7 } from "react/jsx-runtime";
4947
+ var TestnetBanner = () => {
4948
+ if (!isTestnetChain()) {
4949
+ return null;
4950
+ }
4951
+ return /* @__PURE__ */ jsx7(
4952
+ Box3,
4953
+ {
4954
+ position: "fixed",
4955
+ bottom: "0",
4956
+ left: "0",
4957
+ right: "0",
4958
+ bg: "red.600",
4959
+ color: "white",
4960
+ textAlign: "center",
4961
+ py: "1",
4962
+ zIndex: "banner",
4963
+ fontSize: "xs",
4964
+ fontWeight: "bold",
4965
+ letterSpacing: "wide",
4966
+ children: /* @__PURE__ */ jsx7(Text4, { children: "YOU ARE ON TESTNET" })
4967
+ }
4968
+ );
4969
+ };
4883
4970
  export {
4884
4971
  ASSET_TYPE_FACTORY,
4885
4972
  ASSET_TYPE_IBC,
@@ -4924,6 +5011,7 @@ export {
4924
5011
  TESTNET_CHAIN_INFO_FALLBACK,
4925
5012
  TOKEN_LOGO_PLACEHOLDER,
4926
5013
  TTL_NO_EXPIRY,
5014
+ TestnetBanner,
4927
5015
  Toaster,
4928
5016
  TxStatus,
4929
5017
  VALIDATION_ERRORS,
@@ -5004,6 +5092,8 @@ export {
5004
5092
  getCurrentEpoch,
5005
5093
  getCurrentWeekEpochEndTime,
5006
5094
  getDefaultTxMemo,
5095
+ getDelegatorDelegations,
5096
+ getDelegatorValidators,
5007
5097
  getDenomType,
5008
5098
  getDistributionParams,
5009
5099
  getEcosystemApps,
@@ -5060,8 +5150,10 @@ export {
5060
5150
  getStakingRewards,
5061
5151
  getTradingViewIntervals,
5062
5152
  getUSDCDenom,
5153
+ getValidatorDelegatorRewards,
5063
5154
  getValidatorPageUrl,
5064
5155
  getValidatorSupportedDenoms,
5156
+ getValidators,
5065
5157
  getWalletChainsNames,
5066
5158
  getWeekEpochInfo,
5067
5159
  intlDateFormat,