diff --git a/CHANGELOG.md b/CHANGELOG.md index 02b7f99..765ebce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ # 0.1.0 * Initial version + +# 0.1.1 + +* Add request to pay eBill button +* Display Node ID on Home diff --git a/src/generated/client/sdk.gen.ts b/src/generated/client/sdk.gen.ts index 625d876..29d120d 100644 --- a/src/generated/client/sdk.gen.ts +++ b/src/generated/client/sdk.gen.ts @@ -1,7 +1,7 @@ // This file is auto-generated by @hey-api/openapi-ts import type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch'; -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} from './types.gen'; +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} from './types.gen'; import { client as _heyApiClient } from './client.gen'; @@ -152,3 +152,19 @@ export const requestToMint = (options: Opt } }); }; + + +/** + * --------------------------- IdentityDetail +*/ + +export const identityDetail = (options?: Options) => { + return (_heyApiClient).get({ + url: '/v1/admin/identity/detail', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers + } + }); +}; diff --git a/src/generated/client/types.gen.ts b/src/generated/client/types.gen.ts index 2addb30..0b45d20 100644 --- a/src/generated/client/types.gen.ts +++ b/src/generated/client/types.gen.ts @@ -501,11 +501,6 @@ export type KeysetInfoData = { * Request Mint */ - // pub struct RequestToMintFromEBillRequest { - // pub ebill_id: String, - // pub amount: Amount, - // } - export type RequestToMintRequest = { ebill_id: string; amount: number; @@ -529,3 +524,41 @@ export type KeysetInfoData = { query?: never; url: '/v1/admin/treasury/debit/request_to_mint_from_ebill' }; + + /** + * Node ID + */ + + export type IdentityDetailRequest = { + }; + + export type IdentityDetailInfo = { + node_id: string; + name: string; + email: string | null; + bitcoin_public_key: string; + npub: string; + postal_address: PostalAddress | null; + date_of_birth: string | null; + country_of_birth: string | null; + city_of_birth: string | null; + identification_number: string | null; + profile_picture_file: string | null; + identity_document_file: string | null; + nostr_relays: Array; + }; + + export type IdentityDetailResponse = { + /** + * Successful response + */ + 200: IdentityDetailInfo; + }; + + + export type IdentityDetailData = { + body?: never; + path?: never; + query?: never; + url: '/v1/admin/identity/detail' + }; diff --git a/src/pages/home/HomePage.tsx b/src/pages/home/HomePage.tsx index 66120be..14f1cca 100644 --- a/src/pages/home/HomePage.tsx +++ b/src/pages/home/HomePage.tsx @@ -1,7 +1,7 @@ import { PageTitle } from "@/components/PageTitle" import { Skeleton } from "@/components/ui/skeleton" -// import { fetchInfo } from "@/lib/api" -// import { useSuspenseQuery } from "@tanstack/react-query" +import { identityDetail } from "@/generated/client/sdk.gen" +import { useSuspenseQuery } from "@tanstack/react-query" import { Suspense } from "react" function Loader() { @@ -13,25 +13,88 @@ function Loader() { } function PageBody() { - // const { data } = []; useSuspenseQuery({ - // queryKey: ["info"], - // queryFn: fetchInfo, - // }) + const { data } = useSuspenseQuery({ + queryKey: ["identity-detail"], + queryFn: async () => { + const response = await identityDetail() + return response.data ?? null + }, + staleTime: Infinity, + gcTime: Infinity, + }) - const data = { - name: "bcr-wdc-quote-service", - version: "0.1.0", - pubkey: "0283bf290884eed3a7ca2663fc0260de2e2064d6b355ea13f98dec004b7a7ead99", + if (!data) { + return ( +
+
No identity found
+
+ ) } return ( - <> -
- {data.name} - {data.version} - {data.pubkey} +
+
+

Information

+
+
+ Name + {data.name} +
+ {data.email && ( +
+ Email + {data.email} +
+ )} + {data.date_of_birth && ( +
+ Date of Birth + {data.date_of_birth} +
+ )} +
- + +
+

Keys

+
+
+ Node ID + + {data.node_id} + +
+
+ + Bitcoin Public Key + + + {data.bitcoin_public_key} + +
+
+ Nostr Public Key + {data.npub} +
+
+
+ + {data.postal_address && ( +
+

Address

+
+
+
{data.postal_address.address}
+
+ {data.postal_address.city} + {data.postal_address.zip && `, ${data.postal_address.zip}`} +
+
{data.postal_address.country}
+
+
+
+ )} +
) }