Oracle status for this market is{' '}
diff --git a/libs/market-info/src/lib/components/oracle-full-profile/oracle-full-profile.tsx b/libs/market-info/src/lib/components/oracle-full-profile/oracle-full-profile.tsx
index d480790e3..8800d5864 100644
--- a/libs/market-info/src/lib/components/oracle-full-profile/oracle-full-profile.tsx
+++ b/libs/market-info/src/lib/components/oracle-full-profile/oracle-full-profile.tsx
@@ -2,6 +2,7 @@ import { t } from '@vegaprotocol/i18n';
import type { Provider } from '../../oracle-schema';
import { MarketState, MarketStateMapping } from '@vegaprotocol/types';
import {
+ ButtonLink,
ExternalLink,
Icon,
Intent,
@@ -15,6 +16,7 @@ import { getLinkIcon, getVerifiedStatusIcon } from '../oracle-basic-profile';
import { useEnvironment } from '@vegaprotocol/environment';
import type { OracleMarketSpecFieldsFragment } from '../../__generated__/OracleMarketsSpec';
import ReactMarkdown from 'react-markdown';
+import { useState } from 'react';
export const OracleProfileTitle = ({ provider }: { provider: Provider }) => {
const { icon, intent } = getVerifiedStatusIcon(provider);
@@ -78,6 +80,7 @@ export const OracleFullProfile = ({
}) => {
const { message } = getVerifiedStatusIcon(provider);
const { VEGA_EXPLORER_URL } = useEnvironment();
+ const [showMore, setShowMore] = useState(false);
const links = provider.proofs
.filter((proof) => proof.format === 'url' && proof.available === true)
@@ -86,6 +89,9 @@ export const OracleFullProfile = ({
url: 'url' in proof ? proof.url : '',
icon: getLinkIcon(proof.type),
}));
+ const signedMessageProofs = provider.proofs.filter(
+ (proof) => proof.format === 'signed_message' && proof.available === true
+ );
return (
@@ -103,8 +109,15 @@ export const OracleFullProfile = ({
disallowedElements={['img']}
linkTarget="_blank"
>
- {provider.description_markdown}
+ {showMore
+ ? provider.description_markdown
+ : provider.description_markdown.slice(0, 100) + '...'}
+
+ setShowMore(!showMore)}>
+ {!showMore ? t('Read more') : t('Show less')}
+
+
@@ -113,9 +126,12 @@ export const OracleFullProfile = ({
className="dark:text-vega-light-300 text-vega-dark-300 uppercase"
data-testid="verified-accounts"
>
- {t('%s proofs of ownership', links.length.toString())}
+ {t('%s %s of ownership', [
+ provider.proofs.length.toString(),
+ provider.proofs.length === 1 ? 'proof' : 'proofs',
+ ])}
- {links.length > 0 ? (
+ {provider.proofs.length > 0 ? (
{links.map((link) => (
))}
+ {signedMessageProofs.length > 0 && (
+
+ {links.length > 0 ? (
+
+ {t('And %s more %s', [
+ signedMessageProofs.length.toString(),
+ signedMessageProofs.length === 1 ? 'proof' : 'proofs',
+ ])}{' '}
+
+
+ ) : (
+
+ {t('Verify %s %s of ownership', [
+ signedMessageProofs.length.toString(),
+ signedMessageProofs.length === 1 ? 'proof' : 'proofs',
+ ])}{' '}
+
+
+ )}
+
+ )}
) : (
diff --git a/libs/market-info/src/lib/hooks/use-market-oracle.ts b/libs/market-info/src/lib/hooks/use-market-oracle.ts
index efb0d72a6..05418f7d1 100644
--- a/libs/market-info/src/lib/hooks/use-market-oracle.ts
+++ b/libs/market-info/src/lib/hooks/use-market-oracle.ts
@@ -4,7 +4,12 @@ import { useDataProvider } from '@vegaprotocol/data-provider';
import { marketInfoProvider } from '../components/market-info/market-info-data-provider';
import { useMemo } from 'react';
-export const useMarketOracle = (marketId: string) => {
+export const useMarketOracle = (
+ marketId: string,
+ dataSourceSpecKey:
+ | 'dataSourceSpecForSettlementData'
+ | 'dataSourceSpecForTradingTermination' = 'dataSourceSpecForSettlementData'
+) => {
const { ORACLE_PROOFS_URL } = useEnvironment();
const { data: marketInfo } = useDataProvider({
dataProvider: marketInfoProvider,
@@ -16,8 +21,7 @@ export const useMarketOracle = (marketId: string) => {
return undefined;
}
const dataSourceSpec =
- marketInfo.tradableInstrument.instrument.product
- .dataSourceSpecForSettlementData;
+ marketInfo.tradableInstrument.instrument.product[dataSourceSpecKey];
const { data: dataSource, id: dataSourceSpecId } = dataSourceSpec;
const provider = data.find((provider) =>
provider.proofs.some((proof) => {
@@ -48,5 +52,5 @@ export const useMarketOracle = (marketId: string) => {
return { provider, dataSourceSpecId };
}
return undefined;
- }, [data, marketInfo]);
+ }, [data, dataSourceSpecKey, marketInfo]);
};