@oasisprotocol/privana-sdk 0.4.0 → 0.4.2

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.
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkRDMJGMI3_cjs = require('./chunk-RDMJGMI3.cjs');
4
+ var chunkCRJNDCDT_cjs = require('./chunk-CRJNDCDT.cjs');
5
5
  var react = require('react');
6
6
  var reactQuery = require('@tanstack/react-query');
7
7
  var wagmi = require('wagmi');
@@ -229,18 +229,18 @@ async function signWithdrawFromLockMessage({
229
229
 
230
230
  // src/sdk/hooks/use-privana-client.ts
231
231
  function usePrivanaClient() {
232
- const { client } = chunkRDMJGMI3_cjs.usePrivanaContext();
232
+ const { client } = chunkCRJNDCDT_cjs.usePrivanaContext();
233
233
  return client;
234
234
  }
235
235
  var hostedAuthExchangeInflight = /* @__PURE__ */ new Map();
236
236
  function normalizeHostedAuthError(error) {
237
- if (error instanceof chunkRDMJGMI3_cjs.AccountingApiError && error.detail) {
238
- return new chunkRDMJGMI3_cjs.HostedAuthError(error.detail);
237
+ if (error instanceof chunkCRJNDCDT_cjs.AccountingApiError && error.detail) {
238
+ return new chunkCRJNDCDT_cjs.HostedAuthError(error.detail);
239
239
  }
240
240
  if (error instanceof Error) {
241
241
  return error;
242
242
  }
243
- return new chunkRDMJGMI3_cjs.HostedAuthError("Hosted authentication failed.");
243
+ return new chunkCRJNDCDT_cjs.HostedAuthError("Hosted authentication failed.");
244
244
  }
245
245
  function useHostedRedirectAuth() {
246
246
  const {
@@ -251,30 +251,30 @@ function useHostedRedirectAuth() {
251
251
  setHostedAuthSession,
252
252
  clearHostedAuthSession,
253
253
  refreshHostedAuthSession
254
- } = chunkRDMJGMI3_cjs.usePrivanaContext();
254
+ } = chunkCRJNDCDT_cjs.usePrivanaContext();
255
255
  const [error, setError] = react.useState(null);
256
256
  const [isLoading, setIsLoading] = react.useState(false);
257
257
  const loginInflight = react.useRef(null);
258
258
  const completionInflight = react.useRef(null);
259
259
  const pendingStorageKey = react.useMemo(
260
- () => hostedAuthConfig ? chunkRDMJGMI3_cjs.createHostedAuthPendingStorageKey(client.getBaseUrl(), hostedAuthConfig) : null,
260
+ () => hostedAuthConfig ? chunkCRJNDCDT_cjs.createHostedAuthPendingStorageKey(client.getBaseUrl(), hostedAuthConfig) : null,
261
261
  [client, hostedAuthConfig]
262
262
  );
263
263
  const clearPendingLogin = react.useCallback(() => {
264
264
  if (!pendingStorageKey || typeof window === "undefined") return;
265
- chunkRDMJGMI3_cjs.clearHostedAuthPendingTransaction(window.sessionStorage, pendingStorageKey);
265
+ chunkCRJNDCDT_cjs.clearHostedAuthPendingTransaction(window.sessionStorage, pendingStorageKey);
266
266
  }, [pendingStorageKey]);
267
267
  const login = react.useCallback(async () => {
268
268
  if (!hostedAuthConfig) {
269
- throw new chunkRDMJGMI3_cjs.HostedAuthRequiredError(
269
+ throw new chunkCRJNDCDT_cjs.HostedAuthRequiredError(
270
270
  "Hosted redirect authentication is not configured for this provider."
271
271
  );
272
272
  }
273
273
  if (typeof window === "undefined") {
274
- throw new chunkRDMJGMI3_cjs.HostedAuthError("Hosted redirect authentication requires a browser environment.");
274
+ throw new chunkCRJNDCDT_cjs.HostedAuthError("Hosted redirect authentication requires a browser environment.");
275
275
  }
276
276
  if (!pendingStorageKey) {
277
- throw new chunkRDMJGMI3_cjs.HostedAuthError("Hosted redirect authentication storage is not configured.");
277
+ throw new chunkCRJNDCDT_cjs.HostedAuthError("Hosted redirect authentication storage is not configured.");
278
278
  }
279
279
  if (loginInflight.current) {
280
280
  return loginInflight.current;
@@ -283,10 +283,10 @@ function useHostedRedirectAuth() {
283
283
  setIsLoading(true);
284
284
  setError(null);
285
285
  try {
286
- const verifier = chunkRDMJGMI3_cjs.createPkceVerifier();
287
- const codeChallenge = await chunkRDMJGMI3_cjs.createPkceChallenge(verifier);
288
- const state = chunkRDMJGMI3_cjs.createHostedAuthState();
289
- chunkRDMJGMI3_cjs.persistHostedAuthPendingTransaction(window.sessionStorage, pendingStorageKey, {
286
+ const verifier = chunkCRJNDCDT_cjs.createPkceVerifier();
287
+ const codeChallenge = await chunkCRJNDCDT_cjs.createPkceChallenge(verifier);
288
+ const state = chunkCRJNDCDT_cjs.createHostedAuthState();
289
+ chunkCRJNDCDT_cjs.persistHostedAuthPendingTransaction(window.sessionStorage, pendingStorageKey, {
290
290
  codeVerifier: verifier,
291
291
  state
292
292
  });
@@ -315,15 +315,15 @@ function useHostedRedirectAuth() {
315
315
  }, [clearPendingLogin, client, hostedAuthConfig, networkConfig.chainId, pendingStorageKey]);
316
316
  const completeLogin = react.useCallback(async () => {
317
317
  if (!hostedAuthConfig) {
318
- throw new chunkRDMJGMI3_cjs.HostedAuthRequiredError(
318
+ throw new chunkCRJNDCDT_cjs.HostedAuthRequiredError(
319
319
  "Hosted redirect authentication is not configured for this provider."
320
320
  );
321
321
  }
322
322
  if (typeof window === "undefined") {
323
- throw new chunkRDMJGMI3_cjs.HostedAuthError("Hosted redirect authentication requires a browser environment.");
323
+ throw new chunkCRJNDCDT_cjs.HostedAuthError("Hosted redirect authentication requires a browser environment.");
324
324
  }
325
325
  if (!pendingStorageKey) {
326
- throw new chunkRDMJGMI3_cjs.HostedAuthError("Hosted redirect authentication storage is not configured.");
326
+ throw new chunkCRJNDCDT_cjs.HostedAuthError("Hosted redirect authentication storage is not configured.");
327
327
  }
328
328
  if (completionInflight.current) {
329
329
  return completionInflight.current;
@@ -333,30 +333,30 @@ function useHostedRedirectAuth() {
333
333
  setError(null);
334
334
  const callbackUrl = new URL(window.location.href);
335
335
  const cleanupCallbackUrl = () => {
336
- window.history.replaceState(null, "", chunkRDMJGMI3_cjs.stripHostedAuthCallbackParams(callbackUrl));
336
+ window.history.replaceState(null, "", chunkCRJNDCDT_cjs.stripHostedAuthCallbackParams(callbackUrl));
337
337
  };
338
338
  try {
339
- const callback = chunkRDMJGMI3_cjs.parseHostedAuthCallback(callbackUrl, hostedAuthConfig.redirectUri);
339
+ const callback = chunkCRJNDCDT_cjs.parseHostedAuthCallback(callbackUrl, hostedAuthConfig.redirectUri);
340
340
  if (!callback) {
341
341
  return null;
342
342
  }
343
- const pending = chunkRDMJGMI3_cjs.readHostedAuthPendingTransaction(window.sessionStorage, pendingStorageKey);
343
+ const pending = chunkCRJNDCDT_cjs.readHostedAuthPendingTransaction(window.sessionStorage, pendingStorageKey);
344
344
  if (!pending) {
345
345
  clearPendingLogin();
346
346
  cleanupCallbackUrl();
347
- throw new chunkRDMJGMI3_cjs.HostedAuthError(
347
+ throw new chunkCRJNDCDT_cjs.HostedAuthError(
348
348
  "Hosted authentication response could not be matched to a pending login request."
349
349
  );
350
350
  }
351
351
  if (!callback.state || callback.state !== pending.state) {
352
352
  clearPendingLogin();
353
353
  cleanupCallbackUrl();
354
- throw new chunkRDMJGMI3_cjs.HostedAuthStateMismatchError();
354
+ throw new chunkCRJNDCDT_cjs.HostedAuthStateMismatchError();
355
355
  }
356
356
  if ("error" in callback) {
357
357
  clearPendingLogin();
358
358
  cleanupCallbackUrl();
359
- throw new chunkRDMJGMI3_cjs.HostedAuthError(
359
+ throw new chunkCRJNDCDT_cjs.HostedAuthError(
360
360
  callback.errorDescription || callback.error || "Hosted authentication failed."
361
361
  );
362
362
  }
@@ -371,7 +371,7 @@ function useHostedRedirectAuth() {
371
371
  client_id: hostedAuthConfig.clientId,
372
372
  redirect_uri: hostedAuthConfig.redirectUri
373
373
  });
374
- const session = chunkRDMJGMI3_cjs.buildHostedAuthSession(response, hostedAuthConfig);
374
+ const session = chunkCRJNDCDT_cjs.buildHostedAuthSession(response, hostedAuthConfig);
375
375
  setHostedAuthSession(session);
376
376
  clearPendingLogin();
377
377
  cleanupCallbackUrl();
@@ -416,7 +416,7 @@ function useHostedRedirectAuth() {
416
416
  try {
417
417
  return await refreshHostedAuthSession();
418
418
  } catch (refreshError) {
419
- const normalizedError = refreshError instanceof Error ? refreshError : new chunkRDMJGMI3_cjs.HostedAuthError("Hosted authentication refresh failed.");
419
+ const normalizedError = refreshError instanceof Error ? refreshError : new chunkCRJNDCDT_cjs.HostedAuthError("Hosted authentication refresh failed.");
420
420
  setError(normalizedError);
421
421
  throw normalizedError;
422
422
  } finally {
@@ -436,12 +436,12 @@ function useHostedRedirectAuth() {
436
436
  }
437
437
  function useBalance(options = {}) {
438
438
  const queryClient = react.useContext(reactQuery.QueryClientContext);
439
- const accountingContext = chunkRDMJGMI3_cjs.useSafePrivanaContext();
439
+ const accountingContext = chunkCRJNDCDT_cjs.useSafePrivanaContext();
440
440
  const hasProviders = !!queryClient && !!accountingContext;
441
441
  const client = accountingContext?.client;
442
442
  const defaultToken = accountingContext?.defaultToken;
443
443
  const pollingInterval = accountingContext?.pollingInterval ?? 1e4;
444
- const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkRDMJGMI3_cjs.usePrivateReadRequest();
444
+ const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkCRJNDCDT_cjs.usePrivateReadRequest();
445
445
  const tokenId = options.tokenId ?? defaultToken?.id;
446
446
  const query = reactQuery.useQuery({
447
447
  queryKey: ["accounting-balance", ...privateReadQueryScope, tokenId],
@@ -458,7 +458,7 @@ function useBalance(options = {}) {
458
458
  return {
459
459
  balance: balanceWei,
460
460
  balanceWei,
461
- balanceFormatted: chunkRDMJGMI3_cjs.formatTokenAmount(balanceWei),
461
+ balanceFormatted: chunkCRJNDCDT_cjs.formatTokenAmount(balanceWei),
462
462
  tokenSymbol: query.data?.token_symbol ?? "",
463
463
  chainId: query.data?.chain_id ?? "",
464
464
  isLoading: query.isPending || query.isLoading,
@@ -468,8 +468,8 @@ function useBalance(options = {}) {
468
468
  };
469
469
  }
470
470
  function useBatchBalances(options) {
471
- const { client, pollingInterval } = chunkRDMJGMI3_cjs.usePrivanaContext();
472
- const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkRDMJGMI3_cjs.usePrivateReadRequest();
471
+ const { client, pollingInterval } = chunkCRJNDCDT_cjs.usePrivanaContext();
472
+ const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkCRJNDCDT_cjs.usePrivateReadRequest();
473
473
  const query = reactQuery.useQuery({
474
474
  queryKey: ["accounting-batch-balances", ...privateReadQueryScope, options.tokenIds],
475
475
  queryFn: async () => {
@@ -495,7 +495,7 @@ function useEnsureCorrectChain() {
495
495
  async (expectedChainId, timeoutMs, pollIntervalMs = 250) => {
496
496
  const startedAt = Date.now();
497
497
  while (Date.now() - startedAt < timeoutMs) {
498
- const currentChainId = chunkRDMJGMI3_cjs.getChainId2(config);
498
+ const currentChainId = chunkCRJNDCDT_cjs.getChainId2(config);
499
499
  if (currentChainId === expectedChainId) return true;
500
500
  await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
501
501
  }
@@ -505,7 +505,7 @@ function useEnsureCorrectChain() {
505
505
  );
506
506
  const ensureCorrectChain = react.useCallback(
507
507
  async (targetChainId) => {
508
- const currentChainId = chunkRDMJGMI3_cjs.getChainId2(config);
508
+ const currentChainId = chunkCRJNDCDT_cjs.getChainId2(config);
509
509
  if (currentChainId === targetChainId) return false;
510
510
  let switchErrorMessage;
511
511
  try {
@@ -572,11 +572,11 @@ function clearPendingDeposit(address) {
572
572
  }
573
573
  function useDeposit(options = {}) {
574
574
  const { address } = wagmi.useAccount();
575
- const { client, enabledTokens, getChainById: getChainById2 } = chunkRDMJGMI3_cjs.usePrivanaContext();
575
+ const { client, enabledTokens, getChainById: getChainById2 } = chunkCRJNDCDT_cjs.usePrivanaContext();
576
576
  const { data: walletClient } = wagmi.useWalletClient();
577
577
  const queryClient = reactQuery.useQueryClient();
578
578
  const config = wagmi.useConfig();
579
- const { executePrivateRead } = chunkRDMJGMI3_cjs.usePrivateReadRequest();
579
+ const { executePrivateRead } = chunkCRJNDCDT_cjs.usePrivateReadRequest();
580
580
  const confirmations = options.confirmations ?? 15;
581
581
  const [depositAddress, setDepositAddress] = react.useState(null);
582
582
  const [txHash, setTxHash] = react.useState();
@@ -611,7 +611,7 @@ function useDeposit(options = {}) {
611
611
  error: verificationError,
612
612
  verify,
613
613
  reset: resetVerification
614
- } = chunkRDMJGMI3_cjs.useDepositVerification({
614
+ } = chunkCRJNDCDT_cjs.useDepositVerification({
615
615
  pollInterval: options.pollInterval,
616
616
  pollTimeout: options.pollTimeout,
617
617
  onCredited: (hash, response) => {
@@ -699,12 +699,12 @@ function useDeposit(options = {}) {
699
699
  try {
700
700
  let confirmed = false;
701
701
  try {
702
- await chunkRDMJGMI3_cjs.getTransactionReceipt(config, { hash, chainId: persisted.chainId });
702
+ await chunkCRJNDCDT_cjs.getTransactionReceipt(config, { hash, chainId: persisted.chainId });
703
703
  confirmed = true;
704
704
  } catch {
705
705
  }
706
706
  if (!confirmed) {
707
- await chunkRDMJGMI3_cjs.waitForTransactionReceipt(config, {
707
+ await chunkCRJNDCDT_cjs.waitForTransactionReceipt(config, {
708
708
  hash,
709
709
  chainId: persisted.chainId,
710
710
  confirmations
@@ -791,7 +791,7 @@ function useDeposit(options = {}) {
791
791
  try {
792
792
  setIsWaitingForConfirmation(true);
793
793
  try {
794
- await chunkRDMJGMI3_cjs.waitForTransactionReceipt(config, {
794
+ await chunkCRJNDCDT_cjs.waitForTransactionReceipt(config, {
795
795
  hash,
796
796
  chainId: sourceChain.id,
797
797
  confirmations
@@ -865,7 +865,7 @@ function useDeposit(options = {}) {
865
865
  function useWithdraw(options = {}) {
866
866
  const { address } = wagmi.useAccount();
867
867
  const { data: walletClient } = wagmi.useWalletClient();
868
- const { client, networkConfig } = chunkRDMJGMI3_cjs.usePrivanaContext();
868
+ const { client, networkConfig } = chunkCRJNDCDT_cjs.usePrivanaContext();
869
869
  const queryClient = reactQuery.useQueryClient();
870
870
  const { chainId, ensureCorrectChain } = useEnsureCorrectChain();
871
871
  const pollInterval = options.pollInterval ?? 3e3;
@@ -1064,7 +1064,7 @@ function useWithdraw(options = {}) {
1064
1064
  function useLockFunds(options = {}) {
1065
1065
  const { address } = wagmi.useAccount();
1066
1066
  const { data: walletClient } = wagmi.useWalletClient();
1067
- const { client, networkConfig, serviceAddress } = chunkRDMJGMI3_cjs.usePrivanaContext();
1067
+ const { client, networkConfig, serviceAddress } = chunkCRJNDCDT_cjs.usePrivanaContext();
1068
1068
  const queryClient = reactQuery.useQueryClient();
1069
1069
  const mutation = reactQuery.useMutation({
1070
1070
  mutationFn: async (params) => {
@@ -1123,7 +1123,7 @@ function useLockFunds(options = {}) {
1123
1123
  }
1124
1124
  function useUnlockFunds(options = {}) {
1125
1125
  const { address } = wagmi.useAccount();
1126
- const { client } = chunkRDMJGMI3_cjs.usePrivanaContext();
1126
+ const { client } = chunkCRJNDCDT_cjs.usePrivanaContext();
1127
1127
  const queryClient = reactQuery.useQueryClient();
1128
1128
  const unlockMutation = reactQuery.useMutation({
1129
1129
  mutationFn: async (params) => {
@@ -1141,6 +1141,7 @@ function useUnlockFunds(options = {}) {
1141
1141
  queryClient.invalidateQueries({ queryKey: ["accounting-locked-funds"] });
1142
1142
  queryClient.invalidateQueries({ queryKey: ["accounting-total-locked-balance"] });
1143
1143
  queryClient.invalidateQueries({ queryKey: ["accounting-expired-locks"] });
1144
+ queryClient.invalidateQueries({ queryKey: ["accounting-history"] });
1144
1145
  },
1145
1146
  onError: (error) => {
1146
1147
  options.onError?.(error);
@@ -1161,6 +1162,7 @@ function useUnlockFunds(options = {}) {
1161
1162
  queryClient.invalidateQueries({ queryKey: ["accounting-locked-funds"] });
1162
1163
  queryClient.invalidateQueries({ queryKey: ["accounting-total-locked-balance"] });
1163
1164
  queryClient.invalidateQueries({ queryKey: ["accounting-expired-locks"] });
1165
+ queryClient.invalidateQueries({ queryKey: ["accounting-history"] });
1164
1166
  },
1165
1167
  onError: (error) => {
1166
1168
  options.onError?.(error);
@@ -1191,7 +1193,7 @@ function useUnlockFunds(options = {}) {
1191
1193
  function useTransfer(options = {}) {
1192
1194
  const { address } = wagmi.useAccount();
1193
1195
  const { data: walletClient } = wagmi.useWalletClient();
1194
- const { client, networkConfig, serviceAddress } = chunkRDMJGMI3_cjs.usePrivanaContext();
1196
+ const { client, networkConfig, serviceAddress } = chunkCRJNDCDT_cjs.usePrivanaContext();
1195
1197
  const queryClient = reactQuery.useQueryClient();
1196
1198
  const transferMutation = reactQuery.useMutation({
1197
1199
  mutationFn: async (params) => {
@@ -1296,8 +1298,8 @@ function useTransfer(options = {}) {
1296
1298
  };
1297
1299
  }
1298
1300
  function useLockedFunds(options = {}) {
1299
- const { client, pollingInterval, serviceAddress } = chunkRDMJGMI3_cjs.usePrivanaContext();
1300
- const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkRDMJGMI3_cjs.usePrivateReadRequest();
1301
+ const { client, pollingInterval, serviceAddress } = chunkCRJNDCDT_cjs.usePrivanaContext();
1302
+ const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkCRJNDCDT_cjs.usePrivateReadRequest();
1301
1303
  const query = reactQuery.useQuery({
1302
1304
  queryKey: ["accounting-locked-funds", ...privateReadQueryScope, serviceAddress ?? null],
1303
1305
  queryFn: async () => {
@@ -1319,8 +1321,8 @@ function useLockedFunds(options = {}) {
1319
1321
  };
1320
1322
  }
1321
1323
  function useTotalLockedBalance(options = {}) {
1322
- const { client, pollingInterval, defaultToken } = chunkRDMJGMI3_cjs.usePrivanaContext();
1323
- const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkRDMJGMI3_cjs.usePrivateReadRequest();
1324
+ const { client, pollingInterval, defaultToken } = chunkCRJNDCDT_cjs.usePrivanaContext();
1325
+ const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkCRJNDCDT_cjs.usePrivateReadRequest();
1324
1326
  const tokenId = options.tokenId ?? defaultToken?.id;
1325
1327
  const query = reactQuery.useQuery({
1326
1328
  queryKey: ["accounting-total-locked-balance", ...privateReadQueryScope, tokenId],
@@ -1341,8 +1343,8 @@ function useTotalLockedBalance(options = {}) {
1341
1343
  };
1342
1344
  }
1343
1345
  function useExpiredLocks(options = {}) {
1344
- const { client, pollingInterval } = chunkRDMJGMI3_cjs.usePrivanaContext();
1345
- const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkRDMJGMI3_cjs.usePrivateReadRequest();
1346
+ const { client, pollingInterval } = chunkCRJNDCDT_cjs.usePrivanaContext();
1347
+ const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkCRJNDCDT_cjs.usePrivateReadRequest();
1346
1348
  const query = reactQuery.useQuery({
1347
1349
  queryKey: ["accounting-expired-locks", ...privateReadQueryScope],
1348
1350
  queryFn: async () => {
@@ -1364,7 +1366,7 @@ function useExpiredLocks(options = {}) {
1364
1366
  }
1365
1367
  function usePendingWithdrawals(options = {}) {
1366
1368
  const { address, isConnected } = wagmi.useAccount();
1367
- const { client, pollingInterval } = chunkRDMJGMI3_cjs.usePrivanaContext();
1369
+ const { client, pollingInterval } = chunkCRJNDCDT_cjs.usePrivanaContext();
1368
1370
  const query = reactQuery.useQuery({
1369
1371
  queryKey: ["accounting-pending-withdrawals", address],
1370
1372
  queryFn: async () => {
@@ -1400,8 +1402,8 @@ function usePendingWithdrawals(options = {}) {
1400
1402
  };
1401
1403
  }
1402
1404
  function useHistory(options = {}) {
1403
- const { client, pollingInterval } = chunkRDMJGMI3_cjs.usePrivanaContext();
1404
- const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkRDMJGMI3_cjs.usePrivateReadRequest();
1405
+ const { client, pollingInterval } = chunkCRJNDCDT_cjs.usePrivanaContext();
1406
+ const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkCRJNDCDT_cjs.usePrivateReadRequest();
1405
1407
  const offset = options.offset ?? -1;
1406
1408
  const limit = options.limit ?? 50;
1407
1409
  const query = reactQuery.useQuery({
@@ -1425,7 +1427,7 @@ function useHistory(options = {}) {
1425
1427
  };
1426
1428
  }
1427
1429
  function useTokenInfo(options = {}) {
1428
- const { client } = chunkRDMJGMI3_cjs.usePrivanaContext();
1430
+ const { client } = chunkCRJNDCDT_cjs.usePrivanaContext();
1429
1431
  const { tokenId } = options;
1430
1432
  const query = reactQuery.useQuery({
1431
1433
  queryKey: ["accounting-token-info", tokenId],
@@ -1445,7 +1447,7 @@ function useTokenInfo(options = {}) {
1445
1447
  };
1446
1448
  }
1447
1449
  function useTokenList(options = {}) {
1448
- const { client } = chunkRDMJGMI3_cjs.usePrivanaContext();
1450
+ const { client } = chunkCRJNDCDT_cjs.usePrivanaContext();
1449
1451
  const query = reactQuery.useQuery({
1450
1452
  queryKey: ["accounting-token-list"],
1451
1453
  queryFn: () => client.listTokens(),
@@ -1463,7 +1465,7 @@ function useTokenList(options = {}) {
1463
1465
  function useModifyLock(options = {}) {
1464
1466
  const { address } = wagmi.useAccount();
1465
1467
  const { data: walletClient } = wagmi.useWalletClient();
1466
- const { client, networkConfig } = chunkRDMJGMI3_cjs.usePrivanaContext();
1468
+ const { client, networkConfig } = chunkCRJNDCDT_cjs.usePrivanaContext();
1467
1469
  const queryClient = reactQuery.useQueryClient();
1468
1470
  const mutation = reactQuery.useMutation({
1469
1471
  mutationFn: async (params) => {
@@ -1495,6 +1497,7 @@ function useModifyLock(options = {}) {
1495
1497
  queryClient.invalidateQueries({ queryKey: ["accounting-balance"] });
1496
1498
  queryClient.invalidateQueries({ queryKey: ["accounting-locked-funds"] });
1497
1499
  queryClient.invalidateQueries({ queryKey: ["accounting-total-locked-balance"] });
1500
+ queryClient.invalidateQueries({ queryKey: ["accounting-history"] });
1498
1501
  },
1499
1502
  onError: (error) => {
1500
1503
  options.onError?.(error);
@@ -1529,7 +1532,7 @@ function DialogOverlay({
1529
1532
  {
1530
1533
  "data-slot": "dialog-overlay",
1531
1534
  "data-privana": true,
1532
- className: chunkRDMJGMI3_cjs.cn(
1535
+ className: chunkCRJNDCDT_cjs.cn(
1533
1536
  "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
1534
1537
  className
1535
1538
  ),
@@ -1551,7 +1554,7 @@ function DialogContent({
1551
1554
  {
1552
1555
  "data-slot": "dialog-content",
1553
1556
  "data-privana": true,
1554
- className: chunkRDMJGMI3_cjs.cn(
1557
+ className: chunkCRJNDCDT_cjs.cn(
1555
1558
  "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",
1556
1559
  className
1557
1560
  ),
@@ -1579,7 +1582,7 @@ function DialogHeader({ className, ...props }) {
1579
1582
  "div",
1580
1583
  {
1581
1584
  "data-slot": "dialog-header",
1582
- className: chunkRDMJGMI3_cjs.cn("flex flex-col gap-2 text-center sm:text-left", className),
1585
+ className: chunkCRJNDCDT_cjs.cn("flex flex-col gap-2 text-center sm:text-left", className),
1583
1586
  ...props
1584
1587
  }
1585
1588
  );
@@ -1589,7 +1592,7 @@ function DialogTitle({ className, ...props }) {
1589
1592
  DialogPrimitive__namespace.Title,
1590
1593
  {
1591
1594
  "data-slot": "dialog-title",
1592
- className: chunkRDMJGMI3_cjs.cn("text-lg leading-none font-semibold", className),
1595
+ className: chunkCRJNDCDT_cjs.cn("text-lg leading-none font-semibold", className),
1593
1596
  ...props
1594
1597
  }
1595
1598
  );
@@ -1602,7 +1605,7 @@ function DialogDescription({
1602
1605
  DialogPrimitive__namespace.Description,
1603
1606
  {
1604
1607
  "data-slot": "dialog-description",
1605
- className: chunkRDMJGMI3_cjs.cn("text-muted-foreground text-sm", className),
1608
+ className: chunkCRJNDCDT_cjs.cn("text-muted-foreground text-sm", className),
1606
1609
  ...props
1607
1610
  }
1608
1611
  );
@@ -1957,7 +1960,7 @@ function DepositForm({
1957
1960
  onSuccess
1958
1961
  }) {
1959
1962
  const { isConnected, address } = wagmi.useAccount();
1960
- const { chains, getChainById: getChainById2 } = chunkRDMJGMI3_cjs.usePrivanaContext();
1963
+ const { chains, getChainById: getChainById2 } = chunkCRJNDCDT_cjs.usePrivanaContext();
1961
1964
  const [amount, setAmount] = react.useState("");
1962
1965
  const [showSuccess, setShowSuccess] = react.useState(false);
1963
1966
  const [showTimeout, setShowTimeout] = react.useState(false);
@@ -1982,7 +1985,7 @@ function DepositForm({
1982
1985
  }
1983
1986
  });
1984
1987
  const walletBalance = isNative ? nativeBalanceData?.value : erc20Balance;
1985
- const formattedWalletBalance = walletBalance ? chunkRDMJGMI3_cjs.formatTokenAmount(walletBalance.toString(), selectedToken.decimals) : "0.00";
1988
+ const formattedWalletBalance = walletBalance ? chunkCRJNDCDT_cjs.formatTokenAmount(walletBalance.toString(), selectedToken.decimals) : "0.00";
1986
1989
  const handleMaxClick = () => {
1987
1990
  if (formattedWalletBalance && parseFloat(formattedWalletBalance) > 0) {
1988
1991
  setAmount(formattedWalletBalance.replace(/[\s\u2009]/g, ""));
@@ -1990,7 +1993,7 @@ function DepositForm({
1990
1993
  };
1991
1994
  const hasValidAmount = amount && parseFloat(amount) > 0;
1992
1995
  const tooManyDecimals = hasValidAmount && amount.includes(".") && amount.split(".")[1].length > selectedToken.decimals;
1993
- const exceedsBalance = hasValidAmount && !tooManyDecimals && walletBalance != null && chunkRDMJGMI3_cjs.parseTokenAmount(amount, selectedToken.decimals) > walletBalance;
1996
+ const exceedsBalance = hasValidAmount && !tooManyDecimals && walletBalance != null && chunkCRJNDCDT_cjs.parseTokenAmount(amount, selectedToken.decimals) > walletBalance;
1994
1997
  const {
1995
1998
  txHash,
1996
1999
  isGettingAddress,
@@ -2075,7 +2078,7 @@ function DepositForm({
2075
2078
  const handleSubmit = async () => {
2076
2079
  if (!amount || !selectedToken || exceedsBalance) return;
2077
2080
  setCancelled(false);
2078
- const amountInWei = chunkRDMJGMI3_cjs.parseTokenAmount(amount, selectedToken.decimals);
2081
+ const amountInWei = chunkCRJNDCDT_cjs.parseTokenAmount(amount, selectedToken.decimals);
2079
2082
  await deposit({
2080
2083
  tokenId: selectedToken.id,
2081
2084
  amount: amountInWei
@@ -2178,7 +2181,7 @@ function DepositForm({
2178
2181
  setAmount(value);
2179
2182
  }
2180
2183
  },
2181
- className: chunkRDMJGMI3_cjs.cn(
2184
+ className: chunkCRJNDCDT_cjs.cn(
2182
2185
  "text-foreground flex-1 bg-transparent text-sm outline-none",
2183
2186
  "placeholder:text-muted-foreground/50"
2184
2187
  )
@@ -2205,7 +2208,7 @@ function DepositForm({
2205
2208
  {
2206
2209
  onClick: handleSubmit,
2207
2210
  disabled: !isConnected || !hasValidAmount || tooManyDecimals || !!exceedsBalance || isPending,
2208
- className: chunkRDMJGMI3_cjs.cn(
2211
+ className: chunkCRJNDCDT_cjs.cn(
2209
2212
  "flex h-10 w-full cursor-pointer items-center justify-center rounded-[10px] px-3 py-2 text-sm font-medium transition-colors",
2210
2213
  "bg-primary text-primary-foreground hover:bg-primary/90",
2211
2214
  "disabled:cursor-not-allowed disabled:opacity-50"
@@ -2222,7 +2225,7 @@ function WithdrawForm({
2222
2225
  onUnsafeToCloseChange
2223
2226
  }) {
2224
2227
  const { isConnected, address } = wagmi.useAccount();
2225
- const { chains, getChainById: getChainById2 } = chunkRDMJGMI3_cjs.usePrivanaContext();
2228
+ const { chains, getChainById: getChainById2 } = chunkCRJNDCDT_cjs.usePrivanaContext();
2226
2229
  const [amount, setAmount] = react.useState("");
2227
2230
  const [showSuccess, setShowSuccess] = react.useState(false);
2228
2231
  const [showTimeout, setShowTimeout] = react.useState(false);
@@ -2235,7 +2238,7 @@ function WithdrawForm({
2235
2238
  } = useBalance({
2236
2239
  tokenId: selectedToken.id
2237
2240
  });
2238
- const formattedBalance = chunkRDMJGMI3_cjs.formatTokenAmount(balanceWei, selectedToken.decimals);
2241
+ const formattedBalance = chunkCRJNDCDT_cjs.formatTokenAmount(balanceWei, selectedToken.decimals);
2239
2242
  const { withdraw, isPending, currentStep, error, reset } = useWithdraw({
2240
2243
  onProcessingSuccess: () => {
2241
2244
  setAmount("");
@@ -2246,7 +2249,7 @@ function WithdrawForm({
2246
2249
  setShowTimeout(true);
2247
2250
  }
2248
2251
  });
2249
- const explorerUrl = address && targetChain ? chunkRDMJGMI3_cjs.getExplorerAddressUrl(targetChain.id, address) : void 0;
2252
+ const explorerUrl = address && targetChain ? chunkCRJNDCDT_cjs.getExplorerAddressUrl(targetChain.id, address) : void 0;
2250
2253
  const getStepStatus = (step, after) => {
2251
2254
  if (currentStep === step) return "active";
2252
2255
  if (after.includes(currentStep)) return "completed";
@@ -2290,7 +2293,7 @@ function WithdrawForm({
2290
2293
  const handleWithdraw = async () => {
2291
2294
  if (!amount || !selectedToken || exceedsBalance) return;
2292
2295
  setCancelled(false);
2293
- const amountInWei = chunkRDMJGMI3_cjs.parseTokenAmount(amount, selectedToken.decimals);
2296
+ const amountInWei = chunkCRJNDCDT_cjs.parseTokenAmount(amount, selectedToken.decimals);
2294
2297
  await withdraw({
2295
2298
  tokenId: selectedToken.id,
2296
2299
  amount: amountInWei
@@ -2303,7 +2306,7 @@ function WithdrawForm({
2303
2306
  };
2304
2307
  const hasValidAmount = amount && parseFloat(amount) > 0;
2305
2308
  const tooManyDecimals = hasValidAmount && amount.includes(".") && amount.split(".")[1].length > selectedToken.decimals;
2306
- const exceedsBalance = hasValidAmount && !tooManyDecimals && !isBalanceLoading && !isBalanceError && chunkRDMJGMI3_cjs.parseTokenAmount(amount, selectedToken.decimals) > BigInt(balanceWei);
2309
+ const exceedsBalance = hasValidAmount && !tooManyDecimals && !isBalanceLoading && !isBalanceError && chunkCRJNDCDT_cjs.parseTokenAmount(amount, selectedToken.decimals) > BigInt(balanceWei);
2307
2310
  const getButtonText = () => {
2308
2311
  if (!isConnected) return "Connect Wallet";
2309
2312
  return "Withdraw";
@@ -2386,7 +2389,7 @@ function WithdrawForm({
2386
2389
  setAmount(value);
2387
2390
  }
2388
2391
  },
2389
- className: chunkRDMJGMI3_cjs.cn(
2392
+ className: chunkCRJNDCDT_cjs.cn(
2390
2393
  "text-foreground flex-1 bg-transparent text-sm outline-none",
2391
2394
  "placeholder:text-muted-foreground/50"
2392
2395
  )
@@ -2413,7 +2416,7 @@ function WithdrawForm({
2413
2416
  {
2414
2417
  onClick: handleWithdraw,
2415
2418
  disabled: !isConnected || !hasValidAmount || tooManyDecimals || !!exceedsBalance || isPending,
2416
- className: chunkRDMJGMI3_cjs.cn(
2419
+ className: chunkCRJNDCDT_cjs.cn(
2417
2420
  "flex h-10 w-full cursor-pointer items-center justify-center rounded-[10px] px-3 py-2 text-sm font-medium transition-colors",
2418
2421
  "bg-primary text-primary-foreground hover:bg-primary/90",
2419
2422
  "disabled:cursor-not-allowed disabled:opacity-50"
@@ -2468,7 +2471,7 @@ function ChevronDown({ collapsed }) {
2468
2471
  width: "12",
2469
2472
  height: "6",
2470
2473
  viewBox: "0 0 12 6",
2471
- className: chunkRDMJGMI3_cjs.cn("transition-transform", collapsed && "-rotate-90"),
2474
+ className: chunkCRJNDCDT_cjs.cn("transition-transform", collapsed && "-rotate-90"),
2472
2475
  children: /* @__PURE__ */ jsxRuntime.jsx(
2473
2476
  "path",
2474
2477
  {
@@ -2494,15 +2497,15 @@ function BalanceCards({
2494
2497
  tokenId: selectedToken.id
2495
2498
  });
2496
2499
  const { totalLocked, isLoading: lockedLoading } = useLockedFunds({ enabled: showLockedFunds });
2497
- const formattedBalance = chunkRDMJGMI3_cjs.formatTokenAmount(balanceWei, selectedToken.decimals);
2498
- const formattedLocked = showLockedFunds ? chunkRDMJGMI3_cjs.formatTokenAmount(String(totalLocked), selectedToken.decimals) : "0.00";
2499
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkRDMJGMI3_cjs.cn("flex gap-2", disabled && "opacity-50"), children: [
2500
+ const formattedBalance = chunkCRJNDCDT_cjs.formatTokenAmount(balanceWei, selectedToken.decimals);
2501
+ const formattedLocked = showLockedFunds ? chunkCRJNDCDT_cjs.formatTokenAmount(String(totalLocked), selectedToken.decimals) : "0.00";
2502
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkCRJNDCDT_cjs.cn("flex gap-2", disabled && "opacity-50"), children: [
2500
2503
  /* @__PURE__ */ jsxRuntime.jsxs(
2501
2504
  "button",
2502
2505
  {
2503
2506
  onClick: onBalanceClick,
2504
2507
  disabled,
2505
- className: chunkRDMJGMI3_cjs.cn(
2508
+ className: chunkCRJNDCDT_cjs.cn(
2506
2509
  "bg-muted flex flex-1 flex-col gap-2 rounded-[10px] p-5 text-left transition-colors",
2507
2510
  disabled ? "cursor-not-allowed" : "hover:bg-muted/80 cursor-pointer"
2508
2511
  ),
@@ -2523,7 +2526,7 @@ function BalanceCards({
2523
2526
  {
2524
2527
  onClick: onLockedFundsClick,
2525
2528
  disabled,
2526
- className: chunkRDMJGMI3_cjs.cn(
2529
+ className: chunkCRJNDCDT_cjs.cn(
2527
2530
  "bg-muted flex flex-1 flex-col gap-2 rounded-[10px] p-5 text-left transition-colors",
2528
2531
  disabled ? "cursor-not-allowed" : "hover:bg-muted/80 cursor-pointer"
2529
2532
  ),
@@ -2549,7 +2552,7 @@ function Tabs({
2549
2552
  return /* @__PURE__ */ jsxRuntime.jsxs(
2550
2553
  "div",
2551
2554
  {
2552
- className: chunkRDMJGMI3_cjs.cn(
2555
+ className: chunkCRJNDCDT_cjs.cn(
2553
2556
  "bg-muted relative flex gap-2 overflow-hidden rounded-[10px] p-1",
2554
2557
  disabled && "opacity-50"
2555
2558
  ),
@@ -2557,7 +2560,7 @@ function Tabs({
2557
2560
  /* @__PURE__ */ jsxRuntime.jsx(
2558
2561
  "div",
2559
2562
  {
2560
- className: chunkRDMJGMI3_cjs.cn(
2563
+ className: chunkCRJNDCDT_cjs.cn(
2561
2564
  "bg-input absolute top-1 bottom-1 left-1 w-[calc(50%-8px)] rounded-md transition-transform duration-200",
2562
2565
  activeTab === "withdraw" && "translate-x-[calc(100%+8px)]"
2563
2566
  )
@@ -2568,7 +2571,7 @@ function Tabs({
2568
2571
  {
2569
2572
  onClick: () => !disabled && onTabChange("deposit"),
2570
2573
  disabled,
2571
- className: chunkRDMJGMI3_cjs.cn(
2574
+ className: chunkCRJNDCDT_cjs.cn(
2572
2575
  "relative z-10 flex-1 rounded-md px-3 py-[9px] text-sm transition-colors",
2573
2576
  activeTab === "deposit" ? "text-foreground" : "text-muted-foreground",
2574
2577
  disabled ? "cursor-not-allowed" : "cursor-pointer"
@@ -2581,7 +2584,7 @@ function Tabs({
2581
2584
  {
2582
2585
  onClick: () => !disabled && onTabChange("withdraw"),
2583
2586
  disabled,
2584
- className: chunkRDMJGMI3_cjs.cn(
2587
+ className: chunkCRJNDCDT_cjs.cn(
2585
2588
  "relative z-10 flex-1 rounded-md px-3 py-[9px] text-sm transition-colors",
2586
2589
  activeTab === "withdraw" ? "text-foreground" : "text-muted-foreground",
2587
2590
  disabled ? "cursor-not-allowed" : "cursor-pointer"
@@ -2594,14 +2597,14 @@ function Tabs({
2594
2597
  );
2595
2598
  }
2596
2599
  function LockedFundsView({ onBack }) {
2597
- const { getTokenById } = chunkRDMJGMI3_cjs.usePrivanaContext();
2600
+ const { getTokenById } = chunkCRJNDCDT_cjs.usePrivanaContext();
2598
2601
  const { locks, isLoading } = useLockedFunds();
2599
2602
  const { unlockFunds, unlockAllExpired, isPending } = useUnlockFunds();
2600
2603
  const [collapsedSections, setCollapsedSections] = react.useState({});
2601
2604
  const sections = react.useMemo(() => {
2602
2605
  const sectionMap = {};
2603
2606
  locks.forEach((lock) => {
2604
- const serviceName = chunkRDMJGMI3_cjs.shortenAddress(lock.service_address);
2607
+ const serviceName = chunkCRJNDCDT_cjs.shortenAddress(lock.service_address);
2605
2608
  if (!sectionMap[lock.service_address]) {
2606
2609
  sectionMap[lock.service_address] = {
2607
2610
  title: `Service ${serviceName}`,
@@ -2610,9 +2613,9 @@ function LockedFundsView({ onBack }) {
2610
2613
  }
2611
2614
  sectionMap[lock.service_address].items.push({
2612
2615
  lockId: lock.lock_id,
2613
- amount: chunkRDMJGMI3_cjs.formatTokenAmount(String(lock.amount), getTokenById(lock.token_id)?.decimals ?? 18),
2616
+ amount: chunkCRJNDCDT_cjs.formatTokenAmount(String(lock.amount), getTokenById(lock.token_id)?.decimals ?? 18),
2614
2617
  serviceAddress: lock.service_address,
2615
- time: lock.is_expired ? "Click to unlock" : chunkRDMJGMI3_cjs.formatTimeRemaining(lock.expiry),
2618
+ time: lock.is_expired ? "Click to unlock" : chunkCRJNDCDT_cjs.formatTimeRemaining(lock.expiry),
2616
2619
  isExpired: lock.is_expired
2617
2620
  });
2618
2621
  });
@@ -2659,7 +2662,7 @@ function LockedFundsView({ onBack }) {
2659
2662
  !collapsedSections[section.title] && section.items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
2660
2663
  "div",
2661
2664
  {
2662
- className: chunkRDMJGMI3_cjs.cn(
2665
+ className: chunkCRJNDCDT_cjs.cn(
2663
2666
  "flex items-center justify-between gap-3 rounded-lg p-3",
2664
2667
  item.isExpired && "bg-secondary"
2665
2668
  ),
@@ -2673,7 +2676,7 @@ function LockedFundsView({ onBack }) {
2673
2676
  ] }),
2674
2677
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground text-xs", children: [
2675
2678
  "Service: ",
2676
- chunkRDMJGMI3_cjs.shortenAddress(item.serviceAddress)
2679
+ chunkCRJNDCDT_cjs.shortenAddress(item.serviceAddress)
2677
2680
  ] })
2678
2681
  ] })
2679
2682
  ] }),
@@ -2714,7 +2717,7 @@ function BalanceTokenRow({ token }) {
2714
2717
  const { balanceWei, isLoading } = useBalance({
2715
2718
  tokenId: token.id
2716
2719
  });
2717
- const formattedBalance = chunkRDMJGMI3_cjs.formatTokenAmount(balanceWei, token.decimals);
2720
+ const formattedBalance = chunkCRJNDCDT_cjs.formatTokenAmount(balanceWei, token.decimals);
2718
2721
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center gap-2 rounded-lg px-3 py-2.5", children: [
2719
2722
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-[18px] w-[18px] overflow-hidden rounded-full", children: getTokenIcon(token.symbol, 18) }),
2720
2723
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground flex-1 text-sm", children: token.symbol }),
@@ -2722,7 +2725,7 @@ function BalanceTokenRow({ token }) {
2722
2725
  ] });
2723
2726
  }
2724
2727
  function BalanceDetailsView({ onBack }) {
2725
- const { enabledTokens, chains } = chunkRDMJGMI3_cjs.usePrivanaContext();
2728
+ const { enabledTokens, chains } = chunkCRJNDCDT_cjs.usePrivanaContext();
2726
2729
  const [selectedChainId, setSelectedChainId] = react.useState(chains[0]?.id ?? 84532);
2727
2730
  const chainTokens = react.useMemo(() => {
2728
2731
  return enabledTokens.filter((t) => t.chainId === selectedChainId);
@@ -2748,7 +2751,7 @@ function BalanceDetailsView({ onBack }) {
2748
2751
  "button",
2749
2752
  {
2750
2753
  onClick: () => setSelectedChainId(chain.id),
2751
- className: chunkRDMJGMI3_cjs.cn(
2754
+ className: chunkCRJNDCDT_cjs.cn(
2752
2755
  "hover:bg-secondary flex w-full cursor-pointer items-center gap-2 rounded-lg px-3 py-2.5 text-left transition-colors",
2753
2756
  isSelected && "bg-secondary"
2754
2757
  ),
@@ -2789,12 +2792,12 @@ function TokenRow({
2789
2792
  query: { enabled: !!address && !isNative }
2790
2793
  });
2791
2794
  const walletBalance = isNative ? nativeBalanceData?.value : erc20Balance;
2792
- const formattedBalance = walletBalance ? chunkRDMJGMI3_cjs.formatTokenAmount(walletBalance.toString(), token.decimals) : "0.00";
2795
+ const formattedBalance = walletBalance ? chunkCRJNDCDT_cjs.formatTokenAmount(walletBalance.toString(), token.decimals) : "0.00";
2793
2796
  return /* @__PURE__ */ jsxRuntime.jsxs(
2794
2797
  "button",
2795
2798
  {
2796
2799
  onClick,
2797
- className: chunkRDMJGMI3_cjs.cn(
2800
+ className: chunkCRJNDCDT_cjs.cn(
2798
2801
  "hover:bg-secondary flex w-full cursor-pointer items-center gap-2 rounded-lg px-3 py-2.5 text-left transition-colors",
2799
2802
  isSelected && "bg-secondary"
2800
2803
  ),
@@ -2811,7 +2814,7 @@ function TokenSelectorView({
2811
2814
  onSelect,
2812
2815
  selectedTokenId
2813
2816
  }) {
2814
- const { enabledTokens, chains } = chunkRDMJGMI3_cjs.usePrivanaContext();
2817
+ const { enabledTokens, chains } = chunkCRJNDCDT_cjs.usePrivanaContext();
2815
2818
  const [selectedChainId, setSelectedChainId] = react.useState(chains[0]?.id ?? 84532);
2816
2819
  const chainTokens = react.useMemo(() => {
2817
2820
  return enabledTokens.filter((t) => t.chainId === selectedChainId);
@@ -2841,7 +2844,7 @@ function TokenSelectorView({
2841
2844
  "button",
2842
2845
  {
2843
2846
  onClick: () => setSelectedChainId(chain.id),
2844
- className: chunkRDMJGMI3_cjs.cn(
2847
+ className: chunkCRJNDCDT_cjs.cn(
2845
2848
  "hover:bg-secondary flex w-full cursor-pointer items-center gap-2 rounded-lg px-3 py-2.5 text-left transition-colors",
2846
2849
  isSelected && "bg-secondary"
2847
2850
  ),
@@ -2876,7 +2879,7 @@ function ModalBody({
2876
2879
  defaultTab = "deposit",
2877
2880
  onDepositSuccess
2878
2881
  }) {
2879
- const { defaultToken, tokensStatus } = chunkRDMJGMI3_cjs.usePrivanaContext();
2882
+ const { defaultToken, tokensStatus } = chunkCRJNDCDT_cjs.usePrivanaContext();
2880
2883
  const [selectedToken, setSelectedToken] = react.useState(defaultToken);
2881
2884
  const [activeTab, setActiveTab] = react.useState(defaultTab);
2882
2885
  const [currentView, setCurrentView] = react.useState("main");
@@ -2934,7 +2937,7 @@ function ModalBody({
2934
2937
  );
2935
2938
  }
2936
2939
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 pb-4", children: [
2937
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkRDMJGMI3_cjs.cn(isInteractionPending && "pointer-events-none"), children: /* @__PURE__ */ jsxRuntime.jsx(
2940
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkCRJNDCDT_cjs.cn(isInteractionPending && "pointer-events-none"), children: /* @__PURE__ */ jsxRuntime.jsx(
2938
2941
  BalanceCards,
2939
2942
  {
2940
2943
  selectedToken,
@@ -2944,7 +2947,7 @@ function ModalBody({
2944
2947
  disabled: isInteractionPending
2945
2948
  }
2946
2949
  ) }),
2947
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkRDMJGMI3_cjs.cn(isInteractionPending && "pointer-events-none"), children: /* @__PURE__ */ jsxRuntime.jsx(Tabs, { activeTab, onTabChange: setActiveTab, disabled: isInteractionPending }) }),
2950
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkCRJNDCDT_cjs.cn(isInteractionPending && "pointer-events-none"), children: /* @__PURE__ */ jsxRuntime.jsx(Tabs, { activeTab, onTabChange: setActiveTab, disabled: isInteractionPending }) }),
2948
2951
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-muted rounded-[10px] p-5", children: activeTab === "deposit" ? /* @__PURE__ */ jsxRuntime.jsx(
2949
2952
  DepositForm,
2950
2953
  {
@@ -3005,7 +3008,7 @@ function PrivanaModal({
3005
3008
  onClick: handleClose,
3006
3009
  disabled: isCloseBlocked,
3007
3010
  "aria-label": "Close",
3008
- className: chunkRDMJGMI3_cjs.cn(
3011
+ className: chunkCRJNDCDT_cjs.cn(
3009
3012
  "absolute top-6 right-5 z-20 flex h-6 w-6 items-center justify-center transition-colors",
3010
3013
  isCloseBlocked ? "text-muted-foreground/40 cursor-not-allowed" : "text-muted-foreground hover:text-foreground cursor-pointer"
3011
3014
  ),
@@ -3061,7 +3064,7 @@ function PrivanaInlineModal({
3061
3064
  "div",
3062
3065
  {
3063
3066
  "data-privana": true,
3064
- className: chunkRDMJGMI3_cjs.cn(
3067
+ className: chunkCRJNDCDT_cjs.cn(
3065
3068
  "bg-card flex w-[560px] max-w-full flex-col gap-2 overflow-hidden rounded-2xl p-2 shadow-lg",
3066
3069
  className
3067
3070
  ),
@@ -3096,12 +3099,12 @@ function PrivanaButton({
3096
3099
  }
3097
3100
  const handleClick = () => setModalOpen(true);
3098
3101
  const buttonElement = renderButton ? renderButton({ onClick: handleClick, isOpen: modalOpen }) : /* @__PURE__ */ jsxRuntime.jsx(
3099
- chunkRDMJGMI3_cjs.Button,
3102
+ chunkCRJNDCDT_cjs.Button,
3100
3103
  {
3101
3104
  variant,
3102
3105
  size,
3103
3106
  asChild,
3104
- className: chunkRDMJGMI3_cjs.cn(className),
3107
+ className: chunkCRJNDCDT_cjs.cn(className),
3105
3108
  onClick: handleClick,
3106
3109
  disabled: !isConnected,
3107
3110
  ...buttonProps,
@@ -3122,195 +3125,188 @@ function PrivanaButton({
3122
3125
  )
3123
3126
  ] });
3124
3127
  }
3125
- function Skeleton({ className, ...props }) {
3126
- return /* @__PURE__ */ jsxRuntime.jsx(
3127
- "div",
3128
- {
3129
- "data-slot": "skeleton",
3130
- className: chunkRDMJGMI3_cjs.cn("bg-accent animate-pulse rounded-md", className),
3131
- ...props
3132
- }
3133
- );
3134
- }
3135
3128
 
3136
3129
  Object.defineProperty(exports, "AccountingApiError", {
3137
3130
  enumerable: true,
3138
- get: function () { return chunkRDMJGMI3_cjs.AccountingApiError; }
3131
+ get: function () { return chunkCRJNDCDT_cjs.AccountingApiError; }
3139
3132
  });
3140
3133
  Object.defineProperty(exports, "Button", {
3141
3134
  enumerable: true,
3142
- get: function () { return chunkRDMJGMI3_cjs.Button; }
3135
+ get: function () { return chunkCRJNDCDT_cjs.Button; }
3143
3136
  });
3144
3137
  Object.defineProperty(exports, "HOSTED_AUTH_CLOCK_SKEW_MS", {
3145
3138
  enumerable: true,
3146
- get: function () { return chunkRDMJGMI3_cjs.HOSTED_AUTH_CLOCK_SKEW_MS; }
3139
+ get: function () { return chunkCRJNDCDT_cjs.HOSTED_AUTH_CLOCK_SKEW_MS; }
3147
3140
  });
3148
3141
  Object.defineProperty(exports, "HostedAuthError", {
3149
3142
  enumerable: true,
3150
- get: function () { return chunkRDMJGMI3_cjs.HostedAuthError; }
3143
+ get: function () { return chunkCRJNDCDT_cjs.HostedAuthError; }
3151
3144
  });
3152
3145
  Object.defineProperty(exports, "HostedAuthRequiredError", {
3153
3146
  enumerable: true,
3154
- get: function () { return chunkRDMJGMI3_cjs.HostedAuthRequiredError; }
3147
+ get: function () { return chunkCRJNDCDT_cjs.HostedAuthRequiredError; }
3155
3148
  });
3156
3149
  Object.defineProperty(exports, "HostedAuthStateMismatchError", {
3157
3150
  enumerable: true,
3158
- get: function () { return chunkRDMJGMI3_cjs.HostedAuthStateMismatchError; }
3151
+ get: function () { return chunkCRJNDCDT_cjs.HostedAuthStateMismatchError; }
3159
3152
  });
3160
3153
  Object.defineProperty(exports, "HttpClient", {
3161
3154
  enumerable: true,
3162
- get: function () { return chunkRDMJGMI3_cjs.HttpClient; }
3155
+ get: function () { return chunkCRJNDCDT_cjs.HttpClient; }
3163
3156
  });
3164
3157
  Object.defineProperty(exports, "NETWORK_CONFIG", {
3165
3158
  enumerable: true,
3166
- get: function () { return chunkRDMJGMI3_cjs.NETWORK_CONFIG; }
3159
+ get: function () { return chunkCRJNDCDT_cjs.NETWORK_CONFIG; }
3167
3160
  });
3168
3161
  Object.defineProperty(exports, "NetworkError", {
3169
3162
  enumerable: true,
3170
- get: function () { return chunkRDMJGMI3_cjs.NetworkError; }
3163
+ get: function () { return chunkCRJNDCDT_cjs.NetworkError; }
3171
3164
  });
3172
3165
  Object.defineProperty(exports, "PrivanaClient", {
3173
3166
  enumerable: true,
3174
- get: function () { return chunkRDMJGMI3_cjs.PrivanaClient; }
3167
+ get: function () { return chunkCRJNDCDT_cjs.PrivanaClient; }
3175
3168
  });
3176
3169
  Object.defineProperty(exports, "PrivanaProvider", {
3177
3170
  enumerable: true,
3178
- get: function () { return chunkRDMJGMI3_cjs.PrivanaProvider; }
3171
+ get: function () { return chunkCRJNDCDT_cjs.PrivanaProvider; }
3179
3172
  });
3180
3173
  Object.defineProperty(exports, "SUPPORTED_CHAINS", {
3181
3174
  enumerable: true,
3182
- get: function () { return chunkRDMJGMI3_cjs.SUPPORTED_CHAINS; }
3175
+ get: function () { return chunkCRJNDCDT_cjs.SUPPORTED_CHAINS; }
3183
3176
  });
3184
3177
  Object.defineProperty(exports, "SiweAuthProvider", {
3185
3178
  enumerable: true,
3186
- get: function () { return chunkRDMJGMI3_cjs.SiweAuthProvider; }
3179
+ get: function () { return chunkCRJNDCDT_cjs.SiweAuthProvider; }
3180
+ });
3181
+ Object.defineProperty(exports, "Skeleton", {
3182
+ enumerable: true,
3183
+ get: function () { return chunkCRJNDCDT_cjs.Skeleton; }
3187
3184
  });
3188
3185
  Object.defineProperty(exports, "ValidationError", {
3189
3186
  enumerable: true,
3190
- get: function () { return chunkRDMJGMI3_cjs.ValidationError; }
3187
+ get: function () { return chunkCRJNDCDT_cjs.ValidationError; }
3191
3188
  });
3192
3189
  Object.defineProperty(exports, "applyRefreshResponse", {
3193
3190
  enumerable: true,
3194
- get: function () { return chunkRDMJGMI3_cjs.applyRefreshResponse; }
3191
+ get: function () { return chunkCRJNDCDT_cjs.applyRefreshResponse; }
3195
3192
  });
3196
3193
  Object.defineProperty(exports, "buildHostedAuthSession", {
3197
3194
  enumerable: true,
3198
- get: function () { return chunkRDMJGMI3_cjs.buildHostedAuthSession; }
3195
+ get: function () { return chunkCRJNDCDT_cjs.buildHostedAuthSession; }
3199
3196
  });
3200
3197
  Object.defineProperty(exports, "buttonVariants", {
3201
3198
  enumerable: true,
3202
- get: function () { return chunkRDMJGMI3_cjs.buttonVariants; }
3199
+ get: function () { return chunkCRJNDCDT_cjs.buttonVariants; }
3203
3200
  });
3204
3201
  Object.defineProperty(exports, "clearHostedAuthPendingTransaction", {
3205
3202
  enumerable: true,
3206
- get: function () { return chunkRDMJGMI3_cjs.clearHostedAuthPendingTransaction; }
3203
+ get: function () { return chunkCRJNDCDT_cjs.clearHostedAuthPendingTransaction; }
3207
3204
  });
3208
3205
  Object.defineProperty(exports, "createHostedAuthPendingStorageKey", {
3209
3206
  enumerable: true,
3210
- get: function () { return chunkRDMJGMI3_cjs.createHostedAuthPendingStorageKey; }
3207
+ get: function () { return chunkCRJNDCDT_cjs.createHostedAuthPendingStorageKey; }
3211
3208
  });
3212
3209
  Object.defineProperty(exports, "createHostedAuthState", {
3213
3210
  enumerable: true,
3214
- get: function () { return chunkRDMJGMI3_cjs.createHostedAuthState; }
3211
+ get: function () { return chunkCRJNDCDT_cjs.createHostedAuthState; }
3215
3212
  });
3216
3213
  Object.defineProperty(exports, "createHostedAuthStorageKey", {
3217
3214
  enumerable: true,
3218
- get: function () { return chunkRDMJGMI3_cjs.createHostedAuthStorageKey; }
3215
+ get: function () { return chunkCRJNDCDT_cjs.createHostedAuthStorageKey; }
3219
3216
  });
3220
3217
  Object.defineProperty(exports, "createPkceChallenge", {
3221
3218
  enumerable: true,
3222
- get: function () { return chunkRDMJGMI3_cjs.createPkceChallenge; }
3219
+ get: function () { return chunkCRJNDCDT_cjs.createPkceChallenge; }
3223
3220
  });
3224
3221
  Object.defineProperty(exports, "createPkceVerifier", {
3225
3222
  enumerable: true,
3226
- get: function () { return chunkRDMJGMI3_cjs.createPkceVerifier; }
3223
+ get: function () { return chunkCRJNDCDT_cjs.createPkceVerifier; }
3227
3224
  });
3228
3225
  Object.defineProperty(exports, "getAccountingContract", {
3229
3226
  enumerable: true,
3230
- get: function () { return chunkRDMJGMI3_cjs.getAccountingContract; }
3227
+ get: function () { return chunkCRJNDCDT_cjs.getAccountingContract; }
3231
3228
  });
3232
3229
  Object.defineProperty(exports, "getApiUrl", {
3233
3230
  enumerable: true,
3234
- get: function () { return chunkRDMJGMI3_cjs.getApiUrl; }
3231
+ get: function () { return chunkCRJNDCDT_cjs.getApiUrl; }
3235
3232
  });
3236
3233
  Object.defineProperty(exports, "getChainById", {
3237
3234
  enumerable: true,
3238
- get: function () { return chunkRDMJGMI3_cjs.getChainById; }
3235
+ get: function () { return chunkCRJNDCDT_cjs.getChainById; }
3239
3236
  });
3240
3237
  Object.defineProperty(exports, "getChainId", {
3241
3238
  enumerable: true,
3242
- get: function () { return chunkRDMJGMI3_cjs.getChainId; }
3239
+ get: function () { return chunkCRJNDCDT_cjs.getChainId; }
3243
3240
  });
3244
3241
  Object.defineProperty(exports, "getExplorerAddressUrl", {
3245
3242
  enumerable: true,
3246
- get: function () { return chunkRDMJGMI3_cjs.getExplorerAddressUrl; }
3243
+ get: function () { return chunkCRJNDCDT_cjs.getExplorerAddressUrl; }
3247
3244
  });
3248
3245
  Object.defineProperty(exports, "isHostedAuthRefreshActive", {
3249
3246
  enumerable: true,
3250
- get: function () { return chunkRDMJGMI3_cjs.isHostedAuthRefreshActive; }
3247
+ get: function () { return chunkCRJNDCDT_cjs.isHostedAuthRefreshActive; }
3251
3248
  });
3252
3249
  Object.defineProperty(exports, "isHostedAuthSessionActive", {
3253
3250
  enumerable: true,
3254
- get: function () { return chunkRDMJGMI3_cjs.isHostedAuthSessionActive; }
3251
+ get: function () { return chunkCRJNDCDT_cjs.isHostedAuthSessionActive; }
3255
3252
  });
3256
3253
  Object.defineProperty(exports, "normalizeAddress", {
3257
3254
  enumerable: true,
3258
- get: function () { return chunkRDMJGMI3_cjs.normalizeAddress; }
3255
+ get: function () { return chunkCRJNDCDT_cjs.normalizeAddress; }
3259
3256
  });
3260
3257
  Object.defineProperty(exports, "normalizeHex", {
3261
3258
  enumerable: true,
3262
- get: function () { return chunkRDMJGMI3_cjs.normalizeHex; }
3259
+ get: function () { return chunkCRJNDCDT_cjs.normalizeHex; }
3263
3260
  });
3264
3261
  Object.defineProperty(exports, "parseHostedAuthCallback", {
3265
3262
  enumerable: true,
3266
- get: function () { return chunkRDMJGMI3_cjs.parseHostedAuthCallback; }
3263
+ get: function () { return chunkCRJNDCDT_cjs.parseHostedAuthCallback; }
3267
3264
  });
3268
3265
  Object.defineProperty(exports, "persistHostedAuthPendingTransaction", {
3269
3266
  enumerable: true,
3270
- get: function () { return chunkRDMJGMI3_cjs.persistHostedAuthPendingTransaction; }
3267
+ get: function () { return chunkCRJNDCDT_cjs.persistHostedAuthPendingTransaction; }
3271
3268
  });
3272
3269
  Object.defineProperty(exports, "readHostedAuthPendingTransaction", {
3273
3270
  enumerable: true,
3274
- get: function () { return chunkRDMJGMI3_cjs.readHostedAuthPendingTransaction; }
3271
+ get: function () { return chunkCRJNDCDT_cjs.readHostedAuthPendingTransaction; }
3275
3272
  });
3276
3273
  Object.defineProperty(exports, "readStoredHostedAuthSession", {
3277
3274
  enumerable: true,
3278
- get: function () { return chunkRDMJGMI3_cjs.readStoredHostedAuthSession; }
3275
+ get: function () { return chunkCRJNDCDT_cjs.readStoredHostedAuthSession; }
3279
3276
  });
3280
3277
  Object.defineProperty(exports, "stripHostedAuthCallbackParams", {
3281
3278
  enumerable: true,
3282
- get: function () { return chunkRDMJGMI3_cjs.stripHostedAuthCallbackParams; }
3279
+ get: function () { return chunkCRJNDCDT_cjs.stripHostedAuthCallbackParams; }
3283
3280
  });
3284
3281
  Object.defineProperty(exports, "syncHostedAuthSessionToClient", {
3285
3282
  enumerable: true,
3286
- get: function () { return chunkRDMJGMI3_cjs.syncHostedAuthSessionToClient; }
3283
+ get: function () { return chunkCRJNDCDT_cjs.syncHostedAuthSessionToClient; }
3287
3284
  });
3288
3285
  Object.defineProperty(exports, "useDepositVerification", {
3289
3286
  enumerable: true,
3290
- get: function () { return chunkRDMJGMI3_cjs.useDepositVerification; }
3287
+ get: function () { return chunkCRJNDCDT_cjs.useDepositVerification; }
3291
3288
  });
3292
3289
  Object.defineProperty(exports, "usePrivanaContext", {
3293
3290
  enumerable: true,
3294
- get: function () { return chunkRDMJGMI3_cjs.usePrivanaContext; }
3291
+ get: function () { return chunkCRJNDCDT_cjs.usePrivanaContext; }
3295
3292
  });
3296
3293
  Object.defineProperty(exports, "useSafeAccount", {
3297
3294
  enumerable: true,
3298
- get: function () { return chunkRDMJGMI3_cjs.useSafeAccount; }
3295
+ get: function () { return chunkCRJNDCDT_cjs.useSafeAccount; }
3299
3296
  });
3300
3297
  Object.defineProperty(exports, "useSafePrivanaContext", {
3301
3298
  enumerable: true,
3302
- get: function () { return chunkRDMJGMI3_cjs.useSafePrivanaContext; }
3299
+ get: function () { return chunkCRJNDCDT_cjs.useSafePrivanaContext; }
3303
3300
  });
3304
3301
  Object.defineProperty(exports, "useSiweAuth", {
3305
3302
  enumerable: true,
3306
- get: function () { return chunkRDMJGMI3_cjs.useSiweAuth; }
3303
+ get: function () { return chunkCRJNDCDT_cjs.useSiweAuth; }
3307
3304
  });
3308
3305
  exports.LOCK_TYPES = LOCK_TYPES;
3309
3306
  exports.MODIFY_LOCK_TYPES = MODIFY_LOCK_TYPES;
3310
3307
  exports.PrivanaButton = PrivanaButton;
3311
3308
  exports.PrivanaInlineModal = PrivanaInlineModal;
3312
3309
  exports.PrivanaModal = PrivanaModal;
3313
- exports.Skeleton = Skeleton;
3314
3310
  exports.TRANSFER_LOCKED_TYPES = TRANSFER_LOCKED_TYPES;
3315
3311
  exports.TRANSFER_TYPES = TRANSFER_TYPES;
3316
3312
  exports.WITHDRAW_FROM_LOCK_TYPES = WITHDRAW_FROM_LOCK_TYPES;