diff --git a/centrifuge-app/.env-config/.env.ff-prod b/centrifuge-app/.env-config/.env.ff-prod index 2cd9cc716..08482b5a5 100644 --- a/centrifuge-app/.env-config/.env.ff-prod +++ b/centrifuge-app/.env-config/.env.ff-prod @@ -8,7 +8,7 @@ REACT_APP_ONBOARDING_API_URL=https://europe-central2-centrifuge-production-x.clo REACT_APP_PINNING_API_URL=https://europe-central2-centrifuge-production-x.cloudfunctions.net/pinning-api-production REACT_APP_POOL_CREATION_TYPE=propose REACT_APP_RELAY_WSS_URL=wss://rpc.polkadot.io -REACT_APP_SUBQUERY_URL=https://subql.embrio.tech +REACT_APP_SUBQUERY_URL=https://api.centrifuge.io REACT_APP_SUBSCAN_URL=https://centrifuge.subscan.io REACT_APP_TINLAKE_NETWORK=mainnet REACT_APP_INFURA_KEY=8ed99a9a115349bbbc01dcf3a24edc96 diff --git a/centrifuge-app/.env-config/.env.production b/centrifuge-app/.env-config/.env.production index 18d7de6e5..7dadec3d9 100644 --- a/centrifuge-app/.env-config/.env.production +++ b/centrifuge-app/.env-config/.env.production @@ -8,7 +8,7 @@ REACT_APP_ONBOARDING_API_URL=https://europe-central2-centrifuge-production-x.clo REACT_APP_PINNING_API_URL=https://europe-central2-centrifuge-production-x.cloudfunctions.net/pinning-api-production REACT_APP_POOL_CREATION_TYPE=propose REACT_APP_RELAY_WSS_URL=wss://rpc.polkadot.io -REACT_APP_SUBQUERY_URL=https://subql.embrio.tech +REACT_APP_SUBQUERY_URL=https://api.centrifuge.io REACT_APP_SUBSCAN_URL=https://centrifuge.subscan.io REACT_APP_TINLAKE_NETWORK=mainnet REACT_APP_INFURA_KEY=8ed99a9a115349bbbc01dcf3a24edc96 diff --git a/centrifuge-app/src/pages/Loan/ExternalFinanceForm.tsx b/centrifuge-app/src/pages/Loan/ExternalFinanceForm.tsx index 2b1bb380e..a81ce0a66 100644 --- a/centrifuge-app/src/pages/Loan/ExternalFinanceForm.tsx +++ b/centrifuge-app/src/pages/Loan/ExternalFinanceForm.tsx @@ -116,6 +116,11 @@ export function ExternalFinanceForm({ loan, source }: { loan: ExternalLoan; sour const withdraw = useWithdraw(loan.poolId, account!, totalFinance, source) + React.useEffect(() => { + financeForm.validateForm() + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [source]) + if (loan.status === 'Closed' || ('valuationMethod' in loan.pricing && loan.pricing.valuationMethod !== 'oracle')) { return null } diff --git a/centrifuge-app/src/pages/Loan/FinanceForm.tsx b/centrifuge-app/src/pages/Loan/FinanceForm.tsx index e168b2b66..e86d08483 100644 --- a/centrifuge-app/src/pages/Loan/FinanceForm.tsx +++ b/centrifuge-app/src/pages/Loan/FinanceForm.tsx @@ -561,6 +561,8 @@ export function useWithdraw(poolId: string, borrower: CombinedSubstrateAccount, return source === 'reserve' ? amount.lte(totalAvailable) && !!withdrawalAddresses.length : true }, getBatch: () => { + const withdrawalAddresses = Object.values(selectedAddressIndexByCurrency).filter((index) => index !== -1) + if (!withdrawalAddresses.length) return of([]) return combineLatest( withdrawAmounts.flatMap((bucket) => { const index = selectedAddressIndexByCurrency[bucket.currencyKey] ?? 0 diff --git a/centrifuge-app/src/pages/NavManagement/NavManagementAssetTable.tsx b/centrifuge-app/src/pages/NavManagement/NavManagementAssetTable.tsx index 3d9cacb34..44ebb8131 100644 --- a/centrifuge-app/src/pages/NavManagement/NavManagementAssetTable.tsx +++ b/centrifuge-app/src/pages/NavManagement/NavManagementAssetTable.tsx @@ -19,7 +19,7 @@ import { combineLatest, switchMap } from 'rxjs' import daiLogo from '../../assets/images/dai-logo.svg' import usdcLogo from '../../assets/images/usdc-logo.svg' import { ButtonGroup } from '../../components/ButtonGroup' -import { DataCol, DataRow, DataTable } from '../../components/DataTable' +import { DataTable } from '../../components/DataTable' import { LayoutSection } from '../../components/LayoutBase/LayoutSection' import { AssetName } from '../../components/LoanList' import { RouterTextLink } from '../../components/TextLink' @@ -386,29 +386,7 @@ export function NavManagementAssetTable({ poolId }: { poolId: string }) { ) } > - - - - Total - - - - - - - {isEditing && } - - - {formatBalance(newNav, pool.currency.symbol)} - - - - } - /> + diff --git a/centrifuge-app/src/pages/NavManagement/Overview.tsx b/centrifuge-app/src/pages/NavManagement/Overview.tsx index 2892d4a6e..e8a3f78e4 100644 --- a/centrifuge-app/src/pages/NavManagement/Overview.tsx +++ b/centrifuge-app/src/pages/NavManagement/Overview.tsx @@ -109,7 +109,11 @@ export function NavOverviewCard({ poolId }: { poolId: string }) { current={pool.nav.total.toFloat()} change={changeInValuation ? new CurrencyBalance(changeInValuation, pool.currency.decimals).toFloat() : 0} pendingFees={pendingFees.toFloat()} - pendingNav={pool.nav.total.toFloat() - pendingFees.toFloat()} + pendingNav={new CurrencyBalance(changeInValuation, pool.currency.decimals) + .toDecimal() + .add(pool.nav.total.toDecimal()) + .sub(pendingFees.toDecimal()) + .toNumber()} /> ) }