@diviswap/sdk 1.7.11 → 1.7.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/cli/index.js +8 -2
  2. package/dist/cli/templates/nextjs-app/actions.ts.hbs +32 -32
  3. package/dist/cli/templates/nextjs-app/api-hooks.ts.hbs +10 -10
  4. package/dist/cli/templates/nextjs-app/api-route.ts.hbs +65 -65
  5. package/dist/cli/templates/nextjs-app/auth-context.tsx.hbs +1 -1
  6. package/dist/cli/templates/nextjs-app/client.ts.hbs +5 -5
  7. package/dist/cli/templates/nextjs-app/dashboard-hooks.ts.hbs +7 -7
  8. package/dist/cli/templates/nextjs-app/example-page.tsx.hbs +5 -5
  9. package/dist/cli/templates/nextjs-app/hooks.ts.hbs +7 -7
  10. package/dist/cli/templates/nextjs-app/kyc-hooks.ts.hbs +3 -3
  11. package/dist/cli/templates/nextjs-app/kyc-wizard.css.hbs +16 -16
  12. package/dist/cli/templates/nextjs-app/kyc-wizard.tsx.hbs +24 -24
  13. package/dist/cli/templates/nextjs-app/layout-wrapper.tsx.hbs +4 -4
  14. package/dist/cli/templates/nextjs-app/layout.tsx.hbs +4 -4
  15. package/dist/cli/templates/nextjs-app/middleware.ts.hbs +15 -15
  16. package/dist/cli/templates/nextjs-app/provider-wrapper.tsx.hbs +4 -4
  17. package/dist/cli/templates/nextjs-app/provider.tsx.hbs +16 -16
  18. package/dist/cli/templates/nextjs-app/setup-provider.tsx.hbs +4 -4
  19. package/dist/cli/templates/react/api-client-wrapper.ts.hbs +13 -13
  20. package/dist/cli/templates/react/example.tsx.hbs +6 -6
  21. package/dist/cli/templates/react/tanstack-hooks.ts.hbs +14 -14
  22. package/dist/cli/templates/webhooks/nextjs.hbs +3 -3
  23. package/package.json +2 -1
  24. package/src/cli/templates/index.ts +13 -2
  25. package/src/cli/templates/nextjs-app/actions.ts.hbs +32 -32
  26. package/src/cli/templates/nextjs-app/api-hooks.ts.hbs +10 -10
  27. package/src/cli/templates/nextjs-app/api-route.ts.hbs +65 -65
  28. package/src/cli/templates/nextjs-app/auth-context.tsx.hbs +1 -1
  29. package/src/cli/templates/nextjs-app/client.ts.hbs +5 -5
  30. package/src/cli/templates/nextjs-app/dashboard-hooks.ts.hbs +7 -7
  31. package/src/cli/templates/nextjs-app/example-page.tsx.hbs +5 -5
  32. package/src/cli/templates/nextjs-app/hooks.ts.hbs +7 -7
  33. package/src/cli/templates/nextjs-app/kyc-hooks.ts.hbs +3 -3
  34. package/src/cli/templates/nextjs-app/kyc-wizard.css.hbs +16 -16
  35. package/src/cli/templates/nextjs-app/kyc-wizard.tsx.hbs +24 -24
  36. package/src/cli/templates/nextjs-app/layout-wrapper.tsx.hbs +4 -4
  37. package/src/cli/templates/nextjs-app/layout.tsx.hbs +4 -4
  38. package/src/cli/templates/nextjs-app/middleware.ts.hbs +15 -15
  39. package/src/cli/templates/nextjs-app/provider-wrapper.tsx.hbs +4 -4
  40. package/src/cli/templates/nextjs-app/provider.tsx.hbs +16 -16
  41. package/src/cli/templates/nextjs-app/setup-provider.tsx.hbs +4 -4
  42. package/src/cli/templates/react/api-client-wrapper.ts.hbs +13 -13
  43. package/src/cli/templates/react/example.tsx.hbs +6 -6
  44. package/src/cli/templates/react/tanstack-hooks.ts.hbs +14 -14
  45. package/src/cli/templates/webhooks/nextjs.hbs +3 -3
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Add this to your root layout.tsx to enable Diviswap functionality
2
+ * Add this to your root layout.tsx to enable LiberEx functionality
3
3
  *
4
4
  * Example:
5
5
  *
6
- * import { DiviswapProvider } from '@diviswap/sdk/react';
6
+ * import { LiberExProvider } from '@99darwin/liberex-sdk/react';
7
7
  *
8
8
  * export default function RootLayout({
9
9
  * children,
@@ -13,9 +13,9 @@
13
13
  * return (
14
14
  * <html lang="en">
15
15
  * <body>
16
- * <DiviswapProvider>
16
+ * <LiberExProvider>
17
17
  * {children}
18
- * </DiviswapProvider>
18
+ * </LiberExProvider>
19
19
  * </body>
20
20
  * </html>
21
21
  * );
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * API client wrapper for custom backend integration
3
- * This allows you to proxy Diviswap API calls through your own backend
3
+ * This allows you to proxy LiberEx API calls through your own backend
4
4
  * for additional security and custom logic
5
5
  */
6
6
 
@@ -18,10 +18,10 @@ class ApiClient {
18
18
  private async request<T = any>(endpoint: string, options: ApiOptions = {}): Promise<T> {
19
19
  const { params, ...fetchOptions } = options;
20
20
 
21
- let url = `${this.baseUrl}${endpoint}`;
21
+ let url = this.baseUrl + endpoint;
22
22
  if (params) {
23
23
  const searchParams = new URLSearchParams(params);
24
- url += `?${searchParams.toString()}`;
24
+ url += '?' + searchParams.toString();
25
25
  }
26
26
 
27
27
  const response = await fetch(url, {
@@ -40,46 +40,46 @@ class ApiClient {
40
40
  return response.json();
41
41
  }
42
42
 
43
- // Diviswap-specific endpoints
44
- diviswap = {
43
+ // LiberEx-specific endpoints
44
+ liberex = {
45
45
  // Authentication
46
46
  login: (email: string, password: string) =>
47
- this.request('/diviswap', {
47
+ this.request('/liberex', {
48
48
  method: 'POST',
49
49
  body: JSON.stringify({ action: 'login', email, password }),
50
50
  }),
51
51
 
52
52
  logout: () =>
53
- this.request('/diviswap', {
53
+ this.request('/liberex', {
54
54
  method: 'POST',
55
55
  body: JSON.stringify({ action: 'logout' }),
56
56
  }),
57
57
 
58
58
  getSession: () =>
59
- this.request('/diviswap', { params: { resource: 'session' } }),
59
+ this.request('/liberex', { params: { resource: 'session' } }),
60
60
 
61
61
  // Transactions
62
62
  createTransaction: (data: any) =>
63
- this.request('/diviswap', {
63
+ this.request('/liberex', {
64
64
  method: 'POST',
65
65
  body: JSON.stringify({ action: 'createTransaction', ...data }),
66
66
  }),
67
67
 
68
68
  getTransactions: (filters?: any) =>
69
- this.request('/diviswap', { params: { resource: 'transactions', ...filters } }),
69
+ this.request('/liberex', { params: { resource: 'transactions', ...filters } }),
70
70
 
71
71
  // Payees
72
72
  createPayee: (data: any) =>
73
- this.request('/diviswap', {
73
+ this.request('/liberex', {
74
74
  method: 'POST',
75
75
  body: JSON.stringify({ action: 'createPayee', ...data }),
76
76
  }),
77
77
 
78
78
  getPayees: () =>
79
- this.request('/diviswap', { params: { resource: 'payees' } }),
79
+ this.request('/liberex', { params: { resource: 'payees' } }),
80
80
 
81
81
  deletePayee: (id: string) =>
82
- this.request('/diviswap', {
82
+ this.request('/liberex', {
83
83
  method: 'DELETE',
84
84
  params: { resource: 'payee', id },
85
85
  }),
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { DiviswapProvider, useDiviswap } from '@diviswap/sdk/react';
2
+ import { LiberExProvider, useLiberEx } from '@99darwin/liberex-sdk/react';
3
3
  import { apiClient } from './api-client';
4
4
 
5
5
  function TransactionDemo() {
@@ -11,7 +11,7 @@ function TransactionDemo() {
11
11
  logout,
12
12
  createTransaction,
13
13
  getTransactions
14
- } = useDiviswap();
14
+ } = useLiberEx();
15
15
 
16
16
  const handleLogin = async () => {
17
17
  try {
@@ -44,8 +44,8 @@ function TransactionDemo() {
44
44
  }
45
45
 
46
46
  return (
47
- <div className="diviswap-demo">
48
- <h1>Diviswap Demo</h1>
47
+ <div className="liberex-demo">
48
+ <h1>LiberEx Demo</h1>
49
49
 
50
50
  {!user ? (
51
51
  <button onClick={handleLogin}>Login</button>
@@ -62,8 +62,8 @@ function TransactionDemo() {
62
62
 
63
63
  export default function App() {
64
64
  return (
65
- <DiviswapProvider>
65
+ <LiberExProvider>
66
66
  <TransactionDemo />
67
- </DiviswapProvider>
67
+ </LiberExProvider>
68
68
  );
69
69
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Example of using TanStack Query with Diviswap API routes
2
+ * Example of using TanStack Query with LiberEx API routes
3
3
  * This provides automatic caching, background refetching, and optimistic updates
4
4
  */
5
5
 
@@ -8,17 +8,17 @@ import { apiClient } from './api-client';
8
8
 
9
9
  // Query keys for cache invalidation
10
10
  const queryKeys = {
11
- user: ['diviswap', 'user'],
12
- transactions: (filters?: any) => ['diviswap', 'transactions', filters],
13
- payees: ['diviswap', 'payees'],
14
- fees: (amount: number) => ['diviswap', 'fees', amount],
11
+ user: ['liberex', 'user'],
12
+ transactions: (filters?: any) => ['liberex', 'transactions', filters],
13
+ payees: ['liberex', 'payees'],
14
+ fees: (amount: number) => ['liberex', 'fees', amount],
15
15
  };
16
16
 
17
17
  // User hooks
18
18
  export function useUser() {
19
19
  return useQuery({
20
20
  queryKey: queryKeys.user,
21
- queryFn: () => apiClient.diviswap.getSession(),
21
+ queryFn: () => apiClient.liberex.getSession(),
22
22
  retry: false,
23
23
  staleTime: 5 * 60 * 1000, // 5 minutes
24
24
  });
@@ -29,7 +29,7 @@ export function useLogin() {
29
29
 
30
30
  return useMutation({
31
31
  mutationFn: ({ email, password }: { email: string; password: string }) =>
32
- apiClient.diviswap.login(email, password),
32
+ apiClient.liberex.login(email, password),
33
33
  onSuccess: (data) => {
34
34
  queryClient.setQueryData(queryKeys.user, data.user);
35
35
  queryClient.invalidateQueries({ queryKey: queryKeys.transactions() });
@@ -42,7 +42,7 @@ export function useLogout() {
42
42
  const queryClient = useQueryClient();
43
43
 
44
44
  return useMutation({
45
- mutationFn: () => apiClient.diviswap.logout(),
45
+ mutationFn: () => apiClient.liberex.logout(),
46
46
  onSuccess: () => {
47
47
  queryClient.clear(); // Clear all cached data
48
48
  },
@@ -55,7 +55,7 @@ export function useTransactions(filters?: any) {
55
55
 
56
56
  return useQuery({
57
57
  queryKey: queryKeys.transactions(filters),
58
- queryFn: () => apiClient.diviswap.getTransactions(filters),
58
+ queryFn: () => apiClient.liberex.getTransactions(filters),
59
59
  enabled: !!user, // Only fetch if user is authenticated
60
60
  staleTime: 30 * 1000, // 30 seconds
61
61
  });
@@ -65,7 +65,7 @@ export function useCreateTransaction() {
65
65
  const queryClient = useQueryClient();
66
66
 
67
67
  return useMutation({
68
- mutationFn: (data: any) => apiClient.diviswap.createTransaction(data),
68
+ mutationFn: (data: any) => apiClient.liberex.createTransaction(data),
69
69
  onSuccess: () => {
70
70
  // Invalidate and refetch transactions
71
71
  queryClient.invalidateQueries({ queryKey: queryKeys.transactions() });
@@ -82,7 +82,7 @@ export function usePayees() {
82
82
 
83
83
  return useQuery({
84
84
  queryKey: queryKeys.payees,
85
- queryFn: () => apiClient.diviswap.getPayees(),
85
+ queryFn: () => apiClient.liberex.getPayees(),
86
86
  enabled: !!user,
87
87
  staleTime: 60 * 1000, // 1 minute
88
88
  });
@@ -92,7 +92,7 @@ export function useCreatePayee() {
92
92
  const queryClient = useQueryClient();
93
93
 
94
94
  return useMutation({
95
- mutationFn: (data: any) => apiClient.diviswap.createPayee(data),
95
+ mutationFn: (data: any) => apiClient.liberex.createPayee(data),
96
96
  onSuccess: (newPayee) => {
97
97
  // Optimistically add the new payee to the cache
98
98
  queryClient.setQueryData(queryKeys.payees, (old: any[] = []) => {
@@ -106,7 +106,7 @@ export function useDeletePayee() {
106
106
  const queryClient = useQueryClient();
107
107
 
108
108
  return useMutation({
109
- mutationFn: (id: string) => apiClient.diviswap.deletePayee(id),
109
+ mutationFn: (id: string) => apiClient.liberex.deletePayee(id),
110
110
  onMutate: async (deletedId) => {
111
111
  // Cancel in-flight queries
112
112
  await queryClient.cancelQueries({ queryKey: queryKeys.payees });
@@ -139,7 +139,7 @@ export function useDeletePayee() {
139
139
  export function useFeeCalculation(amount: number, enabled = true) {
140
140
  return useQuery({
141
141
  queryKey: queryKeys.fees(amount),
142
- queryFn: () => apiClient.diviswap.calculateFees(amount),
142
+ queryFn: () => apiClient.liberex.calculateFees(amount),
143
143
  enabled: enabled && amount > 0,
144
144
  staleTime: 5 * 60 * 1000, // 5 minutes
145
145
  gcTime: 10 * 60 * 1000, // 10 minutes (formerly cacheTime)
@@ -24,7 +24,7 @@ export async function POST(request: NextRequest) {
24
24
  const rawBody = await request.text();
25
25
 
26
26
  // Get signature from headers
27
- const signature = request.headers.get('x-diviswap-signature');
27
+ const signature = request.headers.get('x-liberex-signature');
28
28
 
29
29
  if (!signature) {
30
30
  return NextResponse.json(
@@ -34,9 +34,9 @@ export async function POST(request: NextRequest) {
34
34
  }
35
35
 
36
36
  // Verify signature
37
- const webhookSecret = process.env.DIVISWAP_WEBHOOK_SECRET;
37
+ const webhookSecret = process.env.LIBEREX_WEBHOOK_SECRET;
38
38
  if (!webhookSecret) {
39
- console.error('DIVISWAP_WEBHOOK_SECRET not configured');
39
+ console.error('LIBEREX_WEBHOOK_SECRET not configured');
40
40
  return NextResponse.json(
41
41
  { error: 'Webhook secret not configured' },
42
42
  { status: 500 }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diviswap/sdk",
3
- "version": "1.7.11",
3
+ "version": "1.7.14",
4
4
  "description": "Official Diviswap SDK - Crypto rails made simple",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -71,6 +71,7 @@
71
71
  "typescript": "^5.7.3"
72
72
  },
73
73
  "dependencies": {
74
+ "@diviswap/sdk": "1.7.12",
74
75
  "@solana/wallet-adapter-base": "0.9.27",
75
76
  "@solana/wallet-adapter-react": "0.15.39",
76
77
  "@solana/wallet-adapter-react-ui": "0.9.39",
@@ -49,8 +49,19 @@ export function getTemplate(templateName: string, data: any): string {
49
49
  // Fallback to inline templates
50
50
  templateSource = getInlineTemplateSource(templateName);
51
51
  }
52
-
53
- template = Handlebars.compile(templateSource);
52
+
53
+ // Escape JavaScript template literals to prevent Handlebars from interpreting them
54
+ // Replace ${ with a placeholder, compile, then replace back
55
+ const PLACEHOLDER = '__TEMPLATE_LITERAL_START__';
56
+ templateSource = templateSource.replace(/\$\{/g, PLACEHOLDER);
57
+
58
+ const compiledTemplate = Handlebars.compile(templateSource);
59
+
60
+ // Wrap to restore ${ after compilation
61
+ template = (data: any) => {
62
+ const result = compiledTemplate(data);
63
+ return result.replace(new RegExp(PLACEHOLDER, 'g'), '${');
64
+ };
54
65
  templateCache.set(templateName, template);
55
66
  }
56
67
 
@@ -1,16 +1,16 @@
1
1
  'use server';
2
2
 
3
- import { Diviswap } from '@diviswap/sdk';
4
- import type { Transaction, Payee } from '@diviswap/sdk';
3
+ import { LiberEx } from '@99darwin/liberex-sdk';
4
+ import type { Transaction, Payee } from '@99darwin/liberex-sdk';
5
5
  import { revalidatePath } from 'next/cache';
6
6
  import { cookies } from 'next/headers';
7
7
 
8
- // Initialize Diviswap SDK
9
- function getDiviswap() {
10
- return Diviswap.init({
11
- apiKey: process.env.DIVISWAP_API_KEY!,
12
- clientId: process.env.DIVISWAP_CLIENT_ID!,
13
- environment: (process.env.NEXT_PUBLIC_DIVISWAP_ENV as 'production' | 'sandbox') || 'production',
8
+ // Initialize LiberEx SDK
9
+ function getLiberEx() {
10
+ return LiberEx.init({
11
+ apiKey: process.env.LIBEREX_API_KEY!,
12
+ clientId: process.env.LIBEREX_CLIENT_ID!,
13
+ environment: (process.env.NEXT_PUBLIC_LIBEREX_ENV as 'production' | 'sandbox') || 'production',
14
14
  debug: true // Enable debug logging
15
15
  });
16
16
  }
@@ -18,7 +18,7 @@ function getDiviswap() {
18
18
  // Helper to get session token from cookies
19
19
  async function getSessionToken() {
20
20
  const cookieStore = await cookies();
21
- const session = cookieStore.get('diviswap_session');
21
+ const session = cookieStore.get('liberex_session');
22
22
  return session?.value;
23
23
  }
24
24
 
@@ -39,7 +39,7 @@ export async function createTransactionAction(data: {
39
39
  return { success: false, error: 'Not authenticated' };
40
40
  }
41
41
 
42
- const diviswap = getDiviswap();
42
+ const liberex = getLiberEx();
43
43
 
44
44
  // Use the appropriate method based on transaction type
45
45
  let transaction;
@@ -47,7 +47,7 @@ export async function createTransactionAction(data: {
47
47
  // Note: Onramp is not yet available in v1 API
48
48
  return { success: false, error: 'Onramp transactions are not yet available' };
49
49
  } else {
50
- transaction = await diviswap.transactions.offramp({
50
+ transaction = await liberex.transactions.offramp({
51
51
  amount: data.amount,
52
52
  currency: data.currency || 'USD',
53
53
  payeeId: data.payeeId!,
@@ -56,7 +56,7 @@ export async function createTransactionAction(data: {
56
56
  });
57
57
  }
58
58
 
59
- revalidatePath('/diviswap');
59
+ revalidatePath('/liberex');
60
60
  return { success: true, transaction };
61
61
  } catch (error) {
62
62
  return {
@@ -78,8 +78,8 @@ export async function getTransactionsAction(filters?: {
78
78
  return { success: false, error: 'Not authenticated' };
79
79
  }
80
80
 
81
- const diviswap = getDiviswap();
82
- const transactions = await diviswap.transactions.list(filters);
81
+ const liberex = getLiberEx();
82
+ const transactions = await liberex.transactions.list(filters);
83
83
 
84
84
  return { success: true, transactions };
85
85
  } catch (error) {
@@ -98,8 +98,8 @@ export async function getPayeesAction() {
98
98
  return { success: false, error: 'Not authenticated' };
99
99
  }
100
100
 
101
- const diviswap = getDiviswap();
102
- const payees = await diviswap.payees.list();
101
+ const liberex = getLiberEx();
102
+ const payees = await liberex.payees.list();
103
103
 
104
104
  return { success: true, payees };
105
105
  } catch (error) {
@@ -122,8 +122,8 @@ export async function createPayeeAction(data: {
122
122
  return { success: false, error: 'Not authenticated' };
123
123
  }
124
124
 
125
- const diviswap = getDiviswap();
126
- const payee = await diviswap.payees.create({
125
+ const liberex = getLiberEx();
126
+ const payee = await liberex.payees.create({
127
127
  nickname: data.nickname,
128
128
  accountNumber: data.accountNumber,
129
129
  routingNumber: data.routingNumber,
@@ -131,7 +131,7 @@ export async function createPayeeAction(data: {
131
131
  setAsDefault: false
132
132
  });
133
133
 
134
- revalidatePath('/diviswap');
134
+ revalidatePath('/liberex');
135
135
  return { success: true, payee };
136
136
  } catch (error) {
137
137
  return {
@@ -148,10 +148,10 @@ export async function deletePayeeAction(payeeId: string) {
148
148
  return { success: false, error: 'Not authenticated' };
149
149
  }
150
150
 
151
- const diviswap = getDiviswap();
152
- await diviswap.payees.delete(payeeId);
151
+ const liberex = getLiberEx();
152
+ await liberex.payees.delete(payeeId);
153
153
 
154
- revalidatePath('/diviswap');
154
+ revalidatePath('/liberex');
155
155
  return { success: true };
156
156
  } catch (error) {
157
157
  return {
@@ -169,8 +169,8 @@ export async function calculateFeesAction(data: {
169
169
  currency?: string;
170
170
  }) {
171
171
  try {
172
- const diviswap = getDiviswap();
173
- const fees = await diviswap.fees.calculateFees({
172
+ const liberex = getLiberEx();
173
+ const fees = await liberex.fees.calculateFees({
174
174
  amount: data.amount,
175
175
  userId: undefined // Optional: for per-user fees
176
176
  });
@@ -191,8 +191,8 @@ export async function getIntegratorFeesAction() {
191
191
  return { success: false, error: 'Not authenticated' };
192
192
  }
193
193
 
194
- const diviswap = getDiviswap();
195
- const fees = await diviswap.fees.getFees();
194
+ const liberex = getLiberEx();
195
+ const fees = await liberex.fees.getFees();
196
196
 
197
197
  return { success: true, fees };
198
198
  } catch (error) {
@@ -213,10 +213,10 @@ export async function updateIntegratorFeeAction(data: {
213
213
  return { success: false, error: 'Not authenticated' };
214
214
  }
215
215
 
216
- const diviswap = getDiviswap();
217
- const fee = await diviswap.fees.setFee(data);
216
+ const liberex = getLiberEx();
217
+ const fee = await liberex.fees.setFee(data);
218
218
 
219
- revalidatePath('/diviswap');
219
+ revalidatePath('/liberex');
220
220
  return { success: true, fee };
221
221
  } catch (error) {
222
222
  return {
@@ -235,8 +235,8 @@ export async function getCurrentUserAction() {
235
235
  return { success: false, user: null };
236
236
  }
237
237
 
238
- const diviswap = getDiviswap();
239
- const user = await diviswap.auth.getProfile();
238
+ const liberex = getLiberEx();
239
+ const user = await liberex.auth.getProfile();
240
240
 
241
241
  return { success: true, user };
242
242
  } catch (error) {
@@ -247,7 +247,7 @@ export async function getCurrentUserAction() {
247
247
  // Utility action for checking API status
248
248
  export async function checkApiStatusAction() {
249
249
  try {
250
- const diviswap = getDiviswap();
250
+ const liberex = getLiberEx();
251
251
  // Note: Health check endpoint not available in SDK
252
252
  return { success: true, status: 'OK' };
253
253
  } catch (error) {
@@ -34,7 +34,7 @@ export function useAuth() {
34
34
 
35
35
  const setCustomer = useCallback(async (customerId: string, customerEmail: string) => {
36
36
  try {
37
- const response = await fetch('/api/diviswap', {
37
+ const response = await fetch('/api/liberex', {
38
38
  method: 'POST',
39
39
  headers: { 'Content-Type': 'application/json' },
40
40
  body: JSON.stringify({
@@ -56,7 +56,7 @@ export function useAuth() {
56
56
 
57
57
  const clearCustomer = useCallback(async () => {
58
58
  try {
59
- await fetch('/api/diviswap', {
59
+ await fetch('/api/liberex', {
60
60
  method: 'POST',
61
61
  headers: { 'Content-Type': 'application/json' },
62
62
  body: JSON.stringify({ action: 'clearCustomer' })
@@ -106,7 +106,7 @@ export function useTransactions() {
106
106
  ...filters
107
107
  });
108
108
 
109
- const response = await fetch(`/api/diviswap?${queryParams}`);
109
+ const response = await fetch(`/api/liberex?${queryParams}`);
110
110
  if (!response.ok) throw new Error('Failed to fetch transactions');
111
111
 
112
112
  const data = await response.json();
@@ -129,7 +129,7 @@ export function useTransactions() {
129
129
  setError(null);
130
130
 
131
131
  try {
132
- const response = await fetch('/api/diviswap', {
132
+ const response = await fetch('/api/liberex', {
133
133
  method: 'POST',
134
134
  headers: { 'Content-Type': 'application/json' },
135
135
  body: JSON.stringify({
@@ -180,7 +180,7 @@ export function usePayees() {
180
180
  setError(null);
181
181
 
182
182
  try {
183
- const response = await fetch(`/api/diviswap?resource=payees&customerId=${customerId}&customerEmail=${customerEmail}`);
183
+ const response = await fetch(`/api/liberex?resource=payees&customerId=${customerId}&customerEmail=${customerEmail}`);
184
184
  if (!response.ok) throw new Error('Failed to fetch payees');
185
185
 
186
186
  const data = await response.json();
@@ -203,7 +203,7 @@ export function usePayees() {
203
203
  setError(null);
204
204
 
205
205
  try {
206
- const response = await fetch('/api/diviswap', {
206
+ const response = await fetch('/api/liberex', {
207
207
  method: 'POST',
208
208
  headers: { 'Content-Type': 'application/json' },
209
209
  body: JSON.stringify({
@@ -237,7 +237,7 @@ export function usePayees() {
237
237
  setError(null);
238
238
 
239
239
  try {
240
- const response = await fetch(`/api/diviswap?resource=payee&id=${id}&customerId=${customerId}&customerEmail=${customerEmail}`, {
240
+ const response = await fetch(`/api/liberex?resource=payee&id=${id}&customerId=${customerId}&customerEmail=${customerEmail}`, {
241
241
  method: 'DELETE'
242
242
  });
243
243
 
@@ -286,7 +286,7 @@ export function useKYC() {
286
286
  setError(null);
287
287
 
288
288
  try {
289
- const response = await fetch(`/api/diviswap?resource=kycStatus&customerId=${customerId}&customerEmail=${customerEmail}`);
289
+ const response = await fetch(`/api/liberex?resource=kycStatus&customerId=${customerId}&customerEmail=${customerEmail}`);
290
290
  if (!response.ok) throw new Error('Failed to fetch KYC status');
291
291
 
292
292
  const data = await response.json();
@@ -309,7 +309,7 @@ export function useKYC() {
309
309
  setError(null);
310
310
 
311
311
  try {
312
- const response = await fetch('/api/diviswap', {
312
+ const response = await fetch('/api/liberex', {
313
313
  method: 'POST',
314
314
  headers: { 'Content-Type': 'application/json' },
315
315
  body: JSON.stringify({
@@ -372,7 +372,7 @@ export function useFeeCalculator() {
372
372
  setError(null);
373
373
 
374
374
  try {
375
- const response = await fetch('/api/diviswap', {
375
+ const response = await fetch('/api/liberex', {
376
376
  method: 'POST',
377
377
  headers: { 'Content-Type': 'application/json' },
378
378
  body: JSON.stringify({