diff --git a/centrifuge-app/src/pages/IssuerCreatePool/TrancheInput.tsx b/centrifuge-app/src/pages/IssuerCreatePool/TrancheInput.tsx index 92ce3d0b01..258b558ee4 100644 --- a/centrifuge-app/src/pages/IssuerCreatePool/TrancheInput.tsx +++ b/centrifuge-app/src/pages/IssuerCreatePool/TrancheInput.tsx @@ -158,13 +158,13 @@ export function TrancheInput({ canRemove, isUpdating }: { canRemove?: boolean; i {index === 0 ? ( <> - {/* For Junior tranche, use interestRatePerSec with "Target APY" label */} + {/* Only most junior tranche has target APY */} } placeholder="0.00" symbol="%" - name={`tranches.${index}.interestRate`} + name={`tranches.${index}.targetAPY`} validate={validate.interestRate} /> diff --git a/centrifuge-app/src/pages/IssuerCreatePool/index.tsx b/centrifuge-app/src/pages/IssuerCreatePool/index.tsx index 621964b277..0aa6dd501a 100644 --- a/centrifuge-app/src/pages/IssuerCreatePool/index.tsx +++ b/centrifuge-app/src/pages/IssuerCreatePool/index.tsx @@ -115,7 +115,7 @@ export type CreatePoolValues = Omit< issuerShortDescription: string ratingAgency: string ratingValue: string - ratingReport: File | null + ratingReportUrl: string } const initialValues: CreatePoolValues = { @@ -148,7 +148,7 @@ const initialValues: CreatePoolValues = { ratingAgency: '', ratingValue: '', - ratingReport: null, + ratingReportUrl: '', tranches: [createEmptyTranche('')], adminMultisig: { @@ -462,6 +462,13 @@ function CreatePoolForm() { url: values.reportUrl, } } + if (values.ratingReportUrl) { + metadataValues.poolRating = { + ratingAgency: values.ratingAgency, + ratingValue: values.ratingValue, + ratingReportUrl: values.ratingReportUrl, + } + } const nonJuniorTranches = metadataValues.tranches.slice(1) const tranches = [ diff --git a/centrifuge-app/src/pages/IssuerPool/Configuration/Details.tsx b/centrifuge-app/src/pages/IssuerPool/Configuration/Details.tsx index ba9566027d..cb2642ab81 100644 --- a/centrifuge-app/src/pages/IssuerPool/Configuration/Details.tsx +++ b/centrifuge-app/src/pages/IssuerPool/Configuration/Details.tsx @@ -20,7 +20,7 @@ import { usePool, usePoolMetadata } from '../../../utils/usePools' import { CreatePoolValues } from '../../IssuerCreatePool' import { validate } from '../../IssuerCreatePool/validate' -type Values = Pick & { +type Values = Pick & { listed: boolean } @@ -55,6 +55,7 @@ export function Details() { : 'Private credit', subAssetClass: metadata?.pool?.asset?.subClass ?? '', listed: metadata?.pool?.listed ?? false, + investorType: metadata?.pool?.investorType ?? '', }), [metadata, iconFile] ) @@ -91,6 +92,7 @@ export function Details() { class: values.assetClass, subClass: values.subAssetClass, }, + investorType: values.investorType, listed: values.listed, }, pod: { @@ -221,7 +223,14 @@ export function Details() { placeholder="" disabled /> - + {((isDemo && editPoolVisibility) || !isDemo) && ( {({ field }: FieldProps) => ( @@ -245,6 +254,7 @@ export function Details() { + )} diff --git a/centrifuge-app/src/pages/IssuerPool/Configuration/Issuer.tsx b/centrifuge-app/src/pages/IssuerPool/Configuration/Issuer.tsx index 27b0108c7d..5b38fab96c 100644 --- a/centrifuge-app/src/pages/IssuerPool/Configuration/Issuer.tsx +++ b/centrifuge-app/src/pages/IssuerPool/Configuration/Issuer.tsx @@ -23,6 +23,7 @@ type Values = Pick< | 'issuerRepName' | 'issuerLogo' | 'issuerDescription' + | 'issuerShortDescription' | 'executiveSummary' | 'website' | 'forum' @@ -31,6 +32,9 @@ type Values = Pick< | 'reportUrl' | 'reportAuthorName' | 'reportAuthorTitle' + | 'ratingAgency' + | 'ratingValue' + | 'ratingReportUrl' > & { reportAuthorAvatar: string | null | File } @@ -54,6 +58,7 @@ export function Issuer() { issuerRepName: metadata?.pool?.issuer?.repName ?? '', issuerLogo: logoFile ?? null, issuerDescription: metadata?.pool?.issuer?.description ?? '', + issuerShortDescription: metadata?.pool?.issuer?.shortDescription ?? '', executiveSummary: metadata?.pool?.links?.executiveSummary ? 'executiveSummary.pdf' : ('' as any), website: metadata?.pool?.links?.website ?? '', forum: metadata?.pool?.links?.forum ?? '', @@ -65,6 +70,9 @@ export function Issuer() { reportAuthorAvatar: metadata?.pool?.reports?.[0]?.author?.avatar ? `avatar.${metadata.pool.reports[0].author.avatar.mime?.split('/')[1]}` : null, + ratingAgency: metadata?.pool?.rating?.ratingAgency ?? '', + ratingValue: metadata?.pool?.rating?.ratingValue ?? '', + ratingReportUrl: metadata?.pool?.rating?.ratingReportUrl ?? '', }), [metadata, logoFile] ) @@ -110,6 +118,7 @@ export function Issuer() { email: values.email, logo: logoChanged && logoUri ? { uri: logoUri, mime: values.issuerLogo!.type } : oldMetadata.pool.issuer.logo, + shortDescription: values.issuerShortDescription, }, links: { executiveSummary: execSummaryUri @@ -119,6 +128,11 @@ export function Issuer() { website: values.website, }, details: values.details, + rating: { + ratingAgency: values.ratingAgency, + ratingValue: values.ratingValue, + ratingReportUrl: values.ratingReportUrl, + }, }, } diff --git a/centrifuge-js/src/modules/pools.ts b/centrifuge-js/src/modules/pools.ts index 7fe0698140..0dad4e2a2c 100644 --- a/centrifuge-js/src/modules/pools.ts +++ b/centrifuge-js/src/modules/pools.ts @@ -645,6 +645,7 @@ interface TrancheFormValues { interestRate: number | '' minRiskBuffer: number | '' minInvestment: number | '' + targetAPY?: number | '' } export type IssuerDetail = { @@ -689,6 +690,11 @@ export interface PoolMetadataInput { authorAvatar: FileType | null url: string } + poolRating?: { + ratingAgency?: string + ratingValue?: string + ratingReportUrl?: string + } executiveSummary: FileType | null website: string @@ -750,6 +756,11 @@ export type PoolMetadata = { status: PoolStatus listed: boolean reports?: PoolReport[] + rating?: { + ratingAgency?: string + ratingValue?: string + ratingReportUrl?: string + } } pod?: { indexer?: string | null @@ -1093,8 +1104,10 @@ export function getPoolsModule(inst: Centrifuge) { const tranchesById: PoolMetadata['tranches'] = {} metadata.tranches.forEach((tranche, index) => { + const targetAPY = tranche?.targetAPY ? { targetAPY: tranche.targetAPY } : {} tranchesById[computeTrancheId(index, poolId)] = { minInitialInvestment: CurrencyBalance.fromFloat(tranche.minInvestment, currencyDecimals).toString(), + ...targetAPY, } }) @@ -1125,6 +1138,13 @@ export function getPoolsModule(inst: Centrifuge) { status: 'open', listed: metadata.listed ?? true, poolFees: metadata.poolFees, + rating: metadata.poolRating + ? { + ratingAgency: metadata.poolRating.ratingAgency, + ratingValue: metadata.poolRating.ratingValue, + ratingReportUrl: metadata.poolRating.ratingReportUrl, + } + : undefined, reports: metadata.poolReport ? [ {