Merge branch 'main' of https://github.com/mars-protocol/mars-v2-frontend into develop
# Conflicts: # package.json # src/api/cosmwasm-client.ts # src/api/incentives/calculateAssetIncentivesApy.ts # src/api/incentives/getTotalActiveEmissionValue.ts # src/api/incentives/getUnclaimedRewards.ts # src/api/markets/getMarket.ts # src/api/markets/getMarketBorrowings.ts # src/api/markets/getMarketDebts.ts # src/api/markets/getMarketDeposits.ts # src/api/markets/getMarketLiquidities.ts # src/api/markets/getMarketUnderlyingLiquidityAmount.ts # src/api/markets/getMarkets.ts # src/api/wallets/getICNS.ts # src/api/wallets/getWalletBalances.ts # src/components/Modals/AddVaultAssets/AddVaultBorrowAssetsModalContent.tsx # src/components/Modals/AssetsSelect/index.tsx # src/components/Modals/BorrowModal.tsx # src/components/Modals/FundWithdraw/WithdrawFromAccount.tsx # src/components/Modals/HLS/Deposit/Leverage.tsx # src/components/Modals/HLS/Deposit/LeverageSummary.tsx # src/components/Modals/HLS/Deposit/useAccordionItems.tsx # src/components/Modals/HLS/Manage/ChangeLeverage.tsx # src/components/Modals/HLS/Manage/Deposit.tsx # src/components/Modals/HLS/Manage/Repay.tsx # src/components/Modals/HLS/Manage/index.tsx # src/components/Modals/HLS/index.tsx # src/components/Modals/ModalContentWithSummary.tsx # src/components/Modals/Vault/VaultBorrowings.tsx # src/components/Wallet/RecentTransactions.tsx # src/components/Wallet/WalletBridges.tsx # src/components/Wallet/WalletConnectedButton.tsx # src/components/Wallet/WalletConnecting.tsx # src/components/Wallet/WalletSelect.tsx # src/components/account/AccountBalancesTable/Columns/Apy.tsx # src/components/account/AccountBalancesTable/Columns/useAccountBalancesColumns.tsx # src/components/account/AccountBalancesTable/functions.ts # src/components/account/AccountBalancesTable/useAccountBalanceData.tsx # src/components/account/AccountComposition.tsx # src/components/account/AccountDetails/index.tsx # src/components/account/AccountFund/AccountFundContent.tsx # src/components/account/AccountList/AccountStats.tsx # src/components/account/AccountPerpPositionTable/Columns/Asset.tsx # src/components/account/AccountSummary.tsx # src/components/borrow/Borrowings.tsx # src/components/borrow/Table/Columns/Debt.tsx # src/components/common/DisplayCurrency.tsx # src/components/common/Select/Option.tsx # src/components/common/Toaster/index.tsx # src/components/earn/farm/Vaults.tsx # src/components/earn/lend/Lends.tsx # src/components/header/DesktopHeader.tsx # src/components/header/navigation/DesktopNavigation.tsx # src/components/header/navigation/Routes.tsx # src/components/hls/Farm/AvailableHLSVaults.tsx # src/components/hls/Farm/Table/Columns/APY.tsx # src/components/hls/Staking/Table/Columns/ActiveApy.tsx # src/components/hls/Staking/Table/Columns/ApyRange.tsx # src/components/perps/BalancesTable/Columns/TradeDirection.tsx # src/components/perps/Module/PerpsManageModule/index.tsx # src/components/perps/Module/PerpsModule.tsx # src/components/portfolio/Account/Balances.tsx # src/components/portfolio/Account/Summary.tsx # src/components/portfolio/Card/index.tsx # src/components/portfolio/Overview/Summary.tsx # src/components/trade/AccountDetailsCard.tsx # src/components/trade/TradeModule/AssetSelector/AssetList.tsx # src/components/trade/TradeModule/AssetSelector/PairsList.tsx # src/components/trade/TradeModule/SwapForm/index.tsx # src/configs/chains/osmosis/devnet.ts # src/hooks/accounts/useAccountIds.tsx # src/hooks/accounts/useAccounts.tsx # src/hooks/assets/useAllAssets.ts # src/hooks/assets/useBasetAsset.ts # src/hooks/assets/useBorrowEnabledAssets.ts # src/hooks/assets/useDisplayCurrencyAssets.ts # src/hooks/assets/useMarketEnabledAssets.ts # src/hooks/assets/usePerpsEnabledAssets.ts # src/hooks/markets/useMarketDeposits.ts # src/hooks/perps/useOpeningFee.ts # src/hooks/useAssetIncentiveApy.ts # src/hooks/useBorrowAsset.ts # src/hooks/useBorrowEnabledMarkets.ts # src/hooks/useBorrowMarketAssetsTableData.ts # src/hooks/useClients.ts # src/hooks/useDepositEnabledMarkets.ts # src/hooks/useHLSStakingAssets.ts # src/hooks/useICNSDomain.tsx # src/hooks/useLendingMarketAssetsTableData.ts # src/hooks/useUnclaimedRewards.tsx # src/hooks/useUpdatedAccount/index.ts # src/hooks/useVaults.tsx # src/hooks/useWalletBalances.tsx # src/pages/LendPage.tsx # src/pages/PortfolioAccountPage.tsx # src/pages/_layout.tsx # src/types/interfaces/asset.d.ts # src/types/interfaces/chain.d.ts # src/utils/accounts.ts # yarn.lock
This commit is contained in:
commit
0dc17e3263
14
src/api/perps/getOpeningFee.ts
Normal file
14
src/api/perps/getOpeningFee.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { getPerpsQueryClient } from 'api/cosmwasm-client'
|
||||
import { BNCoin } from 'types/classes/BNCoin'
|
||||
|
||||
export default async function getOpeningFee(
|
||||
chainConfig: ChainConfig,
|
||||
denom: string,
|
||||
amount: string,
|
||||
) {
|
||||
const perpsClient = await getPerpsQueryClient(chainConfig)
|
||||
|
||||
return perpsClient
|
||||
.openingFee({ denom, size: amount as any })
|
||||
.then((resp) => BNCoin.fromCoin(resp.fee))
|
||||
}
|
14
src/hooks/markets/useMarketAssets.ts
Normal file
14
src/hooks/markets/useMarketAssets.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import useSWR from 'swr'
|
||||
import getMarkets from 'api/markets/getMarkets'
|
||||
|
||||
import useChainConfig from 'hooks/useChainConfig'
|
||||
|
||||
export default function useMarketAssets() {
|
||||
const chainConfig = useChainConfig()
|
||||
return useSWR(`chains/${chainConfig.id}/markets`, () => getMarkets(chainConfig), {
|
||||
suspense: true,
|
||||
fallbackData: [],
|
||||
revalidateOnFocus: false,
|
||||
keepPreviousData: false,
|
||||
})
|
||||
}
|
17
src/hooks/markets/useMarketBorrowings.tsx
Normal file
17
src/hooks/markets/useMarketBorrowings.tsx
Normal file
@ -0,0 +1,17 @@
|
||||
import useSWR from 'swr'
|
||||
import getMarketBorrowings from 'api/markets/getMarketBorrowings'
|
||||
|
||||
import useChainConfig from 'hooks/useChainConfig'
|
||||
|
||||
export default function useMarketBorrowings() {
|
||||
const chainConfig = useChainConfig()
|
||||
return useSWR(
|
||||
`chains/${chainConfig.id}/markets/borrowings`,
|
||||
() => getMarketBorrowings(chainConfig),
|
||||
{
|
||||
fallbackData: [],
|
||||
suspense: false,
|
||||
revalidateOnFocus: false,
|
||||
},
|
||||
)
|
||||
}
|
17
src/hooks/markets/useMarketLiquidities.ts
Normal file
17
src/hooks/markets/useMarketLiquidities.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import useSWR from 'swr'
|
||||
import getMarketLiquidities from 'api/markets/getMarketLiquidities'
|
||||
|
||||
import useChainConfig from 'hooks/useChainConfig'
|
||||
|
||||
export default function useMarketLiquidities() {
|
||||
const chainConfig = useChainConfig()
|
||||
return useSWR(
|
||||
`chains/${chainConfig.id}/markets/liquidities`,
|
||||
() => getMarketLiquidities(chainConfig),
|
||||
{
|
||||
suspense: true,
|
||||
fallbackData: [],
|
||||
revalidateOnFocus: false,
|
||||
},
|
||||
)
|
||||
}
|
Loading…
Reference in New Issue
Block a user