Skip to content

Commit c8b49d3

Browse files
committed
Display version
1 parent dee5210 commit c8b49d3

File tree

3 files changed

+103
-3
lines changed

3 files changed

+103
-3
lines changed

src/generated/client/sdk.gen.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// This file is auto-generated by @hey-api/openapi-ts
22

33
import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';
4-
import type { ListQuotesData, ListQuotesResponse, ListPendingQuotesData, ListPendingQuotesResponse, AdminLookupQuoteData, AdminLookupQuoteResponse, AdminUpdateQuoteData, AdminUpdateQuoteResponse, ResolveOfferData, EnquireQuoteData, EnquireQuoteResponse, LookupQuoteData, LookupQuoteResponse, ActivateKeysetData, ActivateKeysetResponse, DebitData, CreditData, ECashBalance, OnChainBalanceData, OnChainData, KeysetInfoData, KeySetInfo, RequestToMintData, RequestToMintResponseInfo, IdentityDetailData, IdentityDetailInfo, BillPaymentData, BillPaymentState} from './types.gen';
4+
import type { ListQuotesData, ListQuotesResponse, ListPendingQuotesData, ListPendingQuotesResponse, AdminLookupQuoteData, AdminLookupQuoteResponse, AdminUpdateQuoteData, AdminUpdateQuoteResponse, ResolveOfferData, EnquireQuoteData, EnquireQuoteResponse, LookupQuoteData, LookupQuoteResponse, ActivateKeysetData, ActivateKeysetResponse, DebitData, CreditData, ECashBalance, OnChainBalanceData, OnChainData, KeysetInfoData, KeySetInfo, RequestToMintData, RequestToMintResponseInfo, IdentityDetailData, IdentityDetailInfo, BillPaymentData, BillPaymentState, MintInfo, MintInfoData} from './types.gen';
55

66
import { client as _heyApiClient } from './client.gen';
77

@@ -183,3 +183,19 @@ export const paymentStatus = <ThrowOnError extends boolean = false>(options?: Op
183183
}
184184
});
185185
};
186+
187+
188+
/**
189+
* --------------------------- MintInfo
190+
*/
191+
192+
export const mintInfo = <ThrowOnError extends boolean = false>(options?: Options<MintInfoData, ThrowOnError>) => {
193+
return (_heyApiClient).get<MintInfo, unknown, ThrowOnError>({
194+
url: '/v1/admin/info',
195+
...options,
196+
headers: {
197+
'Content-Type': 'application/json',
198+
...options?.headers
199+
}
200+
});
201+
};

src/generated/client/types.gen.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,3 +597,23 @@ export type BillPaymentData = {
597597
query?: never;
598598
url: '/v1/admin/bill/payment_status/{bill_id}';
599599
};
600+
601+
/**
602+
* Mint Info
603+
*/
604+
605+
export type MintInfo = {
606+
name: string,
607+
pubkey: string | null,
608+
version: string | null,
609+
description: string | null,
610+
description_long: string | null,
611+
contact: Array<string> | null,
612+
}
613+
614+
export type MintInfoData = {
615+
body?: never;
616+
path?: never;
617+
query?: never;
618+
url: '/v1/admin/info'
619+
};

src/pages/home/HomePage.tsx

Lines changed: 66 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { PageTitle } from "@/components/PageTitle"
22
import { Skeleton } from "@/components/ui/skeleton"
3-
import { identityDetail } from "@/generated/client/sdk.gen"
3+
import { identityDetail, mintInfo } from "@/generated/client/sdk.gen"
44
import { useSuspenseQuery } from "@tanstack/react-query"
55
import { Suspense } from "react"
66

@@ -23,6 +23,16 @@ function PageBody() {
2323
gcTime: Infinity,
2424
})
2525

26+
const { data: mintData } = useSuspenseQuery({
27+
queryKey: ["mint-info"],
28+
queryFn: async () => {
29+
const response = await mintInfo()
30+
return response.data ?? null
31+
},
32+
staleTime: Infinity,
33+
gcTime: Infinity,
34+
})
35+
2636
if (!data) {
2737
return (
2838
<div className="bg-card text-card-foreground rounded-lg border p-6">
@@ -33,8 +43,62 @@ function PageBody() {
3343

3444
return (
3545
<div className="flex flex-col gap-4">
46+
{mintData && (
47+
<div className="bg-card text-card-foreground rounded-lg border p-6">
48+
<h3 className="text-lg font-semibold mb-4">Mint Information</h3>
49+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
50+
{mintData.name && (
51+
<div className="flex flex-col gap-1">
52+
<span className="text-xs text-muted-foreground uppercase tracking-wide font-medium">Name</span>
53+
<span className="font-semibold text-base">{mintData.name}</span>
54+
</div>
55+
)}
56+
{mintData.version && (
57+
<div className="flex flex-col gap-1">
58+
<span className="text-xs text-muted-foreground uppercase tracking-wide font-medium">Version</span>
59+
<span className="text-sm">{mintData.version}</span>
60+
</div>
61+
)}
62+
{mintData.description && (
63+
<div className="flex flex-col gap-1 md:col-span-2">
64+
<span className="text-xs text-muted-foreground uppercase tracking-wide font-medium">Description</span>
65+
<span className="text-sm">{mintData.description}</span>
66+
</div>
67+
)}
68+
{mintData.description_long && (
69+
<div className="flex flex-col gap-1 md:col-span-2">
70+
<span className="text-xs text-muted-foreground uppercase tracking-wide font-medium">
71+
Long Description
72+
</span>
73+
<span className="text-sm">{mintData.description_long}</span>
74+
</div>
75+
)}
76+
{mintData.pubkey && (
77+
<div className="flex flex-col gap-1 md:col-span-2">
78+
<span className="text-xs text-muted-foreground uppercase tracking-wide font-medium">Public Key</span>
79+
<span className="font-mono text-sm break-all bg-muted p-2 rounded text-muted-foreground">
80+
{mintData.pubkey}
81+
</span>
82+
</div>
83+
)}
84+
{mintData.contact && mintData.contact.length > 0 && (
85+
<div className="flex flex-col gap-1 md:col-span-2">
86+
<span className="text-xs text-muted-foreground uppercase tracking-wide font-medium">Contact</span>
87+
<div className="flex flex-wrap gap-2">
88+
{mintData.contact.map((contact, index) => (
89+
<span key={index} className="text-sm bg-muted px-2 py-1 rounded">
90+
{contact}
91+
</span>
92+
))}
93+
</div>
94+
</div>
95+
)}
96+
</div>
97+
</div>
98+
)}
99+
36100
<div className="bg-card text-card-foreground rounded-lg border p-6">
37-
<h3 className="text-lg font-semibold mb-4">Information</h3>
101+
<h3 className="text-lg font-semibold mb-4">Identity</h3>
38102
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
39103
<div className="flex flex-col gap-1">
40104
<span className="text-xs text-muted-foreground uppercase tracking-wide font-medium">Name</span>

0 commit comments

Comments
 (0)