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