diff --git a/src/constants/endpoints.ts b/src/constants/endpoints.ts index 364155b..98b8955 100644 --- a/src/constants/endpoints.ts +++ b/src/constants/endpoints.ts @@ -1,5 +1,4 @@ const INFO = "/v1/info" -const BALANCES = "/v1/admin/balance" const ADMIN_QUOTE = "/v1/admin/credit/quote" const ADMIN_QUOTE_PENDING = "/v1/admin/credit/quote" @@ -8,4 +7,4 @@ const ADMIN_QUOTE_BY_ID = "/v1/admin/credit/quote/:id" const CREDIT_QUOTE = "/v1/credit/mint/quote" const CREDIT_QUOTES_BY_ID = "/v1/credit/mint/quote/:id" -export { INFO, BALANCES, ADMIN_QUOTE, ADMIN_QUOTE_PENDING, ADMIN_QUOTE_BY_ID, CREDIT_QUOTE, CREDIT_QUOTES_BY_ID } +export { INFO, ADMIN_QUOTE, ADMIN_QUOTE_PENDING, ADMIN_QUOTE_BY_ID, CREDIT_QUOTE, CREDIT_QUOTES_BY_ID } diff --git a/src/generated/client/sdk.gen.ts b/src/generated/client/sdk.gen.ts index 2b547a4..ada7f5f 100644 --- a/src/generated/client/sdk.gen.ts +++ b/src/generated/client/sdk.gen.ts @@ -107,21 +107,21 @@ export const activateKeyset = (options: Op export const debitBalance = (options: Options) => { return (options.client ?? _heyApiClient).get({ - url: '/v1/admin/balance/debit', + url: '/v1/admin/treasury/debit/balance', ...options }); }; export const creditBalance = (options: Options) => { return (options.client ?? _heyApiClient).get({ - url: '/v1/admin/balance/credit', + url: '/v1/admin/treasury/credit/balance', ...options }); }; export const onchainBalance = (options: Options) => { return (options.client ?? _heyApiClient).get({ - url: '/v1/admin/onchain/balance', + url: '/v1/admin/ebpp/onchain/balance', ...options }); }; diff --git a/src/generated/client/types.gen.ts b/src/generated/client/types.gen.ts index 4515483..94db385 100644 --- a/src/generated/client/types.gen.ts +++ b/src/generated/client/types.gen.ts @@ -452,14 +452,14 @@ export type DebitData = { body?: never; path?: never; query?: never; - url: '/v1/admin/balance/debit'; + url: '/v1/admin/treasury/debit/balance'; }; export type CreditData = { body?: never; path?: never; query?: never; - url: '/v1/admin/balance/credit'; + url: '/v1/admin/treasury/credit/balance'; }; export type OnChainBalanceData = { @@ -473,7 +473,7 @@ export type OnChainData = { body?: never; path?: never; query?: never; - url: '/v1/admin/onchain/balance'; + url: '/v1/admin/ebpp/onchain/balance'; }; /** diff --git a/src/lib/api.ts b/src/lib/api.ts index e732b8e..2709c21 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -1,5 +1,5 @@ import { API_URL } from "@/constants/api" -import { BALANCES, INFO } from "@/constants/endpoints" +import { INFO } from "@/constants/endpoints" const apiFetch = async (endpoint: string, options: RequestInit = {}): Promise => { const url = `${API_URL}${endpoint}` @@ -77,10 +77,3 @@ export interface BalancesResponse { } } -export async function fetchBalances(): Promise { - return apiFetch(BALANCES, { - headers: { - "Content-Type": "application/json", - }, - }) -} diff --git a/src/pages/balances/CashFlowPage.tsx b/src/pages/balances/CashFlowPage.tsx index ee8b823..44b4faf 100644 --- a/src/pages/balances/CashFlowPage.tsx +++ b/src/pages/balances/CashFlowPage.tsx @@ -4,9 +4,6 @@ import { CartesianGrid, Line, LineChart, Tooltip, XAxis, YAxis } from "recharts" import { Breadcrumbs } from "@/components/Breadcrumbs" import { PageTitle } from "@/components/PageTitle" import { Skeleton } from "@/components/ui/skeleton" -import { fetchBalances } from "@/lib/api" -import { useSuspenseQuery } from "@tanstack/react-query" -import useLocalStorage from "@/hooks/use-local-storage" import { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent } from "@/components/ui/chart" function Loader() { @@ -88,23 +85,6 @@ function PageBody() { ) } -function DevSection() { - const [devMode] = useLocalStorage("devMode", false) - const { data } = useSuspenseQuery({ - queryKey: ["balances"], - queryFn: fetchBalances, - }) - - return ( - <> - {devMode && ( -
-          {JSON.stringify(data, null, 2)}
-        
- )} - - ) -} export default function CashFlowPage() { return ( @@ -122,7 +102,6 @@ export default function CashFlowPage() { }> - ) diff --git a/src/pages/balances/EarningsPage.tsx b/src/pages/balances/EarningsPage.tsx index 9e68775..024fc6f 100644 --- a/src/pages/balances/EarningsPage.tsx +++ b/src/pages/balances/EarningsPage.tsx @@ -2,9 +2,6 @@ import { Suspense, useState } from "react" import { Breadcrumbs } from "@/components/Breadcrumbs" import { PageTitle } from "@/components/PageTitle" import { Skeleton } from "@/components/ui/skeleton" -import { fetchBalances } from "@/lib/api" -import { useSuspenseQuery } from "@tanstack/react-query" -import useLocalStorage from "@/hooks/use-local-storage" import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group" import { Link } from "react-router" import { Button } from "@/components/ui/button" @@ -85,23 +82,6 @@ function PageBody() { ) } -function DevSection() { - const [devMode] = useLocalStorage("devMode", false) - const { data } = useSuspenseQuery({ - queryKey: ["balances"], - queryFn: fetchBalances, - }) - - return ( - <> - {devMode && ( -
-          {JSON.stringify(data, null, 2)}
-        
- )} - - ) -} export default function EarningsPage() { return ( @@ -111,7 +91,6 @@ export default function EarningsPage() { }> - )