@bze/bze-ui-kit 1.0.1 → 1.0.3
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.d.mts +14 -3
- package/dist/index.d.ts +14 -3
- package/dist/index.js +50 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2,6 +2,8 @@ import BigNumber from 'bignumber.js';
|
|
|
2
2
|
import * as _bze_bzejs_bze_tradebin_store from '@bze/bzejs/bze/tradebin/store';
|
|
3
3
|
import { LiquidityPoolSDKType, AggregatedOrderSDKType, MarketSDKType, OrderSDKType } from '@bze/bzejs/bze/tradebin/store';
|
|
4
4
|
import { StakingRewardParticipantSDKType, PendingUnlockParticipantSDKType, StakingRewardSDKType } from '@bze/bzejs/bze/rewards/store';
|
|
5
|
+
import * as _bze_bzejs_cosmos_base_v1beta1_coin from '@bze/bzejs/cosmos/base/v1beta1/coin';
|
|
6
|
+
import { Coin } from '@bze/bzejs/cosmos/base/v1beta1/coin';
|
|
5
7
|
import * as _bze_bzejs_cosmos_staking_v1beta1_staking from '@bze/bzejs/cosmos/staking/v1beta1/staking';
|
|
6
8
|
import { PoolSDKType, DelegationResponseSDKType, UnbondingDelegationSDKType, ValidatorSDKType, BondStatus } from '@bze/bzejs/cosmos/staking/v1beta1/staking';
|
|
7
9
|
import * as _chain_registry_types from '@chain-registry/types';
|
|
@@ -35,8 +37,6 @@ import * as _bze_bzejs_bze_cointrunk_query_lcd from '@bze/bzejs/bze/cointrunk/qu
|
|
|
35
37
|
import * as _bze_bzejs_bze_burner_query_lcd from '@bze/bzejs/bze/burner/query.lcd';
|
|
36
38
|
import { bze } from '@bze/bzejs';
|
|
37
39
|
import { PageRequest } from '@bze/bzejs/cosmos/base/query/v1beta1/pagination';
|
|
38
|
-
import * as _bze_bzejs_cosmos_base_v1beta1_coin from '@bze/bzejs/cosmos/base/v1beta1/coin';
|
|
39
|
-
import { Coin } from '@bze/bzejs/cosmos/base/v1beta1/coin';
|
|
40
40
|
import { ParamsSDKType } from '@bze/bzejs/bze/burner/params';
|
|
41
41
|
import { QueryAllBurnedCoinsResponseSDKType } from '@bze/bzejs/bze/burner/query';
|
|
42
42
|
import { GetBlockByHeightResponseSDKType } from '@bze/bzejs/cosmos/base/tendermint/v1beta1/query';
|
|
@@ -369,6 +369,17 @@ declare function formatTimeRemainingFromEpochs(endEpoch: bigint | number | BigNu
|
|
|
369
369
|
declare function sleep(ms: number): Promise<void>;
|
|
370
370
|
declare const openExternalLink: (url: string) => void;
|
|
371
371
|
|
|
372
|
+
/**
|
|
373
|
+
* Creates a list of coins with one element. Mirrors cosmjs `coins()` from @cosmjs/amino.
|
|
374
|
+
*/
|
|
375
|
+
declare const coins: (amount: number | string, denom: string) => Coin[];
|
|
376
|
+
/**
|
|
377
|
+
* Parses a coins string like "819966000ucosm,700000000ustake" into a Coin array.
|
|
378
|
+
* Mirrors cosmjs `parseCoins()` from @cosmjs/amino.
|
|
379
|
+
* Denom regex follows Cosmos SDK 0.53 (cosmos-sdk/types/coin.go).
|
|
380
|
+
*/
|
|
381
|
+
declare const parseCoins: (input: string) => Coin[];
|
|
382
|
+
|
|
372
383
|
declare const canDepositFromIBC: (ibcData: IBCData) => boolean;
|
|
373
384
|
declare const canSendToIBC: (ibcData: IBCData) => boolean;
|
|
374
385
|
/** Compute the denom on the first-hop (counterparty) chain, using only this trace. */
|
|
@@ -1283,4 +1294,4 @@ declare function SettingsToggle({ accentColor }: SettingsToggleProps): react_jsx
|
|
|
1283
1294
|
|
|
1284
1295
|
declare const TestnetBanner: () => react_jsx_runtime.JSX.Element | null;
|
|
1285
1296
|
|
|
1286
|
-
export { ASSET_TYPE_FACTORY, ASSET_TYPE_IBC, ASSET_TYPE_LP, ASSET_TYPE_NATIVE, type ActiveOrders, type AddressRewardsStaking, type AddressValidationResult, type AppSettings, type Asset, type AssetBalance, AssetsContext, type AssetsContextType, type Attribute, BZE_CIRCLE_LOGO, BZE_TESTNET_2_SUGGEST_CHAIN, BZE_TESTNET_NETWORK, type Balance, type BeeZeeEndpoints, type BlockResults, type BurnHistoryItem, CHART_1D, CHART_1Y, CHART_30D, CHART_4H, CHART_7D, CONNECTION_TYPE_NONE, CONNECTION_TYPE_POLLING, CONNECTION_TYPE_WS, CURRENT_WALLET_BALANCE_EVENT, type ChainAssets, type ConnectionType, type CounterpartyChainForChannel, DEFAULT_SETTINGS, DEFAULT_TX_MEMO, type DenomTrace, ECOSYSTEM_MENU_LABEL, EPOCH_START_EVENT, EXCLUDED_ASSETS, EXCLUDED_MARKETS, type EcosystemApp, type EndpointValidationResults, type EventCallback, type ExtendedPendingUnlockParticipantSDKType, HighlightText, type HistoryOrder, type IBCCounterparty, type IBCData, type IbcTransitionMock, type InternalEvent, LOCK_CHANGED_EVENT, LP_ASSETS_DECIMALS, type LiquidityPoolData, MAINNET_CHAIN_INFO_FALLBACK, type Market, type MarketData, NEXT_BURN_CHANGED_EVENT, type NativeStakingData, type NativeUnbondingSummary, type NextBurn, ORDER_BOOK_CHANGED_EVENT, ORDER_EXECUTED_EVENT, ORDER_TYPE_BUY, ORDER_TYPE_SELL, type PrettyBalance, type PriceApiResponse, RAFFLE_CHANGED_EVENT, SETTINGS_STORAGE_KEY, STABLE_COINS, SUPPLY_CHANGED_EVENT, SWAP_EXECUTED_EVENT, SettingsSidebarContent, SettingsToggle, Sidebar, type SwapHistory, type SwapRouteResult, TESTNET_CHAIN_INFO_FALLBACK, TOKEN_LOGO_PLACEHOLDER, TTL_NO_EXPIRY, type TendermintEvent, TestnetBanner, Toaster, type TradeViewChart, type TxOptions, TxStatus, type UserNativeStakingData, type UserNativeStakingRewards, type UserPoolData, VALIDATION_ERRORS, VERIFIED_ASSETS, type ValidationResult, WalletSidebarContent, addDebounce, addMultipleDebounce, ammRouter, amountToBigNumberUAmount, amountToUAmount, blockchainEventManager, calcNativeStakingApr, calculateAmountFromPrice, calculatePoolOppositeAmount, calculatePoolPrice, calculatePricePerUnit, calculateRewardsStakingApr, calculateRewardsStakingPendingRewards, calculateTotalAmount, calculateUserPoolData, canDepositFromIBC, canSendToIBC, cancelDebounce, checkAddressWonRaffle, convertToWebSocketUrl, counterpartyChainForChannel, createMarketId, createPoolId, createRestClient, denomOnFirstHopChainFromTrace, formatDate, formatTimeRemaining, formatTimeRemainingFromEpochs, formatUsdAmount, getAddressBalances, getAddressDelegations, getAddressFullMarketOrders, getAddressHistory, getAddressMarketOrders, getAddressNativeDelegatedBalance, getAddressNativeTotalRewards, getAddressPendingUnlock, getAddressRewards, getAddressStakingRewards, getAddressSwapHistory, getAddressUnbondingDelegations, getAddressUnbondingDelegationsSummary, getAggregatorHost, getAllBurnedCoins, getAllSupply, getAllSupplyMetadata, getAllTickers, getAnnualProvisions, getAppName, getArchwayRestURL, getArchwayRpcURL, getAssetLists, getAtomOneRestURL, getAtomOneRpcUrl, getBZEUSDPrice, getBlockDetailsByHeight, getBlockResults, getBlockTimeByHeight, getBurnerModuleAddress, getBurnerParams, getBurnerParamsWithClient, getChainAddressPrefix, getChainAssets, getChainByChainId, getChainByName, getChainExplorerURL, getChainId, getChainName, getChainNativeAssetDenom, getChains, getChartIntervalsLimit, getChartMinutes, getCurrentEpoch, getCurrentWeekEpochEndTime, getDefaultTxMemo, getDelegatorDelegations, getDelegatorValidators, getDenomType, getDistributionParams, getEcosystemApps, getEpochDurationByIdentifier, getEpochsInfo, getFactoryDenomAdminAddress, getFromLocalStorage, getHardcodedLockAddress, getHashIBCTrace, getHourEpochInfo, getIBCAssetList, getIBCTraces, getIbcTransferTimeout, getJackalRestURL, getJackalRpcUrl, getKeyExpiry, getLiquidityPool, getLiquidityPools, getLockedBalances, getLockerAddress, getMarketBuyOrders, getMarketEventKey, getMarketHistory, getMarketOrder, getMarketOrderBookChangedEvent, getMarketOrders, getMarketOrdersHistory, getMarketSellOrders, getMarkets, getMinAmount, getModuleAddress, getNextBurning, getNoOfIntervalsNeeded, getNobleRestURL, getNobleRpcUrl, getOmniFlixRestURL, getOmniFlixRpcUrl, getOsmosisRestURL, getOsmosisRpcUrl, getPageRequestWithLimit, getPendingUnlockParticipants, getPeriodicEpochEndTime, getPeriodicWeekEpochEndTime, getRaffleModuleAddress, getRaffleWinners, getRaffles, getRestClient, getRestURL, getRpcURL, getSettings, getStakingParams, getStakingPool, getStakingRewardParticipantByAddress, getStakingRewards, getTradingViewIntervals, getUSDCDenom, getValidatorDelegatorRewards, getValidatorPageUrl, getValidatorSupportedDenoms, getValidators, getWalletChainsNames, getWeekEpochInfo, intlDateFormat, isFactoryDenom, isIbcAsset, isIbcDenom, isLpDenom, isNativeDenom, isPoolSupportedByValidator, isTestnetChain, keplrSuggestChain, mapEventAttributes, openExternalLink, parseUnbondingDays, poolIdFromPoolDenom, prettyAmount, prettyError, priceToBigNumberUPrice, priceToUPrice, removeFromLocalStorage, removeLeadingZeros, sanitizeIntegerInput, sanitizeNumberInput, setDefaultTxMemo, setInLocalStorage, setKeyExpiry, setSettings, setStorageKeyVersion, shortNumberFormat, sleep, stringTruncateFromCenter, toBigNumber, toPercentage, truncateAddress, truncateDenom, uAmountToAmount, uAmountToBigNumberAmount, uPriceToBigNumberPrice, uPriceToPrice, useAsset, useAssetLiquidityPools, useAssetMarkets, useAssetPrice, useAssets, useAssetsContext, useAssetsManager, useAssetsValue, useBZETx, useBalance, useBalances, useConnectionType, useEpochs, useEpochsManager, useFeeTokens, useIBCChains, useIBCTx, useLiquidityPool, useLiquidityPools, useMarket, useMarkets, useMarketsManager, useSDKTx, useSettings, useSigningClient, useToast, useValidatorLogos, validateBZEBech32Address, validateBech32Address, validateEndpoints, validateRestEndpoint, validateRpcEndpoint };
|
|
1297
|
+
export { ASSET_TYPE_FACTORY, ASSET_TYPE_IBC, ASSET_TYPE_LP, ASSET_TYPE_NATIVE, type ActiveOrders, type AddressRewardsStaking, type AddressValidationResult, type AppSettings, type Asset, type AssetBalance, AssetsContext, type AssetsContextType, type Attribute, BZE_CIRCLE_LOGO, BZE_TESTNET_2_SUGGEST_CHAIN, BZE_TESTNET_NETWORK, type Balance, type BeeZeeEndpoints, type BlockResults, type BurnHistoryItem, CHART_1D, CHART_1Y, CHART_30D, CHART_4H, CHART_7D, CONNECTION_TYPE_NONE, CONNECTION_TYPE_POLLING, CONNECTION_TYPE_WS, CURRENT_WALLET_BALANCE_EVENT, type ChainAssets, type ConnectionType, type CounterpartyChainForChannel, DEFAULT_SETTINGS, DEFAULT_TX_MEMO, type DenomTrace, ECOSYSTEM_MENU_LABEL, EPOCH_START_EVENT, EXCLUDED_ASSETS, EXCLUDED_MARKETS, type EcosystemApp, type EndpointValidationResults, type EventCallback, type ExtendedPendingUnlockParticipantSDKType, HighlightText, type HistoryOrder, type IBCCounterparty, type IBCData, type IbcTransitionMock, type InternalEvent, LOCK_CHANGED_EVENT, LP_ASSETS_DECIMALS, type LiquidityPoolData, MAINNET_CHAIN_INFO_FALLBACK, type Market, type MarketData, NEXT_BURN_CHANGED_EVENT, type NativeStakingData, type NativeUnbondingSummary, type NextBurn, ORDER_BOOK_CHANGED_EVENT, ORDER_EXECUTED_EVENT, ORDER_TYPE_BUY, ORDER_TYPE_SELL, type PrettyBalance, type PriceApiResponse, RAFFLE_CHANGED_EVENT, SETTINGS_STORAGE_KEY, STABLE_COINS, SUPPLY_CHANGED_EVENT, SWAP_EXECUTED_EVENT, SettingsSidebarContent, SettingsToggle, Sidebar, type SwapHistory, type SwapRouteResult, TESTNET_CHAIN_INFO_FALLBACK, TOKEN_LOGO_PLACEHOLDER, TTL_NO_EXPIRY, type TendermintEvent, TestnetBanner, Toaster, type TradeViewChart, type TxOptions, TxStatus, type UserNativeStakingData, type UserNativeStakingRewards, type UserPoolData, VALIDATION_ERRORS, VERIFIED_ASSETS, type ValidationResult, WalletSidebarContent, addDebounce, addMultipleDebounce, ammRouter, amountToBigNumberUAmount, amountToUAmount, blockchainEventManager, calcNativeStakingApr, calculateAmountFromPrice, calculatePoolOppositeAmount, calculatePoolPrice, calculatePricePerUnit, calculateRewardsStakingApr, calculateRewardsStakingPendingRewards, calculateTotalAmount, calculateUserPoolData, canDepositFromIBC, canSendToIBC, cancelDebounce, checkAddressWonRaffle, coins, convertToWebSocketUrl, counterpartyChainForChannel, createMarketId, createPoolId, createRestClient, denomOnFirstHopChainFromTrace, formatDate, formatTimeRemaining, formatTimeRemainingFromEpochs, formatUsdAmount, getAddressBalances, getAddressDelegations, getAddressFullMarketOrders, getAddressHistory, getAddressMarketOrders, getAddressNativeDelegatedBalance, getAddressNativeTotalRewards, getAddressPendingUnlock, getAddressRewards, getAddressStakingRewards, getAddressSwapHistory, getAddressUnbondingDelegations, getAddressUnbondingDelegationsSummary, getAggregatorHost, getAllBurnedCoins, getAllSupply, getAllSupplyMetadata, getAllTickers, getAnnualProvisions, getAppName, getArchwayRestURL, getArchwayRpcURL, getAssetLists, getAtomOneRestURL, getAtomOneRpcUrl, getBZEUSDPrice, getBlockDetailsByHeight, getBlockResults, getBlockTimeByHeight, getBurnerModuleAddress, getBurnerParams, getBurnerParamsWithClient, getChainAddressPrefix, getChainAssets, getChainByChainId, getChainByName, getChainExplorerURL, getChainId, getChainName, getChainNativeAssetDenom, getChains, getChartIntervalsLimit, getChartMinutes, getCurrentEpoch, getCurrentWeekEpochEndTime, getDefaultTxMemo, getDelegatorDelegations, getDelegatorValidators, getDenomType, getDistributionParams, getEcosystemApps, getEpochDurationByIdentifier, getEpochsInfo, getFactoryDenomAdminAddress, getFromLocalStorage, getHardcodedLockAddress, getHashIBCTrace, getHourEpochInfo, getIBCAssetList, getIBCTraces, getIbcTransferTimeout, getJackalRestURL, getJackalRpcUrl, getKeyExpiry, getLiquidityPool, getLiquidityPools, getLockedBalances, getLockerAddress, getMarketBuyOrders, getMarketEventKey, getMarketHistory, getMarketOrder, getMarketOrderBookChangedEvent, getMarketOrders, getMarketOrdersHistory, getMarketSellOrders, getMarkets, getMinAmount, getModuleAddress, getNextBurning, getNoOfIntervalsNeeded, getNobleRestURL, getNobleRpcUrl, getOmniFlixRestURL, getOmniFlixRpcUrl, getOsmosisRestURL, getOsmosisRpcUrl, getPageRequestWithLimit, getPendingUnlockParticipants, getPeriodicEpochEndTime, getPeriodicWeekEpochEndTime, getRaffleModuleAddress, getRaffleWinners, getRaffles, getRestClient, getRestURL, getRpcURL, getSettings, getStakingParams, getStakingPool, getStakingRewardParticipantByAddress, getStakingRewards, getTradingViewIntervals, getUSDCDenom, getValidatorDelegatorRewards, getValidatorPageUrl, getValidatorSupportedDenoms, getValidators, getWalletChainsNames, getWeekEpochInfo, intlDateFormat, isFactoryDenom, isIbcAsset, isIbcDenom, isLpDenom, isNativeDenom, isPoolSupportedByValidator, isTestnetChain, keplrSuggestChain, mapEventAttributes, openExternalLink, parseCoins, parseUnbondingDays, poolIdFromPoolDenom, prettyAmount, prettyError, priceToBigNumberUPrice, priceToUPrice, removeFromLocalStorage, removeLeadingZeros, sanitizeIntegerInput, sanitizeNumberInput, setDefaultTxMemo, setInLocalStorage, setKeyExpiry, setSettings, setStorageKeyVersion, shortNumberFormat, sleep, stringTruncateFromCenter, toBigNumber, toPercentage, truncateAddress, truncateDenom, uAmountToAmount, uAmountToBigNumberAmount, uPriceToBigNumberPrice, uPriceToPrice, useAsset, useAssetLiquidityPools, useAssetMarkets, useAssetPrice, useAssets, useAssetsContext, useAssetsManager, useAssetsValue, useBZETx, useBalance, useBalances, useConnectionType, useEpochs, useEpochsManager, useFeeTokens, useIBCChains, useIBCTx, useLiquidityPool, useLiquidityPools, useMarket, useMarkets, useMarketsManager, useSDKTx, useSettings, useSigningClient, useToast, useValidatorLogos, validateBZEBech32Address, validateBech32Address, validateEndpoints, validateRestEndpoint, validateRpcEndpoint };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import BigNumber from 'bignumber.js';
|
|
|
2
2
|
import * as _bze_bzejs_bze_tradebin_store from '@bze/bzejs/bze/tradebin/store';
|
|
3
3
|
import { LiquidityPoolSDKType, AggregatedOrderSDKType, MarketSDKType, OrderSDKType } from '@bze/bzejs/bze/tradebin/store';
|
|
4
4
|
import { StakingRewardParticipantSDKType, PendingUnlockParticipantSDKType, StakingRewardSDKType } from '@bze/bzejs/bze/rewards/store';
|
|
5
|
+
import * as _bze_bzejs_cosmos_base_v1beta1_coin from '@bze/bzejs/cosmos/base/v1beta1/coin';
|
|
6
|
+
import { Coin } from '@bze/bzejs/cosmos/base/v1beta1/coin';
|
|
5
7
|
import * as _bze_bzejs_cosmos_staking_v1beta1_staking from '@bze/bzejs/cosmos/staking/v1beta1/staking';
|
|
6
8
|
import { PoolSDKType, DelegationResponseSDKType, UnbondingDelegationSDKType, ValidatorSDKType, BondStatus } from '@bze/bzejs/cosmos/staking/v1beta1/staking';
|
|
7
9
|
import * as _chain_registry_types from '@chain-registry/types';
|
|
@@ -35,8 +37,6 @@ import * as _bze_bzejs_bze_cointrunk_query_lcd from '@bze/bzejs/bze/cointrunk/qu
|
|
|
35
37
|
import * as _bze_bzejs_bze_burner_query_lcd from '@bze/bzejs/bze/burner/query.lcd';
|
|
36
38
|
import { bze } from '@bze/bzejs';
|
|
37
39
|
import { PageRequest } from '@bze/bzejs/cosmos/base/query/v1beta1/pagination';
|
|
38
|
-
import * as _bze_bzejs_cosmos_base_v1beta1_coin from '@bze/bzejs/cosmos/base/v1beta1/coin';
|
|
39
|
-
import { Coin } from '@bze/bzejs/cosmos/base/v1beta1/coin';
|
|
40
40
|
import { ParamsSDKType } from '@bze/bzejs/bze/burner/params';
|
|
41
41
|
import { QueryAllBurnedCoinsResponseSDKType } from '@bze/bzejs/bze/burner/query';
|
|
42
42
|
import { GetBlockByHeightResponseSDKType } from '@bze/bzejs/cosmos/base/tendermint/v1beta1/query';
|
|
@@ -369,6 +369,17 @@ declare function formatTimeRemainingFromEpochs(endEpoch: bigint | number | BigNu
|
|
|
369
369
|
declare function sleep(ms: number): Promise<void>;
|
|
370
370
|
declare const openExternalLink: (url: string) => void;
|
|
371
371
|
|
|
372
|
+
/**
|
|
373
|
+
* Creates a list of coins with one element. Mirrors cosmjs `coins()` from @cosmjs/amino.
|
|
374
|
+
*/
|
|
375
|
+
declare const coins: (amount: number | string, denom: string) => Coin[];
|
|
376
|
+
/**
|
|
377
|
+
* Parses a coins string like "819966000ucosm,700000000ustake" into a Coin array.
|
|
378
|
+
* Mirrors cosmjs `parseCoins()` from @cosmjs/amino.
|
|
379
|
+
* Denom regex follows Cosmos SDK 0.53 (cosmos-sdk/types/coin.go).
|
|
380
|
+
*/
|
|
381
|
+
declare const parseCoins: (input: string) => Coin[];
|
|
382
|
+
|
|
372
383
|
declare const canDepositFromIBC: (ibcData: IBCData) => boolean;
|
|
373
384
|
declare const canSendToIBC: (ibcData: IBCData) => boolean;
|
|
374
385
|
/** Compute the denom on the first-hop (counterparty) chain, using only this trace. */
|
|
@@ -1283,4 +1294,4 @@ declare function SettingsToggle({ accentColor }: SettingsToggleProps): react_jsx
|
|
|
1283
1294
|
|
|
1284
1295
|
declare const TestnetBanner: () => react_jsx_runtime.JSX.Element | null;
|
|
1285
1296
|
|
|
1286
|
-
export { ASSET_TYPE_FACTORY, ASSET_TYPE_IBC, ASSET_TYPE_LP, ASSET_TYPE_NATIVE, type ActiveOrders, type AddressRewardsStaking, type AddressValidationResult, type AppSettings, type Asset, type AssetBalance, AssetsContext, type AssetsContextType, type Attribute, BZE_CIRCLE_LOGO, BZE_TESTNET_2_SUGGEST_CHAIN, BZE_TESTNET_NETWORK, type Balance, type BeeZeeEndpoints, type BlockResults, type BurnHistoryItem, CHART_1D, CHART_1Y, CHART_30D, CHART_4H, CHART_7D, CONNECTION_TYPE_NONE, CONNECTION_TYPE_POLLING, CONNECTION_TYPE_WS, CURRENT_WALLET_BALANCE_EVENT, type ChainAssets, type ConnectionType, type CounterpartyChainForChannel, DEFAULT_SETTINGS, DEFAULT_TX_MEMO, type DenomTrace, ECOSYSTEM_MENU_LABEL, EPOCH_START_EVENT, EXCLUDED_ASSETS, EXCLUDED_MARKETS, type EcosystemApp, type EndpointValidationResults, type EventCallback, type ExtendedPendingUnlockParticipantSDKType, HighlightText, type HistoryOrder, type IBCCounterparty, type IBCData, type IbcTransitionMock, type InternalEvent, LOCK_CHANGED_EVENT, LP_ASSETS_DECIMALS, type LiquidityPoolData, MAINNET_CHAIN_INFO_FALLBACK, type Market, type MarketData, NEXT_BURN_CHANGED_EVENT, type NativeStakingData, type NativeUnbondingSummary, type NextBurn, ORDER_BOOK_CHANGED_EVENT, ORDER_EXECUTED_EVENT, ORDER_TYPE_BUY, ORDER_TYPE_SELL, type PrettyBalance, type PriceApiResponse, RAFFLE_CHANGED_EVENT, SETTINGS_STORAGE_KEY, STABLE_COINS, SUPPLY_CHANGED_EVENT, SWAP_EXECUTED_EVENT, SettingsSidebarContent, SettingsToggle, Sidebar, type SwapHistory, type SwapRouteResult, TESTNET_CHAIN_INFO_FALLBACK, TOKEN_LOGO_PLACEHOLDER, TTL_NO_EXPIRY, type TendermintEvent, TestnetBanner, Toaster, type TradeViewChart, type TxOptions, TxStatus, type UserNativeStakingData, type UserNativeStakingRewards, type UserPoolData, VALIDATION_ERRORS, VERIFIED_ASSETS, type ValidationResult, WalletSidebarContent, addDebounce, addMultipleDebounce, ammRouter, amountToBigNumberUAmount, amountToUAmount, blockchainEventManager, calcNativeStakingApr, calculateAmountFromPrice, calculatePoolOppositeAmount, calculatePoolPrice, calculatePricePerUnit, calculateRewardsStakingApr, calculateRewardsStakingPendingRewards, calculateTotalAmount, calculateUserPoolData, canDepositFromIBC, canSendToIBC, cancelDebounce, checkAddressWonRaffle, convertToWebSocketUrl, counterpartyChainForChannel, createMarketId, createPoolId, createRestClient, denomOnFirstHopChainFromTrace, formatDate, formatTimeRemaining, formatTimeRemainingFromEpochs, formatUsdAmount, getAddressBalances, getAddressDelegations, getAddressFullMarketOrders, getAddressHistory, getAddressMarketOrders, getAddressNativeDelegatedBalance, getAddressNativeTotalRewards, getAddressPendingUnlock, getAddressRewards, getAddressStakingRewards, getAddressSwapHistory, getAddressUnbondingDelegations, getAddressUnbondingDelegationsSummary, getAggregatorHost, getAllBurnedCoins, getAllSupply, getAllSupplyMetadata, getAllTickers, getAnnualProvisions, getAppName, getArchwayRestURL, getArchwayRpcURL, getAssetLists, getAtomOneRestURL, getAtomOneRpcUrl, getBZEUSDPrice, getBlockDetailsByHeight, getBlockResults, getBlockTimeByHeight, getBurnerModuleAddress, getBurnerParams, getBurnerParamsWithClient, getChainAddressPrefix, getChainAssets, getChainByChainId, getChainByName, getChainExplorerURL, getChainId, getChainName, getChainNativeAssetDenom, getChains, getChartIntervalsLimit, getChartMinutes, getCurrentEpoch, getCurrentWeekEpochEndTime, getDefaultTxMemo, getDelegatorDelegations, getDelegatorValidators, getDenomType, getDistributionParams, getEcosystemApps, getEpochDurationByIdentifier, getEpochsInfo, getFactoryDenomAdminAddress, getFromLocalStorage, getHardcodedLockAddress, getHashIBCTrace, getHourEpochInfo, getIBCAssetList, getIBCTraces, getIbcTransferTimeout, getJackalRestURL, getJackalRpcUrl, getKeyExpiry, getLiquidityPool, getLiquidityPools, getLockedBalances, getLockerAddress, getMarketBuyOrders, getMarketEventKey, getMarketHistory, getMarketOrder, getMarketOrderBookChangedEvent, getMarketOrders, getMarketOrdersHistory, getMarketSellOrders, getMarkets, getMinAmount, getModuleAddress, getNextBurning, getNoOfIntervalsNeeded, getNobleRestURL, getNobleRpcUrl, getOmniFlixRestURL, getOmniFlixRpcUrl, getOsmosisRestURL, getOsmosisRpcUrl, getPageRequestWithLimit, getPendingUnlockParticipants, getPeriodicEpochEndTime, getPeriodicWeekEpochEndTime, getRaffleModuleAddress, getRaffleWinners, getRaffles, getRestClient, getRestURL, getRpcURL, getSettings, getStakingParams, getStakingPool, getStakingRewardParticipantByAddress, getStakingRewards, getTradingViewIntervals, getUSDCDenom, getValidatorDelegatorRewards, getValidatorPageUrl, getValidatorSupportedDenoms, getValidators, getWalletChainsNames, getWeekEpochInfo, intlDateFormat, isFactoryDenom, isIbcAsset, isIbcDenom, isLpDenom, isNativeDenom, isPoolSupportedByValidator, isTestnetChain, keplrSuggestChain, mapEventAttributes, openExternalLink, parseUnbondingDays, poolIdFromPoolDenom, prettyAmount, prettyError, priceToBigNumberUPrice, priceToUPrice, removeFromLocalStorage, removeLeadingZeros, sanitizeIntegerInput, sanitizeNumberInput, setDefaultTxMemo, setInLocalStorage, setKeyExpiry, setSettings, setStorageKeyVersion, shortNumberFormat, sleep, stringTruncateFromCenter, toBigNumber, toPercentage, truncateAddress, truncateDenom, uAmountToAmount, uAmountToBigNumberAmount, uPriceToBigNumberPrice, uPriceToPrice, useAsset, useAssetLiquidityPools, useAssetMarkets, useAssetPrice, useAssets, useAssetsContext, useAssetsManager, useAssetsValue, useBZETx, useBalance, useBalances, useConnectionType, useEpochs, useEpochsManager, useFeeTokens, useIBCChains, useIBCTx, useLiquidityPool, useLiquidityPools, useMarket, useMarkets, useMarketsManager, useSDKTx, useSettings, useSigningClient, useToast, useValidatorLogos, validateBZEBech32Address, validateBech32Address, validateEndpoints, validateRestEndpoint, validateRpcEndpoint };
|
|
1297
|
+
export { ASSET_TYPE_FACTORY, ASSET_TYPE_IBC, ASSET_TYPE_LP, ASSET_TYPE_NATIVE, type ActiveOrders, type AddressRewardsStaking, type AddressValidationResult, type AppSettings, type Asset, type AssetBalance, AssetsContext, type AssetsContextType, type Attribute, BZE_CIRCLE_LOGO, BZE_TESTNET_2_SUGGEST_CHAIN, BZE_TESTNET_NETWORK, type Balance, type BeeZeeEndpoints, type BlockResults, type BurnHistoryItem, CHART_1D, CHART_1Y, CHART_30D, CHART_4H, CHART_7D, CONNECTION_TYPE_NONE, CONNECTION_TYPE_POLLING, CONNECTION_TYPE_WS, CURRENT_WALLET_BALANCE_EVENT, type ChainAssets, type ConnectionType, type CounterpartyChainForChannel, DEFAULT_SETTINGS, DEFAULT_TX_MEMO, type DenomTrace, ECOSYSTEM_MENU_LABEL, EPOCH_START_EVENT, EXCLUDED_ASSETS, EXCLUDED_MARKETS, type EcosystemApp, type EndpointValidationResults, type EventCallback, type ExtendedPendingUnlockParticipantSDKType, HighlightText, type HistoryOrder, type IBCCounterparty, type IBCData, type IbcTransitionMock, type InternalEvent, LOCK_CHANGED_EVENT, LP_ASSETS_DECIMALS, type LiquidityPoolData, MAINNET_CHAIN_INFO_FALLBACK, type Market, type MarketData, NEXT_BURN_CHANGED_EVENT, type NativeStakingData, type NativeUnbondingSummary, type NextBurn, ORDER_BOOK_CHANGED_EVENT, ORDER_EXECUTED_EVENT, ORDER_TYPE_BUY, ORDER_TYPE_SELL, type PrettyBalance, type PriceApiResponse, RAFFLE_CHANGED_EVENT, SETTINGS_STORAGE_KEY, STABLE_COINS, SUPPLY_CHANGED_EVENT, SWAP_EXECUTED_EVENT, SettingsSidebarContent, SettingsToggle, Sidebar, type SwapHistory, type SwapRouteResult, TESTNET_CHAIN_INFO_FALLBACK, TOKEN_LOGO_PLACEHOLDER, TTL_NO_EXPIRY, type TendermintEvent, TestnetBanner, Toaster, type TradeViewChart, type TxOptions, TxStatus, type UserNativeStakingData, type UserNativeStakingRewards, type UserPoolData, VALIDATION_ERRORS, VERIFIED_ASSETS, type ValidationResult, WalletSidebarContent, addDebounce, addMultipleDebounce, ammRouter, amountToBigNumberUAmount, amountToUAmount, blockchainEventManager, calcNativeStakingApr, calculateAmountFromPrice, calculatePoolOppositeAmount, calculatePoolPrice, calculatePricePerUnit, calculateRewardsStakingApr, calculateRewardsStakingPendingRewards, calculateTotalAmount, calculateUserPoolData, canDepositFromIBC, canSendToIBC, cancelDebounce, checkAddressWonRaffle, coins, convertToWebSocketUrl, counterpartyChainForChannel, createMarketId, createPoolId, createRestClient, denomOnFirstHopChainFromTrace, formatDate, formatTimeRemaining, formatTimeRemainingFromEpochs, formatUsdAmount, getAddressBalances, getAddressDelegations, getAddressFullMarketOrders, getAddressHistory, getAddressMarketOrders, getAddressNativeDelegatedBalance, getAddressNativeTotalRewards, getAddressPendingUnlock, getAddressRewards, getAddressStakingRewards, getAddressSwapHistory, getAddressUnbondingDelegations, getAddressUnbondingDelegationsSummary, getAggregatorHost, getAllBurnedCoins, getAllSupply, getAllSupplyMetadata, getAllTickers, getAnnualProvisions, getAppName, getArchwayRestURL, getArchwayRpcURL, getAssetLists, getAtomOneRestURL, getAtomOneRpcUrl, getBZEUSDPrice, getBlockDetailsByHeight, getBlockResults, getBlockTimeByHeight, getBurnerModuleAddress, getBurnerParams, getBurnerParamsWithClient, getChainAddressPrefix, getChainAssets, getChainByChainId, getChainByName, getChainExplorerURL, getChainId, getChainName, getChainNativeAssetDenom, getChains, getChartIntervalsLimit, getChartMinutes, getCurrentEpoch, getCurrentWeekEpochEndTime, getDefaultTxMemo, getDelegatorDelegations, getDelegatorValidators, getDenomType, getDistributionParams, getEcosystemApps, getEpochDurationByIdentifier, getEpochsInfo, getFactoryDenomAdminAddress, getFromLocalStorage, getHardcodedLockAddress, getHashIBCTrace, getHourEpochInfo, getIBCAssetList, getIBCTraces, getIbcTransferTimeout, getJackalRestURL, getJackalRpcUrl, getKeyExpiry, getLiquidityPool, getLiquidityPools, getLockedBalances, getLockerAddress, getMarketBuyOrders, getMarketEventKey, getMarketHistory, getMarketOrder, getMarketOrderBookChangedEvent, getMarketOrders, getMarketOrdersHistory, getMarketSellOrders, getMarkets, getMinAmount, getModuleAddress, getNextBurning, getNoOfIntervalsNeeded, getNobleRestURL, getNobleRpcUrl, getOmniFlixRestURL, getOmniFlixRpcUrl, getOsmosisRestURL, getOsmosisRpcUrl, getPageRequestWithLimit, getPendingUnlockParticipants, getPeriodicEpochEndTime, getPeriodicWeekEpochEndTime, getRaffleModuleAddress, getRaffleWinners, getRaffles, getRestClient, getRestURL, getRpcURL, getSettings, getStakingParams, getStakingPool, getStakingRewardParticipantByAddress, getStakingRewards, getTradingViewIntervals, getUSDCDenom, getValidatorDelegatorRewards, getValidatorPageUrl, getValidatorSupportedDenoms, getValidators, getWalletChainsNames, getWeekEpochInfo, intlDateFormat, isFactoryDenom, isIbcAsset, isIbcDenom, isLpDenom, isNativeDenom, isPoolSupportedByValidator, isTestnetChain, keplrSuggestChain, mapEventAttributes, openExternalLink, parseCoins, parseUnbondingDays, poolIdFromPoolDenom, prettyAmount, prettyError, priceToBigNumberUPrice, priceToUPrice, removeFromLocalStorage, removeLeadingZeros, sanitizeIntegerInput, sanitizeNumberInput, setDefaultTxMemo, setInLocalStorage, setKeyExpiry, setSettings, setStorageKeyVersion, shortNumberFormat, sleep, stringTruncateFromCenter, toBigNumber, toPercentage, truncateAddress, truncateDenom, uAmountToAmount, uAmountToBigNumberAmount, uPriceToBigNumberPrice, uPriceToPrice, useAsset, useAssetLiquidityPools, useAssetMarkets, useAssetPrice, useAssets, useAssetsContext, useAssetsManager, useAssetsValue, useBZETx, useBalance, useBalances, useConnectionType, useEpochs, useEpochsManager, useFeeTokens, useIBCChains, useIBCTx, useLiquidityPool, useLiquidityPools, useMarket, useMarkets, useMarketsManager, useSDKTx, useSettings, useSigningClient, useToast, useValidatorLogos, validateBZEBech32Address, validateBech32Address, validateEndpoints, validateRestEndpoint, validateRpcEndpoint };
|
package/dist/index.js
CHANGED
|
@@ -127,6 +127,7 @@ __export(index_exports, {
|
|
|
127
127
|
canSendToIBC: () => canSendToIBC,
|
|
128
128
|
cancelDebounce: () => cancelDebounce,
|
|
129
129
|
checkAddressWonRaffle: () => checkAddressWonRaffle,
|
|
130
|
+
coins: () => coins,
|
|
130
131
|
convertToWebSocketUrl: () => convertToWebSocketUrl,
|
|
131
132
|
counterpartyChainForChannel: () => counterpartyChainForChannel,
|
|
132
133
|
createMarketId: () => createMarketId,
|
|
@@ -258,6 +259,7 @@ __export(index_exports, {
|
|
|
258
259
|
keplrSuggestChain: () => keplrSuggestChain,
|
|
259
260
|
mapEventAttributes: () => mapEventAttributes,
|
|
260
261
|
openExternalLink: () => openExternalLink,
|
|
262
|
+
parseCoins: () => parseCoins,
|
|
261
263
|
parseUnbondingDays: () => parseUnbondingDays,
|
|
262
264
|
poolIdFromPoolDenom: () => poolIdFromPoolDenom,
|
|
263
265
|
prettyAmount: () => prettyAmount,
|
|
@@ -1008,6 +1010,36 @@ var openExternalLink = (url) => {
|
|
|
1008
1010
|
window.open(url, "_blank", "noopener,noreferrer");
|
|
1009
1011
|
};
|
|
1010
1012
|
|
|
1013
|
+
// src/utils/coins.ts
|
|
1014
|
+
var coin = (amount, denom) => {
|
|
1015
|
+
let outAmount;
|
|
1016
|
+
if (typeof amount === "number") {
|
|
1017
|
+
if (!Number.isInteger(amount) || amount < 0 || amount > Number.MAX_SAFE_INTEGER) {
|
|
1018
|
+
throw new Error("Given amount is not a safe integer. Consider using a string instead to overcome the limitations of JS numbers.");
|
|
1019
|
+
}
|
|
1020
|
+
outAmount = String(amount);
|
|
1021
|
+
} else {
|
|
1022
|
+
if (!amount.match(/^[0-9]+$/)) {
|
|
1023
|
+
throw new Error("Invalid unsigned integer string format");
|
|
1024
|
+
}
|
|
1025
|
+
outAmount = amount.replace(/^0*/, "") || "0";
|
|
1026
|
+
}
|
|
1027
|
+
return { amount: outAmount, denom };
|
|
1028
|
+
};
|
|
1029
|
+
var coins = (amount, denom) => {
|
|
1030
|
+
return [coin(amount, denom)];
|
|
1031
|
+
};
|
|
1032
|
+
var parseCoins = (input) => {
|
|
1033
|
+
return input.replace(/\s/g, "").split(",").filter(Boolean).map((part) => {
|
|
1034
|
+
const match = part.match(/^([0-9]+)([a-zA-Z][a-zA-Z0-9/:._-]{2,127})$/);
|
|
1035
|
+
if (!match) throw new Error("Got an invalid coin string");
|
|
1036
|
+
return {
|
|
1037
|
+
amount: match[1].replace(/^0+/, "") || "0",
|
|
1038
|
+
denom: match[2]
|
|
1039
|
+
};
|
|
1040
|
+
});
|
|
1041
|
+
};
|
|
1042
|
+
|
|
1011
1043
|
// src/utils/ibc.ts
|
|
1012
1044
|
var import_bignumber3 = __toESM(require("bignumber.js"));
|
|
1013
1045
|
var canDepositFromIBC = (ibcData2) => {
|
|
@@ -4027,10 +4059,10 @@ var useToast = () => {
|
|
|
4027
4059
|
};
|
|
4028
4060
|
|
|
4029
4061
|
// src/hooks/useTx.tsx
|
|
4062
|
+
var import_tx = require("@bze/bzejs/cosmos/tx/v1beta1/tx");
|
|
4030
4063
|
var import_react15 = require("@interchain-kit/react");
|
|
4031
4064
|
var import_bignumber13 = __toESM(require("bignumber.js"));
|
|
4032
4065
|
var import_react16 = require("react");
|
|
4033
|
-
var coins = (amount, denom) => [{ amount: String(amount), denom }];
|
|
4034
4066
|
var TxStatus = /* @__PURE__ */ ((TxStatus2) => {
|
|
4035
4067
|
TxStatus2["Failed"] = "Transaction Failed";
|
|
4036
4068
|
TxStatus2["Successful"] = "Transaction Successful";
|
|
@@ -4078,9 +4110,20 @@ var useTx = (chainName) => {
|
|
|
4078
4110
|
return isSigningClientReady;
|
|
4079
4111
|
}, [isSigningClientReady, signingClientError]);
|
|
4080
4112
|
const simulateFee = (0, import_react16.useCallback)(async (messages, memo) => {
|
|
4113
|
+
var _a2;
|
|
4081
4114
|
const gasPrice = 0.02;
|
|
4082
4115
|
const nativeDenom = getChainNativeAssetDenom();
|
|
4083
|
-
const
|
|
4116
|
+
const signer = signingClient;
|
|
4117
|
+
const encodedMessages = messages.map(({ typeUrl, value }) => {
|
|
4118
|
+
const encoder = signer.getEncoder(typeUrl);
|
|
4119
|
+
const encodedWriter = encoder.encode(value);
|
|
4120
|
+
const encodedValue = typeof (encodedWriter == null ? void 0 : encodedWriter.finish) === "function" ? encodedWriter.finish() : encodedWriter;
|
|
4121
|
+
return { typeUrl, value: encodedValue };
|
|
4122
|
+
});
|
|
4123
|
+
const txBody = import_tx.TxBody.fromPartial({ messages: encodedMessages, memo: memo != null ? memo : "" });
|
|
4124
|
+
const signerInfo = import_tx.SignerInfo.fromPartial({ modeInfo: { single: { mode: 1 } }, sequence: BigInt(0) });
|
|
4125
|
+
const { gasInfo } = await signer.simulateByTxBody(txBody, [signerInfo]);
|
|
4126
|
+
const gasEstimated = Number((_a2 = gasInfo == null ? void 0 : gasInfo.gasUsed) != null ? _a2 : BigInt(0));
|
|
4084
4127
|
const gasAmount = (0, import_bignumber13.default)(gasEstimated).multipliedBy(1.5);
|
|
4085
4128
|
const gasPayment = gasAmount.multipliedBy(gasPrice);
|
|
4086
4129
|
const nativeFee = {
|
|
@@ -4719,15 +4762,15 @@ var import_core = require("@interchain-kit/core");
|
|
|
4719
4762
|
var import_bignumber14 = __toESM(require("bignumber.js"));
|
|
4720
4763
|
var import_bzejs4 = require("@bze/bzejs");
|
|
4721
4764
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
4722
|
-
var validateAmount = (amount,
|
|
4723
|
-
if (!
|
|
4765
|
+
var validateAmount = (amount, coin2, onError) => {
|
|
4766
|
+
if (!coin2) return;
|
|
4724
4767
|
if (amount === "") return;
|
|
4725
4768
|
const amountNumber = (0, import_bignumber14.default)(amount);
|
|
4726
4769
|
if (amountNumber.isNaN()) {
|
|
4727
4770
|
onError("Invalid amount");
|
|
4728
4771
|
return;
|
|
4729
4772
|
}
|
|
4730
|
-
const coinBalance = uAmountToBigNumberAmount(
|
|
4773
|
+
const coinBalance = uAmountToBigNumberAmount(coin2.amount, coin2.decimals);
|
|
4731
4774
|
if (coinBalance.isLessThan(amount)) {
|
|
4732
4775
|
onError("Insufficient balance");
|
|
4733
4776
|
} else {
|
|
@@ -5371,6 +5414,7 @@ var TestnetBanner = () => {
|
|
|
5371
5414
|
canSendToIBC,
|
|
5372
5415
|
cancelDebounce,
|
|
5373
5416
|
checkAddressWonRaffle,
|
|
5417
|
+
coins,
|
|
5374
5418
|
convertToWebSocketUrl,
|
|
5375
5419
|
counterpartyChainForChannel,
|
|
5376
5420
|
createMarketId,
|
|
@@ -5502,6 +5546,7 @@ var TestnetBanner = () => {
|
|
|
5502
5546
|
keplrSuggestChain,
|
|
5503
5547
|
mapEventAttributes,
|
|
5504
5548
|
openExternalLink,
|
|
5549
|
+
parseCoins,
|
|
5505
5550
|
parseUnbondingDays,
|
|
5506
5551
|
poolIdFromPoolDenom,
|
|
5507
5552
|
prettyAmount,
|