diff --git a/centrifuge-app/src/components/PoolCard/index.tsx b/centrifuge-app/src/components/PoolCard/index.tsx index 82b4109a3b..a68974abc1 100644 --- a/centrifuge-app/src/components/PoolCard/index.tsx +++ b/centrifuge-app/src/components/PoolCard/index.tsx @@ -199,7 +199,7 @@ export function PoolCard({ } }) .reverse() - }, [isTinlakePool, metaData?.tranches, tinlakeKey, tranches]) + }, [isTinlakePool, metaData?.tranches, tinlakeKey, tranches, createdAt, poolId]) return ( diff --git a/centrifuge-app/src/components/PoolOverview/TrancheTokenCards.tsx b/centrifuge-app/src/components/PoolOverview/TrancheTokenCards.tsx index be41ed4ab6..927b584c4c 100644 --- a/centrifuge-app/src/components/PoolOverview/TrancheTokenCards.tsx +++ b/centrifuge-app/src/components/PoolOverview/TrancheTokenCards.tsx @@ -42,9 +42,6 @@ export const TrancheTokenCards = ({ return 'mezzanine' } - const getTarget = (tranche: Token) => - (isTinlakePool && tranche.seniority === 0) || poolId === DYF_POOL_ID || poolId === NS3_POOL_ID - const columns = useMemo(() => { return [ { @@ -121,6 +118,8 @@ export const TrancheTokenCards = ({ }, [pool.tranches, metadata, poolId, pool?.currency.symbol]) const dataTable = useMemo(() => { + const getTarget = (tranche: Token) => + (isTinlakePool && tranche.seniority === 0) || poolId === DYF_POOL_ID || poolId === NS3_POOL_ID return trancheTokens.map((tranche) => { const calculateApy = (trancheToken: Token) => { if (isTinlakePool && getTrancheText(trancheToken) === 'senior') return formatPercentage(trancheToken.apy) @@ -145,7 +144,7 @@ export const TrancheTokenCards = ({ isTarget: getTarget(tranche), } }) - }, [trancheTokens, getTarget]) + }, [trancheTokens, daysSinceCreation, isTinlakePool, poolId]) return ( diff --git a/centrifuge-app/src/pages/IssuerCreatePool/PoolDetailsSection.tsx b/centrifuge-app/src/pages/IssuerCreatePool/PoolDetailsSection.tsx index 7975d4fa94..97178d4d75 100644 --- a/centrifuge-app/src/pages/IssuerCreatePool/PoolDetailsSection.tsx +++ b/centrifuge-app/src/pages/IssuerCreatePool/PoolDetailsSection.tsx @@ -11,7 +11,6 @@ import { TextInput, } from '@centrifuge/fabric' import { Field, FieldProps, useFormikContext } from 'formik' -import { useTheme } from 'styled-components' import { FieldWithErrorMessage } from '../../../src/components/FieldWithErrorMessage' import { Tooltips } from '../../../src/components/Tooltips' import { isTestEnv } from '../../../src/config' @@ -27,7 +26,6 @@ export const AddButton = ({ onClick }: { onClick: () => void }) => ( ) export const PoolDetailsSection = () => { - const theme = useTheme() const form = useFormikContext() const createLabel = (label: string) => `${label}${isTestEnv ? '' : '*'}` diff --git a/centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx b/centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx index 5abc4f400c..b3bfede001 100644 --- a/centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx +++ b/centrifuge-app/src/pages/IssuerCreatePool/PoolSetupSection.tsx @@ -17,12 +17,10 @@ import { Field, FieldArray, FieldProps, useFormikContext } from 'formik' import { useTheme } from 'styled-components' import { FieldWithErrorMessage } from '../../../src/components/FieldWithErrorMessage' import { Tooltips } from '../../../src/components/Tooltips' -import { feeCategories, isTestEnv } from '../../../src/config' +import { feeCategories } from '../../../src/config' import { AddButton } from './PoolDetailsSection' import { CheckboxOption, Line, StyledGrid } from './PoolStructureSection' -const MAX_FEES = 5 - const FEE_TYPES = [ { label: 'Direct charge', value: 'chargedUpTo' }, { label: 'Fixed %', value: 'fixed' }, @@ -34,7 +32,6 @@ export const PoolSetupSection = () => { const theme = useTheme() const form = useFormikContext() const { values } = form - const createLabel = (label: string) => `${label}${isTestEnv ? '' : '*'}` return ( diff --git a/centrifuge-app/src/pages/IssuerCreatePool/index.tsx b/centrifuge-app/src/pages/IssuerCreatePool/index.tsx index c59e87d611..018cde8203 100644 --- a/centrifuge-app/src/pages/IssuerCreatePool/index.tsx +++ b/centrifuge-app/src/pages/IssuerCreatePool/index.tsx @@ -39,7 +39,7 @@ const IssuerCreatePoolPage = () => { const [stepCompleted, setStepCompleted] = useState({ 1: false, 2: false, 3: false }) const form = useFormik({ - initialValues: initialValues, + initialValues, validate: (values) => validateValues(values), validateOnMount: true, onSubmit: () => console.log('a'), diff --git a/centrifuge-app/src/pages/IssuerCreatePool/oldindex.tsx b/centrifuge-app/src/pages/IssuerCreatePool/oldindex.tsx index 17fe1b6875..79609964cd 100644 --- a/centrifuge-app/src/pages/IssuerCreatePool/oldindex.tsx +++ b/centrifuge-app/src/pages/IssuerCreatePool/oldindex.tsx @@ -259,6 +259,11 @@ function CreatePoolForm() { cent.pools.createPool(poolArgs, { createType: options?.createType, batch: true }), ]).pipe( switchMap(([api, poolSubmittable]) => { + // BATCH https://polkadot.js.org/docs/kusama/extrinsics/#batchcalls-veccall + api.tx.utlity + .batch + // create pool current functionality + pure proxy functionality goes here + () const adminProxyDelegates = multisigAddr ? [multisigAddr] : (adminMultisig && values.adminMultisig?.signers?.filter((addr) => addr !== address)) ?? [] diff --git a/centrifuge-app/src/pages/Pool/Assets/index.tsx b/centrifuge-app/src/pages/Pool/Assets/index.tsx index b9ebfc843e..461f506e70 100644 --- a/centrifuge-app/src/pages/Pool/Assets/index.tsx +++ b/centrifuge-app/src/pages/Pool/Assets/index.tsx @@ -44,8 +44,8 @@ export function PoolDetailAssets() { if (!poolId) throw new Error('Pool not found') const pool = usePool(poolId) - const { data: loans, isLoading } = useLoans(poolId) - const { isLoading: isLoadingSnapshots, data: snapshots } = useAllPoolAssetSnapshots(poolId, new Date().toString()) + const { data: loans } = useLoans(poolId) + const { data: snapshots } = useAllPoolAssetSnapshots(poolId, new Date().toString()) const isTinlakePool = poolId.startsWith('0x') const basePath = useBasePath() const cashLoans = (loans ?? []).filter( diff --git a/centrifuge-js/src/modules/pools.ts b/centrifuge-js/src/modules/pools.ts index 149218fbde..553d5cb399 100644 --- a/centrifuge-js/src/modules/pools.ts +++ b/centrifuge-js/src/modules/pools.ts @@ -674,6 +674,7 @@ export interface PoolMetadataInput { tranches: TrancheFormValues[] // details + poolName: string assetDenomination: string investorType: string poolIcon: FileType | null @@ -716,7 +717,10 @@ export interface PoolMetadataInput { poolFees: { id: number; name: string; feePosition: 'Top of waterfall'; category?: string; feeType: FeeTypes }[] poolType: 'open' | 'closed' + + adminMultisigEnabled: boolean } + export type WithdrawAddress = { name?: string address: string @@ -776,7 +780,7 @@ export type PoolMetadata = { { icon?: FileType | null minInitialInvestment?: string - targetAPY?: string // only junior tranche (index: 0) has targetAPY + apy: string } > loanTemplates?: { @@ -1118,7 +1122,7 @@ export function getPoolsModule(inst: Centrifuge) { metadata.tranches.forEach((tranche, index) => { tranchesById[computeTrancheId(index, poolId)] = { minInitialInvestment: CurrencyBalance.fromFloat(tranche.minInvestment, currencyDecimals).toString(), - targetAPY: tranche.targetAPY, + apy: tranche.apy, } })