@oasisprotocol/privana-sdk 0.5.7 → 0.5.8

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 chunkFFYLKZ7J_cjs = require('./chunk-FFYLKZ7J.cjs');
4
+ var chunkEXFISDHQ_cjs = require('./chunk-EXFISDHQ.cjs');
5
5
  var react = require('react');
6
6
  var reactQuery = require('@tanstack/react-query');
7
7
  var wagmi = require('wagmi');
@@ -35,18 +35,18 @@ var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive)
35
35
 
36
36
  // src/sdk/hooks/use-privana-client.ts
37
37
  function usePrivanaClient() {
38
- const { client } = chunkFFYLKZ7J_cjs.usePrivanaContext();
38
+ const { client } = chunkEXFISDHQ_cjs.usePrivanaContext();
39
39
  return client;
40
40
  }
41
41
  var hostedAuthExchangeInflight = /* @__PURE__ */ new Map();
42
42
  function normalizeHostedAuthError(error) {
43
- if (error instanceof chunkFFYLKZ7J_cjs.AccountingApiError && error.detail) {
44
- return new chunkFFYLKZ7J_cjs.HostedAuthError(error.detail);
43
+ if (error instanceof chunkEXFISDHQ_cjs.AccountingApiError && error.detail) {
44
+ return new chunkEXFISDHQ_cjs.HostedAuthError(error.detail);
45
45
  }
46
46
  if (error instanceof Error) {
47
47
  return error;
48
48
  }
49
- return new chunkFFYLKZ7J_cjs.HostedAuthError("Hosted authentication failed.");
49
+ return new chunkEXFISDHQ_cjs.HostedAuthError("Hosted authentication failed.");
50
50
  }
51
51
  function useHostedRedirectAuth() {
52
52
  const {
@@ -57,30 +57,30 @@ function useHostedRedirectAuth() {
57
57
  setHostedAuthSession,
58
58
  clearHostedAuthSession,
59
59
  refreshHostedAuthSession
60
- } = chunkFFYLKZ7J_cjs.usePrivanaContext();
60
+ } = chunkEXFISDHQ_cjs.usePrivanaContext();
61
61
  const [error, setError] = react.useState(null);
62
62
  const [isLoading, setIsLoading] = react.useState(false);
63
63
  const loginInflight = react.useRef(null);
64
64
  const completionInflight = react.useRef(null);
65
65
  const pendingStorageKey = react.useMemo(
66
- () => hostedAuthConfig ? chunkFFYLKZ7J_cjs.createHostedAuthPendingStorageKey(client.getBaseUrl(), hostedAuthConfig) : null,
66
+ () => hostedAuthConfig ? chunkEXFISDHQ_cjs.createHostedAuthPendingStorageKey(client.getBaseUrl(), hostedAuthConfig) : null,
67
67
  [client, hostedAuthConfig]
68
68
  );
69
69
  const clearPendingLogin = react.useCallback(() => {
70
70
  if (!pendingStorageKey || typeof window === "undefined") return;
71
- chunkFFYLKZ7J_cjs.clearHostedAuthPendingTransaction(window.sessionStorage, pendingStorageKey);
71
+ chunkEXFISDHQ_cjs.clearHostedAuthPendingTransaction(window.sessionStorage, pendingStorageKey);
72
72
  }, [pendingStorageKey]);
73
73
  const login = react.useCallback(async () => {
74
74
  if (!hostedAuthConfig) {
75
- throw new chunkFFYLKZ7J_cjs.HostedAuthRequiredError(
75
+ throw new chunkEXFISDHQ_cjs.HostedAuthRequiredError(
76
76
  "Hosted redirect authentication is not configured for this provider."
77
77
  );
78
78
  }
79
79
  if (typeof window === "undefined") {
80
- throw new chunkFFYLKZ7J_cjs.HostedAuthError("Hosted redirect authentication requires a browser environment.");
80
+ throw new chunkEXFISDHQ_cjs.HostedAuthError("Hosted redirect authentication requires a browser environment.");
81
81
  }
82
82
  if (!pendingStorageKey) {
83
- throw new chunkFFYLKZ7J_cjs.HostedAuthError("Hosted redirect authentication storage is not configured.");
83
+ throw new chunkEXFISDHQ_cjs.HostedAuthError("Hosted redirect authentication storage is not configured.");
84
84
  }
85
85
  if (loginInflight.current) {
86
86
  return loginInflight.current;
@@ -89,10 +89,10 @@ function useHostedRedirectAuth() {
89
89
  setIsLoading(true);
90
90
  setError(null);
91
91
  try {
92
- const verifier = chunkFFYLKZ7J_cjs.createPkceVerifier();
93
- const codeChallenge = await chunkFFYLKZ7J_cjs.createPkceChallenge(verifier);
94
- const state = chunkFFYLKZ7J_cjs.createHostedAuthState();
95
- chunkFFYLKZ7J_cjs.persistHostedAuthPendingTransaction(window.sessionStorage, pendingStorageKey, {
92
+ const verifier = chunkEXFISDHQ_cjs.createPkceVerifier();
93
+ const codeChallenge = await chunkEXFISDHQ_cjs.createPkceChallenge(verifier);
94
+ const state = chunkEXFISDHQ_cjs.createHostedAuthState();
95
+ chunkEXFISDHQ_cjs.persistHostedAuthPendingTransaction(window.sessionStorage, pendingStorageKey, {
96
96
  codeVerifier: verifier,
97
97
  state
98
98
  });
@@ -121,15 +121,15 @@ function useHostedRedirectAuth() {
121
121
  }, [clearPendingLogin, client, hostedAuthConfig, networkConfig.chainId, pendingStorageKey]);
122
122
  const completeLogin = react.useCallback(async () => {
123
123
  if (!hostedAuthConfig) {
124
- throw new chunkFFYLKZ7J_cjs.HostedAuthRequiredError(
124
+ throw new chunkEXFISDHQ_cjs.HostedAuthRequiredError(
125
125
  "Hosted redirect authentication is not configured for this provider."
126
126
  );
127
127
  }
128
128
  if (typeof window === "undefined") {
129
- throw new chunkFFYLKZ7J_cjs.HostedAuthError("Hosted redirect authentication requires a browser environment.");
129
+ throw new chunkEXFISDHQ_cjs.HostedAuthError("Hosted redirect authentication requires a browser environment.");
130
130
  }
131
131
  if (!pendingStorageKey) {
132
- throw new chunkFFYLKZ7J_cjs.HostedAuthError("Hosted redirect authentication storage is not configured.");
132
+ throw new chunkEXFISDHQ_cjs.HostedAuthError("Hosted redirect authentication storage is not configured.");
133
133
  }
134
134
  if (completionInflight.current) {
135
135
  return completionInflight.current;
@@ -139,30 +139,30 @@ function useHostedRedirectAuth() {
139
139
  setError(null);
140
140
  const callbackUrl = new URL(window.location.href);
141
141
  const cleanupCallbackUrl = () => {
142
- window.history.replaceState(null, "", chunkFFYLKZ7J_cjs.stripHostedAuthCallbackParams(callbackUrl));
142
+ window.history.replaceState(null, "", chunkEXFISDHQ_cjs.stripHostedAuthCallbackParams(callbackUrl));
143
143
  };
144
144
  try {
145
- const callback = chunkFFYLKZ7J_cjs.parseHostedAuthCallback(callbackUrl, hostedAuthConfig.redirectUri);
145
+ const callback = chunkEXFISDHQ_cjs.parseHostedAuthCallback(callbackUrl, hostedAuthConfig.redirectUri);
146
146
  if (!callback) {
147
147
  return null;
148
148
  }
149
- const pending = chunkFFYLKZ7J_cjs.readHostedAuthPendingTransaction(window.sessionStorage, pendingStorageKey);
149
+ const pending = chunkEXFISDHQ_cjs.readHostedAuthPendingTransaction(window.sessionStorage, pendingStorageKey);
150
150
  if (!pending) {
151
151
  clearPendingLogin();
152
152
  cleanupCallbackUrl();
153
- throw new chunkFFYLKZ7J_cjs.HostedAuthError(
153
+ throw new chunkEXFISDHQ_cjs.HostedAuthError(
154
154
  "Hosted authentication response could not be matched to a pending login request."
155
155
  );
156
156
  }
157
157
  if (!callback.state || callback.state !== pending.state) {
158
158
  clearPendingLogin();
159
159
  cleanupCallbackUrl();
160
- throw new chunkFFYLKZ7J_cjs.HostedAuthStateMismatchError();
160
+ throw new chunkEXFISDHQ_cjs.HostedAuthStateMismatchError();
161
161
  }
162
162
  if ("error" in callback) {
163
163
  clearPendingLogin();
164
164
  cleanupCallbackUrl();
165
- throw new chunkFFYLKZ7J_cjs.HostedAuthError(
165
+ throw new chunkEXFISDHQ_cjs.HostedAuthError(
166
166
  callback.errorDescription || callback.error || "Hosted authentication failed."
167
167
  );
168
168
  }
@@ -177,7 +177,7 @@ function useHostedRedirectAuth() {
177
177
  client_id: hostedAuthConfig.clientId,
178
178
  redirect_uri: hostedAuthConfig.redirectUri
179
179
  });
180
- const session = chunkFFYLKZ7J_cjs.buildHostedAuthSession(response, hostedAuthConfig);
180
+ const session = chunkEXFISDHQ_cjs.buildHostedAuthSession(response, hostedAuthConfig);
181
181
  setHostedAuthSession(session);
182
182
  clearPendingLogin();
183
183
  cleanupCallbackUrl();
@@ -222,7 +222,7 @@ function useHostedRedirectAuth() {
222
222
  try {
223
223
  return await refreshHostedAuthSession();
224
224
  } catch (refreshError) {
225
- const normalizedError = refreshError instanceof Error ? refreshError : new chunkFFYLKZ7J_cjs.HostedAuthError("Hosted authentication refresh failed.");
225
+ const normalizedError = refreshError instanceof Error ? refreshError : new chunkEXFISDHQ_cjs.HostedAuthError("Hosted authentication refresh failed.");
226
226
  setError(normalizedError);
227
227
  throw normalizedError;
228
228
  } finally {
@@ -242,12 +242,12 @@ function useHostedRedirectAuth() {
242
242
  }
243
243
  function useBalance(options = {}) {
244
244
  const queryClient = react.useContext(reactQuery.QueryClientContext);
245
- const accountingContext = chunkFFYLKZ7J_cjs.useSafePrivanaContext();
245
+ const accountingContext = chunkEXFISDHQ_cjs.useSafePrivanaContext();
246
246
  const hasProviders = !!queryClient && !!accountingContext;
247
247
  const client = accountingContext?.client;
248
248
  const defaultToken = accountingContext?.defaultToken;
249
249
  const pollingInterval = accountingContext?.pollingInterval ?? 1e4;
250
- const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
250
+ const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkEXFISDHQ_cjs.usePrivateReadRequest();
251
251
  const tokenId = options.tokenId ?? defaultToken?.id;
252
252
  const query = reactQuery.useQuery({
253
253
  queryKey: ["accounting-balance", ...privateReadQueryScope, tokenId],
@@ -264,7 +264,7 @@ function useBalance(options = {}) {
264
264
  return {
265
265
  balance: balanceWei,
266
266
  balanceWei,
267
- balanceFormatted: chunkFFYLKZ7J_cjs.formatTokenAmount(balanceWei),
267
+ balanceFormatted: chunkEXFISDHQ_cjs.formatTokenAmount(balanceWei),
268
268
  tokenSymbol: query.data?.token_symbol ?? "",
269
269
  chainId: query.data?.chain_id ?? "",
270
270
  isLoading: query.isPending || query.isLoading,
@@ -274,8 +274,8 @@ function useBalance(options = {}) {
274
274
  };
275
275
  }
276
276
  function useBatchBalances(options) {
277
- const { client, pollingInterval } = chunkFFYLKZ7J_cjs.usePrivanaContext();
278
- const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
277
+ const { client, pollingInterval } = chunkEXFISDHQ_cjs.usePrivanaContext();
278
+ const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkEXFISDHQ_cjs.usePrivateReadRequest();
279
279
  const query = reactQuery.useQuery({
280
280
  queryKey: ["accounting-batch-balances", ...privateReadQueryScope, options.tokenIds],
281
281
  queryFn: async () => {
@@ -307,17 +307,17 @@ function storageKey(address) {
307
307
  return `privana:pending-deposit:${address.toLowerCase()}`;
308
308
  }
309
309
  function savePendingDeposit(address, data) {
310
- const stored = chunkFFYLKZ7J_cjs.setBrowserStorageItem(storageKey(address), JSON.stringify(data));
310
+ const stored = chunkEXFISDHQ_cjs.setBrowserStorageItem(storageKey(address), JSON.stringify(data));
311
311
  if (!stored && data.signedLock) {
312
312
  throw new Error("Unable to persist pending locked deposit for recovery");
313
313
  }
314
314
  }
315
315
  function loadPendingDeposit(address) {
316
316
  try {
317
- const raw = chunkFFYLKZ7J_cjs.getBrowserStorageItem(storageKey(address));
317
+ const raw = chunkEXFISDHQ_cjs.getBrowserStorageItem(storageKey(address));
318
318
  if (!raw) return null;
319
319
  const data = JSON.parse(raw);
320
- if (Date.now() - data.savedAt > STALE_MS && !(data.signedLock && chunkFFYLKZ7J_cjs.isSignedLockUsable(data.signedLock))) {
320
+ if (Date.now() - data.savedAt > STALE_MS && !(data.signedLock && chunkEXFISDHQ_cjs.isSignedLockUsable(data.signedLock))) {
321
321
  clearPendingDeposit(address);
322
322
  return null;
323
323
  }
@@ -329,21 +329,21 @@ function loadPendingDeposit(address) {
329
329
  function clearPendingDeposit(address, onlyForTxHash) {
330
330
  if (onlyForTxHash) {
331
331
  try {
332
- const raw = chunkFFYLKZ7J_cjs.getBrowserStorageItem(storageKey(address));
332
+ const raw = chunkEXFISDHQ_cjs.getBrowserStorageItem(storageKey(address));
333
333
  const recordTxHash = raw ? JSON.parse(raw).txHash : void 0;
334
334
  if (recordTxHash && recordTxHash !== onlyForTxHash) return;
335
335
  } catch {
336
336
  }
337
337
  }
338
- chunkFFYLKZ7J_cjs.removeBrowserStorageItem(storageKey(address));
338
+ chunkEXFISDHQ_cjs.removeBrowserStorageItem(storageKey(address));
339
339
  }
340
340
  function useDeposit(options = {}) {
341
341
  const { address } = wagmi.useAccount();
342
- const { client, enabledTokens, getChainById: getChainById2, networkConfig, serviceAddress } = chunkFFYLKZ7J_cjs.usePrivanaContext();
342
+ const { client, enabledTokens, getChainById: getChainById2, networkConfig, serviceAddress } = chunkEXFISDHQ_cjs.usePrivanaContext();
343
343
  const { data: walletClient } = wagmi.useWalletClient();
344
344
  const queryClient = reactQuery.useQueryClient();
345
345
  const config = wagmi.useConfig();
346
- const { executePrivateRead, privateReadAddress } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
346
+ const { executePrivateRead, privateReadAddress } = chunkEXFISDHQ_cjs.usePrivateReadRequest();
347
347
  const privateReadAddressRef = react.useRef(privateReadAddress);
348
348
  privateReadAddressRef.current = privateReadAddress;
349
349
  const [depositAddress, setDepositAddress] = react.useState(null);
@@ -382,7 +382,7 @@ function useDeposit(options = {}) {
382
382
  const submitPendingLockAfterCredit = react.useCallback(
383
383
  async (signedLock, creditedAmount) => {
384
384
  try {
385
- const result = await chunkFFYLKZ7J_cjs.submitPendingLock({
385
+ const result = await chunkEXFISDHQ_cjs.submitPendingLock({
386
386
  client,
387
387
  payload: signedLock,
388
388
  creditedAmount
@@ -393,7 +393,7 @@ function useDeposit(options = {}) {
393
393
  queryClient.invalidateQueries({ queryKey: ["accounting-history"] });
394
394
  onLockSubmittedRef.current?.(result);
395
395
  } catch (err) {
396
- const error2 = err instanceof chunkFFYLKZ7J_cjs.PostDepositLockError ? err : new chunkFFYLKZ7J_cjs.PostDepositLockError(
396
+ const error2 = err instanceof chunkEXFISDHQ_cjs.PostDepositLockError ? err : new chunkEXFISDHQ_cjs.PostDepositLockError(
397
397
  err instanceof Error ? err.message : "Lock submission failed",
398
398
  "submission-failed",
399
399
  BigInt(signedLock.amount),
@@ -412,7 +412,7 @@ function useDeposit(options = {}) {
412
412
  error: verificationError,
413
413
  verify,
414
414
  reset: resetVerification
415
- } = chunkFFYLKZ7J_cjs.useDepositVerification({
415
+ } = chunkEXFISDHQ_cjs.useDepositVerification({
416
416
  pollInterval: options.pollInterval,
417
417
  pollTimeout: options.pollTimeout,
418
418
  onCredited: (hash, response, creditedAmount) => {
@@ -462,7 +462,7 @@ function useDeposit(options = {}) {
462
462
  } = wagmi.useSendTransaction();
463
463
  const isSendingTx = isWritingContract || isSendingNative;
464
464
  const sendError = writeError ?? sendNativeError;
465
- const { ensureCorrectChain } = chunkFFYLKZ7J_cjs.useEnsureCorrectChain();
465
+ const { ensureCorrectChain } = chunkEXFISDHQ_cjs.useEnsureCorrectChain();
466
466
  const invalidateGeneration = react.useCallback(() => {
467
467
  generationRef.current++;
468
468
  }, []);
@@ -511,16 +511,16 @@ function useDeposit(options = {}) {
511
511
  const confirmations = resolveConfirmations(persisted.depositAddress, persisted.chainId);
512
512
  let confirmed = false;
513
513
  try {
514
- const receipt = await chunkFFYLKZ7J_cjs.getTransactionReceipt(config, {
514
+ const receipt = await chunkEXFISDHQ_cjs.getTransactionReceipt(config, {
515
515
  hash,
516
516
  chainId: persisted.chainId
517
517
  });
518
- const blockNumber = await chunkFFYLKZ7J_cjs.getBlockNumber(config, { chainId: persisted.chainId });
518
+ const blockNumber = await chunkEXFISDHQ_cjs.getBlockNumber(config, { chainId: persisted.chainId });
519
519
  confirmed = blockNumber - receipt.blockNumber + 1n >= BigInt(confirmations);
520
520
  } catch {
521
521
  }
522
522
  if (!confirmed) {
523
- await chunkFFYLKZ7J_cjs.waitForTransactionReceipt(config, {
523
+ await chunkEXFISDHQ_cjs.waitForTransactionReceipt(config, {
524
524
  hash,
525
525
  chainId: persisted.chainId,
526
526
  confirmations
@@ -572,13 +572,13 @@ function useDeposit(options = {}) {
572
572
  );
573
573
  }
574
574
  const confirmations = resolveConfirmations(addrResponse, sourceChain.id);
575
- if (params.postDepositLock && !chunkFFYLKZ7J_cjs.canUseBrowserStorage()) {
575
+ if (params.postDepositLock && !chunkEXFISDHQ_cjs.canUseBrowserStorage()) {
576
576
  throw new Error("Browser storage is required for locked deposit recovery");
577
577
  }
578
- const lockAmount = chunkFFYLKZ7J_cjs.clampLockAmount(params.amount, params.postDepositLock?.maxAmount);
578
+ const lockAmount = chunkEXFISDHQ_cjs.clampLockAmount(params.amount, params.postDepositLock?.maxAmount);
579
579
  let signedLock;
580
580
  if (params.postDepositLock) {
581
- const lockOwner = chunkFFYLKZ7J_cjs.requireDepositLockOwner(address, privateReadAddress);
581
+ const lockOwner = chunkEXFISDHQ_cjs.requireDepositLockOwner(address, privateReadAddress);
582
582
  setIsSwitchingChain(true);
583
583
  try {
584
584
  await ensureCorrectChain(networkConfig.chainId);
@@ -586,15 +586,15 @@ function useDeposit(options = {}) {
586
586
  if (!isStale()) setIsSwitchingChain(false);
587
587
  }
588
588
  if (isStale()) return;
589
- const signingWalletClient = await chunkFFYLKZ7J_cjs.getWalletClient(config, {
589
+ const signingWalletClient = await chunkEXFISDHQ_cjs.getWalletClient(config, {
590
590
  chainId: networkConfig.chainId
591
591
  });
592
- signedLock = await chunkFFYLKZ7J_cjs.createSignedLockRequest({
592
+ signedLock = await chunkEXFISDHQ_cjs.createSignedLockRequest({
593
593
  client,
594
594
  walletClient: signingWalletClient,
595
595
  userAddress: lockOwner,
596
596
  networkConfig,
597
- serviceAddress: chunkFFYLKZ7J_cjs.requireServiceAddress(
597
+ serviceAddress: chunkEXFISDHQ_cjs.requireServiceAddress(
598
598
  params.postDepositLock.serviceAddress ?? serviceAddress
599
599
  ),
600
600
  tokenId: params.tokenId,
@@ -648,7 +648,7 @@ function useDeposit(options = {}) {
648
648
  try {
649
649
  setIsWaitingForConfirmation(true);
650
650
  try {
651
- await chunkFFYLKZ7J_cjs.waitForTransactionReceipt(config, {
651
+ await chunkEXFISDHQ_cjs.waitForTransactionReceipt(config, {
652
652
  hash,
653
653
  chainId: sourceChain.id,
654
654
  confirmations
@@ -724,10 +724,10 @@ function useDeposit(options = {}) {
724
724
  }
725
725
  function useDepositAddress(options = {}) {
726
726
  const queryClient = react.useContext(reactQuery.QueryClientContext);
727
- const accountingContext = chunkFFYLKZ7J_cjs.useSafePrivanaContext();
727
+ const accountingContext = chunkEXFISDHQ_cjs.useSafePrivanaContext();
728
728
  const hasProviders = !!queryClient && !!accountingContext;
729
729
  const client = accountingContext?.client;
730
- const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
730
+ const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkEXFISDHQ_cjs.usePrivateReadRequest();
731
731
  const isReady = hasProviders && privateReadReady && !!privateReadAddress && !!client;
732
732
  const query = reactQuery.useQuery({
733
733
  queryKey: ["accounting-deposit-address", ...privateReadQueryScope],
@@ -751,9 +751,9 @@ function useDepositAddress(options = {}) {
751
751
  function useWithdraw(options = {}) {
752
752
  const { address } = wagmi.useAccount();
753
753
  const { data: walletClient } = wagmi.useWalletClient();
754
- const { client, networkConfig } = chunkFFYLKZ7J_cjs.usePrivanaContext();
754
+ const { client, networkConfig } = chunkEXFISDHQ_cjs.usePrivanaContext();
755
755
  const queryClient = reactQuery.useQueryClient();
756
- const { chainId, ensureCorrectChain } = chunkFFYLKZ7J_cjs.useEnsureCorrectChain();
756
+ const { chainId, ensureCorrectChain } = chunkEXFISDHQ_cjs.useEnsureCorrectChain();
757
757
  const pollInterval = options.pollInterval ?? 3e3;
758
758
  const pollTimeout = options.pollTimeout ?? 18e4;
759
759
  const [currentStep, setCurrentStep] = react.useState("idle");
@@ -821,7 +821,7 @@ function useWithdraw(options = {}) {
821
821
  if (isStale()) return void 0;
822
822
  const nonce = BigInt(nonceResponse.nonce);
823
823
  setCurrentStep("signing");
824
- const signature = await chunkFFYLKZ7J_cjs.signWithdrawMessage({
824
+ const signature = await chunkEXFISDHQ_cjs.signWithdrawMessage({
825
825
  walletClient,
826
826
  chainId: signingChainId,
827
827
  verifyingContract: networkConfig.accountingContract,
@@ -950,7 +950,7 @@ function useWithdraw(options = {}) {
950
950
  function useLockFunds(options = {}) {
951
951
  const { address } = wagmi.useAccount();
952
952
  const { data: walletClient } = wagmi.useWalletClient();
953
- const { client, networkConfig, serviceAddress } = chunkFFYLKZ7J_cjs.usePrivanaContext();
953
+ const { client, networkConfig, serviceAddress } = chunkEXFISDHQ_cjs.usePrivanaContext();
954
954
  const queryClient = reactQuery.useQueryClient();
955
955
  const mutation = reactQuery.useMutation({
956
956
  mutationFn: async (params) => {
@@ -961,7 +961,7 @@ function useLockFunds(options = {}) {
961
961
  throw new Error("Service address not configured");
962
962
  }
963
963
  const { nonce } = await client.getLockNonce(address);
964
- const signature = await chunkFFYLKZ7J_cjs.signLockMessage({
964
+ const signature = await chunkEXFISDHQ_cjs.signLockMessage({
965
965
  walletClient,
966
966
  chainId: networkConfig.chainId,
967
967
  verifyingContract: networkConfig.accountingContract,
@@ -1009,7 +1009,7 @@ function useLockFunds(options = {}) {
1009
1009
  }
1010
1010
  function useUnlockFunds(options = {}) {
1011
1011
  const { address } = wagmi.useAccount();
1012
- const { client } = chunkFFYLKZ7J_cjs.usePrivanaContext();
1012
+ const { client } = chunkEXFISDHQ_cjs.usePrivanaContext();
1013
1013
  const queryClient = reactQuery.useQueryClient();
1014
1014
  const unlockMutation = reactQuery.useMutation({
1015
1015
  mutationFn: async (params) => {
@@ -1079,7 +1079,7 @@ function useUnlockFunds(options = {}) {
1079
1079
  function useTransfer(options = {}) {
1080
1080
  const { address } = wagmi.useAccount();
1081
1081
  const { data: walletClient } = wagmi.useWalletClient();
1082
- const { client, networkConfig, serviceAddress } = chunkFFYLKZ7J_cjs.usePrivanaContext();
1082
+ const { client, networkConfig, serviceAddress } = chunkEXFISDHQ_cjs.usePrivanaContext();
1083
1083
  const queryClient = reactQuery.useQueryClient();
1084
1084
  const transferMutation = reactQuery.useMutation({
1085
1085
  mutationFn: async (params) => {
@@ -1087,7 +1087,7 @@ function useTransfer(options = {}) {
1087
1087
  throw new Error("Wallet not connected");
1088
1088
  }
1089
1089
  const { nonce } = await client.getTransferNonce(address);
1090
- const signature = await chunkFFYLKZ7J_cjs.signTransferMessage({
1090
+ const signature = await chunkEXFISDHQ_cjs.signTransferMessage({
1091
1091
  walletClient,
1092
1092
  chainId: networkConfig.chainId,
1093
1093
  verifyingContract: networkConfig.accountingContract,
@@ -1124,7 +1124,7 @@ function useTransfer(options = {}) {
1124
1124
  throw new Error("Service address not configured");
1125
1125
  }
1126
1126
  const { nonce } = await client.getTransferLockedNonce(serviceAddress);
1127
- const signature = await chunkFFYLKZ7J_cjs.signTransferLockedMessage({
1127
+ const signature = await chunkEXFISDHQ_cjs.signTransferLockedMessage({
1128
1128
  walletClient,
1129
1129
  chainId: networkConfig.chainId,
1130
1130
  verifyingContract: networkConfig.accountingContract,
@@ -1184,8 +1184,8 @@ function useTransfer(options = {}) {
1184
1184
  };
1185
1185
  }
1186
1186
  function useLockedFunds(options = {}) {
1187
- const { client, pollingInterval, serviceAddress } = chunkFFYLKZ7J_cjs.usePrivanaContext();
1188
- const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
1187
+ const { client, pollingInterval, serviceAddress } = chunkEXFISDHQ_cjs.usePrivanaContext();
1188
+ const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkEXFISDHQ_cjs.usePrivateReadRequest();
1189
1189
  const query = reactQuery.useQuery({
1190
1190
  queryKey: ["accounting-locked-funds", ...privateReadQueryScope, serviceAddress ?? null],
1191
1191
  queryFn: async () => {
@@ -1207,8 +1207,8 @@ function useLockedFunds(options = {}) {
1207
1207
  };
1208
1208
  }
1209
1209
  function useTotalLockedBalance(options = {}) {
1210
- const { client, pollingInterval, defaultToken } = chunkFFYLKZ7J_cjs.usePrivanaContext();
1211
- const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
1210
+ const { client, pollingInterval, defaultToken } = chunkEXFISDHQ_cjs.usePrivanaContext();
1211
+ const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkEXFISDHQ_cjs.usePrivateReadRequest();
1212
1212
  const tokenId = options.tokenId ?? defaultToken?.id;
1213
1213
  const query = reactQuery.useQuery({
1214
1214
  queryKey: ["accounting-total-locked-balance", ...privateReadQueryScope, tokenId],
@@ -1229,8 +1229,8 @@ function useTotalLockedBalance(options = {}) {
1229
1229
  };
1230
1230
  }
1231
1231
  function useExpiredLocks(options = {}) {
1232
- const { client, pollingInterval } = chunkFFYLKZ7J_cjs.usePrivanaContext();
1233
- const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
1232
+ const { client, pollingInterval } = chunkEXFISDHQ_cjs.usePrivanaContext();
1233
+ const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkEXFISDHQ_cjs.usePrivateReadRequest();
1234
1234
  const query = reactQuery.useQuery({
1235
1235
  queryKey: ["accounting-expired-locks", ...privateReadQueryScope],
1236
1236
  queryFn: async () => {
@@ -1251,14 +1251,14 @@ function useExpiredLocks(options = {}) {
1251
1251
  };
1252
1252
  }
1253
1253
  function statusCodeOf(error) {
1254
- return error instanceof chunkFFYLKZ7J_cjs.AccountingApiError ? error.statusCode : void 0;
1254
+ return error instanceof chunkEXFISDHQ_cjs.AccountingApiError ? error.statusCode : void 0;
1255
1255
  }
1256
1256
  function usePendingDeposits(options = {}) {
1257
1257
  const queryClient = react.useContext(reactQuery.QueryClientContext);
1258
- const accountingContext = chunkFFYLKZ7J_cjs.useSafePrivanaContext();
1258
+ const accountingContext = chunkEXFISDHQ_cjs.useSafePrivanaContext();
1259
1259
  const hasProviders = !!queryClient && !!accountingContext;
1260
1260
  const client = accountingContext?.client;
1261
- const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
1261
+ const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkEXFISDHQ_cjs.usePrivateReadRequest();
1262
1262
  const { chainId, tokenAddress, lookbackBlocks } = options;
1263
1263
  const query = reactQuery.useQuery({
1264
1264
  queryKey: ["accounting-pending-deposits", ...privateReadQueryScope, chainId, tokenAddress],
@@ -1305,7 +1305,7 @@ function usePendingDeposits(options = {}) {
1305
1305
  }
1306
1306
  function usePendingWithdrawals(options = {}) {
1307
1307
  const { address, isConnected } = wagmi.useAccount();
1308
- const { client, pollingInterval } = chunkFFYLKZ7J_cjs.usePrivanaContext();
1308
+ const { client, pollingInterval } = chunkEXFISDHQ_cjs.usePrivanaContext();
1309
1309
  const query = reactQuery.useQuery({
1310
1310
  queryKey: ["accounting-pending-withdrawals", address],
1311
1311
  queryFn: async () => {
@@ -1341,8 +1341,8 @@ function usePendingWithdrawals(options = {}) {
1341
1341
  };
1342
1342
  }
1343
1343
  function useHistory(options = {}) {
1344
- const { client, pollingInterval } = chunkFFYLKZ7J_cjs.usePrivanaContext();
1345
- const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
1344
+ const { client, pollingInterval } = chunkEXFISDHQ_cjs.usePrivanaContext();
1345
+ const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkEXFISDHQ_cjs.usePrivateReadRequest();
1346
1346
  const offset = options.offset ?? -1;
1347
1347
  const limit = options.limit ?? 50;
1348
1348
  const query = reactQuery.useQuery({
@@ -1366,7 +1366,7 @@ function useHistory(options = {}) {
1366
1366
  };
1367
1367
  }
1368
1368
  function useTokenInfo(options = {}) {
1369
- const { client } = chunkFFYLKZ7J_cjs.usePrivanaContext();
1369
+ const { client } = chunkEXFISDHQ_cjs.usePrivanaContext();
1370
1370
  const { tokenId } = options;
1371
1371
  const query = reactQuery.useQuery({
1372
1372
  queryKey: ["accounting-token-info", tokenId],
@@ -1386,7 +1386,7 @@ function useTokenInfo(options = {}) {
1386
1386
  };
1387
1387
  }
1388
1388
  function useTokenList(options = {}) {
1389
- const { client } = chunkFFYLKZ7J_cjs.usePrivanaContext();
1389
+ const { client } = chunkEXFISDHQ_cjs.usePrivanaContext();
1390
1390
  const query = reactQuery.useQuery({
1391
1391
  queryKey: ["accounting-token-list"],
1392
1392
  queryFn: () => client.listTokens(),
@@ -1404,7 +1404,7 @@ function useTokenList(options = {}) {
1404
1404
  function useModifyLock(options = {}) {
1405
1405
  const { address } = wagmi.useAccount();
1406
1406
  const { data: walletClient } = wagmi.useWalletClient();
1407
- const { client, networkConfig } = chunkFFYLKZ7J_cjs.usePrivanaContext();
1407
+ const { client, networkConfig } = chunkEXFISDHQ_cjs.usePrivanaContext();
1408
1408
  const queryClient = reactQuery.useQueryClient();
1409
1409
  const mutation = reactQuery.useMutation({
1410
1410
  mutationFn: async (params) => {
@@ -1412,7 +1412,7 @@ function useModifyLock(options = {}) {
1412
1412
  throw new Error("Wallet not connected");
1413
1413
  }
1414
1414
  const { nonce } = await client.getModifyLockNonce(address);
1415
- const signature = await chunkFFYLKZ7J_cjs.signModifyLockMessage({
1415
+ const signature = await chunkEXFISDHQ_cjs.signModifyLockMessage({
1416
1416
  walletClient,
1417
1417
  chainId: networkConfig.chainId,
1418
1418
  verifyingContract: networkConfig.accountingContract,
@@ -1471,7 +1471,7 @@ function DialogOverlay({
1471
1471
  {
1472
1472
  "data-slot": "dialog-overlay",
1473
1473
  "data-privana": true,
1474
- className: chunkFFYLKZ7J_cjs.cn(
1474
+ className: chunkEXFISDHQ_cjs.cn(
1475
1475
  "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",
1476
1476
  className
1477
1477
  ),
@@ -1493,7 +1493,7 @@ function DialogContent({
1493
1493
  {
1494
1494
  "data-slot": "dialog-content",
1495
1495
  "data-privana": true,
1496
- className: chunkFFYLKZ7J_cjs.cn(
1496
+ className: chunkEXFISDHQ_cjs.cn(
1497
1497
  "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",
1498
1498
  className
1499
1499
  ),
@@ -1521,7 +1521,7 @@ function DialogTitle({ className, ...props }) {
1521
1521
  DialogPrimitive__namespace.Title,
1522
1522
  {
1523
1523
  "data-slot": "dialog-title",
1524
- className: chunkFFYLKZ7J_cjs.cn("text-lg leading-none font-semibold", className),
1524
+ className: chunkEXFISDHQ_cjs.cn("text-lg leading-none font-semibold", className),
1525
1525
  ...props
1526
1526
  }
1527
1527
  );
@@ -1534,7 +1534,7 @@ function DialogDescription({
1534
1534
  DialogPrimitive__namespace.Description,
1535
1535
  {
1536
1536
  "data-slot": "dialog-description",
1537
- className: chunkFFYLKZ7J_cjs.cn("text-muted-foreground text-sm", className),
1537
+ className: chunkEXFISDHQ_cjs.cn("text-muted-foreground text-sm", className),
1538
1538
  ...props
1539
1539
  }
1540
1540
  );
@@ -1576,7 +1576,7 @@ function sessionKey(owner, sessionId) {
1576
1576
  return `${SESSION_PREFIX}${owner.toLowerCase()}:${sessionId}`;
1577
1577
  }
1578
1578
  function activeSessionId(owner) {
1579
- const value = chunkFFYLKZ7J_cjs.getSharedBrowserStorageItem(activeSessionKey(owner));
1579
+ const value = chunkEXFISDHQ_cjs.getSharedBrowserStorageItem(activeSessionKey(owner));
1580
1580
  return value || void 0;
1581
1581
  }
1582
1582
  function isPositiveIntegerString(value) {
@@ -1608,7 +1608,7 @@ function isSessionRecord(value) {
1608
1608
  }
1609
1609
  function writeSessionRecord(session) {
1610
1610
  const id = externalDepositSessionId(session.chainId, session.tokenId);
1611
- return chunkFFYLKZ7J_cjs.setSharedBrowserStorageItem(sessionKey(session.owner, id), JSON.stringify(session));
1611
+ return chunkEXFISDHQ_cjs.setSharedBrowserStorageItem(sessionKey(session.owner, id), JSON.stringify(session));
1612
1612
  }
1613
1613
  function saveExternalDepositLockSession(session, expectedSession = null) {
1614
1614
  if (!isSessionRecord(session)) throw new Error("Invalid external deposit lock session");
@@ -1622,12 +1622,12 @@ function saveExternalDepositLockSession(session, expectedSession = null) {
1622
1622
  throw new Error("Unable to persist external deposit lock session");
1623
1623
  }
1624
1624
  if (previousId !== nextId) {
1625
- if (!chunkFFYLKZ7J_cjs.setSharedBrowserStorageItem(activeSessionKey(session.owner), nextId)) {
1626
- chunkFFYLKZ7J_cjs.removeSharedBrowserStorageItem(sessionKey(session.owner, nextId));
1625
+ if (!chunkEXFISDHQ_cjs.setSharedBrowserStorageItem(activeSessionKey(session.owner), nextId)) {
1626
+ chunkEXFISDHQ_cjs.removeSharedBrowserStorageItem(sessionKey(session.owner, nextId));
1627
1627
  throw new Error("Unable to persist external deposit lock session");
1628
1628
  }
1629
1629
  if (previousId) {
1630
- chunkFFYLKZ7J_cjs.removeSharedBrowserStorageItem(sessionKey(session.owner, previousId));
1630
+ chunkEXFISDHQ_cjs.removeSharedBrowserStorageItem(sessionKey(session.owner, previousId));
1631
1631
  }
1632
1632
  }
1633
1633
  }
@@ -1636,17 +1636,17 @@ function loadExternalDepositLockSession(owner) {
1636
1636
  if (!id) return void 0;
1637
1637
  const key = sessionKey(owner, id);
1638
1638
  try {
1639
- const raw = chunkFFYLKZ7J_cjs.getSharedBrowserStorageItem(key);
1639
+ const raw = chunkEXFISDHQ_cjs.getSharedBrowserStorageItem(key);
1640
1640
  const parsed = raw ? JSON.parse(raw) : void 0;
1641
1641
  if (!isSessionRecord(parsed) || parsed.owner.toLowerCase() !== owner.toLowerCase() || externalDepositSessionId(parsed.chainId, parsed.tokenId) !== id) {
1642
- chunkFFYLKZ7J_cjs.removeSharedBrowserStorageItem(key);
1643
- chunkFFYLKZ7J_cjs.removeSharedBrowserStorageItem(activeSessionKey(owner));
1642
+ chunkEXFISDHQ_cjs.removeSharedBrowserStorageItem(key);
1643
+ chunkEXFISDHQ_cjs.removeSharedBrowserStorageItem(activeSessionKey(owner));
1644
1644
  return void 0;
1645
1645
  }
1646
1646
  return parsed;
1647
1647
  } catch {
1648
- chunkFFYLKZ7J_cjs.removeSharedBrowserStorageItem(key);
1649
- chunkFFYLKZ7J_cjs.removeSharedBrowserStorageItem(activeSessionKey(owner));
1648
+ chunkEXFISDHQ_cjs.removeSharedBrowserStorageItem(key);
1649
+ chunkEXFISDHQ_cjs.removeSharedBrowserStorageItem(activeSessionKey(owner));
1650
1650
  return void 0;
1651
1651
  }
1652
1652
  }
@@ -1677,8 +1677,8 @@ function clearExternalDepositLockSession(owner, expectedSessionId, expectedGener
1677
1677
  const current = loadExternalDepositLockSession(owner);
1678
1678
  if (!current || current.generation !== expectedGeneration) return;
1679
1679
  }
1680
- chunkFFYLKZ7J_cjs.removeSharedBrowserStorageItem(sessionKey(owner, id));
1681
- chunkFFYLKZ7J_cjs.removeSharedBrowserStorageItem(activeSessionKey(owner));
1680
+ chunkEXFISDHQ_cjs.removeSharedBrowserStorageItem(sessionKey(owner, id));
1681
+ chunkEXFISDHQ_cjs.removeSharedBrowserStorageItem(activeSessionKey(owner));
1682
1682
  }
1683
1683
  function isSameVerification(left, right) {
1684
1684
  if (!left || !right) return left === right;
@@ -1731,7 +1731,7 @@ function markSubmissionAmbiguous(session, signature) {
1731
1731
  return writeSessionRecord({ ...current, submissionAmbiguous: true });
1732
1732
  }
1733
1733
  function ambiguousSubmissionError(error) {
1734
- return new chunkFFYLKZ7J_cjs.PostDepositLockError(
1734
+ return new chunkEXFISDHQ_cjs.PostDepositLockError(
1735
1735
  "Lock submission could not be confirmed. Retry only the saved signature, or check locked funds before stopping recovery.",
1736
1736
  error.reason,
1737
1737
  error.signedAmount,
@@ -1744,7 +1744,7 @@ function ambiguousSubmissionError(error) {
1744
1744
  }
1745
1745
  function isDefinitiveSubmissionFailure(error) {
1746
1746
  const cause = error.cause;
1747
- return cause instanceof chunkFFYLKZ7J_cjs.AccountingApiError && cause.statusCode !== 408 && cause.statusCode < 500;
1747
+ return cause instanceof chunkEXFISDHQ_cjs.AccountingApiError && cause.statusCode !== 408 && cause.statusCode < 500;
1748
1748
  }
1749
1749
  function submissionLockName(session) {
1750
1750
  return `privana:external-deposit-lock:submit:${session.owner.toLowerCase()}:${externalDepositSessionId(session.chainId, session.tokenId)}`;
@@ -1764,7 +1764,7 @@ async function submitExternalDepositLock(client, session) {
1764
1764
  return withSubmissionLock(session, async (crossTabExclusive) => {
1765
1765
  const current = loadExternalDepositLockSession(session.owner);
1766
1766
  if (!current || current.generation !== session.generation) {
1767
- throw new chunkFFYLKZ7J_cjs.PostDepositLockError(
1767
+ throw new chunkEXFISDHQ_cjs.PostDepositLockError(
1768
1768
  "External deposit lock session changed before submission",
1769
1769
  "not-found",
1770
1770
  BigInt(session.maxLockAmount),
@@ -1783,7 +1783,7 @@ async function submitExternalDepositLock(client, session) {
1783
1783
  async function submitExternalDepositLockAttempt(client, session, crossTabExclusive) {
1784
1784
  const creditedAmount = session.creditedAmount ? BigInt(session.creditedAmount) : void 0;
1785
1785
  if (!creditedAmount) {
1786
- throw new chunkFFYLKZ7J_cjs.PostDepositLockError(
1786
+ throw new chunkEXFISDHQ_cjs.PostDepositLockError(
1787
1787
  "External deposit has not been credited",
1788
1788
  "submission-failed",
1789
1789
  BigInt(session.maxLockAmount)
@@ -1791,7 +1791,7 @@ async function submitExternalDepositLockAttempt(client, session, crossTabExclusi
1791
1791
  }
1792
1792
  const payload = session.payload;
1793
1793
  if (!payload) {
1794
- throw new chunkFFYLKZ7J_cjs.PostDepositLockError(
1794
+ throw new chunkEXFISDHQ_cjs.PostDepositLockError(
1795
1795
  "No persisted signed policy found for this deposit session",
1796
1796
  "not-found",
1797
1797
  BigInt(session.maxLockAmount),
@@ -1799,7 +1799,7 @@ async function submitExternalDepositLockAttempt(client, session, crossTabExclusi
1799
1799
  );
1800
1800
  }
1801
1801
  try {
1802
- return await chunkFFYLKZ7J_cjs.submitPendingLock({
1802
+ return await chunkEXFISDHQ_cjs.submitPendingLock({
1803
1803
  client,
1804
1804
  payload,
1805
1805
  creditedAmount,
@@ -1810,23 +1810,23 @@ async function submitExternalDepositLockAttempt(client, session, crossTabExclusi
1810
1810
  }
1811
1811
  });
1812
1812
  } catch (err) {
1813
- if (err instanceof chunkFFYLKZ7J_cjs.PostDepositLockError && err.reason === "submission-failed" && crossTabExclusive && !session.submissionAmbiguous && isDefinitiveSubmissionFailure(err)) {
1813
+ if (err instanceof chunkEXFISDHQ_cjs.PostDepositLockError && err.reason === "submission-failed" && crossTabExclusive && !session.submissionAmbiguous && isDefinitiveSubmissionFailure(err)) {
1814
1814
  if (!clearSubmittedPayload(session, payload.signature, true)) {
1815
1815
  const latest = loadExternalDepositLockSession(session.owner);
1816
1816
  if (latest?.submissionAmbiguous) throw ambiguousSubmissionError(err);
1817
1817
  }
1818
- } else if (err instanceof chunkFFYLKZ7J_cjs.PostDepositLockError && err.reason === "submission-failed") {
1818
+ } else if (err instanceof chunkEXFISDHQ_cjs.PostDepositLockError && err.reason === "submission-failed") {
1819
1819
  const ambiguous = markSubmissionAmbiguous(session, payload.signature) || loadExternalDepositLockSession(session.owner)?.submissionAmbiguous === true;
1820
1820
  if (ambiguous) throw ambiguousSubmissionError(err);
1821
1821
  } else {
1822
1822
  const current = loadExternalDepositLockSession(session.owner);
1823
1823
  if (session.submissionAmbiguous || current?.submissionAmbiguous) {
1824
- if (err instanceof chunkFFYLKZ7J_cjs.PostDepositLockError) throw ambiguousSubmissionError(err);
1824
+ if (err instanceof chunkEXFISDHQ_cjs.PostDepositLockError) throw ambiguousSubmissionError(err);
1825
1825
  throw err;
1826
1826
  }
1827
1827
  if (!clearSubmittedPayload(session, payload.signature)) {
1828
1828
  const latest = loadExternalDepositLockSession(session.owner);
1829
- if (latest?.submissionAmbiguous && err instanceof chunkFFYLKZ7J_cjs.PostDepositLockError) {
1829
+ if (latest?.submissionAmbiguous && err instanceof chunkEXFISDHQ_cjs.PostDepositLockError) {
1830
1830
  throw ambiguousSubmissionError(err);
1831
1831
  }
1832
1832
  }
@@ -1839,12 +1839,12 @@ function useExternalDepositLock({
1839
1839
  onLockSubmitted,
1840
1840
  onLockFailed
1841
1841
  }) {
1842
- const { client, networkConfig, serviceAddress, getTokenById, tokensStatus } = chunkFFYLKZ7J_cjs.usePrivanaContext();
1842
+ const { client, networkConfig, serviceAddress, getTokenById, tokensStatus } = chunkEXFISDHQ_cjs.usePrivanaContext();
1843
1843
  const config = wagmi.useConfig();
1844
1844
  const queryClient = reactQuery.useQueryClient();
1845
1845
  const { address } = wagmi.useAccount();
1846
- const { privateReadAddress } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
1847
- const { ensureCorrectChain } = chunkFFYLKZ7J_cjs.useEnsureCorrectChain();
1846
+ const { privateReadAddress } = chunkEXFISDHQ_cjs.usePrivateReadRequest();
1847
+ const { ensureCorrectChain } = chunkEXFISDHQ_cjs.useEnsureCorrectChain();
1848
1848
  const [isSigning, setIsSigning] = react.useState(false);
1849
1849
  const [isSubmittingLock, setIsSubmittingLock] = react.useState(false);
1850
1850
  const [session, setSession] = react.useState(null);
@@ -1904,7 +1904,7 @@ function useExternalDepositLock({
1904
1904
  result = await submitExternalDepositLock(client, submission);
1905
1905
  } catch (err) {
1906
1906
  const stored = loadExternalDepositLockSession(active.owner);
1907
- const error = err instanceof chunkFFYLKZ7J_cjs.PostDepositLockError ? err : new chunkFFYLKZ7J_cjs.PostDepositLockError(
1907
+ const error = err instanceof chunkEXFISDHQ_cjs.PostDepositLockError ? err : new chunkEXFISDHQ_cjs.PostDepositLockError(
1908
1908
  err instanceof Error ? err.message : "Lock submission failed",
1909
1909
  "submission-failed",
1910
1910
  BigInt(active.maxLockAmount),
@@ -1983,7 +1983,7 @@ function useExternalDepositLock({
1983
1983
  void submitSession(restored);
1984
1984
  } else if (restored.creditedAmount) {
1985
1985
  notifyFailure(
1986
- new chunkFFYLKZ7J_cjs.PostDepositLockError(
1986
+ new chunkEXFISDHQ_cjs.PostDepositLockError(
1987
1987
  "Deposit credited; sign a fresh policy to lock the funds",
1988
1988
  "not-found",
1989
1989
  BigInt(restored.maxLockAmount),
@@ -2023,10 +2023,10 @@ function useExternalDepositLock({
2023
2023
  if (signingRef.current || settlingRef.current) {
2024
2024
  throw new Error("A policy operation is already in progress");
2025
2025
  }
2026
- if (!chunkFFYLKZ7J_cjs.canUseSharedBrowserStorage()) {
2026
+ if (!chunkEXFISDHQ_cjs.canUseSharedBrowserStorage()) {
2027
2027
  throw new Error("Browser storage is required for locked deposit recovery");
2028
2028
  }
2029
- const owner = chunkFFYLKZ7J_cjs.requireDepositLockOwner(address, privateReadAddress);
2029
+ const owner = chunkEXFISDHQ_cjs.requireDepositLockOwner(address, privateReadAddress);
2030
2030
  if (sessionRef.current || loadExternalDepositLockSession(owner)) {
2031
2031
  throw new Error("Finish or cancel the active external deposit before starting another");
2032
2032
  }
@@ -2035,26 +2035,26 @@ function useExternalDepositLock({
2035
2035
  if (token.contract === viem.zeroAddress) {
2036
2036
  throw new Error("External deposits support ERC20 tokens only");
2037
2037
  }
2038
- const targetService = chunkFFYLKZ7J_cjs.requireServiceAddress(serviceAddress);
2039
- const lockDuration = allowance.lockDuration ?? chunkFFYLKZ7J_cjs.DEFAULT_LOCK_DURATION_SECONDS;
2038
+ const targetService = chunkEXFISDHQ_cjs.requireServiceAddress(serviceAddress);
2039
+ const lockDuration = allowance.lockDuration ?? chunkEXFISDHQ_cjs.DEFAULT_LOCK_DURATION_SECONDS;
2040
2040
  signingRef.current = true;
2041
2041
  setIsSigning(true);
2042
2042
  try {
2043
2043
  await ensureCorrectChain(networkConfig.chainId);
2044
- const signingWalletClient = await chunkFFYLKZ7J_cjs.getWalletClient(config, {
2044
+ const signingWalletClient = await chunkEXFISDHQ_cjs.getWalletClient(config, {
2045
2045
  chainId: networkConfig.chainId
2046
2046
  });
2047
- const payload = await chunkFFYLKZ7J_cjs.createSignedLockRequest({
2047
+ const payload = await chunkEXFISDHQ_cjs.createSignedLockRequest({
2048
2048
  client,
2049
2049
  walletClient: signingWalletClient,
2050
2050
  userAddress: owner,
2051
2051
  networkConfig,
2052
2052
  serviceAddress: targetService,
2053
2053
  tokenId: token.id,
2054
- amount: chunkFFYLKZ7J_cjs.clampLockAmount(amount, BigInt(allowance.value)),
2054
+ amount: chunkEXFISDHQ_cjs.clampLockAmount(amount, BigInt(allowance.value)),
2055
2055
  lockDuration
2056
2056
  });
2057
- const startBlock = await chunkFFYLKZ7J_cjs.getBlockNumber(config, { chainId: token.chainId });
2057
+ const startBlock = await chunkEXFISDHQ_cjs.getBlockNumber(config, { chainId: token.chainId });
2058
2058
  if (startBlock > BigInt(Number.MAX_SAFE_INTEGER)) {
2059
2059
  throw new Error("Source-chain block number exceeds the supported range");
2060
2060
  }
@@ -2120,7 +2120,7 @@ function useExternalDepositLock({
2120
2120
  pendingCreditedTransitionRef.current = { predecessor: active, credited };
2121
2121
  installSession(credited);
2122
2122
  notifyFailure(
2123
- new chunkFFYLKZ7J_cjs.PostDepositLockError(
2123
+ new chunkEXFISDHQ_cjs.PostDepositLockError(
2124
2124
  err instanceof Error ? err.message : "Unable to persist credited deposit state",
2125
2125
  "submission-failed",
2126
2126
  BigInt(active.maxLockAmount),
@@ -2180,7 +2180,7 @@ function useExternalDepositLock({
2180
2180
  if (!token || token.chainId !== active.chainId || token.contract === viem.zeroAddress) {
2181
2181
  throw new Error("The credited token is no longer available");
2182
2182
  }
2183
- const targetService = chunkFFYLKZ7J_cjs.requireServiceAddress(serviceAddress);
2183
+ const targetService = chunkEXFISDHQ_cjs.requireServiceAddress(serviceAddress);
2184
2184
  if (targetService.toLowerCase() !== active.serviceAddress.toLowerCase()) {
2185
2185
  throw new Error("The service for this credited deposit has changed");
2186
2186
  }
@@ -2193,17 +2193,17 @@ function useExternalDepositLock({
2193
2193
  "The previous lock submission may have succeeded; a fresh signature is unsafe"
2194
2194
  );
2195
2195
  }
2196
- const owner = chunkFFYLKZ7J_cjs.requireDepositLockOwner(address, privateReadAddress);
2196
+ const owner = chunkEXFISDHQ_cjs.requireDepositLockOwner(address, privateReadAddress);
2197
2197
  const amount = externalDepositRetryAmount(active);
2198
2198
  let retrySession;
2199
2199
  signingRef.current = true;
2200
2200
  setIsSigning(true);
2201
2201
  try {
2202
2202
  await ensureCorrectChain(networkConfig.chainId);
2203
- const signingWalletClient = await chunkFFYLKZ7J_cjs.getWalletClient(config, {
2203
+ const signingWalletClient = await chunkEXFISDHQ_cjs.getWalletClient(config, {
2204
2204
  chainId: networkConfig.chainId
2205
2205
  });
2206
- const payload = await chunkFFYLKZ7J_cjs.createSignedLockRequest({
2206
+ const payload = await chunkEXFISDHQ_cjs.createSignedLockRequest({
2207
2207
  client,
2208
2208
  walletClient: signingWalletClient,
2209
2209
  userAddress: owner,
@@ -2425,7 +2425,7 @@ function getChainIcon(chainId, size) {
2425
2425
  }
2426
2426
  }
2427
2427
  function TokenSelectorView({ selectedTokenId, onSelect }) {
2428
- const { enabledTokens, getChainById: getChainById2 } = chunkFFYLKZ7J_cjs.usePrivanaContext();
2428
+ const { enabledTokens, getChainById: getChainById2 } = chunkEXFISDHQ_cjs.usePrivanaContext();
2429
2429
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-muted flex flex-col rounded-[10px] p-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex max-h-72 flex-col gap-1 overflow-y-auto", children: [
2430
2430
  enabledTokens.map((token) => {
2431
2431
  const isSelected = selectedTokenId === token.id;
@@ -2435,7 +2435,7 @@ function TokenSelectorView({ selectedTokenId, onSelect }) {
2435
2435
  {
2436
2436
  type: "button",
2437
2437
  onClick: () => onSelect(token.id),
2438
- className: chunkFFYLKZ7J_cjs.cn(
2438
+ className: chunkEXFISDHQ_cjs.cn(
2439
2439
  "hover:bg-secondary flex w-full cursor-pointer items-center gap-3 rounded-lg px-3 py-2 text-left transition-colors",
2440
2440
  isSelected && "bg-secondary"
2441
2441
  ),
@@ -2476,15 +2476,356 @@ function TokenSelectorView({ selectedTokenId, onSelect }) {
2476
2476
  enabledTokens.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground px-3 py-6 text-center text-sm", children: "No tokens available" })
2477
2477
  ] }) });
2478
2478
  }
2479
+ function assertTransakCheckoutPreconditions({
2480
+ activeIntentId,
2481
+ canOpen,
2482
+ canRecreateSession
2483
+ }) {
2484
+ if (activeIntentId && !canRecreateSession) {
2485
+ throw new Error("Continue signed-intent recovery instead of reopening this checkout");
2486
+ }
2487
+ if (!canOpen) {
2488
+ throw new Error("Card checkout is unavailable; close this purchase and start again");
2489
+ }
2490
+ }
2491
+ function TransakCardWidgetView({
2492
+ token,
2493
+ providerAssetCode,
2494
+ amount,
2495
+ allowance,
2496
+ lockServiceAddress,
2497
+ onCredited,
2498
+ onLockSubmitted,
2499
+ onLockFailed,
2500
+ onLeave,
2501
+ onUnsafeToCloseChange,
2502
+ onActiveFlowChange,
2503
+ useOnRamp = chunkEXFISDHQ_cjs.useTransakOnRamp
2504
+ }) {
2505
+ const [actionError, setActionError] = react.useState(null);
2506
+ const [rowError, setRowError] = react.useState(null);
2507
+ const [lockSettled, setLockSettled] = react.useState(false);
2508
+ const [lockError, setLockError] = react.useState(null);
2509
+ const [ownedTerminal, setOwnedTerminal] = react.useState(false);
2510
+ const ownedIntentIdRef = react.useRef(null);
2511
+ const postDepositLock = react.useMemo(
2512
+ () => allowance ? {
2513
+ serviceAddress: lockServiceAddress,
2514
+ maxAmount: BigInt(allowance.value),
2515
+ lockDuration: allowance.lockDuration
2516
+ } : void 0,
2517
+ [allowance, lockServiceAddress]
2518
+ );
2519
+ const ownsRecord = react.useCallback(
2520
+ (record) => Boolean(
2521
+ ownedIntentIdRef.current && chunkEXFISDHQ_cjs.matchesOnRampTransaction(record, ownedIntentIdRef.current)
2522
+ ),
2523
+ []
2524
+ );
2525
+ const {
2526
+ status,
2527
+ activeIntentId,
2528
+ pending,
2529
+ activeVerificationId,
2530
+ error,
2531
+ finalityProgress,
2532
+ depositAddress,
2533
+ minDepositBaseUnits,
2534
+ selectedToken,
2535
+ isLaunching,
2536
+ isWidgetOpen,
2537
+ canRecreateSession,
2538
+ widget,
2539
+ launch,
2540
+ recreateSession,
2541
+ closeWidget,
2542
+ finishPendingVerification,
2543
+ refreshPending
2544
+ } = useOnRamp({
2545
+ tokenId: token.id,
2546
+ postDepositLock,
2547
+ iframeTitle: "Card checkout",
2548
+ iframeClassName: "h-[680px] w-full border-0",
2549
+ onCredited: (_depositTxHash, record) => {
2550
+ if (!ownsRecord(record)) return;
2551
+ onCredited?.();
2552
+ if (!postDepositLock) {
2553
+ setOwnedTerminal(true);
2554
+ onActiveFlowChange?.(false);
2555
+ }
2556
+ },
2557
+ onLockSubmitted: (_response, record) => {
2558
+ if (!ownsRecord(record)) return;
2559
+ setLockError(null);
2560
+ setLockSettled(true);
2561
+ setOwnedTerminal(true);
2562
+ onActiveFlowChange?.(false);
2563
+ onLockSubmitted?.();
2564
+ },
2565
+ onLockFailed: (nextError, record) => {
2566
+ if (!ownsRecord(record)) return;
2567
+ setLockError(nextError);
2568
+ setOwnedTerminal(true);
2569
+ onActiveFlowChange?.(false);
2570
+ onLockFailed?.(nextError);
2571
+ }
2572
+ });
2573
+ const ownedIntentId = ownedIntentIdRef.current ?? activeIntentId;
2574
+ react.useEffect(() => {
2575
+ if (activeIntentId && !ownedIntentIdRef.current) {
2576
+ ownedIntentIdRef.current = activeIntentId;
2577
+ }
2578
+ }, [activeIntentId]);
2579
+ let amountBaseUnits;
2580
+ try {
2581
+ amountBaseUnits = viem.parseUnits(amount, token.decimals);
2582
+ } catch {
2583
+ }
2584
+ const minimumTargetBaseUnits = minDepositBaseUnits === void 0 ? void 0 : chunkEXFISDHQ_cjs.getTransakMinimumTargetBaseUnits(minDepositBaseUnits);
2585
+ const belowMinimum = amountBaseUnits !== void 0 && minimumTargetBaseUnits !== void 0 && amountBaseUnits < minimumTargetBaseUnits;
2586
+ const minimumUnknown = minimumTargetBaseUnits === void 0;
2587
+ const tokenMismatch = !chunkEXFISDHQ_cjs.matchesFrozenOnRampToken(token, selectedToken);
2588
+ const isSettling = status === "awaiting-delivery" || status === "verifying";
2589
+ const lockPending = !!allowance && status === "credited" && !lockSettled && !lockError;
2590
+ const ownedPending = ownedIntentId ? pending.filter((record) => chunkEXFISDHQ_cjs.matchesOnRampTransaction(record, ownedIntentId)) : [];
2591
+ const ownedFlowActive = !ownedTerminal && (Boolean(activeIntentId && activeIntentId === ownedIntentId) || ownedPending.length > 0 || lockPending);
2592
+ const canOpen = Boolean(selectedToken && depositAddress && amountBaseUnits && amountBaseUnits > 0n) && !tokenMismatch && !minimumUnknown && !belowMinimum && !isLaunching && !isWidgetOpen && !isSettling && status !== "credited" && (!activeIntentId || canRecreateSession);
2593
+ react.useEffect(() => {
2594
+ onActiveFlowChange?.(ownedFlowActive);
2595
+ }, [onActiveFlowChange, ownedFlowActive]);
2596
+ const unsafeToClose = isLaunching || lockPending;
2597
+ react.useEffect(() => {
2598
+ onUnsafeToCloseChange?.(unsafeToClose);
2599
+ return () => onUnsafeToCloseChange?.(false);
2600
+ }, [onUnsafeToCloseChange, unsafeToClose]);
2601
+ const runCheckout = react.useCallback(async () => {
2602
+ setActionError(null);
2603
+ try {
2604
+ assertTransakCheckoutPreconditions({ activeIntentId, canOpen, canRecreateSession });
2605
+ setLockError(null);
2606
+ setLockSettled(false);
2607
+ setOwnedTerminal(false);
2608
+ if (!activeIntentId) ownedIntentIdRef.current = null;
2609
+ if (activeIntentId) await recreateSession();
2610
+ else await launch({ providerAssetCode, quoteCurrencyAmount: amount });
2611
+ } catch (nextError) {
2612
+ setActionError(
2613
+ nextError instanceof Error ? nextError : new Error("Failed to open card checkout")
2614
+ );
2615
+ }
2616
+ }, [
2617
+ activeIntentId,
2618
+ amount,
2619
+ canOpen,
2620
+ canRecreateSession,
2621
+ launch,
2622
+ providerAssetCode,
2623
+ recreateSession
2624
+ ]);
2625
+ const handleClose = react.useCallback(async () => {
2626
+ setActionError(null);
2627
+ try {
2628
+ await closeWidget();
2629
+ } catch (nextError) {
2630
+ setActionError(
2631
+ nextError instanceof Error ? nextError : new Error("Failed to close card checkout")
2632
+ );
2633
+ }
2634
+ }, [closeWidget]);
2635
+ const handleLeave = react.useCallback(() => {
2636
+ setActionError(null);
2637
+ onActiveFlowChange?.(false);
2638
+ onLeave?.();
2639
+ }, [onActiveFlowChange, onLeave]);
2640
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-muted flex flex-col gap-4 rounded-[10px] p-5", children: [
2641
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
2642
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-foreground text-[28px] leading-8 font-medium", children: "Complete your purchase" }),
2643
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-muted-foreground mt-1 text-sm", children: [
2644
+ "Buy ",
2645
+ token.symbol,
2646
+ " and deposit it directly into your Privana balance."
2647
+ ] })
2648
+ ] }),
2649
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-border bg-card rounded-lg border p-3 text-sm", children: [
2650
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-foreground font-medium", children: [
2651
+ "Target receipt: at least ",
2652
+ amount,
2653
+ " ",
2654
+ token.symbol
2655
+ ] }),
2656
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground mt-1", children: "In Transak, adjust the fiat amount until \u201CYou receive\u201D is at least this target." }),
2657
+ allowance && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground mt-1", children: "The pre-signed lock is 98% of the target, capped by the service allowance." })
2658
+ ] }),
2659
+ widget ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-border bg-card overflow-hidden rounded-xl border", children: [
2660
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-border flex items-center justify-between border-b px-4 py-2 text-sm", children: [
2661
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: "Card checkout" }),
2662
+ /* @__PURE__ */ jsxRuntime.jsx(chunkEXFISDHQ_cjs.Button, { type: "button", variant: "outline", size: "sm", onClick: () => void handleClose(), children: "Close" })
2663
+ ] }),
2664
+ widget
2665
+ ] }) : status === "credited" && !lockPending && !lockError ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-2 py-8 text-center", children: [
2666
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CircleCheckIcon, { className: "text-primary size-8", "aria-hidden": true }),
2667
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground text-sm font-medium", children: "Purchase credited" }),
2668
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-muted-foreground text-sm", children: [
2669
+ "Your ",
2670
+ token.symbol,
2671
+ " deposit is now available in your balance."
2672
+ ] })
2673
+ ] }) : !activeIntentId || canRecreateSession ? /* @__PURE__ */ jsxRuntime.jsxs(chunkEXFISDHQ_cjs.Button, { type: "button", disabled: !canOpen, onClick: () => void runCheckout(), children: [
2674
+ isLaunching && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "animate-spin", "aria-hidden": true }),
2675
+ isLaunching ? "Opening checkout\u2026" : activeIntentId ? "Reopen card checkout" : allowance ? "Sign policy and open checkout" : "Open card checkout"
2676
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: "This signed purchase is in recovery. Do not open another checkout for it." }),
2677
+ !depositAddress && !error && !actionError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: "Preparing your secure deposit address\u2026" }),
2678
+ tokenMismatch && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive text-sm", role: "alert", children: "The token configuration changed. Close this purchase and start again." }),
2679
+ !tokenMismatch && depositAddress && minimumUnknown && !error && !actionError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive text-sm", role: "alert", children: "The minimum purchase amount is unavailable. Close this purchase and try again." }),
2680
+ belowMinimum && minimumTargetBaseUnits !== void 0 && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-destructive text-sm", role: "alert", children: [
2681
+ "Minimum target is ",
2682
+ viem.formatUnits(minimumTargetBaseUnits, token.decimals),
2683
+ " ",
2684
+ token.symbol,
2685
+ ", including a 5% delivery buffer."
2686
+ ] }),
2687
+ isSettling && pending.length === 0 && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-muted-foreground flex items-center gap-2 text-sm", children: [
2688
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin", "aria-hidden": true }),
2689
+ "Verifying your purchase\u2026"
2690
+ ] }),
2691
+ lockPending && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-muted-foreground flex items-center gap-2 text-sm", children: [
2692
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin", "aria-hidden": true }),
2693
+ "Purchase credited. Locking your funds\u2026"
2694
+ ] }),
2695
+ pending.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
2696
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground text-sm font-medium", children: "Validating purchases" }),
2697
+ pending.map((record) => {
2698
+ const isActivelyVerifying = record.transaction_id === activeVerificationId;
2699
+ const progress = parseFinalityProgress(finalityProgress[record.transaction_id]);
2700
+ const showRetry = chunkEXFISDHQ_cjs.canRetryOnRampVerification(record, activeVerificationId);
2701
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2702
+ "div",
2703
+ {
2704
+ className: "border-border flex flex-col gap-2 rounded-md border p-2",
2705
+ children: [
2706
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-muted-foreground flex items-center gap-1 text-xs", children: [
2707
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-3 animate-spin", "aria-hidden": true }),
2708
+ record.on_chain_tx_hash ? progress ?? (isActivelyVerifying ? "Verifying\u2026" : "Ready to verify") : "Waiting for provider delivery\u2026"
2709
+ ] }),
2710
+ rowError?.id === record.transaction_id && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive text-xs", children: rowError.message }),
2711
+ showRetry && /* @__PURE__ */ jsxRuntime.jsx(
2712
+ chunkEXFISDHQ_cjs.Button,
2713
+ {
2714
+ type: "button",
2715
+ variant: "outline",
2716
+ size: "sm",
2717
+ onClick: async () => {
2718
+ setRowError(null);
2719
+ try {
2720
+ await finishPendingVerification(record);
2721
+ } catch (nextError) {
2722
+ setRowError({
2723
+ id: record.transaction_id,
2724
+ message: nextError instanceof Error ? nextError.message : "Verification failed"
2725
+ });
2726
+ }
2727
+ },
2728
+ children: "Retry verification"
2729
+ }
2730
+ ),
2731
+ !record.on_chain_tx_hash && /* @__PURE__ */ jsxRuntime.jsx(
2732
+ chunkEXFISDHQ_cjs.Button,
2733
+ {
2734
+ type: "button",
2735
+ variant: "outline",
2736
+ size: "sm",
2737
+ onClick: () => void refreshPending(),
2738
+ children: "Refresh delivery"
2739
+ }
2740
+ )
2741
+ ]
2742
+ },
2743
+ record.transaction_id
2744
+ );
2745
+ })
2746
+ ] }),
2747
+ onLeave && ownedFlowActive && !unsafeToClose && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
2748
+ /* @__PURE__ */ jsxRuntime.jsx(chunkEXFISDHQ_cjs.Button, { type: "button", variant: "outline", onClick: handleLeave, children: "Leave checkout" }),
2749
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-xs", children: "Privana will keep this signed purchase available for exact recovery." })
2750
+ ] }),
2751
+ (actionError ?? error) && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive text-sm", role: "alert", children: (actionError ?? error)?.message }),
2752
+ lockError && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-destructive text-sm", role: "alert", children: [
2753
+ "Purchase credited, but locking the funds failed: ",
2754
+ lockError.message
2755
+ ] })
2756
+ ] });
2757
+ }
2758
+ function parseFinalityProgress(message) {
2759
+ if (!message) return null;
2760
+ const match = message.match(/(\d+\/\d+)\s+confirmations/i);
2761
+ return match ? `${match[1]} confirmations` : null;
2762
+ }
2479
2763
  function CreditCardWidgetView({
2480
2764
  token,
2765
+ onRamp,
2481
2766
  amount,
2482
2767
  allowance,
2768
+ lockServiceAddress,
2483
2769
  onCredited,
2484
2770
  onLockSubmitted,
2485
- onLockFailed
2771
+ onLockFailed,
2772
+ onLeave,
2773
+ onUnsafeToCloseChange,
2774
+ onActiveFlowChange
2486
2775
  }) {
2487
- const moonpayCurrencyCode = token?.moonpayCurrencyCode;
2776
+ if (onRamp.unavailableReason || !token || !onRamp.provider || !onRamp.providerAssetCode) {
2777
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-muted flex flex-col gap-2 rounded-[10px] p-5", children: [
2778
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-foreground text-[28px] leading-8 font-medium", children: "Card purchases unavailable" }),
2779
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive text-sm", children: onRamp.unavailableReason ?? "The card on-ramp is not configured for this token." })
2780
+ ] });
2781
+ }
2782
+ if (onRamp.provider === "transak") {
2783
+ return /* @__PURE__ */ jsxRuntime.jsx(
2784
+ TransakCardWidgetView,
2785
+ {
2786
+ token,
2787
+ providerAssetCode: onRamp.providerAssetCode,
2788
+ amount,
2789
+ allowance,
2790
+ lockServiceAddress,
2791
+ onCredited,
2792
+ onLockSubmitted,
2793
+ onLockFailed,
2794
+ onLeave,
2795
+ onUnsafeToCloseChange,
2796
+ onActiveFlowChange
2797
+ }
2798
+ );
2799
+ }
2800
+ return /* @__PURE__ */ jsxRuntime.jsx(
2801
+ MoonPayCardWidgetView,
2802
+ {
2803
+ token,
2804
+ amount,
2805
+ allowance,
2806
+ lockServiceAddress,
2807
+ onCredited,
2808
+ onLockSubmitted,
2809
+ onLockFailed,
2810
+ onLeaveFlow: onLeave,
2811
+ onUnsafeToCloseChange,
2812
+ onActiveFlowChange
2813
+ }
2814
+ );
2815
+ }
2816
+ function MoonPayCardWidgetView({
2817
+ token,
2818
+ amount,
2819
+ allowance,
2820
+ lockServiceAddress,
2821
+ onCredited,
2822
+ onLockSubmitted,
2823
+ onLockFailed,
2824
+ onLeaveFlow,
2825
+ onUnsafeToCloseChange,
2826
+ onActiveFlowChange
2827
+ }) {
2828
+ const moonpayCurrencyCode = token.moonpayCurrencyCode;
2488
2829
  const containerRef = react.useRef(null);
2489
2830
  const [widgetTheme, setWidgetTheme] = react.useState();
2490
2831
  react.useEffect(() => {
@@ -2492,26 +2833,32 @@ function CreditCardWidgetView({
2492
2833
  }, []);
2493
2834
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, className: "bg-muted flex flex-col gap-6 rounded-[10px] p-5", children: [
2494
2835
  /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-foreground text-[28px] leading-8 font-medium", children: "Complete your purchase" }),
2495
- token && moonpayCurrencyCode ? /* @__PURE__ */ jsxRuntime.jsx(
2496
- chunkFFYLKZ7J_cjs.FiatOnRampForm,
2836
+ moonpayCurrencyCode ? /* @__PURE__ */ jsxRuntime.jsx(
2837
+ chunkEXFISDHQ_cjs.FiatOnRampForm,
2497
2838
  {
2498
2839
  tokenId: token.id,
2840
+ frozenToken: token,
2499
2841
  currencyCode: moonpayCurrencyCode,
2500
2842
  quoteCurrencyAmount: amount || void 0,
2501
2843
  lockAmount: true,
2502
2844
  variant: "embedded",
2503
2845
  autoStart: true,
2504
2846
  theme: widgetTheme,
2847
+ onlyRouteActiveIntentCallbacks: true,
2848
+ onUnsafeToCloseChange,
2849
+ onActiveFlowChange,
2505
2850
  postDepositLock: allowance ? {
2851
+ serviceAddress: lockServiceAddress,
2506
2852
  maxAmount: BigInt(allowance.value),
2507
2853
  lockDuration: allowance.lockDuration
2508
2854
  } : void 0,
2509
2855
  onCredited,
2510
2856
  onLockSubmitted,
2511
- onLockFailed
2857
+ onLockFailed,
2858
+ onLeaveFlow
2512
2859
  }
2513
2860
  ) : /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-muted-foreground text-sm", children: [
2514
- token?.symbol ?? "This token",
2861
+ token.symbol,
2515
2862
  " isn\u2019t available for card purchases yet."
2516
2863
  ] })
2517
2864
  ] });
@@ -2782,7 +3129,7 @@ function ChevronDownIcon({
2782
3129
  height: "16",
2783
3130
  viewBox: "0 0 16 16",
2784
3131
  fill: "none",
2785
- className: chunkFFYLKZ7J_cjs.cn(
3132
+ className: chunkEXFISDHQ_cjs.cn(
2786
3133
  "transition-transform",
2787
3134
  direction === "right" && "-rotate-90",
2788
3135
  direction === "up" && "rotate-180",
@@ -2820,7 +3167,7 @@ function CopyIcon() {
2820
3167
  }
2821
3168
  );
2822
3169
  }
2823
- function CircleCheckIcon() {
3170
+ function CircleCheckIcon2() {
2824
3171
  return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", children: [
2825
3172
  /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "10", cy: "10", r: "9", stroke: "currentColor", strokeWidth: "1.5" }),
2826
3173
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -2935,11 +3282,11 @@ function PolicyTermRow({
2935
3282
  /* @__PURE__ */ jsxRuntime.jsx(
2936
3283
  "div",
2937
3284
  {
2938
- className: chunkFFYLKZ7J_cjs.cn(
3285
+ className: chunkEXFISDHQ_cjs.cn(
2939
3286
  "mt-0.5 shrink-0",
2940
3287
  kind === "permission" ? "text-emerald-500" : "text-orange-500"
2941
3288
  ),
2942
- children: kind === "permission" ? /* @__PURE__ */ jsxRuntime.jsx(CircleCheckIcon, {}) : /* @__PURE__ */ jsxRuntime.jsx(CircleXIcon, {})
3289
+ children: kind === "permission" ? /* @__PURE__ */ jsxRuntime.jsx(CircleCheckIcon2, {}) : /* @__PURE__ */ jsxRuntime.jsx(CircleXIcon, {})
2943
3290
  }
2944
3291
  ),
2945
3292
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
@@ -2999,6 +3346,7 @@ function AllowancePolicySection({
2999
3346
  function DepositView({
3000
3347
  source,
3001
3348
  selectedToken,
3349
+ onRamp,
3002
3350
  amount,
3003
3351
  allowance,
3004
3352
  externalMinimum,
@@ -3008,7 +3356,7 @@ function DepositView({
3008
3356
  onSubmit,
3009
3357
  isSubmitting = false
3010
3358
  }) {
3011
- const { getChainById: getChainById2, chains, serviceName, serviceIcon, networkConfig, hostedAuthConfig } = chunkFFYLKZ7J_cjs.usePrivanaContext();
3359
+ const { getChainById: getChainById2, chains, serviceName, serviceIcon, networkConfig, hostedAuthConfig } = chunkEXFISDHQ_cjs.usePrivanaContext();
3012
3360
  const { address, isConnected } = wagmi.useAccount();
3013
3361
  const appName = serviceName ?? "Privana";
3014
3362
  const chain = selectedToken ? getChainById2(selectedToken.chainId) : void 0;
@@ -3017,6 +3365,8 @@ function DepositView({
3017
3365
  const isConnectedSource = source === "connected";
3018
3366
  const isExternal = source === "external";
3019
3367
  const isCreditCard = source === "credit-card";
3368
+ const isMoonPayCard = isCreditCard && chunkEXFISDHQ_cjs.isMoonPayProductOnRamp(onRamp);
3369
+ const isTransakCard = isCreditCard && onRamp.provider === "transak";
3020
3370
  const isNative = selectedToken?.contract === viem.zeroAddress;
3021
3371
  const { data: nativeBalanceData } = wagmi.useBalance({
3022
3372
  address,
@@ -3032,7 +3382,7 @@ function DepositView({
3032
3382
  query: { enabled: isConnectedSource && !!address && !!selectedToken && !isNative }
3033
3383
  });
3034
3384
  const walletBalance = isNative ? nativeBalanceData?.value : erc20Balance;
3035
- const formattedWalletBalance = walletBalance != null && selectedToken ? chunkFFYLKZ7J_cjs.formatTokenAmount(walletBalance.toString(), selectedToken.decimals) : "0.00";
3385
+ const formattedWalletBalance = walletBalance != null && selectedToken ? chunkEXFISDHQ_cjs.formatTokenAmount(walletBalance.toString(), selectedToken.decimals) : "0.00";
3036
3386
  const {
3037
3387
  minBuyAmount: moonpayMinBuy,
3038
3388
  isLoading: moonpayLimitsLoading,
@@ -3040,20 +3390,20 @@ function DepositView({
3040
3390
  } = useMoonpayLimits({
3041
3391
  currencyCode: selectedToken?.moonpayCurrencyCode,
3042
3392
  apiBaseUrl: networkConfig.moonpayApiUrl,
3043
- enabled: isCreditCard
3393
+ enabled: isMoonPayCard
3044
3394
  });
3045
3395
  const hasValidAmount = !!amount && parseFloat(amount) > 0;
3046
- const maxAmountDecimals = isCreditCard ? 2 : selectedToken?.decimals;
3396
+ const maxAmountDecimals = isMoonPayCard ? 2 : selectedToken?.decimals;
3047
3397
  const tooManyDecimals = hasValidAmount && maxAmountDecimals != null && amount.includes(".") && amount.split(".")[1].length > maxAmountDecimals;
3048
- const exceedsBalance = isConnectedSource && hasValidAmount && !tooManyDecimals && !!selectedToken && walletBalance != null && chunkFFYLKZ7J_cjs.parseTokenAmount(amount, selectedToken.decimals) > walletBalance;
3049
- const belowMoonpayMin = isCreditCard && hasValidAmount && moonpayMinBuy != null && parseFloat(amount) < moonpayMinBuy;
3050
- const moonpayLimitsUnready = isCreditCard && !!selectedToken?.moonpayCurrencyCode && moonpayMinBuy == null;
3051
- const creditCardUnavailable = isCreditCard && !!selectedToken && !selectedToken.moonpayCurrencyCode;
3398
+ const exceedsBalance = isConnectedSource && hasValidAmount && !tooManyDecimals && !!selectedToken && walletBalance != null && chunkEXFISDHQ_cjs.parseTokenAmount(amount, selectedToken.decimals) > walletBalance;
3399
+ const belowMoonpayMin = isMoonPayCard && hasValidAmount && moonpayMinBuy != null && parseFloat(amount) < moonpayMinBuy;
3400
+ const moonpayLimitsUnready = isMoonPayCard && !!onRamp.providerAssetCode && moonpayMinBuy == null;
3401
+ const creditCardUnavailable = isCreditCard && !!onRamp.unavailableReason;
3052
3402
  const externalTokenUnavailable = isExternal && !!selectedToken && isNative;
3053
3403
  const externalMinimumRequired = isExternal && !!allowance && !!selectedToken;
3054
3404
  const externalMinimumLoading = externalMinimumRequired && externalMinimum === void 0;
3055
3405
  const externalMinimumUnavailable = externalMinimumRequired && externalMinimum === null;
3056
- const belowExternalMinimum = externalMinimumRequired && hasValidAmount && !tooManyDecimals && !!selectedToken && typeof externalMinimum === "bigint" && chunkFFYLKZ7J_cjs.parseTokenAmount(amount, selectedToken.decimals) < externalMinimum;
3406
+ const belowExternalMinimum = externalMinimumRequired && hasValidAmount && !tooManyDecimals && !!selectedToken && typeof externalMinimum === "bigint" && chunkEXFISDHQ_cjs.parseTokenAmount(amount, selectedToken.decimals) < externalMinimum;
3057
3407
  const externalNeedsWallet = isExternal && (!!allowance || !hostedAuthConfig);
3058
3408
  const needsConnect = (isConnectedSource || externalNeedsWallet) && !isConnected;
3059
3409
  const canDeposit = hasValidAmount && !!selectedToken && !tooManyDecimals && !exceedsBalance && !belowMoonpayMin && !moonpayLimitsUnready && !creditCardUnavailable && !externalTokenUnavailable && !externalMinimumLoading && !externalMinimumUnavailable && !belowExternalMinimum && !needsConnect;
@@ -3063,8 +3413,8 @@ function DepositView({
3063
3413
  };
3064
3414
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-muted flex flex-col gap-6 rounded-[10px] p-5", children: [
3065
3415
  isCreditCard ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
3066
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-foreground text-[28px] leading-8 font-medium", children: "Buy with credit card and deposit" }),
3067
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: "Enter your deposit amount and proceed to sign a policy." })
3416
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-foreground text-[28px] leading-8 font-medium", children: "Buy with card and deposit" }),
3417
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: isTransakCard ? "Enter your target deposit amount and continue." : "Enter your deposit amount and proceed to sign a policy." })
3068
3418
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
3069
3419
  /* @__PURE__ */ jsxRuntime.jsxs("h2", { className: "text-foreground text-[28px] leading-8 font-medium", children: [
3070
3420
  "Deposit from ",
@@ -3079,7 +3429,7 @@ function DepositView({
3079
3429
  {
3080
3430
  type: "button",
3081
3431
  onClick: onSelectToken,
3082
- disabled: isSubmitting,
3432
+ disabled: isSubmitting || isCreditCard && onRamp.tokenSelectionLocked,
3083
3433
  className: "border-border bg-input flex w-full cursor-pointer items-center gap-3 rounded-lg border p-3 text-left disabled:cursor-not-allowed disabled:opacity-50",
3084
3434
  children: [
3085
3435
  selectedToken ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -3092,7 +3442,7 @@ function DepositView({
3092
3442
  ] })
3093
3443
  ] })
3094
3444
  ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground flex-1 text-sm", children: "Select token" }),
3095
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground flex h-5 w-5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRightIcon, {}) })
3445
+ (!isCreditCard || !onRamp.tokenSelectionLocked) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted-foreground flex h-5 w-5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(ChevronRightIcon, {}) })
3096
3446
  ]
3097
3447
  }
3098
3448
  )
@@ -3110,7 +3460,7 @@ function DepositView({
3110
3460
  /* @__PURE__ */ jsxRuntime.jsxs(
3111
3461
  "div",
3112
3462
  {
3113
- className: chunkFFYLKZ7J_cjs.cn(
3463
+ className: chunkEXFISDHQ_cjs.cn(
3114
3464
  "border-border bg-input flex items-center gap-2 rounded-[10px] border",
3115
3465
  isConnectedSource ? "py-1 pr-1 pl-3" : "px-3 py-3"
3116
3466
  ),
@@ -3162,12 +3512,9 @@ function DepositView({
3162
3512
  ] }),
3163
3513
  externalMinimumLoading && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: "Checking minimum deposit\u2026" }),
3164
3514
  externalMinimumUnavailable && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive text-sm", children: "Couldn\u2019t load the minimum deposit. Please try again." }),
3165
- isCreditCard && moonpayLimitsError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive text-sm", children: "Couldn\u2019t load purchase limits. Please try again." }),
3166
- isCreditCard && moonpayLimitsLoading && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: "Checking purchase limits\u2026" }),
3167
- creditCardUnavailable && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-destructive text-sm", children: [
3168
- selectedToken?.symbol ?? "This token",
3169
- " isn\u2019t available for card purchases yet."
3170
- ] }),
3515
+ isMoonPayCard && moonpayLimitsError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive text-sm", children: "Couldn\u2019t load purchase limits. Please try again." }),
3516
+ isMoonPayCard && moonpayLimitsLoading && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: "Checking purchase limits\u2026" }),
3517
+ creditCardUnavailable && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive text-sm", children: onRamp.unavailableReason }),
3171
3518
  externalTokenUnavailable && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-destructive text-sm", children: [
3172
3519
  selectedToken?.symbol ?? "This token",
3173
3520
  " can\u2019t be used for external deposits. Choose an ERC20 token."
@@ -3194,7 +3541,7 @@ function DepositView({
3194
3541
  if (selectedToken) onSubmit({ source, tokenId: selectedToken.id, amount });
3195
3542
  },
3196
3543
  className: "bg-primary text-primary-foreground hover:bg-primary/90 flex h-10 w-full cursor-pointer items-center justify-center rounded-[10px] px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50",
3197
- children: needsConnect ? "Connect Wallet" : allowance ? "Sign Policy and Deposit" : "Deposit"
3544
+ children: needsConnect ? "Connect Wallet" : isTransakCard ? "Continue" : allowance ? "Sign Policy and Deposit" : "Deposit"
3198
3545
  }
3199
3546
  )
3200
3547
  ] });
@@ -3250,7 +3597,7 @@ function ExternalDepositView({
3250
3597
  onDiscardLock,
3251
3598
  lock
3252
3599
  }) {
3253
- const { getChainById: getChainById2, getTokenById, serviceName } = chunkFFYLKZ7J_cjs.usePrivanaContext();
3600
+ const { getChainById: getChainById2, getTokenById, serviceName } = chunkEXFISDHQ_cjs.usePrivanaContext();
3254
3601
  const appName = serviceName ?? "Privana";
3255
3602
  const { depositAddress, isReady, isLoading } = depositAddressState;
3256
3603
  const chain = token ? getChainById2(token.chainId) : void 0;
@@ -3266,7 +3613,7 @@ function ExternalDepositView({
3266
3613
  const [nothingFound, setNothingFound] = react.useState(false);
3267
3614
  const [credited, setCredited] = react.useState(null);
3268
3615
  const [showCancelWarning, setShowCancelWarning] = react.useState(false);
3269
- const verification = chunkFFYLKZ7J_cjs.useDepositVerification({
3616
+ const verification = chunkEXFISDHQ_cjs.useDepositVerification({
3270
3617
  onCredited: (txHash, _response, creditedAmount) => {
3271
3618
  if (settleAfterCredit) {
3272
3619
  void settleAfterCredit(txHash, creditedAmount);
@@ -3390,11 +3737,11 @@ function ExternalDepositView({
3390
3737
  ] }),
3391
3738
  showDepositInstructions && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3392
3739
  !scanPaused && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: "Send the displayed amount in one transfer. Transfers below the minimum are not combined or automatically returned." }),
3393
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-secondary flex h-50 items-center justify-center rounded-[10px]", children: !isReady ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground px-6 text-center text-sm", children: "Connect your wallet to generate a deposit address." }) : depositAddress ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-[10px] bg-white p-3", children: /* @__PURE__ */ jsxRuntime.jsx(qrcode_react.QRCodeSVG, { value: depositAddress, size: 160 }) }) : isLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkFFYLKZ7J_cjs.Skeleton, { className: "h-full w-full rounded-[10px]" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-sm", children: "Deposit address unavailable" }) }),
3740
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-secondary flex h-50 items-center justify-center rounded-[10px]", children: !isReady ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground px-6 text-center text-sm", children: "Connect your wallet to generate a deposit address." }) : depositAddress ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-[10px] bg-white p-3", children: /* @__PURE__ */ jsxRuntime.jsx(qrcode_react.QRCodeSVG, { value: depositAddress, size: 160 }) }) : isLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkEXFISDHQ_cjs.Skeleton, { className: "h-full w-full rounded-[10px]" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-sm", children: "Deposit address unavailable" }) }),
3394
3741
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3", children: [
3395
3742
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: "Deposit Address" }),
3396
3743
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
3397
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-border flex h-10 min-w-0 flex-1 items-center rounded-[10px] border px-3", children: depositAddress ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground min-w-0 flex-1 truncate text-sm", children: depositAddress }) : isReady && isLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkFFYLKZ7J_cjs.Skeleton, { className: "h-4 w-3/4" }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: "\u2014" }) }),
3744
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-border flex h-10 min-w-0 flex-1 items-center rounded-[10px] border px-3", children: depositAddress ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground min-w-0 flex-1 truncate text-sm", children: depositAddress }) : isReady && isLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkEXFISDHQ_cjs.Skeleton, { className: "h-4 w-3/4" }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: "\u2014" }) }),
3398
3745
  /* @__PURE__ */ jsxRuntime.jsxs(
3399
3746
  "button",
3400
3747
  {
@@ -3449,7 +3796,7 @@ function ExternalDepositView({
3449
3796
  TransactionSuccessView,
3450
3797
  {
3451
3798
  title: "Deposit Credited",
3452
- message: `Transfer ${chunkFFYLKZ7J_cjs.shortenAddress(credited.txHash)} has been credited to your Privana balance.`,
3799
+ message: `Transfer ${chunkEXFISDHQ_cjs.shortenAddress(credited.txHash)} has been credited to your Privana balance.`,
3453
3800
  onDone: () => {
3454
3801
  setCredited(null);
3455
3802
  verification.reset();
@@ -3478,7 +3825,7 @@ function ExternalDepositView({
3478
3825
  {
3479
3826
  title: "Awaiting Deposit",
3480
3827
  subtitle: listening ? "We are listening for your incoming transaction for the next hour." : "We've stopped listening automatically. Use the button below to check for your deposit.",
3481
- remaining: listening ? chunkFFYLKZ7J_cjs.formatCountdown(secondsLeft) : void 0
3828
+ remaining: listening ? chunkEXFISDHQ_cjs.formatCountdown(secondsLeft) : void 0
3482
3829
  }
3483
3830
  ),
3484
3831
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3", children: [
@@ -3506,9 +3853,11 @@ function ExternalDepositView({
3506
3853
  ] })
3507
3854
  ] });
3508
3855
  }
3509
- function MoonPayGate({ enabled, children }) {
3510
- const { networkConfig } = chunkFFYLKZ7J_cjs.usePrivanaContext();
3511
- const apiKey = networkConfig.moonpayApiKey;
3856
+ function MoonPayGate({
3857
+ enabled,
3858
+ apiKey,
3859
+ children
3860
+ }) {
3512
3861
  if (!enabled || !apiKey) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
3513
3862
  return /* @__PURE__ */ jsxRuntime.jsx(moonpayReact.MoonPayProvider, { apiKey, children });
3514
3863
  }
@@ -3528,7 +3877,7 @@ function MethodTabs({
3528
3877
  /* @__PURE__ */ jsxRuntime.jsx(
3529
3878
  "div",
3530
3879
  {
3531
- className: chunkFFYLKZ7J_cjs.cn(
3880
+ className: chunkEXFISDHQ_cjs.cn(
3532
3881
  "bg-input absolute top-1 bottom-1 left-1 w-[calc(50%-8px)] rounded-md transition-transform duration-200",
3533
3882
  activeTab === "credit-card" && "translate-x-[calc(100%+8px)]"
3534
3883
  )
@@ -3539,7 +3888,7 @@ function MethodTabs({
3539
3888
  {
3540
3889
  type: "button",
3541
3890
  onClick: () => onTabChange("crypto"),
3542
- className: chunkFFYLKZ7J_cjs.cn(
3891
+ className: chunkEXFISDHQ_cjs.cn(
3543
3892
  "relative z-10 flex-1 cursor-pointer rounded-md px-3 py-[9px] text-sm font-medium transition-colors",
3544
3893
  activeTab === "crypto" ? "text-foreground" : "text-muted-foreground"
3545
3894
  ),
@@ -3551,7 +3900,7 @@ function MethodTabs({
3551
3900
  {
3552
3901
  type: "button",
3553
3902
  onClick: () => onTabChange("credit-card"),
3554
- className: chunkFFYLKZ7J_cjs.cn(
3903
+ className: chunkEXFISDHQ_cjs.cn(
3555
3904
  "relative z-10 flex-1 cursor-pointer rounded-md px-3 py-[9px] text-sm font-medium transition-colors",
3556
3905
  activeTab === "credit-card" ? "text-foreground" : "text-muted-foreground"
3557
3906
  ),
@@ -3595,15 +3944,52 @@ function DepositModalContent({
3595
3944
  onCloseBlockedChange,
3596
3945
  onExit
3597
3946
  }) {
3598
- const { serviceName, enabledTokens, defaultToken, hostedAuthConfig, getChainById: getChainById2, getTokenById } = chunkFFYLKZ7J_cjs.usePrivanaContext();
3947
+ const {
3948
+ serviceName,
3949
+ enabledTokens,
3950
+ defaultToken,
3951
+ hostedAuthConfig,
3952
+ serviceAddress,
3953
+ getChainById: getChainById2,
3954
+ getTokenById,
3955
+ networkConfig,
3956
+ onRamp
3957
+ } = chunkEXFISDHQ_cjs.usePrivanaContext();
3599
3958
  const { address } = wagmi.useAccount();
3959
+ const { privateReadQueryScope } = chunkEXFISDHQ_cjs.usePrivateReadRequest();
3960
+ const [privateReadApiUrl, accountingChainId, beneficiaryAddress] = privateReadQueryScope;
3600
3961
  const appName = serviceName ?? "Privana";
3601
3962
  const [activeTab, setActiveTab] = react.useState(defaultTab);
3602
3963
  const [view, setView] = react.useState("method");
3603
3964
  const [source, setSource] = react.useState("connected");
3604
3965
  const [selectedTokenId, setSelectedTokenId] = react.useState(defaultToken?.id ?? "");
3605
3966
  const [amount, setAmount] = react.useState("");
3606
- const selectedToken = enabledTokens.find((t) => t.id === selectedTokenId) ?? defaultToken;
3967
+ const [cardFlow, setCardFlow] = react.useState(null);
3968
+ const [cardFlowActive, setCardFlowActive] = react.useState(false);
3969
+ const [cardUnsafeToClose, setCardUnsafeToClose] = react.useState(false);
3970
+ const nextCardFlowId = react.useRef(0);
3971
+ const stateSelectedToken = enabledTokens.find((t) => t.id === selectedTokenId) ?? defaultToken;
3972
+ const cardOnRamp = react.useMemo(
3973
+ () => chunkEXFISDHQ_cjs.resolveProductOnRamp({
3974
+ config: onRamp,
3975
+ enabledTokens,
3976
+ legacyToken: stateSelectedToken,
3977
+ moonpayApiKey: networkConfig.moonpayApiKey
3978
+ }),
3979
+ [enabledTokens, networkConfig.moonpayApiKey, onRamp, stateSelectedToken]
3980
+ );
3981
+ const cardOnRampScope = react.useMemo(
3982
+ () => ({
3983
+ apiUrl: privateReadApiUrl,
3984
+ accountingChainId,
3985
+ accountingContract: networkConfig.accountingContract,
3986
+ beneficiaryAddress
3987
+ }),
3988
+ [accountingChainId, beneficiaryAddress, networkConfig.accountingContract, privateReadApiUrl]
3989
+ );
3990
+ const mountedCardFlow = cardFlow && chunkEXFISDHQ_cjs.matchesProductOnRampScope(cardFlow.scope, cardOnRampScope) ? cardFlow : null;
3991
+ const displayedCardOnRamp = view === "credit-card-widget" && mountedCardFlow ? mountedCardFlow.selection : cardOnRamp;
3992
+ const selectedToken = source === "credit-card" ? displayedCardOnRamp.token : stateSelectedToken;
3607
3993
  const externalDepositAddress = useDepositAddress({
3608
3994
  enabled: source === "external" && (view === "deposit" || view === "external-deposit")
3609
3995
  });
@@ -3617,6 +4003,9 @@ function DepositModalContent({
3617
4003
  setView("method");
3618
4004
  setAmount("");
3619
4005
  setSelectedTokenId("");
4006
+ setCardFlow(null);
4007
+ setCardFlowActive(false);
4008
+ setCardUnsafeToClose(false);
3620
4009
  }
3621
4010
  }, [address, hostedAuthConfig]);
3622
4011
  const openDeposit = (next) => {
@@ -3639,9 +4028,33 @@ function DepositModalContent({
3639
4028
  }
3640
4029
  };
3641
4030
  const finishCardPurchase = () => {
4031
+ setCardFlowActive(false);
4032
+ setCardUnsafeToClose(false);
3642
4033
  setAmount("");
3643
4034
  onDepositSuccess?.();
3644
4035
  };
4036
+ const leaveCardPurchase = react.useCallback(() => {
4037
+ setCardFlow(null);
4038
+ setCardFlowActive(false);
4039
+ setCardUnsafeToClose(false);
4040
+ setAmount("");
4041
+ setView("deposit");
4042
+ }, []);
4043
+ react.useEffect(() => {
4044
+ if (cardFlow && !chunkEXFISDHQ_cjs.matchesProductOnRampScope(cardFlow.scope, cardOnRampScope)) {
4045
+ leaveCardPurchase();
4046
+ }
4047
+ }, [cardFlow, cardOnRampScope, leaveCardPurchase]);
4048
+ const cardOutcomeCallbacks = mountedCardFlow ? chunkEXFISDHQ_cjs.createProductOnRampOutcomeCallbacks({
4049
+ requiresLock: mountedCardFlow.requiresLock,
4050
+ onComplete: finishCardPurchase,
4051
+ onLockFailed: (err) => {
4052
+ setCardFlowActive(false);
4053
+ setCardUnsafeToClose(false);
4054
+ setLockFailure(err);
4055
+ onLockFailed?.(err);
4056
+ }
4057
+ }) : null;
3645
4058
  const {
3646
4059
  txHash,
3647
4060
  isGettingAddress,
@@ -3711,7 +4124,7 @@ function DepositModalContent({
3711
4124
  setView("deposit");
3712
4125
  }
3713
4126
  }, [allowance, externalLock.session, view]);
3714
- const isUnsafeToClose = (isGettingAddress || isSendingTransaction) && !cancelled || externalLock.isSigning || externalLock.isSubmittingLock;
4127
+ const isUnsafeToClose = (isGettingAddress || isSendingTransaction) && !cancelled || externalLock.isSigning || externalLock.isSubmittingLock || cardUnsafeToClose;
3715
4128
  react.useEffect(() => {
3716
4129
  onCloseBlockedChange?.(isUnsafeToClose);
3717
4130
  }, [isUnsafeToClose, onCloseBlockedChange]);
@@ -3730,7 +4143,7 @@ function DepositModalContent({
3730
4143
  sonner.toast.error("External deposits support ERC20 tokens only");
3731
4144
  return;
3732
4145
  }
3733
- const depositAmount = chunkFFYLKZ7J_cjs.parseTokenAmount(args.amount, token2.decimals);
4146
+ const depositAmount = chunkEXFISDHQ_cjs.parseTokenAmount(args.amount, token2.decimals);
3734
4147
  if (!allowance) {
3735
4148
  setView("external-deposit");
3736
4149
  return;
@@ -3754,6 +4167,28 @@ function DepositModalContent({
3754
4167
  return;
3755
4168
  }
3756
4169
  if (args.source === "credit-card") {
4170
+ if (cardFlow && cardFlowActive) {
4171
+ setView("credit-card-widget");
4172
+ return;
4173
+ }
4174
+ try {
4175
+ setCardFlow(
4176
+ chunkEXFISDHQ_cjs.createProductOnRampFlowSnapshot({
4177
+ id: ++nextCardFlowId.current,
4178
+ selection: cardOnRamp,
4179
+ amount: args.amount,
4180
+ allowance,
4181
+ lockServiceAddress: serviceAddress,
4182
+ moonpayApiKey: networkConfig.moonpayApiKey,
4183
+ scope: cardOnRampScope
4184
+ })
4185
+ );
4186
+ } catch (error) {
4187
+ sonner.toast.error(error instanceof Error ? error.message : "Card purchase is unavailable");
4188
+ return;
4189
+ }
4190
+ setCardFlowActive(false);
4191
+ setCardUnsafeToClose(false);
3757
4192
  setView("credit-card-widget");
3758
4193
  return;
3759
4194
  }
@@ -3763,7 +4198,7 @@ function DepositModalContent({
3763
4198
  setCancelled(false);
3764
4199
  deposit({
3765
4200
  tokenId: token.id,
3766
- amount: chunkFFYLKZ7J_cjs.parseTokenAmount(args.amount, token.decimals),
4201
+ amount: chunkEXFISDHQ_cjs.parseTokenAmount(args.amount, token.decimals),
3767
4202
  postDepositLock: allowance ? {
3768
4203
  maxAmount: BigInt(allowance.value),
3769
4204
  lockDuration: allowance.lockDuration
@@ -3804,7 +4239,7 @@ function DepositModalContent({
3804
4239
  ];
3805
4240
  const hasExternalLockRecovery = view === "external-deposit" && !!externalLock.session?.creditedAmount;
3806
4241
  const externalSubmissionAmbiguous = hasExternalLockRecovery && !!lockFailure?.submissionMayHaveSucceeded;
3807
- const savedExternalPayloadUsable = !!externalLock.session?.payload && chunkFFYLKZ7J_cjs.isSignedLockUsable(externalLock.session.payload);
4242
+ const savedExternalPayloadUsable = !!externalLock.session?.payload && chunkEXFISDHQ_cjs.isSignedLockUsable(externalLock.session.payload);
3808
4243
  const ambiguousRecoveryMustBeAbandoned = externalSubmissionAmbiguous && !savedExternalPayloadUsable;
3809
4244
  const externalRecoveryExitLabel = externalSubmissionAmbiguous ? "Stop recovery" : "Keep funds unlocked";
3810
4245
  const lockFailureToken = hasExternalLockRecovery && externalLock.session ? getTokenById(externalLock.session.tokenId) ?? selectedToken : selectedToken;
@@ -3831,6 +4266,12 @@ function DepositModalContent({
3831
4266
  setCancelled(false);
3832
4267
  resetDeposit();
3833
4268
  if (view === "external-deposit") setView("deposit");
4269
+ if (view === "credit-card-widget") {
4270
+ setCardFlow(null);
4271
+ setCardFlowActive(false);
4272
+ setCardUnsafeToClose(false);
4273
+ setView("deposit");
4274
+ }
3834
4275
  };
3835
4276
  const handleExternalLockRetry = () => {
3836
4277
  externalLock.retryAfterCredit().catch((err) => {
@@ -3854,12 +4295,20 @@ function DepositModalContent({
3854
4295
  retryVerification().catch(() => {
3855
4296
  });
3856
4297
  };
3857
- const back = view === "external-deposit" ? { to: "deposit", label: "Deposit from External Wallet" } : view === "credit-card-widget" ? { to: "deposit", label: "Buy with credit card and deposit" } : view === "select-token" ? { to: "deposit", label: "Deposit" } : { to: "method", label: "Deposit Method" };
4298
+ const back = view === "external-deposit" ? { to: "deposit", label: "Deposit from External Wallet" } : view === "credit-card-widget" ? { to: "deposit", label: "Buy with card and deposit" } : view === "select-token" ? { to: "deposit", label: "Deposit" } : { to: "method", label: "Deposit Method" };
3858
4299
  const goBack = () => {
3859
4300
  if (view === "external-deposit" && externalLock.session) {
3860
4301
  sonner.toast.error("Cancel the active deposit from the address screen before going back");
3861
4302
  return;
3862
4303
  }
4304
+ if (view === "credit-card-widget" && (cardUnsafeToClose || cardFlowActive)) {
4305
+ sonner.toast.error("Finish or recover the active card purchase before going back");
4306
+ return;
4307
+ }
4308
+ if (view === "credit-card-widget") {
4309
+ setCardFlow(null);
4310
+ setCardUnsafeToClose(false);
4311
+ }
3863
4312
  if (back.to === "method") {
3864
4313
  setAmount("");
3865
4314
  setSelectedTokenId("");
@@ -3874,7 +4323,7 @@ function DepositModalContent({
3874
4323
  onClick: onClose,
3875
4324
  disabled: isUnsafeToClose,
3876
4325
  "aria-label": "Close",
3877
- className: chunkFFYLKZ7J_cjs.cn(
4326
+ className: chunkEXFISDHQ_cjs.cn(
3878
4327
  "absolute top-6 right-5 z-20 flex h-5 w-5 items-center justify-center transition-colors",
3879
4328
  isUnsafeToClose ? "text-muted-foreground/40 cursor-not-allowed" : "text-muted-foreground hover:text-foreground cursor-pointer"
3880
4329
  ),
@@ -3945,8 +4394,8 @@ function DepositModalContent({
3945
4394
  ] }),
3946
4395
  activeView === "method" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "bg-muted flex flex-col gap-6 rounded-[10px] p-5", children: [
3947
4396
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
3948
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-foreground text-[28px] leading-8 font-medium", children: activeTab === "crypto" ? "Choose the deposit method" : "Buy with credit card and deposit" }),
3949
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: activeTab === "crypto" ? "Choose the deposit method." : "Use credit card to buy crypto and deposit" })
4397
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-foreground text-[28px] leading-8 font-medium", children: activeTab === "crypto" ? "Choose the deposit method" : "Buy with card and deposit" }),
4398
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: activeTab === "crypto" ? "Choose the deposit method." : "Buy crypto by card and deposit it into your account." })
3950
4399
  ] }),
3951
4400
  /* @__PURE__ */ jsxRuntime.jsx(MethodTabs, { activeTab, onTabChange: setActiveTab }),
3952
4401
  activeTab === "crypto" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3", children: [
@@ -3975,8 +4424,8 @@ function DepositModalContent({
3975
4424
  ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-3", children: /* @__PURE__ */ jsxRuntime.jsx(
3976
4425
  MethodOption,
3977
4426
  {
3978
- title: "Moonpay",
3979
- description: "on selected address",
4427
+ title: "Buy with card",
4428
+ description: "Purchase and deposit directly into your account.",
3980
4429
  onClick: () => {
3981
4430
  onSelectCreditCard?.();
3982
4431
  openDeposit("credit-card");
@@ -3984,21 +4433,29 @@ function DepositModalContent({
3984
4433
  }
3985
4434
  ) })
3986
4435
  ] }),
3987
- activeView === "deposit" && /* @__PURE__ */ jsxRuntime.jsx(MoonPayGate, { enabled: source === "credit-card", children: /* @__PURE__ */ jsxRuntime.jsx(
3988
- DepositView,
4436
+ activeView === "deposit" && /* @__PURE__ */ jsxRuntime.jsx(
4437
+ MoonPayGate,
3989
4438
  {
3990
- source,
3991
- selectedToken,
3992
- amount,
3993
- allowance,
3994
- externalMinimum,
3995
- onAmountChange: setAmount,
3996
- onSelectToken: () => setView("select-token"),
3997
- onConnectWallet,
3998
- onSubmit: handleSubmit,
3999
- isSubmitting: isPending || externalLock.isSigning || externalLock.isSubmittingLock
4439
+ enabled: source === "credit-card" && cardOnRamp.provider === "moonpay" && !cardOnRamp.unavailableReason,
4440
+ apiKey: networkConfig.moonpayApiKey,
4441
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4442
+ DepositView,
4443
+ {
4444
+ source,
4445
+ selectedToken,
4446
+ onRamp: cardOnRamp,
4447
+ amount,
4448
+ allowance,
4449
+ externalMinimum,
4450
+ onAmountChange: setAmount,
4451
+ onSelectToken: () => setView("select-token"),
4452
+ onConnectWallet,
4453
+ onSubmit: handleSubmit,
4454
+ isSubmitting: isPending || externalLock.isSigning || externalLock.isSubmittingLock
4455
+ }
4456
+ )
4000
4457
  }
4001
- ) }),
4458
+ ),
4002
4459
  activeView === "select-token" && /* @__PURE__ */ jsxRuntime.jsx(
4003
4460
  TokenSelectorView,
4004
4461
  {
@@ -4020,20 +4477,30 @@ function DepositModalContent({
4020
4477
  lock: externalLock.session ? externalLock : void 0
4021
4478
  }
4022
4479
  ),
4023
- activeView === "credit-card-widget" && /* @__PURE__ */ jsxRuntime.jsx(MoonPayGate, { enabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(
4024
- CreditCardWidgetView,
4480
+ activeView === "credit-card-widget" && mountedCardFlow && /* @__PURE__ */ jsxRuntime.jsx(
4481
+ MoonPayGate,
4025
4482
  {
4026
- token: selectedToken,
4027
- amount,
4028
- allowance,
4029
- onCredited: allowance ? void 0 : finishCardPurchase,
4030
- onLockSubmitted: finishCardPurchase,
4031
- onLockFailed: (err) => {
4032
- setLockFailure(err);
4033
- onLockFailed?.(err);
4034
- }
4483
+ enabled: mountedCardFlow.selection.provider === "moonpay",
4484
+ apiKey: mountedCardFlow.moonpayApiKey,
4485
+ children: /* @__PURE__ */ jsxRuntime.jsx(
4486
+ CreditCardWidgetView,
4487
+ {
4488
+ token: mountedCardFlow.selection.token,
4489
+ onRamp: mountedCardFlow.selection,
4490
+ amount: mountedCardFlow.amount,
4491
+ allowance: mountedCardFlow.allowance,
4492
+ lockServiceAddress: mountedCardFlow.lockServiceAddress,
4493
+ onUnsafeToCloseChange: setCardUnsafeToClose,
4494
+ onActiveFlowChange: setCardFlowActive,
4495
+ onCredited: cardOutcomeCallbacks?.onCredited,
4496
+ onLockSubmitted: cardOutcomeCallbacks?.onLockSubmitted,
4497
+ onLockFailed: cardOutcomeCallbacks?.onLockFailed,
4498
+ onLeave: leaveCardPurchase
4499
+ },
4500
+ mountedCardFlow.id
4501
+ )
4035
4502
  }
4036
- ) })
4503
+ )
4037
4504
  ] });
4038
4505
  }
4039
4506
  function DepositModal({ open, onClose, ...handlers }) {
@@ -4082,7 +4549,7 @@ function DepositInlineModal({ className, ...handlers }) {
4082
4549
  "div",
4083
4550
  {
4084
4551
  "data-privana": true,
4085
- className: chunkFFYLKZ7J_cjs.cn(
4552
+ className: chunkEXFISDHQ_cjs.cn(
4086
4553
  "bg-card relative flex w-[560px] max-w-full flex-col gap-2 overflow-hidden rounded-2xl p-2 shadow-lg",
4087
4554
  className
4088
4555
  ),
@@ -4098,7 +4565,7 @@ function WithdrawView({
4098
4565
  onPendingChange,
4099
4566
  onWithdrawSuccess
4100
4567
  }) {
4101
- const { chains, getChainById: getChainById2 } = chunkFFYLKZ7J_cjs.usePrivanaContext();
4568
+ const { chains, getChainById: getChainById2 } = chunkEXFISDHQ_cjs.usePrivanaContext();
4102
4569
  const { isConnected, address } = wagmi.useAccount();
4103
4570
  const [showSuccess, setShowSuccess] = react.useState(false);
4104
4571
  const [showTimeout, setShowTimeout] = react.useState(false);
@@ -4112,7 +4579,7 @@ function WithdrawView({
4112
4579
  tokenId: selectedToken?.id,
4113
4580
  enabled: !!selectedToken
4114
4581
  });
4115
- const formattedBalance = selectedToken ? chunkFFYLKZ7J_cjs.formatTokenAmount(balanceWei, selectedToken.decimals) : "0.00";
4582
+ const formattedBalance = selectedToken ? chunkEXFISDHQ_cjs.formatTokenAmount(balanceWei, selectedToken.decimals) : "0.00";
4116
4583
  const { withdraw, isPending, currentStep, error, reset } = useWithdraw({
4117
4584
  onProcessingSuccess: () => {
4118
4585
  onAmountChange("");
@@ -4128,7 +4595,7 @@ function WithdrawView({
4128
4595
  setShowTimeout(true);
4129
4596
  }
4130
4597
  });
4131
- const explorerUrl = address && targetChain ? chunkFFYLKZ7J_cjs.getExplorerAddressUrl(targetChain.id, address) : void 0;
4598
+ const explorerUrl = address && targetChain ? chunkEXFISDHQ_cjs.getExplorerAddressUrl(targetChain.id, address) : void 0;
4132
4599
  const getStepStatus = (step, after) => {
4133
4600
  if (currentStep === step) return "active";
4134
4601
  if (after.includes(currentStep)) return "completed";
@@ -4153,7 +4620,7 @@ function WithdrawView({
4153
4620
  }, [isPending, cancelled, onPendingChange]);
4154
4621
  const hasValidAmount = !!amount && parseFloat(amount) > 0;
4155
4622
  const tooManyDecimals = !!hasValidAmount && !!selectedToken && amount.includes(".") && amount.split(".")[1].length > selectedToken.decimals;
4156
- const exceedsBalance = !!hasValidAmount && !tooManyDecimals && !!selectedToken && !isBalanceLoading && !isBalanceError && chunkFFYLKZ7J_cjs.parseTokenAmount(amount, selectedToken.decimals) > BigInt(balanceWei);
4623
+ const exceedsBalance = !!hasValidAmount && !tooManyDecimals && !!selectedToken && !isBalanceLoading && !isBalanceError && chunkEXFISDHQ_cjs.parseTokenAmount(amount, selectedToken.decimals) > BigInt(balanceWei);
4157
4624
  const canWithdraw = isConnected && hasValidAmount && !!selectedToken && !tooManyDecimals && !exceedsBalance;
4158
4625
  const handleMax = () => {
4159
4626
  if (!selectedToken) return;
@@ -4165,7 +4632,7 @@ function WithdrawView({
4165
4632
  setCancelled(false);
4166
4633
  await withdraw({
4167
4634
  tokenId: selectedToken.id,
4168
- amount: chunkFFYLKZ7J_cjs.parseTokenAmount(amount, selectedToken.decimals)
4635
+ amount: chunkEXFISDHQ_cjs.parseTokenAmount(amount, selectedToken.decimals)
4169
4636
  });
4170
4637
  };
4171
4638
  const handleCancel = () => {
@@ -4185,7 +4652,7 @@ function WithdrawView({
4185
4652
  title: "Withdrawal Complete",
4186
4653
  message: `Your ${selectedToken.symbol} withdrawal has been processed. Funds should appear in your wallet shortly.`,
4187
4654
  explorerUrl,
4188
- explorerLabel: targetChain ? chunkFFYLKZ7J_cjs.getExplorerLabel(targetChain.id) : void 0,
4655
+ explorerLabel: targetChain ? chunkEXFISDHQ_cjs.getExplorerLabel(targetChain.id) : void 0,
4189
4656
  onDone: handleDone
4190
4657
  }
4191
4658
  ) });
@@ -4297,7 +4764,7 @@ function WithdrawModalContent({
4297
4764
  onBack,
4298
4765
  onWithdrawSuccess
4299
4766
  }) {
4300
- const { serviceName, enabledTokens, defaultToken, hostedAuthConfig } = chunkFFYLKZ7J_cjs.usePrivanaContext();
4767
+ const { serviceName, enabledTokens, defaultToken, hostedAuthConfig } = chunkEXFISDHQ_cjs.usePrivanaContext();
4301
4768
  const { address } = wagmi.useAccount();
4302
4769
  const appName = serviceName ?? "Privana";
4303
4770
  const [view, setView] = react.useState("form");
@@ -4423,7 +4890,7 @@ function WithdrawInlineModal({ className, onWithdrawSuccess }) {
4423
4890
  "div",
4424
4891
  {
4425
4892
  "data-privana": true,
4426
- className: chunkFFYLKZ7J_cjs.cn(
4893
+ className: chunkEXFISDHQ_cjs.cn(
4427
4894
  "bg-card relative flex w-[560px] max-w-full flex-col gap-2 overflow-hidden rounded-2xl p-2 shadow-lg",
4428
4895
  className
4429
4896
  ),
@@ -4467,14 +4934,14 @@ function SegmentedBalanceBar({
4467
4934
  showAvailable && /* @__PURE__ */ jsxRuntime.jsx(
4468
4935
  "div",
4469
4936
  {
4470
- className: chunkFFYLKZ7J_cjs.cn(AVAILABLE_COLOR, "rounded-l-full", !showInUse && "rounded-r-full"),
4937
+ className: chunkEXFISDHQ_cjs.cn(AVAILABLE_COLOR, "rounded-l-full", !showInUse && "rounded-r-full"),
4471
4938
  style: { flexGrow: grow(availableWei) }
4472
4939
  }
4473
4940
  ),
4474
4941
  showInUse && /* @__PURE__ */ jsxRuntime.jsx(
4475
4942
  "div",
4476
4943
  {
4477
- className: chunkFFYLKZ7J_cjs.cn(IN_USE_COLOR, "rounded-r-full", !showAvailable && "rounded-l-full"),
4944
+ className: chunkEXFISDHQ_cjs.cn(IN_USE_COLOR, "rounded-r-full", !showAvailable && "rounded-l-full"),
4478
4945
  style: { flexGrow: grow(inUseWei) }
4479
4946
  }
4480
4947
  )
@@ -4482,7 +4949,7 @@ function SegmentedBalanceBar({
4482
4949
  }
4483
4950
  function BalanceLegendItem({ color, label }) {
4484
4951
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
4485
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkFFYLKZ7J_cjs.cn("h-2.5 w-2.5 rounded-full", color) }),
4952
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkEXFISDHQ_cjs.cn("h-2.5 w-2.5 rounded-full", color) }),
4486
4953
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground text-sm leading-5", children: label })
4487
4954
  ] });
4488
4955
  }
@@ -4495,7 +4962,7 @@ function WalletBalanceView({
4495
4962
  onAddFunds,
4496
4963
  onWithdraw
4497
4964
  }) {
4498
- const { serviceName, serviceIcon, defaultToken } = chunkFFYLKZ7J_cjs.usePrivanaContext();
4965
+ const { serviceName, serviceIcon, defaultToken } = chunkEXFISDHQ_cjs.usePrivanaContext();
4499
4966
  const appName = serviceName ?? "Privana";
4500
4967
  const token = defaultToken;
4501
4968
  const {
@@ -4508,14 +4975,14 @@ function WalletBalanceView({
4508
4975
  const variant = !session ? "idle" : inUseWei === 0n ? "session-zero" : availableWei === 0n ? "fully-in-use" : "mixed";
4509
4976
  const expiry = session?.expiry;
4510
4977
  useNow(3e4, expiry != null);
4511
- const countdown = expiry != null ? chunkFFYLKZ7J_cjs.formatTimeRemaining(expiry) : null;
4978
+ const countdown = expiry != null ? chunkEXFISDHQ_cjs.formatTimeRemaining(expiry) : null;
4512
4979
  const decimals = token?.decimals ?? 18;
4513
- const totalFormatted = chunkFFYLKZ7J_cjs.formatTokenAmount((availableWei + inUseWei).toString(), decimals);
4514
- const availableFormatted = chunkFFYLKZ7J_cjs.formatTokenAmount(availableWei.toString(), decimals);
4515
- const inUseFormatted = chunkFFYLKZ7J_cjs.formatTokenAmount(inUseWei.toString(), decimals);
4980
+ const totalFormatted = chunkEXFISDHQ_cjs.formatTokenAmount((availableWei + inUseWei).toString(), decimals);
4981
+ const availableFormatted = chunkEXFISDHQ_cjs.formatTokenAmount(availableWei.toString(), decimals);
4982
+ const inUseFormatted = chunkEXFISDHQ_cjs.formatTokenAmount(inUseWei.toString(), decimals);
4516
4983
  const hasValidAmount = !!amount && parseFloat(amount) > 0;
4517
4984
  const tooManyDecimals = hasValidAmount && !!token && amount.includes(".") && amount.split(".")[1].length > token.decimals;
4518
- const exceedsBalance = hasValidAmount && !tooManyDecimals && !!token && !isBalanceLoading && !isBalanceError && chunkFFYLKZ7J_cjs.parseTokenAmount(amount, token.decimals) > availableWei;
4985
+ const exceedsBalance = hasValidAmount && !tooManyDecimals && !!token && !isBalanceLoading && !isBalanceError && chunkEXFISDHQ_cjs.parseTokenAmount(amount, token.decimals) > availableWei;
4519
4986
  const canFundSession = hasValidAmount && !!token && !tooManyDecimals && !exceedsBalance && !isBalanceLoading && !isBalanceError;
4520
4987
  const handleMax = () => {
4521
4988
  const max = availableFormatted.replace(/\s/g, "");
@@ -4533,7 +5000,7 @@ function WalletBalanceView({
4533
5000
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-sm leading-[14px]", children: "Total" }),
4534
5001
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "bg-secondary text-muted-foreground rounded-full px-2 py-[5px] text-[10px] leading-[10px] font-bold", children: token?.symbol ?? "\u2014" })
4535
5002
  ] }),
4536
- isBalanceLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkFFYLKZ7J_cjs.Skeleton, { className: "h-9 w-40" }) : isBalanceError ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-[32px] leading-9 font-medium", children: "\u2014" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground text-[32px] leading-9 font-medium", children: totalFormatted })
5003
+ isBalanceLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkEXFISDHQ_cjs.Skeleton, { className: "h-9 w-40" }) : isBalanceError ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-[32px] leading-9 font-medium", children: "\u2014" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground text-[32px] leading-9 font-medium", children: totalFormatted })
4537
5004
  ] }),
4538
5005
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
4539
5006
  /* @__PURE__ */ jsxRuntime.jsx(SegmentedBalanceBar, { availableWei, inUseWei }),
@@ -4684,7 +5151,7 @@ function WalletModalContent({
4684
5151
  onCloseBlockedChange,
4685
5152
  ...depositHandlers
4686
5153
  }) {
4687
- const { serviceName, hostedAuthConfig } = chunkFFYLKZ7J_cjs.usePrivanaContext();
5154
+ const { serviceName, hostedAuthConfig } = chunkEXFISDHQ_cjs.usePrivanaContext();
4688
5155
  const { address } = wagmi.useAccount();
4689
5156
  const appName = serviceName ?? "Privana";
4690
5157
  const [view, setView] = react.useState("balance");
@@ -4788,7 +5255,7 @@ function WalletModalContent({
4788
5255
  onClick: onClose,
4789
5256
  disabled: closeBlocked,
4790
5257
  "aria-label": "Close",
4791
- className: chunkFFYLKZ7J_cjs.cn(
5258
+ className: chunkEXFISDHQ_cjs.cn(
4792
5259
  "absolute top-6 right-5 z-20 flex h-5 w-5 items-center justify-center transition-colors",
4793
5260
  closeBlocked ? "text-muted-foreground/40 cursor-not-allowed" : "text-muted-foreground hover:text-foreground cursor-pointer"
4794
5261
  ),
@@ -4916,7 +5383,7 @@ function WalletInlineModal({ className, ...handlers }) {
4916
5383
  "div",
4917
5384
  {
4918
5385
  "data-privana": true,
4919
- className: chunkFFYLKZ7J_cjs.cn(
5386
+ className: chunkEXFISDHQ_cjs.cn(
4920
5387
  "bg-card relative flex w-[560px] max-w-full flex-col gap-2 overflow-hidden rounded-2xl p-2 shadow-lg",
4921
5388
  className
4922
5389
  ),
@@ -4927,295 +5394,295 @@ function WalletInlineModal({ className, ...handlers }) {
4927
5394
 
4928
5395
  Object.defineProperty(exports, "AccountingApiError", {
4929
5396
  enumerable: true,
4930
- get: function () { return chunkFFYLKZ7J_cjs.AccountingApiError; }
5397
+ get: function () { return chunkEXFISDHQ_cjs.AccountingApiError; }
4931
5398
  });
4932
5399
  Object.defineProperty(exports, "Button", {
4933
5400
  enumerable: true,
4934
- get: function () { return chunkFFYLKZ7J_cjs.Button; }
5401
+ get: function () { return chunkEXFISDHQ_cjs.Button; }
4935
5402
  });
4936
5403
  Object.defineProperty(exports, "DEFAULT_LOCK_DURATION_SECONDS", {
4937
5404
  enumerable: true,
4938
- get: function () { return chunkFFYLKZ7J_cjs.DEFAULT_LOCK_DURATION_SECONDS; }
5405
+ get: function () { return chunkEXFISDHQ_cjs.DEFAULT_LOCK_DURATION_SECONDS; }
4939
5406
  });
4940
5407
  Object.defineProperty(exports, "DEFAULT_ONRAMP_LOCK_BUFFER", {
4941
5408
  enumerable: true,
4942
- get: function () { return chunkFFYLKZ7J_cjs.DEFAULT_ONRAMP_LOCK_BUFFER; }
5409
+ get: function () { return chunkEXFISDHQ_cjs.DEFAULT_ONRAMP_LOCK_BUFFER; }
4943
5410
  });
4944
5411
  Object.defineProperty(exports, "HOSTED_AUTH_CLOCK_SKEW_MS", {
4945
5412
  enumerable: true,
4946
- get: function () { return chunkFFYLKZ7J_cjs.HOSTED_AUTH_CLOCK_SKEW_MS; }
5413
+ get: function () { return chunkEXFISDHQ_cjs.HOSTED_AUTH_CLOCK_SKEW_MS; }
4947
5414
  });
4948
5415
  Object.defineProperty(exports, "HostedAuthError", {
4949
5416
  enumerable: true,
4950
- get: function () { return chunkFFYLKZ7J_cjs.HostedAuthError; }
5417
+ get: function () { return chunkEXFISDHQ_cjs.HostedAuthError; }
4951
5418
  });
4952
5419
  Object.defineProperty(exports, "HostedAuthRequiredError", {
4953
5420
  enumerable: true,
4954
- get: function () { return chunkFFYLKZ7J_cjs.HostedAuthRequiredError; }
5421
+ get: function () { return chunkEXFISDHQ_cjs.HostedAuthRequiredError; }
4955
5422
  });
4956
5423
  Object.defineProperty(exports, "HostedAuthStateMismatchError", {
4957
5424
  enumerable: true,
4958
- get: function () { return chunkFFYLKZ7J_cjs.HostedAuthStateMismatchError; }
5425
+ get: function () { return chunkEXFISDHQ_cjs.HostedAuthStateMismatchError; }
4959
5426
  });
4960
5427
  Object.defineProperty(exports, "HttpClient", {
4961
5428
  enumerable: true,
4962
- get: function () { return chunkFFYLKZ7J_cjs.HttpClient; }
5429
+ get: function () { return chunkEXFISDHQ_cjs.HttpClient; }
4963
5430
  });
4964
5431
  Object.defineProperty(exports, "LOCK_TYPES", {
4965
5432
  enumerable: true,
4966
- get: function () { return chunkFFYLKZ7J_cjs.LOCK_TYPES; }
5433
+ get: function () { return chunkEXFISDHQ_cjs.LOCK_TYPES; }
4967
5434
  });
4968
5435
  Object.defineProperty(exports, "MODIFY_LOCK_TYPES", {
4969
5436
  enumerable: true,
4970
- get: function () { return chunkFFYLKZ7J_cjs.MODIFY_LOCK_TYPES; }
5437
+ get: function () { return chunkEXFISDHQ_cjs.MODIFY_LOCK_TYPES; }
4971
5438
  });
4972
5439
  Object.defineProperty(exports, "NETWORK_CONFIG", {
4973
5440
  enumerable: true,
4974
- get: function () { return chunkFFYLKZ7J_cjs.NETWORK_CONFIG; }
5441
+ get: function () { return chunkEXFISDHQ_cjs.NETWORK_CONFIG; }
4975
5442
  });
4976
5443
  Object.defineProperty(exports, "NetworkError", {
4977
5444
  enumerable: true,
4978
- get: function () { return chunkFFYLKZ7J_cjs.NetworkError; }
5445
+ get: function () { return chunkEXFISDHQ_cjs.NetworkError; }
4979
5446
  });
4980
5447
  Object.defineProperty(exports, "PostDepositLockError", {
4981
5448
  enumerable: true,
4982
- get: function () { return chunkFFYLKZ7J_cjs.PostDepositLockError; }
5449
+ get: function () { return chunkEXFISDHQ_cjs.PostDepositLockError; }
4983
5450
  });
4984
5451
  Object.defineProperty(exports, "PrivanaClient", {
4985
5452
  enumerable: true,
4986
- get: function () { return chunkFFYLKZ7J_cjs.PrivanaClient; }
5453
+ get: function () { return chunkEXFISDHQ_cjs.PrivanaClient; }
4987
5454
  });
4988
5455
  Object.defineProperty(exports, "PrivanaProvider", {
4989
5456
  enumerable: true,
4990
- get: function () { return chunkFFYLKZ7J_cjs.PrivanaProvider; }
5457
+ get: function () { return chunkEXFISDHQ_cjs.PrivanaProvider; }
4991
5458
  });
4992
5459
  Object.defineProperty(exports, "SUPPORTED_CHAINS", {
4993
5460
  enumerable: true,
4994
- get: function () { return chunkFFYLKZ7J_cjs.SUPPORTED_CHAINS; }
5461
+ get: function () { return chunkEXFISDHQ_cjs.SUPPORTED_CHAINS; }
4995
5462
  });
4996
5463
  Object.defineProperty(exports, "SiweAuthProvider", {
4997
5464
  enumerable: true,
4998
- get: function () { return chunkFFYLKZ7J_cjs.SiweAuthProvider; }
5465
+ get: function () { return chunkEXFISDHQ_cjs.SiweAuthProvider; }
4999
5466
  });
5000
5467
  Object.defineProperty(exports, "Skeleton", {
5001
5468
  enumerable: true,
5002
- get: function () { return chunkFFYLKZ7J_cjs.Skeleton; }
5469
+ get: function () { return chunkEXFISDHQ_cjs.Skeleton; }
5003
5470
  });
5004
5471
  Object.defineProperty(exports, "TRANSFER_LOCKED_TYPES", {
5005
5472
  enumerable: true,
5006
- get: function () { return chunkFFYLKZ7J_cjs.TRANSFER_LOCKED_TYPES; }
5473
+ get: function () { return chunkEXFISDHQ_cjs.TRANSFER_LOCKED_TYPES; }
5007
5474
  });
5008
5475
  Object.defineProperty(exports, "TRANSFER_TYPES", {
5009
5476
  enumerable: true,
5010
- get: function () { return chunkFFYLKZ7J_cjs.TRANSFER_TYPES; }
5477
+ get: function () { return chunkEXFISDHQ_cjs.TRANSFER_TYPES; }
5011
5478
  });
5012
5479
  Object.defineProperty(exports, "ValidationError", {
5013
5480
  enumerable: true,
5014
- get: function () { return chunkFFYLKZ7J_cjs.ValidationError; }
5481
+ get: function () { return chunkEXFISDHQ_cjs.ValidationError; }
5015
5482
  });
5016
5483
  Object.defineProperty(exports, "WITHDRAW_FROM_LOCK_TYPES", {
5017
5484
  enumerable: true,
5018
- get: function () { return chunkFFYLKZ7J_cjs.WITHDRAW_FROM_LOCK_TYPES; }
5485
+ get: function () { return chunkEXFISDHQ_cjs.WITHDRAW_FROM_LOCK_TYPES; }
5019
5486
  });
5020
5487
  Object.defineProperty(exports, "WITHDRAW_TYPES", {
5021
5488
  enumerable: true,
5022
- get: function () { return chunkFFYLKZ7J_cjs.WITHDRAW_TYPES; }
5489
+ get: function () { return chunkEXFISDHQ_cjs.WITHDRAW_TYPES; }
5023
5490
  });
5024
5491
  Object.defineProperty(exports, "applyLockBuffer", {
5025
5492
  enumerable: true,
5026
- get: function () { return chunkFFYLKZ7J_cjs.applyLockBuffer; }
5493
+ get: function () { return chunkEXFISDHQ_cjs.applyLockBuffer; }
5027
5494
  });
5028
5495
  Object.defineProperty(exports, "applyRefreshResponse", {
5029
5496
  enumerable: true,
5030
- get: function () { return chunkFFYLKZ7J_cjs.applyRefreshResponse; }
5497
+ get: function () { return chunkEXFISDHQ_cjs.applyRefreshResponse; }
5031
5498
  });
5032
5499
  Object.defineProperty(exports, "buildHostedAuthSession", {
5033
5500
  enumerable: true,
5034
- get: function () { return chunkFFYLKZ7J_cjs.buildHostedAuthSession; }
5501
+ get: function () { return chunkEXFISDHQ_cjs.buildHostedAuthSession; }
5035
5502
  });
5036
5503
  Object.defineProperty(exports, "buildSiweStatement", {
5037
5504
  enumerable: true,
5038
- get: function () { return chunkFFYLKZ7J_cjs.buildSiweStatement; }
5505
+ get: function () { return chunkEXFISDHQ_cjs.buildSiweStatement; }
5039
5506
  });
5040
5507
  Object.defineProperty(exports, "buttonVariants", {
5041
5508
  enumerable: true,
5042
- get: function () { return chunkFFYLKZ7J_cjs.buttonVariants; }
5509
+ get: function () { return chunkEXFISDHQ_cjs.buttonVariants; }
5043
5510
  });
5044
5511
  Object.defineProperty(exports, "clampLockAmount", {
5045
5512
  enumerable: true,
5046
- get: function () { return chunkFFYLKZ7J_cjs.clampLockAmount; }
5513
+ get: function () { return chunkEXFISDHQ_cjs.clampLockAmount; }
5047
5514
  });
5048
5515
  Object.defineProperty(exports, "clearHostedAuthPendingTransaction", {
5049
5516
  enumerable: true,
5050
- get: function () { return chunkFFYLKZ7J_cjs.clearHostedAuthPendingTransaction; }
5517
+ get: function () { return chunkEXFISDHQ_cjs.clearHostedAuthPendingTransaction; }
5051
5518
  });
5052
5519
  Object.defineProperty(exports, "clearPendingLock", {
5053
5520
  enumerable: true,
5054
- get: function () { return chunkFFYLKZ7J_cjs.clearPendingLock; }
5521
+ get: function () { return chunkEXFISDHQ_cjs.clearPendingLock; }
5055
5522
  });
5056
5523
  Object.defineProperty(exports, "createDomain", {
5057
5524
  enumerable: true,
5058
- get: function () { return chunkFFYLKZ7J_cjs.createDomain; }
5525
+ get: function () { return chunkEXFISDHQ_cjs.createDomain; }
5059
5526
  });
5060
5527
  Object.defineProperty(exports, "createHostedAuthPendingStorageKey", {
5061
5528
  enumerable: true,
5062
- get: function () { return chunkFFYLKZ7J_cjs.createHostedAuthPendingStorageKey; }
5529
+ get: function () { return chunkEXFISDHQ_cjs.createHostedAuthPendingStorageKey; }
5063
5530
  });
5064
5531
  Object.defineProperty(exports, "createHostedAuthState", {
5065
5532
  enumerable: true,
5066
- get: function () { return chunkFFYLKZ7J_cjs.createHostedAuthState; }
5533
+ get: function () { return chunkEXFISDHQ_cjs.createHostedAuthState; }
5067
5534
  });
5068
5535
  Object.defineProperty(exports, "createHostedAuthStorageKey", {
5069
5536
  enumerable: true,
5070
- get: function () { return chunkFFYLKZ7J_cjs.createHostedAuthStorageKey; }
5537
+ get: function () { return chunkEXFISDHQ_cjs.createHostedAuthStorageKey; }
5071
5538
  });
5072
5539
  Object.defineProperty(exports, "createLockExpiry", {
5073
5540
  enumerable: true,
5074
- get: function () { return chunkFFYLKZ7J_cjs.createLockExpiry; }
5541
+ get: function () { return chunkEXFISDHQ_cjs.createLockExpiry; }
5075
5542
  });
5076
5543
  Object.defineProperty(exports, "createPkceChallenge", {
5077
5544
  enumerable: true,
5078
- get: function () { return chunkFFYLKZ7J_cjs.createPkceChallenge; }
5545
+ get: function () { return chunkEXFISDHQ_cjs.createPkceChallenge; }
5079
5546
  });
5080
5547
  Object.defineProperty(exports, "createPkceVerifier", {
5081
5548
  enumerable: true,
5082
- get: function () { return chunkFFYLKZ7J_cjs.createPkceVerifier; }
5549
+ get: function () { return chunkEXFISDHQ_cjs.createPkceVerifier; }
5083
5550
  });
5084
5551
  Object.defineProperty(exports, "createSignedLockRequest", {
5085
5552
  enumerable: true,
5086
- get: function () { return chunkFFYLKZ7J_cjs.createSignedLockRequest; }
5553
+ get: function () { return chunkEXFISDHQ_cjs.createSignedLockRequest; }
5087
5554
  });
5088
5555
  Object.defineProperty(exports, "getAccountingContract", {
5089
5556
  enumerable: true,
5090
- get: function () { return chunkFFYLKZ7J_cjs.getAccountingContract; }
5557
+ get: function () { return chunkEXFISDHQ_cjs.getAccountingContract; }
5091
5558
  });
5092
5559
  Object.defineProperty(exports, "getApiUrl", {
5093
5560
  enumerable: true,
5094
- get: function () { return chunkFFYLKZ7J_cjs.getApiUrl; }
5561
+ get: function () { return chunkEXFISDHQ_cjs.getApiUrl; }
5095
5562
  });
5096
5563
  Object.defineProperty(exports, "getChainById", {
5097
5564
  enumerable: true,
5098
- get: function () { return chunkFFYLKZ7J_cjs.getChainById; }
5565
+ get: function () { return chunkEXFISDHQ_cjs.getChainById; }
5099
5566
  });
5100
5567
  Object.defineProperty(exports, "getChainId", {
5101
5568
  enumerable: true,
5102
- get: function () { return chunkFFYLKZ7J_cjs.getChainId; }
5569
+ get: function () { return chunkEXFISDHQ_cjs.getChainId; }
5103
5570
  });
5104
5571
  Object.defineProperty(exports, "getExplorerAddressUrl", {
5105
5572
  enumerable: true,
5106
- get: function () { return chunkFFYLKZ7J_cjs.getExplorerAddressUrl; }
5573
+ get: function () { return chunkEXFISDHQ_cjs.getExplorerAddressUrl; }
5107
5574
  });
5108
5575
  Object.defineProperty(exports, "getExplorerLabel", {
5109
5576
  enumerable: true,
5110
- get: function () { return chunkFFYLKZ7J_cjs.getExplorerLabel; }
5577
+ get: function () { return chunkEXFISDHQ_cjs.getExplorerLabel; }
5111
5578
  });
5112
5579
  Object.defineProperty(exports, "isHostedAuthRefreshActive", {
5113
5580
  enumerable: true,
5114
- get: function () { return chunkFFYLKZ7J_cjs.isHostedAuthRefreshActive; }
5581
+ get: function () { return chunkEXFISDHQ_cjs.isHostedAuthRefreshActive; }
5115
5582
  });
5116
5583
  Object.defineProperty(exports, "isHostedAuthSessionActive", {
5117
5584
  enumerable: true,
5118
- get: function () { return chunkFFYLKZ7J_cjs.isHostedAuthSessionActive; }
5585
+ get: function () { return chunkEXFISDHQ_cjs.isHostedAuthSessionActive; }
5119
5586
  });
5120
5587
  Object.defineProperty(exports, "isSignedLockUsable", {
5121
5588
  enumerable: true,
5122
- get: function () { return chunkFFYLKZ7J_cjs.isSignedLockUsable; }
5589
+ get: function () { return chunkEXFISDHQ_cjs.isSignedLockUsable; }
5123
5590
  });
5124
5591
  Object.defineProperty(exports, "loadPendingLock", {
5125
5592
  enumerable: true,
5126
- get: function () { return chunkFFYLKZ7J_cjs.loadPendingLock; }
5593
+ get: function () { return chunkEXFISDHQ_cjs.loadPendingLock; }
5127
5594
  });
5128
5595
  Object.defineProperty(exports, "normalizeAddress", {
5129
5596
  enumerable: true,
5130
- get: function () { return chunkFFYLKZ7J_cjs.normalizeAddress; }
5597
+ get: function () { return chunkEXFISDHQ_cjs.normalizeAddress; }
5131
5598
  });
5132
5599
  Object.defineProperty(exports, "normalizeHex", {
5133
5600
  enumerable: true,
5134
- get: function () { return chunkFFYLKZ7J_cjs.normalizeHex; }
5601
+ get: function () { return chunkEXFISDHQ_cjs.normalizeHex; }
5135
5602
  });
5136
5603
  Object.defineProperty(exports, "parseHostedAuthCallback", {
5137
5604
  enumerable: true,
5138
- get: function () { return chunkFFYLKZ7J_cjs.parseHostedAuthCallback; }
5605
+ get: function () { return chunkEXFISDHQ_cjs.parseHostedAuthCallback; }
5139
5606
  });
5140
5607
  Object.defineProperty(exports, "persistHostedAuthPendingTransaction", {
5141
5608
  enumerable: true,
5142
- get: function () { return chunkFFYLKZ7J_cjs.persistHostedAuthPendingTransaction; }
5609
+ get: function () { return chunkEXFISDHQ_cjs.persistHostedAuthPendingTransaction; }
5143
5610
  });
5144
5611
  Object.defineProperty(exports, "readHostedAuthPendingTransaction", {
5145
5612
  enumerable: true,
5146
- get: function () { return chunkFFYLKZ7J_cjs.readHostedAuthPendingTransaction; }
5613
+ get: function () { return chunkEXFISDHQ_cjs.readHostedAuthPendingTransaction; }
5147
5614
  });
5148
5615
  Object.defineProperty(exports, "readStoredHostedAuthSession", {
5149
5616
  enumerable: true,
5150
- get: function () { return chunkFFYLKZ7J_cjs.readStoredHostedAuthSession; }
5617
+ get: function () { return chunkEXFISDHQ_cjs.readStoredHostedAuthSession; }
5151
5618
  });
5152
5619
  Object.defineProperty(exports, "requireDepositLockOwner", {
5153
5620
  enumerable: true,
5154
- get: function () { return chunkFFYLKZ7J_cjs.requireDepositLockOwner; }
5621
+ get: function () { return chunkEXFISDHQ_cjs.requireDepositLockOwner; }
5155
5622
  });
5156
5623
  Object.defineProperty(exports, "requireServiceAddress", {
5157
5624
  enumerable: true,
5158
- get: function () { return chunkFFYLKZ7J_cjs.requireServiceAddress; }
5625
+ get: function () { return chunkEXFISDHQ_cjs.requireServiceAddress; }
5159
5626
  });
5160
5627
  Object.defineProperty(exports, "savePendingLock", {
5161
5628
  enumerable: true,
5162
- get: function () { return chunkFFYLKZ7J_cjs.savePendingLock; }
5629
+ get: function () { return chunkEXFISDHQ_cjs.savePendingLock; }
5163
5630
  });
5164
5631
  Object.defineProperty(exports, "signLockMessage", {
5165
5632
  enumerable: true,
5166
- get: function () { return chunkFFYLKZ7J_cjs.signLockMessage; }
5633
+ get: function () { return chunkEXFISDHQ_cjs.signLockMessage; }
5167
5634
  });
5168
5635
  Object.defineProperty(exports, "signModifyLockMessage", {
5169
5636
  enumerable: true,
5170
- get: function () { return chunkFFYLKZ7J_cjs.signModifyLockMessage; }
5637
+ get: function () { return chunkEXFISDHQ_cjs.signModifyLockMessage; }
5171
5638
  });
5172
5639
  Object.defineProperty(exports, "signTransferLockedMessage", {
5173
5640
  enumerable: true,
5174
- get: function () { return chunkFFYLKZ7J_cjs.signTransferLockedMessage; }
5641
+ get: function () { return chunkEXFISDHQ_cjs.signTransferLockedMessage; }
5175
5642
  });
5176
5643
  Object.defineProperty(exports, "signTransferMessage", {
5177
5644
  enumerable: true,
5178
- get: function () { return chunkFFYLKZ7J_cjs.signTransferMessage; }
5645
+ get: function () { return chunkEXFISDHQ_cjs.signTransferMessage; }
5179
5646
  });
5180
5647
  Object.defineProperty(exports, "signWithdrawFromLockMessage", {
5181
5648
  enumerable: true,
5182
- get: function () { return chunkFFYLKZ7J_cjs.signWithdrawFromLockMessage; }
5649
+ get: function () { return chunkEXFISDHQ_cjs.signWithdrawFromLockMessage; }
5183
5650
  });
5184
5651
  Object.defineProperty(exports, "signWithdrawMessage", {
5185
5652
  enumerable: true,
5186
- get: function () { return chunkFFYLKZ7J_cjs.signWithdrawMessage; }
5653
+ get: function () { return chunkEXFISDHQ_cjs.signWithdrawMessage; }
5187
5654
  });
5188
5655
  Object.defineProperty(exports, "stripHostedAuthCallbackParams", {
5189
5656
  enumerable: true,
5190
- get: function () { return chunkFFYLKZ7J_cjs.stripHostedAuthCallbackParams; }
5657
+ get: function () { return chunkEXFISDHQ_cjs.stripHostedAuthCallbackParams; }
5191
5658
  });
5192
5659
  Object.defineProperty(exports, "submitPendingLock", {
5193
5660
  enumerable: true,
5194
- get: function () { return chunkFFYLKZ7J_cjs.submitPendingLock; }
5661
+ get: function () { return chunkEXFISDHQ_cjs.submitPendingLock; }
5195
5662
  });
5196
5663
  Object.defineProperty(exports, "syncHostedAuthSessionToClient", {
5197
5664
  enumerable: true,
5198
- get: function () { return chunkFFYLKZ7J_cjs.syncHostedAuthSessionToClient; }
5665
+ get: function () { return chunkEXFISDHQ_cjs.syncHostedAuthSessionToClient; }
5199
5666
  });
5200
5667
  Object.defineProperty(exports, "useDepositVerification", {
5201
5668
  enumerable: true,
5202
- get: function () { return chunkFFYLKZ7J_cjs.useDepositVerification; }
5669
+ get: function () { return chunkEXFISDHQ_cjs.useDepositVerification; }
5203
5670
  });
5204
5671
  Object.defineProperty(exports, "usePrivanaContext", {
5205
5672
  enumerable: true,
5206
- get: function () { return chunkFFYLKZ7J_cjs.usePrivanaContext; }
5673
+ get: function () { return chunkEXFISDHQ_cjs.usePrivanaContext; }
5207
5674
  });
5208
5675
  Object.defineProperty(exports, "useSafeAccount", {
5209
5676
  enumerable: true,
5210
- get: function () { return chunkFFYLKZ7J_cjs.useSafeAccount; }
5677
+ get: function () { return chunkEXFISDHQ_cjs.useSafeAccount; }
5211
5678
  });
5212
5679
  Object.defineProperty(exports, "useSafePrivanaContext", {
5213
5680
  enumerable: true,
5214
- get: function () { return chunkFFYLKZ7J_cjs.useSafePrivanaContext; }
5681
+ get: function () { return chunkEXFISDHQ_cjs.useSafePrivanaContext; }
5215
5682
  });
5216
5683
  Object.defineProperty(exports, "useSiweAuth", {
5217
5684
  enumerable: true,
5218
- get: function () { return chunkFFYLKZ7J_cjs.useSiweAuth; }
5685
+ get: function () { return chunkEXFISDHQ_cjs.useSiweAuth; }
5219
5686
  });
5220
5687
  exports.DepositInlineModal = DepositInlineModal;
5221
5688
  exports.DepositModal = DepositModal;