mirror of
https://github.com/cerc-io/mars-interface.git
synced 2025-01-22 02:59:06 +00:00
commit
4ea8f54b78
@ -1,6 +1,5 @@
|
||||
import 'chart.js/auto'
|
||||
|
||||
import { Coin } from '@cosmjs/stargate'
|
||||
import classNames from 'classnames'
|
||||
import {
|
||||
BorrowCapacity,
|
||||
@ -22,7 +21,7 @@ import {
|
||||
maintainanceMarginWeightedDepositValue,
|
||||
producePercentData,
|
||||
} from 'libs/assetInfo'
|
||||
import { formatValue, lookup, lookupSymbol, magnify } from 'libs/parse'
|
||||
import { formatValue, lookup, lookupSymbol } from 'libs/parse'
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { Bar } from 'react-chartjs-2'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
@ -46,7 +45,6 @@ interface Props {
|
||||
actionButtonSpec: ModalActionButton
|
||||
submitted: boolean
|
||||
feeError?: string
|
||||
txFee?: Coin
|
||||
activeView: ViewType
|
||||
denom: string
|
||||
decimals: number
|
||||
@ -67,7 +65,6 @@ export const Action = ({
|
||||
actionButtonSpec,
|
||||
submitted,
|
||||
feeError,
|
||||
txFee,
|
||||
activeView,
|
||||
denom,
|
||||
decimals,
|
||||
@ -229,13 +226,8 @@ export const Action = ({
|
||||
}, [denom, availableBalanceBaseCurrency, currentAssetPrice, marketAssetLiquidity])
|
||||
|
||||
const repayMax = useMemo((): number => {
|
||||
let adjustedWalletBalance = walletBalance
|
||||
if (denom === baseCurrency.denom) {
|
||||
adjustedWalletBalance = walletBalance - Number(magnify(Number(txFee), 6))
|
||||
}
|
||||
|
||||
return Math.min(assetBorrowBalance, adjustedWalletBalance)
|
||||
}, [assetBorrowBalance, walletBalance, txFee, denom, baseCurrency.denom])
|
||||
return Math.min(assetBorrowBalance, walletBalance)
|
||||
}, [assetBorrowBalance, walletBalance, denom, baseCurrency.denom])
|
||||
|
||||
const maxWithdrawableAmount = useMemo((): number => {
|
||||
const assetLtvRatio = findByDenom(marketInfo, denom)?.max_loan_to_value || 0
|
||||
|
@ -17,7 +17,7 @@ i18next
|
||||
backend: {
|
||||
crossDomain: true,
|
||||
loadPath() {
|
||||
return 'https://raw.githubusercontent.com/mars-protocol/translations/develop/{{lng}}.json'
|
||||
return 'https://raw.githubusercontent.com/mars-protocol/translations/master/{{lng}}.json'
|
||||
},
|
||||
},
|
||||
react: {
|
||||
|
Loading…
Reference in New Issue
Block a user