diff --git a/lib/xStarScore/useFetchXStarScore.ts b/lib/xStarScore/useFetchXStarScore.ts index dab7deda8e..3247c95a31 100644 --- a/lib/xStarScore/useFetchXStarScore.ts +++ b/lib/xStarScore/useFetchXStarScore.ts @@ -17,7 +17,7 @@ export default function useFetchXStarScore({ hash }: Params) { pathParams: { hash }, queryOptions: { select: (response) => { - const parsedResponse = v.safeParse(v.object({ data: v.string() }), response); + const parsedResponse = v.safeParse(v.object({ data: v.object({ level: v.nullable(v.string()) }) }), response); if (!parsedResponse.success) { throw Error(ERROR_NAME); @@ -27,7 +27,7 @@ export default function useFetchXStarScore({ hash }: Params) { }, enabled: Boolean(hash) && config.features.xStarScore.isEnabled, placeholderData: { - data: 'Base' as const, + data: { level: 'Base' }, }, retry: 0, }, diff --git a/types/api/address.ts b/types/api/address.ts index 9081486edd..5a95b34f6e 100644 --- a/types/api/address.ts +++ b/types/api/address.ts @@ -273,5 +273,7 @@ export type AddressEpochRewardsItem = { }; export type AddressXStarResponse = { - data: string | null; + data: { + level: string | null; + }; }; diff --git a/ui/pages/Address.tsx b/ui/pages/Address.tsx index 16e623ce51..f8bbdb1b1f 100644 --- a/ui/pages/Address.tsx +++ b/ui/pages/Address.tsx @@ -302,10 +302,10 @@ const AddressPageContent = () => { undefined, ...formatUserTags(addressQuery.data), ...(addressMetadataQuery.data?.addresses?.[hash.toLowerCase()]?.tags.filter(tag => tag.tagType !== 'note') || []), - !addressQuery.data?.is_contract && xScoreFeature.isEnabled && xStarQuery.data?.data ? + !addressQuery.data?.is_contract && xScoreFeature.isEnabled && xStarQuery.data?.data.level ? { slug: 'xstar', - name: `XHS ${ xStarQuery.data.data } level`, + name: `XHS ${ xStarQuery.data.data.level } level`, tagType: 'custom' as const, ordinal: 12, meta: {