@oasisprotocol/privana-sdk 0.5.5 → 0.5.7
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/{chunk-PMBU2F2R.js → chunk-4VOTSHNC.js} +22 -4
- package/dist/chunk-4VOTSHNC.js.map +1 -0
- package/dist/{chunk-7VNAGKRC.cjs → chunk-FFYLKZ7J.cjs} +22 -4
- package/dist/chunk-FFYLKZ7J.cjs.map +1 -0
- package/dist/index.cjs +267 -251
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -5
- package/dist/index.d.ts +3 -5
- package/dist/index.js +27 -11
- package/dist/index.js.map +1 -1
- package/dist/on-ramp.cjs +3 -3
- package/dist/on-ramp.d.cts +2 -2
- package/dist/on-ramp.d.ts +2 -2
- package/dist/on-ramp.js +1 -1
- package/dist/{pending-lock-IgzZyg9C.d.cts → pending-lock-BIMYw4gd.d.cts} +3 -2
- package/dist/{pending-lock-IgzZyg9C.d.ts → pending-lock-BIMYw4gd.d.ts} +3 -2
- package/package.json +1 -1
- package/dist/chunk-7VNAGKRC.cjs.map +0 -1
- package/dist/chunk-PMBU2F2R.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkFFYLKZ7J_cjs = require('./chunk-FFYLKZ7J.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 } =
|
|
38
|
+
const { client } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
39
39
|
return client;
|
|
40
40
|
}
|
|
41
41
|
var hostedAuthExchangeInflight = /* @__PURE__ */ new Map();
|
|
42
42
|
function normalizeHostedAuthError(error) {
|
|
43
|
-
if (error instanceof
|
|
44
|
-
return new
|
|
43
|
+
if (error instanceof chunkFFYLKZ7J_cjs.AccountingApiError && error.detail) {
|
|
44
|
+
return new chunkFFYLKZ7J_cjs.HostedAuthError(error.detail);
|
|
45
45
|
}
|
|
46
46
|
if (error instanceof Error) {
|
|
47
47
|
return error;
|
|
48
48
|
}
|
|
49
|
-
return new
|
|
49
|
+
return new chunkFFYLKZ7J_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
|
-
} =
|
|
60
|
+
} = chunkFFYLKZ7J_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 ?
|
|
66
|
+
() => hostedAuthConfig ? chunkFFYLKZ7J_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
|
-
|
|
71
|
+
chunkFFYLKZ7J_cjs.clearHostedAuthPendingTransaction(window.sessionStorage, pendingStorageKey);
|
|
72
72
|
}, [pendingStorageKey]);
|
|
73
73
|
const login = react.useCallback(async () => {
|
|
74
74
|
if (!hostedAuthConfig) {
|
|
75
|
-
throw new
|
|
75
|
+
throw new chunkFFYLKZ7J_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
|
|
80
|
+
throw new chunkFFYLKZ7J_cjs.HostedAuthError("Hosted redirect authentication requires a browser environment.");
|
|
81
81
|
}
|
|
82
82
|
if (!pendingStorageKey) {
|
|
83
|
-
throw new
|
|
83
|
+
throw new chunkFFYLKZ7J_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 =
|
|
93
|
-
const codeChallenge = await
|
|
94
|
-
const state =
|
|
95
|
-
|
|
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, {
|
|
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
|
|
124
|
+
throw new chunkFFYLKZ7J_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
|
|
129
|
+
throw new chunkFFYLKZ7J_cjs.HostedAuthError("Hosted redirect authentication requires a browser environment.");
|
|
130
130
|
}
|
|
131
131
|
if (!pendingStorageKey) {
|
|
132
|
-
throw new
|
|
132
|
+
throw new chunkFFYLKZ7J_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, "",
|
|
142
|
+
window.history.replaceState(null, "", chunkFFYLKZ7J_cjs.stripHostedAuthCallbackParams(callbackUrl));
|
|
143
143
|
};
|
|
144
144
|
try {
|
|
145
|
-
const callback =
|
|
145
|
+
const callback = chunkFFYLKZ7J_cjs.parseHostedAuthCallback(callbackUrl, hostedAuthConfig.redirectUri);
|
|
146
146
|
if (!callback) {
|
|
147
147
|
return null;
|
|
148
148
|
}
|
|
149
|
-
const pending =
|
|
149
|
+
const pending = chunkFFYLKZ7J_cjs.readHostedAuthPendingTransaction(window.sessionStorage, pendingStorageKey);
|
|
150
150
|
if (!pending) {
|
|
151
151
|
clearPendingLogin();
|
|
152
152
|
cleanupCallbackUrl();
|
|
153
|
-
throw new
|
|
153
|
+
throw new chunkFFYLKZ7J_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
|
|
160
|
+
throw new chunkFFYLKZ7J_cjs.HostedAuthStateMismatchError();
|
|
161
161
|
}
|
|
162
162
|
if ("error" in callback) {
|
|
163
163
|
clearPendingLogin();
|
|
164
164
|
cleanupCallbackUrl();
|
|
165
|
-
throw new
|
|
165
|
+
throw new chunkFFYLKZ7J_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 =
|
|
180
|
+
const session = chunkFFYLKZ7J_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
|
|
225
|
+
const normalizedError = refreshError instanceof Error ? refreshError : new chunkFFYLKZ7J_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 =
|
|
245
|
+
const accountingContext = chunkFFYLKZ7J_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 } =
|
|
250
|
+
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkFFYLKZ7J_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:
|
|
267
|
+
balanceFormatted: chunkFFYLKZ7J_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 } =
|
|
278
|
-
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } =
|
|
277
|
+
const { client, pollingInterval } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
278
|
+
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
|
|
279
279
|
const query = reactQuery.useQuery({
|
|
280
280
|
queryKey: ["accounting-batch-balances", ...privateReadQueryScope, options.tokenIds],
|
|
281
281
|
queryFn: async () => {
|
|
@@ -296,21 +296,28 @@ function useBatchBalances(options) {
|
|
|
296
296
|
};
|
|
297
297
|
}
|
|
298
298
|
var STALE_MS = 30 * 60 * 1e3;
|
|
299
|
+
function resolveConfirmations(depositAddress, chainId) {
|
|
300
|
+
const confirmations = depositAddress.finality_depth?.[String(chainId)];
|
|
301
|
+
if (confirmations === void 0) {
|
|
302
|
+
throw new Error(`Deposits are not supported on chain ${chainId}`);
|
|
303
|
+
}
|
|
304
|
+
return confirmations;
|
|
305
|
+
}
|
|
299
306
|
function storageKey(address) {
|
|
300
307
|
return `privana:pending-deposit:${address.toLowerCase()}`;
|
|
301
308
|
}
|
|
302
309
|
function savePendingDeposit(address, data) {
|
|
303
|
-
const stored =
|
|
310
|
+
const stored = chunkFFYLKZ7J_cjs.setBrowserStorageItem(storageKey(address), JSON.stringify(data));
|
|
304
311
|
if (!stored && data.signedLock) {
|
|
305
312
|
throw new Error("Unable to persist pending locked deposit for recovery");
|
|
306
313
|
}
|
|
307
314
|
}
|
|
308
315
|
function loadPendingDeposit(address) {
|
|
309
316
|
try {
|
|
310
|
-
const raw =
|
|
317
|
+
const raw = chunkFFYLKZ7J_cjs.getBrowserStorageItem(storageKey(address));
|
|
311
318
|
if (!raw) return null;
|
|
312
319
|
const data = JSON.parse(raw);
|
|
313
|
-
if (Date.now() - data.savedAt > STALE_MS && !(data.signedLock &&
|
|
320
|
+
if (Date.now() - data.savedAt > STALE_MS && !(data.signedLock && chunkFFYLKZ7J_cjs.isSignedLockUsable(data.signedLock))) {
|
|
314
321
|
clearPendingDeposit(address);
|
|
315
322
|
return null;
|
|
316
323
|
}
|
|
@@ -322,24 +329,23 @@ function loadPendingDeposit(address) {
|
|
|
322
329
|
function clearPendingDeposit(address, onlyForTxHash) {
|
|
323
330
|
if (onlyForTxHash) {
|
|
324
331
|
try {
|
|
325
|
-
const raw =
|
|
332
|
+
const raw = chunkFFYLKZ7J_cjs.getBrowserStorageItem(storageKey(address));
|
|
326
333
|
const recordTxHash = raw ? JSON.parse(raw).txHash : void 0;
|
|
327
334
|
if (recordTxHash && recordTxHash !== onlyForTxHash) return;
|
|
328
335
|
} catch {
|
|
329
336
|
}
|
|
330
337
|
}
|
|
331
|
-
|
|
338
|
+
chunkFFYLKZ7J_cjs.removeBrowserStorageItem(storageKey(address));
|
|
332
339
|
}
|
|
333
340
|
function useDeposit(options = {}) {
|
|
334
341
|
const { address } = wagmi.useAccount();
|
|
335
|
-
const { client, enabledTokens, getChainById: getChainById2, networkConfig, serviceAddress } =
|
|
342
|
+
const { client, enabledTokens, getChainById: getChainById2, networkConfig, serviceAddress } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
336
343
|
const { data: walletClient } = wagmi.useWalletClient();
|
|
337
344
|
const queryClient = reactQuery.useQueryClient();
|
|
338
345
|
const config = wagmi.useConfig();
|
|
339
|
-
const { executePrivateRead, privateReadAddress } =
|
|
346
|
+
const { executePrivateRead, privateReadAddress } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
|
|
340
347
|
const privateReadAddressRef = react.useRef(privateReadAddress);
|
|
341
348
|
privateReadAddressRef.current = privateReadAddress;
|
|
342
|
-
const confirmations = options.confirmations ?? 15;
|
|
343
349
|
const [depositAddress, setDepositAddress] = react.useState(null);
|
|
344
350
|
const [txHash, setTxHash] = react.useState();
|
|
345
351
|
const [isSwitchingChain, setIsSwitchingChain] = react.useState(false);
|
|
@@ -376,7 +382,7 @@ function useDeposit(options = {}) {
|
|
|
376
382
|
const submitPendingLockAfterCredit = react.useCallback(
|
|
377
383
|
async (signedLock, creditedAmount) => {
|
|
378
384
|
try {
|
|
379
|
-
const result = await
|
|
385
|
+
const result = await chunkFFYLKZ7J_cjs.submitPendingLock({
|
|
380
386
|
client,
|
|
381
387
|
payload: signedLock,
|
|
382
388
|
creditedAmount
|
|
@@ -387,7 +393,7 @@ function useDeposit(options = {}) {
|
|
|
387
393
|
queryClient.invalidateQueries({ queryKey: ["accounting-history"] });
|
|
388
394
|
onLockSubmittedRef.current?.(result);
|
|
389
395
|
} catch (err) {
|
|
390
|
-
const error2 = err instanceof
|
|
396
|
+
const error2 = err instanceof chunkFFYLKZ7J_cjs.PostDepositLockError ? err : new chunkFFYLKZ7J_cjs.PostDepositLockError(
|
|
391
397
|
err instanceof Error ? err.message : "Lock submission failed",
|
|
392
398
|
"submission-failed",
|
|
393
399
|
BigInt(signedLock.amount),
|
|
@@ -406,7 +412,7 @@ function useDeposit(options = {}) {
|
|
|
406
412
|
error: verificationError,
|
|
407
413
|
verify,
|
|
408
414
|
reset: resetVerification
|
|
409
|
-
} =
|
|
415
|
+
} = chunkFFYLKZ7J_cjs.useDepositVerification({
|
|
410
416
|
pollInterval: options.pollInterval,
|
|
411
417
|
pollTimeout: options.pollTimeout,
|
|
412
418
|
onCredited: (hash, response, creditedAmount) => {
|
|
@@ -456,7 +462,7 @@ function useDeposit(options = {}) {
|
|
|
456
462
|
} = wagmi.useSendTransaction();
|
|
457
463
|
const isSendingTx = isWritingContract || isSendingNative;
|
|
458
464
|
const sendError = writeError ?? sendNativeError;
|
|
459
|
-
const { ensureCorrectChain } =
|
|
465
|
+
const { ensureCorrectChain } = chunkFFYLKZ7J_cjs.useEnsureCorrectChain();
|
|
460
466
|
const invalidateGeneration = react.useCallback(() => {
|
|
461
467
|
generationRef.current++;
|
|
462
468
|
}, []);
|
|
@@ -502,18 +508,19 @@ function useDeposit(options = {}) {
|
|
|
502
508
|
const isStale = () => generation !== generationRef.current;
|
|
503
509
|
(async () => {
|
|
504
510
|
try {
|
|
511
|
+
const confirmations = resolveConfirmations(persisted.depositAddress, persisted.chainId);
|
|
505
512
|
let confirmed = false;
|
|
506
513
|
try {
|
|
507
|
-
const receipt = await
|
|
514
|
+
const receipt = await chunkFFYLKZ7J_cjs.getTransactionReceipt(config, {
|
|
508
515
|
hash,
|
|
509
516
|
chainId: persisted.chainId
|
|
510
517
|
});
|
|
511
|
-
const blockNumber = await
|
|
518
|
+
const blockNumber = await chunkFFYLKZ7J_cjs.getBlockNumber(config, { chainId: persisted.chainId });
|
|
512
519
|
confirmed = blockNumber - receipt.blockNumber + 1n >= BigInt(confirmations);
|
|
513
520
|
} catch {
|
|
514
521
|
}
|
|
515
522
|
if (!confirmed) {
|
|
516
|
-
await
|
|
523
|
+
await chunkFFYLKZ7J_cjs.waitForTransactionReceipt(config, {
|
|
517
524
|
hash,
|
|
518
525
|
chainId: persisted.chainId,
|
|
519
526
|
confirmations
|
|
@@ -533,7 +540,7 @@ function useDeposit(options = {}) {
|
|
|
533
540
|
onErrorRef.current?.(error2);
|
|
534
541
|
}
|
|
535
542
|
})();
|
|
536
|
-
}, [address, config,
|
|
543
|
+
}, [address, config, queryClient, verify]);
|
|
537
544
|
const deposit = react.useCallback(
|
|
538
545
|
async (params) => {
|
|
539
546
|
if (verificationContextRef.current) {
|
|
@@ -564,13 +571,14 @@ function useDeposit(options = {}) {
|
|
|
564
571
|
`Amount is below the minimum deposit (${minAmountStr}) for ${isNative ? "native" : "ERC-20"} on chain ${sourceChain.id}`
|
|
565
572
|
);
|
|
566
573
|
}
|
|
567
|
-
|
|
574
|
+
const confirmations = resolveConfirmations(addrResponse, sourceChain.id);
|
|
575
|
+
if (params.postDepositLock && !chunkFFYLKZ7J_cjs.canUseBrowserStorage()) {
|
|
568
576
|
throw new Error("Browser storage is required for locked deposit recovery");
|
|
569
577
|
}
|
|
570
|
-
const lockAmount =
|
|
578
|
+
const lockAmount = chunkFFYLKZ7J_cjs.clampLockAmount(params.amount, params.postDepositLock?.maxAmount);
|
|
571
579
|
let signedLock;
|
|
572
580
|
if (params.postDepositLock) {
|
|
573
|
-
const lockOwner =
|
|
581
|
+
const lockOwner = chunkFFYLKZ7J_cjs.requireDepositLockOwner(address, privateReadAddress);
|
|
574
582
|
setIsSwitchingChain(true);
|
|
575
583
|
try {
|
|
576
584
|
await ensureCorrectChain(networkConfig.chainId);
|
|
@@ -578,15 +586,15 @@ function useDeposit(options = {}) {
|
|
|
578
586
|
if (!isStale()) setIsSwitchingChain(false);
|
|
579
587
|
}
|
|
580
588
|
if (isStale()) return;
|
|
581
|
-
const signingWalletClient = await
|
|
589
|
+
const signingWalletClient = await chunkFFYLKZ7J_cjs.getWalletClient(config, {
|
|
582
590
|
chainId: networkConfig.chainId
|
|
583
591
|
});
|
|
584
|
-
signedLock = await
|
|
592
|
+
signedLock = await chunkFFYLKZ7J_cjs.createSignedLockRequest({
|
|
585
593
|
client,
|
|
586
594
|
walletClient: signingWalletClient,
|
|
587
595
|
userAddress: lockOwner,
|
|
588
596
|
networkConfig,
|
|
589
|
-
serviceAddress:
|
|
597
|
+
serviceAddress: chunkFFYLKZ7J_cjs.requireServiceAddress(
|
|
590
598
|
params.postDepositLock.serviceAddress ?? serviceAddress
|
|
591
599
|
),
|
|
592
600
|
tokenId: params.tokenId,
|
|
@@ -640,7 +648,7 @@ function useDeposit(options = {}) {
|
|
|
640
648
|
try {
|
|
641
649
|
setIsWaitingForConfirmation(true);
|
|
642
650
|
try {
|
|
643
|
-
await
|
|
651
|
+
await chunkFFYLKZ7J_cjs.waitForTransactionReceipt(config, {
|
|
644
652
|
hash,
|
|
645
653
|
chainId: sourceChain.id,
|
|
646
654
|
confirmations
|
|
@@ -674,7 +682,6 @@ function useDeposit(options = {}) {
|
|
|
674
682
|
client,
|
|
675
683
|
getChainById2,
|
|
676
684
|
config,
|
|
677
|
-
confirmations,
|
|
678
685
|
enabledTokens,
|
|
679
686
|
ensureCorrectChain,
|
|
680
687
|
networkConfig,
|
|
@@ -717,10 +724,10 @@ function useDeposit(options = {}) {
|
|
|
717
724
|
}
|
|
718
725
|
function useDepositAddress(options = {}) {
|
|
719
726
|
const queryClient = react.useContext(reactQuery.QueryClientContext);
|
|
720
|
-
const accountingContext =
|
|
727
|
+
const accountingContext = chunkFFYLKZ7J_cjs.useSafePrivanaContext();
|
|
721
728
|
const hasProviders = !!queryClient && !!accountingContext;
|
|
722
729
|
const client = accountingContext?.client;
|
|
723
|
-
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } =
|
|
730
|
+
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
|
|
724
731
|
const isReady = hasProviders && privateReadReady && !!privateReadAddress && !!client;
|
|
725
732
|
const query = reactQuery.useQuery({
|
|
726
733
|
queryKey: ["accounting-deposit-address", ...privateReadQueryScope],
|
|
@@ -744,9 +751,9 @@ function useDepositAddress(options = {}) {
|
|
|
744
751
|
function useWithdraw(options = {}) {
|
|
745
752
|
const { address } = wagmi.useAccount();
|
|
746
753
|
const { data: walletClient } = wagmi.useWalletClient();
|
|
747
|
-
const { client, networkConfig } =
|
|
754
|
+
const { client, networkConfig } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
748
755
|
const queryClient = reactQuery.useQueryClient();
|
|
749
|
-
const { chainId, ensureCorrectChain } =
|
|
756
|
+
const { chainId, ensureCorrectChain } = chunkFFYLKZ7J_cjs.useEnsureCorrectChain();
|
|
750
757
|
const pollInterval = options.pollInterval ?? 3e3;
|
|
751
758
|
const pollTimeout = options.pollTimeout ?? 18e4;
|
|
752
759
|
const [currentStep, setCurrentStep] = react.useState("idle");
|
|
@@ -814,7 +821,7 @@ function useWithdraw(options = {}) {
|
|
|
814
821
|
if (isStale()) return void 0;
|
|
815
822
|
const nonce = BigInt(nonceResponse.nonce);
|
|
816
823
|
setCurrentStep("signing");
|
|
817
|
-
const signature = await
|
|
824
|
+
const signature = await chunkFFYLKZ7J_cjs.signWithdrawMessage({
|
|
818
825
|
walletClient,
|
|
819
826
|
chainId: signingChainId,
|
|
820
827
|
verifyingContract: networkConfig.accountingContract,
|
|
@@ -943,7 +950,7 @@ function useWithdraw(options = {}) {
|
|
|
943
950
|
function useLockFunds(options = {}) {
|
|
944
951
|
const { address } = wagmi.useAccount();
|
|
945
952
|
const { data: walletClient } = wagmi.useWalletClient();
|
|
946
|
-
const { client, networkConfig, serviceAddress } =
|
|
953
|
+
const { client, networkConfig, serviceAddress } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
947
954
|
const queryClient = reactQuery.useQueryClient();
|
|
948
955
|
const mutation = reactQuery.useMutation({
|
|
949
956
|
mutationFn: async (params) => {
|
|
@@ -954,7 +961,7 @@ function useLockFunds(options = {}) {
|
|
|
954
961
|
throw new Error("Service address not configured");
|
|
955
962
|
}
|
|
956
963
|
const { nonce } = await client.getLockNonce(address);
|
|
957
|
-
const signature = await
|
|
964
|
+
const signature = await chunkFFYLKZ7J_cjs.signLockMessage({
|
|
958
965
|
walletClient,
|
|
959
966
|
chainId: networkConfig.chainId,
|
|
960
967
|
verifyingContract: networkConfig.accountingContract,
|
|
@@ -1002,7 +1009,7 @@ function useLockFunds(options = {}) {
|
|
|
1002
1009
|
}
|
|
1003
1010
|
function useUnlockFunds(options = {}) {
|
|
1004
1011
|
const { address } = wagmi.useAccount();
|
|
1005
|
-
const { client } =
|
|
1012
|
+
const { client } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
1006
1013
|
const queryClient = reactQuery.useQueryClient();
|
|
1007
1014
|
const unlockMutation = reactQuery.useMutation({
|
|
1008
1015
|
mutationFn: async (params) => {
|
|
@@ -1072,7 +1079,7 @@ function useUnlockFunds(options = {}) {
|
|
|
1072
1079
|
function useTransfer(options = {}) {
|
|
1073
1080
|
const { address } = wagmi.useAccount();
|
|
1074
1081
|
const { data: walletClient } = wagmi.useWalletClient();
|
|
1075
|
-
const { client, networkConfig, serviceAddress } =
|
|
1082
|
+
const { client, networkConfig, serviceAddress } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
1076
1083
|
const queryClient = reactQuery.useQueryClient();
|
|
1077
1084
|
const transferMutation = reactQuery.useMutation({
|
|
1078
1085
|
mutationFn: async (params) => {
|
|
@@ -1080,7 +1087,7 @@ function useTransfer(options = {}) {
|
|
|
1080
1087
|
throw new Error("Wallet not connected");
|
|
1081
1088
|
}
|
|
1082
1089
|
const { nonce } = await client.getTransferNonce(address);
|
|
1083
|
-
const signature = await
|
|
1090
|
+
const signature = await chunkFFYLKZ7J_cjs.signTransferMessage({
|
|
1084
1091
|
walletClient,
|
|
1085
1092
|
chainId: networkConfig.chainId,
|
|
1086
1093
|
verifyingContract: networkConfig.accountingContract,
|
|
@@ -1117,7 +1124,7 @@ function useTransfer(options = {}) {
|
|
|
1117
1124
|
throw new Error("Service address not configured");
|
|
1118
1125
|
}
|
|
1119
1126
|
const { nonce } = await client.getTransferLockedNonce(serviceAddress);
|
|
1120
|
-
const signature = await
|
|
1127
|
+
const signature = await chunkFFYLKZ7J_cjs.signTransferLockedMessage({
|
|
1121
1128
|
walletClient,
|
|
1122
1129
|
chainId: networkConfig.chainId,
|
|
1123
1130
|
verifyingContract: networkConfig.accountingContract,
|
|
@@ -1177,8 +1184,8 @@ function useTransfer(options = {}) {
|
|
|
1177
1184
|
};
|
|
1178
1185
|
}
|
|
1179
1186
|
function useLockedFunds(options = {}) {
|
|
1180
|
-
const { client, pollingInterval, serviceAddress } =
|
|
1181
|
-
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } =
|
|
1187
|
+
const { client, pollingInterval, serviceAddress } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
1188
|
+
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
|
|
1182
1189
|
const query = reactQuery.useQuery({
|
|
1183
1190
|
queryKey: ["accounting-locked-funds", ...privateReadQueryScope, serviceAddress ?? null],
|
|
1184
1191
|
queryFn: async () => {
|
|
@@ -1200,8 +1207,8 @@ function useLockedFunds(options = {}) {
|
|
|
1200
1207
|
};
|
|
1201
1208
|
}
|
|
1202
1209
|
function useTotalLockedBalance(options = {}) {
|
|
1203
|
-
const { client, pollingInterval, defaultToken } =
|
|
1204
|
-
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } =
|
|
1210
|
+
const { client, pollingInterval, defaultToken } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
1211
|
+
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
|
|
1205
1212
|
const tokenId = options.tokenId ?? defaultToken?.id;
|
|
1206
1213
|
const query = reactQuery.useQuery({
|
|
1207
1214
|
queryKey: ["accounting-total-locked-balance", ...privateReadQueryScope, tokenId],
|
|
@@ -1222,8 +1229,8 @@ function useTotalLockedBalance(options = {}) {
|
|
|
1222
1229
|
};
|
|
1223
1230
|
}
|
|
1224
1231
|
function useExpiredLocks(options = {}) {
|
|
1225
|
-
const { client, pollingInterval } =
|
|
1226
|
-
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } =
|
|
1232
|
+
const { client, pollingInterval } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
1233
|
+
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
|
|
1227
1234
|
const query = reactQuery.useQuery({
|
|
1228
1235
|
queryKey: ["accounting-expired-locks", ...privateReadQueryScope],
|
|
1229
1236
|
queryFn: async () => {
|
|
@@ -1244,14 +1251,14 @@ function useExpiredLocks(options = {}) {
|
|
|
1244
1251
|
};
|
|
1245
1252
|
}
|
|
1246
1253
|
function statusCodeOf(error) {
|
|
1247
|
-
return error instanceof
|
|
1254
|
+
return error instanceof chunkFFYLKZ7J_cjs.AccountingApiError ? error.statusCode : void 0;
|
|
1248
1255
|
}
|
|
1249
1256
|
function usePendingDeposits(options = {}) {
|
|
1250
1257
|
const queryClient = react.useContext(reactQuery.QueryClientContext);
|
|
1251
|
-
const accountingContext =
|
|
1258
|
+
const accountingContext = chunkFFYLKZ7J_cjs.useSafePrivanaContext();
|
|
1252
1259
|
const hasProviders = !!queryClient && !!accountingContext;
|
|
1253
1260
|
const client = accountingContext?.client;
|
|
1254
|
-
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } =
|
|
1261
|
+
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
|
|
1255
1262
|
const { chainId, tokenAddress, lookbackBlocks } = options;
|
|
1256
1263
|
const query = reactQuery.useQuery({
|
|
1257
1264
|
queryKey: ["accounting-pending-deposits", ...privateReadQueryScope, chainId, tokenAddress],
|
|
@@ -1298,7 +1305,7 @@ function usePendingDeposits(options = {}) {
|
|
|
1298
1305
|
}
|
|
1299
1306
|
function usePendingWithdrawals(options = {}) {
|
|
1300
1307
|
const { address, isConnected } = wagmi.useAccount();
|
|
1301
|
-
const { client, pollingInterval } =
|
|
1308
|
+
const { client, pollingInterval } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
1302
1309
|
const query = reactQuery.useQuery({
|
|
1303
1310
|
queryKey: ["accounting-pending-withdrawals", address],
|
|
1304
1311
|
queryFn: async () => {
|
|
@@ -1334,8 +1341,8 @@ function usePendingWithdrawals(options = {}) {
|
|
|
1334
1341
|
};
|
|
1335
1342
|
}
|
|
1336
1343
|
function useHistory(options = {}) {
|
|
1337
|
-
const { client, pollingInterval } =
|
|
1338
|
-
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } =
|
|
1344
|
+
const { client, pollingInterval } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
1345
|
+
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
|
|
1339
1346
|
const offset = options.offset ?? -1;
|
|
1340
1347
|
const limit = options.limit ?? 50;
|
|
1341
1348
|
const query = reactQuery.useQuery({
|
|
@@ -1359,7 +1366,7 @@ function useHistory(options = {}) {
|
|
|
1359
1366
|
};
|
|
1360
1367
|
}
|
|
1361
1368
|
function useTokenInfo(options = {}) {
|
|
1362
|
-
const { client } =
|
|
1369
|
+
const { client } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
1363
1370
|
const { tokenId } = options;
|
|
1364
1371
|
const query = reactQuery.useQuery({
|
|
1365
1372
|
queryKey: ["accounting-token-info", tokenId],
|
|
@@ -1379,7 +1386,7 @@ function useTokenInfo(options = {}) {
|
|
|
1379
1386
|
};
|
|
1380
1387
|
}
|
|
1381
1388
|
function useTokenList(options = {}) {
|
|
1382
|
-
const { client } =
|
|
1389
|
+
const { client } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
1383
1390
|
const query = reactQuery.useQuery({
|
|
1384
1391
|
queryKey: ["accounting-token-list"],
|
|
1385
1392
|
queryFn: () => client.listTokens(),
|
|
@@ -1397,7 +1404,7 @@ function useTokenList(options = {}) {
|
|
|
1397
1404
|
function useModifyLock(options = {}) {
|
|
1398
1405
|
const { address } = wagmi.useAccount();
|
|
1399
1406
|
const { data: walletClient } = wagmi.useWalletClient();
|
|
1400
|
-
const { client, networkConfig } =
|
|
1407
|
+
const { client, networkConfig } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
1401
1408
|
const queryClient = reactQuery.useQueryClient();
|
|
1402
1409
|
const mutation = reactQuery.useMutation({
|
|
1403
1410
|
mutationFn: async (params) => {
|
|
@@ -1405,7 +1412,7 @@ function useModifyLock(options = {}) {
|
|
|
1405
1412
|
throw new Error("Wallet not connected");
|
|
1406
1413
|
}
|
|
1407
1414
|
const { nonce } = await client.getModifyLockNonce(address);
|
|
1408
|
-
const signature = await
|
|
1415
|
+
const signature = await chunkFFYLKZ7J_cjs.signModifyLockMessage({
|
|
1409
1416
|
walletClient,
|
|
1410
1417
|
chainId: networkConfig.chainId,
|
|
1411
1418
|
verifyingContract: networkConfig.accountingContract,
|
|
@@ -1464,7 +1471,7 @@ function DialogOverlay({
|
|
|
1464
1471
|
{
|
|
1465
1472
|
"data-slot": "dialog-overlay",
|
|
1466
1473
|
"data-privana": true,
|
|
1467
|
-
className:
|
|
1474
|
+
className: chunkFFYLKZ7J_cjs.cn(
|
|
1468
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",
|
|
1469
1476
|
className
|
|
1470
1477
|
),
|
|
@@ -1486,7 +1493,7 @@ function DialogContent({
|
|
|
1486
1493
|
{
|
|
1487
1494
|
"data-slot": "dialog-content",
|
|
1488
1495
|
"data-privana": true,
|
|
1489
|
-
className:
|
|
1496
|
+
className: chunkFFYLKZ7J_cjs.cn(
|
|
1490
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",
|
|
1491
1498
|
className
|
|
1492
1499
|
),
|
|
@@ -1514,7 +1521,7 @@ function DialogTitle({ className, ...props }) {
|
|
|
1514
1521
|
DialogPrimitive__namespace.Title,
|
|
1515
1522
|
{
|
|
1516
1523
|
"data-slot": "dialog-title",
|
|
1517
|
-
className:
|
|
1524
|
+
className: chunkFFYLKZ7J_cjs.cn("text-lg leading-none font-semibold", className),
|
|
1518
1525
|
...props
|
|
1519
1526
|
}
|
|
1520
1527
|
);
|
|
@@ -1527,7 +1534,7 @@ function DialogDescription({
|
|
|
1527
1534
|
DialogPrimitive__namespace.Description,
|
|
1528
1535
|
{
|
|
1529
1536
|
"data-slot": "dialog-description",
|
|
1530
|
-
className:
|
|
1537
|
+
className: chunkFFYLKZ7J_cjs.cn("text-muted-foreground text-sm", className),
|
|
1531
1538
|
...props
|
|
1532
1539
|
}
|
|
1533
1540
|
);
|
|
@@ -1569,7 +1576,7 @@ function sessionKey(owner, sessionId) {
|
|
|
1569
1576
|
return `${SESSION_PREFIX}${owner.toLowerCase()}:${sessionId}`;
|
|
1570
1577
|
}
|
|
1571
1578
|
function activeSessionId(owner) {
|
|
1572
|
-
const value =
|
|
1579
|
+
const value = chunkFFYLKZ7J_cjs.getSharedBrowserStorageItem(activeSessionKey(owner));
|
|
1573
1580
|
return value || void 0;
|
|
1574
1581
|
}
|
|
1575
1582
|
function isPositiveIntegerString(value) {
|
|
@@ -1601,7 +1608,7 @@ function isSessionRecord(value) {
|
|
|
1601
1608
|
}
|
|
1602
1609
|
function writeSessionRecord(session) {
|
|
1603
1610
|
const id = externalDepositSessionId(session.chainId, session.tokenId);
|
|
1604
|
-
return
|
|
1611
|
+
return chunkFFYLKZ7J_cjs.setSharedBrowserStorageItem(sessionKey(session.owner, id), JSON.stringify(session));
|
|
1605
1612
|
}
|
|
1606
1613
|
function saveExternalDepositLockSession(session, expectedSession = null) {
|
|
1607
1614
|
if (!isSessionRecord(session)) throw new Error("Invalid external deposit lock session");
|
|
@@ -1615,12 +1622,12 @@ function saveExternalDepositLockSession(session, expectedSession = null) {
|
|
|
1615
1622
|
throw new Error("Unable to persist external deposit lock session");
|
|
1616
1623
|
}
|
|
1617
1624
|
if (previousId !== nextId) {
|
|
1618
|
-
if (!
|
|
1619
|
-
|
|
1625
|
+
if (!chunkFFYLKZ7J_cjs.setSharedBrowserStorageItem(activeSessionKey(session.owner), nextId)) {
|
|
1626
|
+
chunkFFYLKZ7J_cjs.removeSharedBrowserStorageItem(sessionKey(session.owner, nextId));
|
|
1620
1627
|
throw new Error("Unable to persist external deposit lock session");
|
|
1621
1628
|
}
|
|
1622
1629
|
if (previousId) {
|
|
1623
|
-
|
|
1630
|
+
chunkFFYLKZ7J_cjs.removeSharedBrowserStorageItem(sessionKey(session.owner, previousId));
|
|
1624
1631
|
}
|
|
1625
1632
|
}
|
|
1626
1633
|
}
|
|
@@ -1629,17 +1636,17 @@ function loadExternalDepositLockSession(owner) {
|
|
|
1629
1636
|
if (!id) return void 0;
|
|
1630
1637
|
const key = sessionKey(owner, id);
|
|
1631
1638
|
try {
|
|
1632
|
-
const raw =
|
|
1639
|
+
const raw = chunkFFYLKZ7J_cjs.getSharedBrowserStorageItem(key);
|
|
1633
1640
|
const parsed = raw ? JSON.parse(raw) : void 0;
|
|
1634
1641
|
if (!isSessionRecord(parsed) || parsed.owner.toLowerCase() !== owner.toLowerCase() || externalDepositSessionId(parsed.chainId, parsed.tokenId) !== id) {
|
|
1635
|
-
|
|
1636
|
-
|
|
1642
|
+
chunkFFYLKZ7J_cjs.removeSharedBrowserStorageItem(key);
|
|
1643
|
+
chunkFFYLKZ7J_cjs.removeSharedBrowserStorageItem(activeSessionKey(owner));
|
|
1637
1644
|
return void 0;
|
|
1638
1645
|
}
|
|
1639
1646
|
return parsed;
|
|
1640
1647
|
} catch {
|
|
1641
|
-
|
|
1642
|
-
|
|
1648
|
+
chunkFFYLKZ7J_cjs.removeSharedBrowserStorageItem(key);
|
|
1649
|
+
chunkFFYLKZ7J_cjs.removeSharedBrowserStorageItem(activeSessionKey(owner));
|
|
1643
1650
|
return void 0;
|
|
1644
1651
|
}
|
|
1645
1652
|
}
|
|
@@ -1670,8 +1677,8 @@ function clearExternalDepositLockSession(owner, expectedSessionId, expectedGener
|
|
|
1670
1677
|
const current = loadExternalDepositLockSession(owner);
|
|
1671
1678
|
if (!current || current.generation !== expectedGeneration) return;
|
|
1672
1679
|
}
|
|
1673
|
-
|
|
1674
|
-
|
|
1680
|
+
chunkFFYLKZ7J_cjs.removeSharedBrowserStorageItem(sessionKey(owner, id));
|
|
1681
|
+
chunkFFYLKZ7J_cjs.removeSharedBrowserStorageItem(activeSessionKey(owner));
|
|
1675
1682
|
}
|
|
1676
1683
|
function isSameVerification(left, right) {
|
|
1677
1684
|
if (!left || !right) return left === right;
|
|
@@ -1724,7 +1731,7 @@ function markSubmissionAmbiguous(session, signature) {
|
|
|
1724
1731
|
return writeSessionRecord({ ...current, submissionAmbiguous: true });
|
|
1725
1732
|
}
|
|
1726
1733
|
function ambiguousSubmissionError(error) {
|
|
1727
|
-
return new
|
|
1734
|
+
return new chunkFFYLKZ7J_cjs.PostDepositLockError(
|
|
1728
1735
|
"Lock submission could not be confirmed. Retry only the saved signature, or check locked funds before stopping recovery.",
|
|
1729
1736
|
error.reason,
|
|
1730
1737
|
error.signedAmount,
|
|
@@ -1737,7 +1744,7 @@ function ambiguousSubmissionError(error) {
|
|
|
1737
1744
|
}
|
|
1738
1745
|
function isDefinitiveSubmissionFailure(error) {
|
|
1739
1746
|
const cause = error.cause;
|
|
1740
|
-
return cause instanceof
|
|
1747
|
+
return cause instanceof chunkFFYLKZ7J_cjs.AccountingApiError && cause.statusCode !== 408 && cause.statusCode < 500;
|
|
1741
1748
|
}
|
|
1742
1749
|
function submissionLockName(session) {
|
|
1743
1750
|
return `privana:external-deposit-lock:submit:${session.owner.toLowerCase()}:${externalDepositSessionId(session.chainId, session.tokenId)}`;
|
|
@@ -1757,7 +1764,7 @@ async function submitExternalDepositLock(client, session) {
|
|
|
1757
1764
|
return withSubmissionLock(session, async (crossTabExclusive) => {
|
|
1758
1765
|
const current = loadExternalDepositLockSession(session.owner);
|
|
1759
1766
|
if (!current || current.generation !== session.generation) {
|
|
1760
|
-
throw new
|
|
1767
|
+
throw new chunkFFYLKZ7J_cjs.PostDepositLockError(
|
|
1761
1768
|
"External deposit lock session changed before submission",
|
|
1762
1769
|
"not-found",
|
|
1763
1770
|
BigInt(session.maxLockAmount),
|
|
@@ -1776,7 +1783,7 @@ async function submitExternalDepositLock(client, session) {
|
|
|
1776
1783
|
async function submitExternalDepositLockAttempt(client, session, crossTabExclusive) {
|
|
1777
1784
|
const creditedAmount = session.creditedAmount ? BigInt(session.creditedAmount) : void 0;
|
|
1778
1785
|
if (!creditedAmount) {
|
|
1779
|
-
throw new
|
|
1786
|
+
throw new chunkFFYLKZ7J_cjs.PostDepositLockError(
|
|
1780
1787
|
"External deposit has not been credited",
|
|
1781
1788
|
"submission-failed",
|
|
1782
1789
|
BigInt(session.maxLockAmount)
|
|
@@ -1784,7 +1791,7 @@ async function submitExternalDepositLockAttempt(client, session, crossTabExclusi
|
|
|
1784
1791
|
}
|
|
1785
1792
|
const payload = session.payload;
|
|
1786
1793
|
if (!payload) {
|
|
1787
|
-
throw new
|
|
1794
|
+
throw new chunkFFYLKZ7J_cjs.PostDepositLockError(
|
|
1788
1795
|
"No persisted signed policy found for this deposit session",
|
|
1789
1796
|
"not-found",
|
|
1790
1797
|
BigInt(session.maxLockAmount),
|
|
@@ -1792,7 +1799,7 @@ async function submitExternalDepositLockAttempt(client, session, crossTabExclusi
|
|
|
1792
1799
|
);
|
|
1793
1800
|
}
|
|
1794
1801
|
try {
|
|
1795
|
-
return await
|
|
1802
|
+
return await chunkFFYLKZ7J_cjs.submitPendingLock({
|
|
1796
1803
|
client,
|
|
1797
1804
|
payload,
|
|
1798
1805
|
creditedAmount,
|
|
@@ -1803,23 +1810,23 @@ async function submitExternalDepositLockAttempt(client, session, crossTabExclusi
|
|
|
1803
1810
|
}
|
|
1804
1811
|
});
|
|
1805
1812
|
} catch (err) {
|
|
1806
|
-
if (err instanceof
|
|
1813
|
+
if (err instanceof chunkFFYLKZ7J_cjs.PostDepositLockError && err.reason === "submission-failed" && crossTabExclusive && !session.submissionAmbiguous && isDefinitiveSubmissionFailure(err)) {
|
|
1807
1814
|
if (!clearSubmittedPayload(session, payload.signature, true)) {
|
|
1808
1815
|
const latest = loadExternalDepositLockSession(session.owner);
|
|
1809
1816
|
if (latest?.submissionAmbiguous) throw ambiguousSubmissionError(err);
|
|
1810
1817
|
}
|
|
1811
|
-
} else if (err instanceof
|
|
1818
|
+
} else if (err instanceof chunkFFYLKZ7J_cjs.PostDepositLockError && err.reason === "submission-failed") {
|
|
1812
1819
|
const ambiguous = markSubmissionAmbiguous(session, payload.signature) || loadExternalDepositLockSession(session.owner)?.submissionAmbiguous === true;
|
|
1813
1820
|
if (ambiguous) throw ambiguousSubmissionError(err);
|
|
1814
1821
|
} else {
|
|
1815
1822
|
const current = loadExternalDepositLockSession(session.owner);
|
|
1816
1823
|
if (session.submissionAmbiguous || current?.submissionAmbiguous) {
|
|
1817
|
-
if (err instanceof
|
|
1824
|
+
if (err instanceof chunkFFYLKZ7J_cjs.PostDepositLockError) throw ambiguousSubmissionError(err);
|
|
1818
1825
|
throw err;
|
|
1819
1826
|
}
|
|
1820
1827
|
if (!clearSubmittedPayload(session, payload.signature)) {
|
|
1821
1828
|
const latest = loadExternalDepositLockSession(session.owner);
|
|
1822
|
-
if (latest?.submissionAmbiguous && err instanceof
|
|
1829
|
+
if (latest?.submissionAmbiguous && err instanceof chunkFFYLKZ7J_cjs.PostDepositLockError) {
|
|
1823
1830
|
throw ambiguousSubmissionError(err);
|
|
1824
1831
|
}
|
|
1825
1832
|
}
|
|
@@ -1832,12 +1839,12 @@ function useExternalDepositLock({
|
|
|
1832
1839
|
onLockSubmitted,
|
|
1833
1840
|
onLockFailed
|
|
1834
1841
|
}) {
|
|
1835
|
-
const { client, networkConfig, serviceAddress, getTokenById, tokensStatus } =
|
|
1842
|
+
const { client, networkConfig, serviceAddress, getTokenById, tokensStatus } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
1836
1843
|
const config = wagmi.useConfig();
|
|
1837
1844
|
const queryClient = reactQuery.useQueryClient();
|
|
1838
1845
|
const { address } = wagmi.useAccount();
|
|
1839
|
-
const { privateReadAddress } =
|
|
1840
|
-
const { ensureCorrectChain } =
|
|
1846
|
+
const { privateReadAddress } = chunkFFYLKZ7J_cjs.usePrivateReadRequest();
|
|
1847
|
+
const { ensureCorrectChain } = chunkFFYLKZ7J_cjs.useEnsureCorrectChain();
|
|
1841
1848
|
const [isSigning, setIsSigning] = react.useState(false);
|
|
1842
1849
|
const [isSubmittingLock, setIsSubmittingLock] = react.useState(false);
|
|
1843
1850
|
const [session, setSession] = react.useState(null);
|
|
@@ -1897,7 +1904,7 @@ function useExternalDepositLock({
|
|
|
1897
1904
|
result = await submitExternalDepositLock(client, submission);
|
|
1898
1905
|
} catch (err) {
|
|
1899
1906
|
const stored = loadExternalDepositLockSession(active.owner);
|
|
1900
|
-
const error = err instanceof
|
|
1907
|
+
const error = err instanceof chunkFFYLKZ7J_cjs.PostDepositLockError ? err : new chunkFFYLKZ7J_cjs.PostDepositLockError(
|
|
1901
1908
|
err instanceof Error ? err.message : "Lock submission failed",
|
|
1902
1909
|
"submission-failed",
|
|
1903
1910
|
BigInt(active.maxLockAmount),
|
|
@@ -1976,7 +1983,7 @@ function useExternalDepositLock({
|
|
|
1976
1983
|
void submitSession(restored);
|
|
1977
1984
|
} else if (restored.creditedAmount) {
|
|
1978
1985
|
notifyFailure(
|
|
1979
|
-
new
|
|
1986
|
+
new chunkFFYLKZ7J_cjs.PostDepositLockError(
|
|
1980
1987
|
"Deposit credited; sign a fresh policy to lock the funds",
|
|
1981
1988
|
"not-found",
|
|
1982
1989
|
BigInt(restored.maxLockAmount),
|
|
@@ -2016,10 +2023,10 @@ function useExternalDepositLock({
|
|
|
2016
2023
|
if (signingRef.current || settlingRef.current) {
|
|
2017
2024
|
throw new Error("A policy operation is already in progress");
|
|
2018
2025
|
}
|
|
2019
|
-
if (!
|
|
2026
|
+
if (!chunkFFYLKZ7J_cjs.canUseSharedBrowserStorage()) {
|
|
2020
2027
|
throw new Error("Browser storage is required for locked deposit recovery");
|
|
2021
2028
|
}
|
|
2022
|
-
const owner =
|
|
2029
|
+
const owner = chunkFFYLKZ7J_cjs.requireDepositLockOwner(address, privateReadAddress);
|
|
2023
2030
|
if (sessionRef.current || loadExternalDepositLockSession(owner)) {
|
|
2024
2031
|
throw new Error("Finish or cancel the active external deposit before starting another");
|
|
2025
2032
|
}
|
|
@@ -2028,26 +2035,26 @@ function useExternalDepositLock({
|
|
|
2028
2035
|
if (token.contract === viem.zeroAddress) {
|
|
2029
2036
|
throw new Error("External deposits support ERC20 tokens only");
|
|
2030
2037
|
}
|
|
2031
|
-
const targetService =
|
|
2032
|
-
const lockDuration = allowance.lockDuration ??
|
|
2038
|
+
const targetService = chunkFFYLKZ7J_cjs.requireServiceAddress(serviceAddress);
|
|
2039
|
+
const lockDuration = allowance.lockDuration ?? chunkFFYLKZ7J_cjs.DEFAULT_LOCK_DURATION_SECONDS;
|
|
2033
2040
|
signingRef.current = true;
|
|
2034
2041
|
setIsSigning(true);
|
|
2035
2042
|
try {
|
|
2036
2043
|
await ensureCorrectChain(networkConfig.chainId);
|
|
2037
|
-
const signingWalletClient = await
|
|
2044
|
+
const signingWalletClient = await chunkFFYLKZ7J_cjs.getWalletClient(config, {
|
|
2038
2045
|
chainId: networkConfig.chainId
|
|
2039
2046
|
});
|
|
2040
|
-
const payload = await
|
|
2047
|
+
const payload = await chunkFFYLKZ7J_cjs.createSignedLockRequest({
|
|
2041
2048
|
client,
|
|
2042
2049
|
walletClient: signingWalletClient,
|
|
2043
2050
|
userAddress: owner,
|
|
2044
2051
|
networkConfig,
|
|
2045
2052
|
serviceAddress: targetService,
|
|
2046
2053
|
tokenId: token.id,
|
|
2047
|
-
amount:
|
|
2054
|
+
amount: chunkFFYLKZ7J_cjs.clampLockAmount(amount, BigInt(allowance.value)),
|
|
2048
2055
|
lockDuration
|
|
2049
2056
|
});
|
|
2050
|
-
const startBlock = await
|
|
2057
|
+
const startBlock = await chunkFFYLKZ7J_cjs.getBlockNumber(config, { chainId: token.chainId });
|
|
2051
2058
|
if (startBlock > BigInt(Number.MAX_SAFE_INTEGER)) {
|
|
2052
2059
|
throw new Error("Source-chain block number exceeds the supported range");
|
|
2053
2060
|
}
|
|
@@ -2113,7 +2120,7 @@ function useExternalDepositLock({
|
|
|
2113
2120
|
pendingCreditedTransitionRef.current = { predecessor: active, credited };
|
|
2114
2121
|
installSession(credited);
|
|
2115
2122
|
notifyFailure(
|
|
2116
|
-
new
|
|
2123
|
+
new chunkFFYLKZ7J_cjs.PostDepositLockError(
|
|
2117
2124
|
err instanceof Error ? err.message : "Unable to persist credited deposit state",
|
|
2118
2125
|
"submission-failed",
|
|
2119
2126
|
BigInt(active.maxLockAmount),
|
|
@@ -2173,7 +2180,7 @@ function useExternalDepositLock({
|
|
|
2173
2180
|
if (!token || token.chainId !== active.chainId || token.contract === viem.zeroAddress) {
|
|
2174
2181
|
throw new Error("The credited token is no longer available");
|
|
2175
2182
|
}
|
|
2176
|
-
const targetService =
|
|
2183
|
+
const targetService = chunkFFYLKZ7J_cjs.requireServiceAddress(serviceAddress);
|
|
2177
2184
|
if (targetService.toLowerCase() !== active.serviceAddress.toLowerCase()) {
|
|
2178
2185
|
throw new Error("The service for this credited deposit has changed");
|
|
2179
2186
|
}
|
|
@@ -2186,17 +2193,17 @@ function useExternalDepositLock({
|
|
|
2186
2193
|
"The previous lock submission may have succeeded; a fresh signature is unsafe"
|
|
2187
2194
|
);
|
|
2188
2195
|
}
|
|
2189
|
-
const owner =
|
|
2196
|
+
const owner = chunkFFYLKZ7J_cjs.requireDepositLockOwner(address, privateReadAddress);
|
|
2190
2197
|
const amount = externalDepositRetryAmount(active);
|
|
2191
2198
|
let retrySession;
|
|
2192
2199
|
signingRef.current = true;
|
|
2193
2200
|
setIsSigning(true);
|
|
2194
2201
|
try {
|
|
2195
2202
|
await ensureCorrectChain(networkConfig.chainId);
|
|
2196
|
-
const signingWalletClient = await
|
|
2203
|
+
const signingWalletClient = await chunkFFYLKZ7J_cjs.getWalletClient(config, {
|
|
2197
2204
|
chainId: networkConfig.chainId
|
|
2198
2205
|
});
|
|
2199
|
-
const payload = await
|
|
2206
|
+
const payload = await chunkFFYLKZ7J_cjs.createSignedLockRequest({
|
|
2200
2207
|
client,
|
|
2201
2208
|
walletClient: signingWalletClient,
|
|
2202
2209
|
userAddress: owner,
|
|
@@ -2329,7 +2336,7 @@ function BaseIcon({ className, size = 24 }) {
|
|
|
2329
2336
|
}
|
|
2330
2337
|
);
|
|
2331
2338
|
}
|
|
2332
|
-
function
|
|
2339
|
+
function EthereumIcon({ className, size = 24 }) {
|
|
2333
2340
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2334
2341
|
"svg",
|
|
2335
2342
|
{
|
|
@@ -2380,18 +2387,19 @@ function WETHIcon({ className, size = 24 }) {
|
|
|
2380
2387
|
}
|
|
2381
2388
|
function getTokenIcon(symbol, size) {
|
|
2382
2389
|
const iconSize = size ?? 24;
|
|
2383
|
-
switch (symbol.toUpperCase()) {
|
|
2390
|
+
switch ((symbol ?? "").toUpperCase()) {
|
|
2384
2391
|
case "USDC":
|
|
2385
2392
|
return /* @__PURE__ */ jsxRuntime.jsx(USDCIcon, { size: iconSize });
|
|
2393
|
+
case "ETH":
|
|
2386
2394
|
case "WETH":
|
|
2387
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2395
|
+
return /* @__PURE__ */ jsxRuntime.jsx(EthereumIcon, { size: iconSize });
|
|
2388
2396
|
default:
|
|
2389
2397
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2390
2398
|
"div",
|
|
2391
2399
|
{
|
|
2392
2400
|
className: "bg-muted flex items-center justify-center rounded-full text-xs font-bold",
|
|
2393
2401
|
style: { width: iconSize, height: iconSize },
|
|
2394
|
-
children: symbol.slice(0, 2)
|
|
2402
|
+
children: (symbol ?? "?").slice(0, 2)
|
|
2395
2403
|
}
|
|
2396
2404
|
);
|
|
2397
2405
|
}
|
|
@@ -2399,8 +2407,12 @@ function getTokenIcon(symbol, size) {
|
|
|
2399
2407
|
function getChainIcon(chainId, size) {
|
|
2400
2408
|
const iconSize = size ?? 24;
|
|
2401
2409
|
switch (chainId) {
|
|
2410
|
+
case 8453:
|
|
2402
2411
|
case 84532:
|
|
2403
2412
|
return /* @__PURE__ */ jsxRuntime.jsx(BaseIcon, { size: iconSize });
|
|
2413
|
+
case 1:
|
|
2414
|
+
case 11155111:
|
|
2415
|
+
return /* @__PURE__ */ jsxRuntime.jsx(EthereumIcon, { size: iconSize });
|
|
2404
2416
|
default:
|
|
2405
2417
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2406
2418
|
"div",
|
|
@@ -2413,16 +2425,17 @@ function getChainIcon(chainId, size) {
|
|
|
2413
2425
|
}
|
|
2414
2426
|
}
|
|
2415
2427
|
function TokenSelectorView({ selectedTokenId, onSelect }) {
|
|
2416
|
-
const { enabledTokens } =
|
|
2428
|
+
const { enabledTokens, getChainById: getChainById2 } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
2417
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: [
|
|
2418
2430
|
enabledTokens.map((token) => {
|
|
2419
2431
|
const isSelected = selectedTokenId === token.id;
|
|
2432
|
+
const chainName = getChainById2(token.chainId)?.name;
|
|
2420
2433
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2421
2434
|
"button",
|
|
2422
2435
|
{
|
|
2423
2436
|
type: "button",
|
|
2424
2437
|
onClick: () => onSelect(token.id),
|
|
2425
|
-
className:
|
|
2438
|
+
className: chunkFFYLKZ7J_cjs.cn(
|
|
2426
2439
|
"hover:bg-secondary flex w-full cursor-pointer items-center gap-3 rounded-lg px-3 py-2 text-left transition-colors",
|
|
2427
2440
|
isSelected && "bg-secondary"
|
|
2428
2441
|
),
|
|
@@ -2430,7 +2443,10 @@ function TokenSelectorView({ selectedTokenId, onSelect }) {
|
|
|
2430
2443
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-6 w-6 shrink-0 overflow-hidden rounded-full", children: getTokenIcon(token.symbol, 24) }),
|
|
2431
2444
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
2432
2445
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-foreground text-sm font-medium", children: token.symbol }),
|
|
2433
|
-
/* @__PURE__ */ jsxRuntime.
|
|
2446
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-muted-foreground text-[11px]", children: [
|
|
2447
|
+
"on ",
|
|
2448
|
+
chainName ?? "\u2014"
|
|
2449
|
+
] })
|
|
2434
2450
|
] }),
|
|
2435
2451
|
isSelected && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-primary flex h-4 w-4 shrink-0 items-center justify-center rounded-full", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2436
2452
|
"svg",
|
|
@@ -2477,7 +2493,7 @@ function CreditCardWidgetView({
|
|
|
2477
2493
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, className: "bg-muted flex flex-col gap-6 rounded-[10px] p-5", children: [
|
|
2478
2494
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-foreground text-[28px] leading-8 font-medium", children: "Complete your purchase" }),
|
|
2479
2495
|
token && moonpayCurrencyCode ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2480
|
-
|
|
2496
|
+
chunkFFYLKZ7J_cjs.FiatOnRampForm,
|
|
2481
2497
|
{
|
|
2482
2498
|
tokenId: token.id,
|
|
2483
2499
|
currencyCode: moonpayCurrencyCode,
|
|
@@ -2766,7 +2782,7 @@ function ChevronDownIcon({
|
|
|
2766
2782
|
height: "16",
|
|
2767
2783
|
viewBox: "0 0 16 16",
|
|
2768
2784
|
fill: "none",
|
|
2769
|
-
className:
|
|
2785
|
+
className: chunkFFYLKZ7J_cjs.cn(
|
|
2770
2786
|
"transition-transform",
|
|
2771
2787
|
direction === "right" && "-rotate-90",
|
|
2772
2788
|
direction === "up" && "rotate-180",
|
|
@@ -2919,7 +2935,7 @@ function PolicyTermRow({
|
|
|
2919
2935
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2920
2936
|
"div",
|
|
2921
2937
|
{
|
|
2922
|
-
className:
|
|
2938
|
+
className: chunkFFYLKZ7J_cjs.cn(
|
|
2923
2939
|
"mt-0.5 shrink-0",
|
|
2924
2940
|
kind === "permission" ? "text-emerald-500" : "text-orange-500"
|
|
2925
2941
|
),
|
|
@@ -2992,7 +3008,7 @@ function DepositView({
|
|
|
2992
3008
|
onSubmit,
|
|
2993
3009
|
isSubmitting = false
|
|
2994
3010
|
}) {
|
|
2995
|
-
const { getChainById: getChainById2, chains, serviceName, serviceIcon, networkConfig, hostedAuthConfig } =
|
|
3011
|
+
const { getChainById: getChainById2, chains, serviceName, serviceIcon, networkConfig, hostedAuthConfig } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
2996
3012
|
const { address, isConnected } = wagmi.useAccount();
|
|
2997
3013
|
const appName = serviceName ?? "Privana";
|
|
2998
3014
|
const chain = selectedToken ? getChainById2(selectedToken.chainId) : void 0;
|
|
@@ -3016,7 +3032,7 @@ function DepositView({
|
|
|
3016
3032
|
query: { enabled: isConnectedSource && !!address && !!selectedToken && !isNative }
|
|
3017
3033
|
});
|
|
3018
3034
|
const walletBalance = isNative ? nativeBalanceData?.value : erc20Balance;
|
|
3019
|
-
const formattedWalletBalance = walletBalance != null && selectedToken ?
|
|
3035
|
+
const formattedWalletBalance = walletBalance != null && selectedToken ? chunkFFYLKZ7J_cjs.formatTokenAmount(walletBalance.toString(), selectedToken.decimals) : "0.00";
|
|
3020
3036
|
const {
|
|
3021
3037
|
minBuyAmount: moonpayMinBuy,
|
|
3022
3038
|
isLoading: moonpayLimitsLoading,
|
|
@@ -3029,7 +3045,7 @@ function DepositView({
|
|
|
3029
3045
|
const hasValidAmount = !!amount && parseFloat(amount) > 0;
|
|
3030
3046
|
const maxAmountDecimals = isCreditCard ? 2 : selectedToken?.decimals;
|
|
3031
3047
|
const tooManyDecimals = hasValidAmount && maxAmountDecimals != null && amount.includes(".") && amount.split(".")[1].length > maxAmountDecimals;
|
|
3032
|
-
const exceedsBalance = isConnectedSource && hasValidAmount && !tooManyDecimals && !!selectedToken && walletBalance != null &&
|
|
3048
|
+
const exceedsBalance = isConnectedSource && hasValidAmount && !tooManyDecimals && !!selectedToken && walletBalance != null && chunkFFYLKZ7J_cjs.parseTokenAmount(amount, selectedToken.decimals) > walletBalance;
|
|
3033
3049
|
const belowMoonpayMin = isCreditCard && hasValidAmount && moonpayMinBuy != null && parseFloat(amount) < moonpayMinBuy;
|
|
3034
3050
|
const moonpayLimitsUnready = isCreditCard && !!selectedToken?.moonpayCurrencyCode && moonpayMinBuy == null;
|
|
3035
3051
|
const creditCardUnavailable = isCreditCard && !!selectedToken && !selectedToken.moonpayCurrencyCode;
|
|
@@ -3037,7 +3053,7 @@ function DepositView({
|
|
|
3037
3053
|
const externalMinimumRequired = isExternal && !!allowance && !!selectedToken;
|
|
3038
3054
|
const externalMinimumLoading = externalMinimumRequired && externalMinimum === void 0;
|
|
3039
3055
|
const externalMinimumUnavailable = externalMinimumRequired && externalMinimum === null;
|
|
3040
|
-
const belowExternalMinimum = externalMinimumRequired && hasValidAmount && !tooManyDecimals && !!selectedToken && typeof externalMinimum === "bigint" &&
|
|
3056
|
+
const belowExternalMinimum = externalMinimumRequired && hasValidAmount && !tooManyDecimals && !!selectedToken && typeof externalMinimum === "bigint" && chunkFFYLKZ7J_cjs.parseTokenAmount(amount, selectedToken.decimals) < externalMinimum;
|
|
3041
3057
|
const externalNeedsWallet = isExternal && (!!allowance || !hostedAuthConfig);
|
|
3042
3058
|
const needsConnect = (isConnectedSource || externalNeedsWallet) && !isConnected;
|
|
3043
3059
|
const canDeposit = hasValidAmount && !!selectedToken && !tooManyDecimals && !exceedsBalance && !belowMoonpayMin && !moonpayLimitsUnready && !creditCardUnavailable && !externalTokenUnavailable && !externalMinimumLoading && !externalMinimumUnavailable && !belowExternalMinimum && !needsConnect;
|
|
@@ -3094,7 +3110,7 @@ function DepositView({
|
|
|
3094
3110
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3095
3111
|
"div",
|
|
3096
3112
|
{
|
|
3097
|
-
className:
|
|
3113
|
+
className: chunkFFYLKZ7J_cjs.cn(
|
|
3098
3114
|
"border-border bg-input flex items-center gap-2 rounded-[10px] border",
|
|
3099
3115
|
isConnectedSource ? "py-1 pr-1 pl-3" : "px-3 py-3"
|
|
3100
3116
|
),
|
|
@@ -3234,7 +3250,7 @@ function ExternalDepositView({
|
|
|
3234
3250
|
onDiscardLock,
|
|
3235
3251
|
lock
|
|
3236
3252
|
}) {
|
|
3237
|
-
const { getChainById: getChainById2, getTokenById, serviceName } =
|
|
3253
|
+
const { getChainById: getChainById2, getTokenById, serviceName } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
3238
3254
|
const appName = serviceName ?? "Privana";
|
|
3239
3255
|
const { depositAddress, isReady, isLoading } = depositAddressState;
|
|
3240
3256
|
const chain = token ? getChainById2(token.chainId) : void 0;
|
|
@@ -3250,7 +3266,7 @@ function ExternalDepositView({
|
|
|
3250
3266
|
const [nothingFound, setNothingFound] = react.useState(false);
|
|
3251
3267
|
const [credited, setCredited] = react.useState(null);
|
|
3252
3268
|
const [showCancelWarning, setShowCancelWarning] = react.useState(false);
|
|
3253
|
-
const verification =
|
|
3269
|
+
const verification = chunkFFYLKZ7J_cjs.useDepositVerification({
|
|
3254
3270
|
onCredited: (txHash, _response, creditedAmount) => {
|
|
3255
3271
|
if (settleAfterCredit) {
|
|
3256
3272
|
void settleAfterCredit(txHash, creditedAmount);
|
|
@@ -3374,11 +3390,11 @@ function ExternalDepositView({
|
|
|
3374
3390
|
] }),
|
|
3375
3391
|
showDepositInstructions && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3376
3392
|
!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." }),
|
|
3377
|
-
/* @__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(
|
|
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" }) }),
|
|
3378
3394
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
3379
3395
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: "Deposit Address" }),
|
|
3380
3396
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
3381
|
-
/* @__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(
|
|
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" }) }),
|
|
3382
3398
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3383
3399
|
"button",
|
|
3384
3400
|
{
|
|
@@ -3433,7 +3449,7 @@ function ExternalDepositView({
|
|
|
3433
3449
|
TransactionSuccessView,
|
|
3434
3450
|
{
|
|
3435
3451
|
title: "Deposit Credited",
|
|
3436
|
-
message: `Transfer ${
|
|
3452
|
+
message: `Transfer ${chunkFFYLKZ7J_cjs.shortenAddress(credited.txHash)} has been credited to your Privana balance.`,
|
|
3437
3453
|
onDone: () => {
|
|
3438
3454
|
setCredited(null);
|
|
3439
3455
|
verification.reset();
|
|
@@ -3462,7 +3478,7 @@ function ExternalDepositView({
|
|
|
3462
3478
|
{
|
|
3463
3479
|
title: "Awaiting Deposit",
|
|
3464
3480
|
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.",
|
|
3465
|
-
remaining: listening ?
|
|
3481
|
+
remaining: listening ? chunkFFYLKZ7J_cjs.formatCountdown(secondsLeft) : void 0
|
|
3466
3482
|
}
|
|
3467
3483
|
),
|
|
3468
3484
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
@@ -3491,7 +3507,7 @@ function ExternalDepositView({
|
|
|
3491
3507
|
] });
|
|
3492
3508
|
}
|
|
3493
3509
|
function MoonPayGate({ enabled, children }) {
|
|
3494
|
-
const { networkConfig } =
|
|
3510
|
+
const { networkConfig } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
3495
3511
|
const apiKey = networkConfig.moonpayApiKey;
|
|
3496
3512
|
if (!enabled || !apiKey) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
3497
3513
|
return /* @__PURE__ */ jsxRuntime.jsx(moonpayReact.MoonPayProvider, { apiKey, children });
|
|
@@ -3512,7 +3528,7 @@ function MethodTabs({
|
|
|
3512
3528
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3513
3529
|
"div",
|
|
3514
3530
|
{
|
|
3515
|
-
className:
|
|
3531
|
+
className: chunkFFYLKZ7J_cjs.cn(
|
|
3516
3532
|
"bg-input absolute top-1 bottom-1 left-1 w-[calc(50%-8px)] rounded-md transition-transform duration-200",
|
|
3517
3533
|
activeTab === "credit-card" && "translate-x-[calc(100%+8px)]"
|
|
3518
3534
|
)
|
|
@@ -3523,7 +3539,7 @@ function MethodTabs({
|
|
|
3523
3539
|
{
|
|
3524
3540
|
type: "button",
|
|
3525
3541
|
onClick: () => onTabChange("crypto"),
|
|
3526
|
-
className:
|
|
3542
|
+
className: chunkFFYLKZ7J_cjs.cn(
|
|
3527
3543
|
"relative z-10 flex-1 cursor-pointer rounded-md px-3 py-[9px] text-sm font-medium transition-colors",
|
|
3528
3544
|
activeTab === "crypto" ? "text-foreground" : "text-muted-foreground"
|
|
3529
3545
|
),
|
|
@@ -3535,7 +3551,7 @@ function MethodTabs({
|
|
|
3535
3551
|
{
|
|
3536
3552
|
type: "button",
|
|
3537
3553
|
onClick: () => onTabChange("credit-card"),
|
|
3538
|
-
className:
|
|
3554
|
+
className: chunkFFYLKZ7J_cjs.cn(
|
|
3539
3555
|
"relative z-10 flex-1 cursor-pointer rounded-md px-3 py-[9px] text-sm font-medium transition-colors",
|
|
3540
3556
|
activeTab === "credit-card" ? "text-foreground" : "text-muted-foreground"
|
|
3541
3557
|
),
|
|
@@ -3579,7 +3595,7 @@ function DepositModalContent({
|
|
|
3579
3595
|
onCloseBlockedChange,
|
|
3580
3596
|
onExit
|
|
3581
3597
|
}) {
|
|
3582
|
-
const { serviceName, enabledTokens, defaultToken, hostedAuthConfig, getChainById: getChainById2, getTokenById } =
|
|
3598
|
+
const { serviceName, enabledTokens, defaultToken, hostedAuthConfig, getChainById: getChainById2, getTokenById } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
3583
3599
|
const { address } = wagmi.useAccount();
|
|
3584
3600
|
const appName = serviceName ?? "Privana";
|
|
3585
3601
|
const [activeTab, setActiveTab] = react.useState(defaultTab);
|
|
@@ -3714,7 +3730,7 @@ function DepositModalContent({
|
|
|
3714
3730
|
sonner.toast.error("External deposits support ERC20 tokens only");
|
|
3715
3731
|
return;
|
|
3716
3732
|
}
|
|
3717
|
-
const depositAmount =
|
|
3733
|
+
const depositAmount = chunkFFYLKZ7J_cjs.parseTokenAmount(args.amount, token2.decimals);
|
|
3718
3734
|
if (!allowance) {
|
|
3719
3735
|
setView("external-deposit");
|
|
3720
3736
|
return;
|
|
@@ -3747,7 +3763,7 @@ function DepositModalContent({
|
|
|
3747
3763
|
setCancelled(false);
|
|
3748
3764
|
deposit({
|
|
3749
3765
|
tokenId: token.id,
|
|
3750
|
-
amount:
|
|
3766
|
+
amount: chunkFFYLKZ7J_cjs.parseTokenAmount(args.amount, token.decimals),
|
|
3751
3767
|
postDepositLock: allowance ? {
|
|
3752
3768
|
maxAmount: BigInt(allowance.value),
|
|
3753
3769
|
lockDuration: allowance.lockDuration
|
|
@@ -3788,7 +3804,7 @@ function DepositModalContent({
|
|
|
3788
3804
|
];
|
|
3789
3805
|
const hasExternalLockRecovery = view === "external-deposit" && !!externalLock.session?.creditedAmount;
|
|
3790
3806
|
const externalSubmissionAmbiguous = hasExternalLockRecovery && !!lockFailure?.submissionMayHaveSucceeded;
|
|
3791
|
-
const savedExternalPayloadUsable = !!externalLock.session?.payload &&
|
|
3807
|
+
const savedExternalPayloadUsable = !!externalLock.session?.payload && chunkFFYLKZ7J_cjs.isSignedLockUsable(externalLock.session.payload);
|
|
3792
3808
|
const ambiguousRecoveryMustBeAbandoned = externalSubmissionAmbiguous && !savedExternalPayloadUsable;
|
|
3793
3809
|
const externalRecoveryExitLabel = externalSubmissionAmbiguous ? "Stop recovery" : "Keep funds unlocked";
|
|
3794
3810
|
const lockFailureToken = hasExternalLockRecovery && externalLock.session ? getTokenById(externalLock.session.tokenId) ?? selectedToken : selectedToken;
|
|
@@ -3858,7 +3874,7 @@ function DepositModalContent({
|
|
|
3858
3874
|
onClick: onClose,
|
|
3859
3875
|
disabled: isUnsafeToClose,
|
|
3860
3876
|
"aria-label": "Close",
|
|
3861
|
-
className:
|
|
3877
|
+
className: chunkFFYLKZ7J_cjs.cn(
|
|
3862
3878
|
"absolute top-6 right-5 z-20 flex h-5 w-5 items-center justify-center transition-colors",
|
|
3863
3879
|
isUnsafeToClose ? "text-muted-foreground/40 cursor-not-allowed" : "text-muted-foreground hover:text-foreground cursor-pointer"
|
|
3864
3880
|
),
|
|
@@ -4066,7 +4082,7 @@ function DepositInlineModal({ className, ...handlers }) {
|
|
|
4066
4082
|
"div",
|
|
4067
4083
|
{
|
|
4068
4084
|
"data-privana": true,
|
|
4069
|
-
className:
|
|
4085
|
+
className: chunkFFYLKZ7J_cjs.cn(
|
|
4070
4086
|
"bg-card relative flex w-[560px] max-w-full flex-col gap-2 overflow-hidden rounded-2xl p-2 shadow-lg",
|
|
4071
4087
|
className
|
|
4072
4088
|
),
|
|
@@ -4082,7 +4098,7 @@ function WithdrawView({
|
|
|
4082
4098
|
onPendingChange,
|
|
4083
4099
|
onWithdrawSuccess
|
|
4084
4100
|
}) {
|
|
4085
|
-
const { chains, getChainById: getChainById2 } =
|
|
4101
|
+
const { chains, getChainById: getChainById2 } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
4086
4102
|
const { isConnected, address } = wagmi.useAccount();
|
|
4087
4103
|
const [showSuccess, setShowSuccess] = react.useState(false);
|
|
4088
4104
|
const [showTimeout, setShowTimeout] = react.useState(false);
|
|
@@ -4096,7 +4112,7 @@ function WithdrawView({
|
|
|
4096
4112
|
tokenId: selectedToken?.id,
|
|
4097
4113
|
enabled: !!selectedToken
|
|
4098
4114
|
});
|
|
4099
|
-
const formattedBalance = selectedToken ?
|
|
4115
|
+
const formattedBalance = selectedToken ? chunkFFYLKZ7J_cjs.formatTokenAmount(balanceWei, selectedToken.decimals) : "0.00";
|
|
4100
4116
|
const { withdraw, isPending, currentStep, error, reset } = useWithdraw({
|
|
4101
4117
|
onProcessingSuccess: () => {
|
|
4102
4118
|
onAmountChange("");
|
|
@@ -4112,7 +4128,7 @@ function WithdrawView({
|
|
|
4112
4128
|
setShowTimeout(true);
|
|
4113
4129
|
}
|
|
4114
4130
|
});
|
|
4115
|
-
const explorerUrl = address && targetChain ?
|
|
4131
|
+
const explorerUrl = address && targetChain ? chunkFFYLKZ7J_cjs.getExplorerAddressUrl(targetChain.id, address) : void 0;
|
|
4116
4132
|
const getStepStatus = (step, after) => {
|
|
4117
4133
|
if (currentStep === step) return "active";
|
|
4118
4134
|
if (after.includes(currentStep)) return "completed";
|
|
@@ -4137,7 +4153,7 @@ function WithdrawView({
|
|
|
4137
4153
|
}, [isPending, cancelled, onPendingChange]);
|
|
4138
4154
|
const hasValidAmount = !!amount && parseFloat(amount) > 0;
|
|
4139
4155
|
const tooManyDecimals = !!hasValidAmount && !!selectedToken && amount.includes(".") && amount.split(".")[1].length > selectedToken.decimals;
|
|
4140
|
-
const exceedsBalance = !!hasValidAmount && !tooManyDecimals && !!selectedToken && !isBalanceLoading && !isBalanceError &&
|
|
4156
|
+
const exceedsBalance = !!hasValidAmount && !tooManyDecimals && !!selectedToken && !isBalanceLoading && !isBalanceError && chunkFFYLKZ7J_cjs.parseTokenAmount(amount, selectedToken.decimals) > BigInt(balanceWei);
|
|
4141
4157
|
const canWithdraw = isConnected && hasValidAmount && !!selectedToken && !tooManyDecimals && !exceedsBalance;
|
|
4142
4158
|
const handleMax = () => {
|
|
4143
4159
|
if (!selectedToken) return;
|
|
@@ -4149,7 +4165,7 @@ function WithdrawView({
|
|
|
4149
4165
|
setCancelled(false);
|
|
4150
4166
|
await withdraw({
|
|
4151
4167
|
tokenId: selectedToken.id,
|
|
4152
|
-
amount:
|
|
4168
|
+
amount: chunkFFYLKZ7J_cjs.parseTokenAmount(amount, selectedToken.decimals)
|
|
4153
4169
|
});
|
|
4154
4170
|
};
|
|
4155
4171
|
const handleCancel = () => {
|
|
@@ -4169,7 +4185,7 @@ function WithdrawView({
|
|
|
4169
4185
|
title: "Withdrawal Complete",
|
|
4170
4186
|
message: `Your ${selectedToken.symbol} withdrawal has been processed. Funds should appear in your wallet shortly.`,
|
|
4171
4187
|
explorerUrl,
|
|
4172
|
-
explorerLabel: targetChain ?
|
|
4188
|
+
explorerLabel: targetChain ? chunkFFYLKZ7J_cjs.getExplorerLabel(targetChain.id) : void 0,
|
|
4173
4189
|
onDone: handleDone
|
|
4174
4190
|
}
|
|
4175
4191
|
) });
|
|
@@ -4281,7 +4297,7 @@ function WithdrawModalContent({
|
|
|
4281
4297
|
onBack,
|
|
4282
4298
|
onWithdrawSuccess
|
|
4283
4299
|
}) {
|
|
4284
|
-
const { serviceName, enabledTokens, defaultToken, hostedAuthConfig } =
|
|
4300
|
+
const { serviceName, enabledTokens, defaultToken, hostedAuthConfig } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
4285
4301
|
const { address } = wagmi.useAccount();
|
|
4286
4302
|
const appName = serviceName ?? "Privana";
|
|
4287
4303
|
const [view, setView] = react.useState("form");
|
|
@@ -4407,7 +4423,7 @@ function WithdrawInlineModal({ className, onWithdrawSuccess }) {
|
|
|
4407
4423
|
"div",
|
|
4408
4424
|
{
|
|
4409
4425
|
"data-privana": true,
|
|
4410
|
-
className:
|
|
4426
|
+
className: chunkFFYLKZ7J_cjs.cn(
|
|
4411
4427
|
"bg-card relative flex w-[560px] max-w-full flex-col gap-2 overflow-hidden rounded-2xl p-2 shadow-lg",
|
|
4412
4428
|
className
|
|
4413
4429
|
),
|
|
@@ -4451,14 +4467,14 @@ function SegmentedBalanceBar({
|
|
|
4451
4467
|
showAvailable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4452
4468
|
"div",
|
|
4453
4469
|
{
|
|
4454
|
-
className:
|
|
4470
|
+
className: chunkFFYLKZ7J_cjs.cn(AVAILABLE_COLOR, "rounded-l-full", !showInUse && "rounded-r-full"),
|
|
4455
4471
|
style: { flexGrow: grow(availableWei) }
|
|
4456
4472
|
}
|
|
4457
4473
|
),
|
|
4458
4474
|
showInUse && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4459
4475
|
"div",
|
|
4460
4476
|
{
|
|
4461
|
-
className:
|
|
4477
|
+
className: chunkFFYLKZ7J_cjs.cn(IN_USE_COLOR, "rounded-r-full", !showAvailable && "rounded-l-full"),
|
|
4462
4478
|
style: { flexGrow: grow(inUseWei) }
|
|
4463
4479
|
}
|
|
4464
4480
|
)
|
|
@@ -4466,7 +4482,7 @@ function SegmentedBalanceBar({
|
|
|
4466
4482
|
}
|
|
4467
4483
|
function BalanceLegendItem({ color, label }) {
|
|
4468
4484
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
4469
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
4485
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkFFYLKZ7J_cjs.cn("h-2.5 w-2.5 rounded-full", color) }),
|
|
4470
4486
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground text-sm leading-5", children: label })
|
|
4471
4487
|
] });
|
|
4472
4488
|
}
|
|
@@ -4479,7 +4495,7 @@ function WalletBalanceView({
|
|
|
4479
4495
|
onAddFunds,
|
|
4480
4496
|
onWithdraw
|
|
4481
4497
|
}) {
|
|
4482
|
-
const { serviceName, serviceIcon, defaultToken } =
|
|
4498
|
+
const { serviceName, serviceIcon, defaultToken } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
4483
4499
|
const appName = serviceName ?? "Privana";
|
|
4484
4500
|
const token = defaultToken;
|
|
4485
4501
|
const {
|
|
@@ -4492,14 +4508,14 @@ function WalletBalanceView({
|
|
|
4492
4508
|
const variant = !session ? "idle" : inUseWei === 0n ? "session-zero" : availableWei === 0n ? "fully-in-use" : "mixed";
|
|
4493
4509
|
const expiry = session?.expiry;
|
|
4494
4510
|
useNow(3e4, expiry != null);
|
|
4495
|
-
const countdown = expiry != null ?
|
|
4511
|
+
const countdown = expiry != null ? chunkFFYLKZ7J_cjs.formatTimeRemaining(expiry) : null;
|
|
4496
4512
|
const decimals = token?.decimals ?? 18;
|
|
4497
|
-
const totalFormatted =
|
|
4498
|
-
const availableFormatted =
|
|
4499
|
-
const inUseFormatted =
|
|
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);
|
|
4500
4516
|
const hasValidAmount = !!amount && parseFloat(amount) > 0;
|
|
4501
4517
|
const tooManyDecimals = hasValidAmount && !!token && amount.includes(".") && amount.split(".")[1].length > token.decimals;
|
|
4502
|
-
const exceedsBalance = hasValidAmount && !tooManyDecimals && !!token && !isBalanceLoading && !isBalanceError &&
|
|
4518
|
+
const exceedsBalance = hasValidAmount && !tooManyDecimals && !!token && !isBalanceLoading && !isBalanceError && chunkFFYLKZ7J_cjs.parseTokenAmount(amount, token.decimals) > availableWei;
|
|
4503
4519
|
const canFundSession = hasValidAmount && !!token && !tooManyDecimals && !exceedsBalance && !isBalanceLoading && !isBalanceError;
|
|
4504
4520
|
const handleMax = () => {
|
|
4505
4521
|
const max = availableFormatted.replace(/\s/g, "");
|
|
@@ -4517,7 +4533,7 @@ function WalletBalanceView({
|
|
|
4517
4533
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-sm leading-[14px]", children: "Total" }),
|
|
4518
4534
|
/* @__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" })
|
|
4519
4535
|
] }),
|
|
4520
|
-
isBalanceLoading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
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 })
|
|
4521
4537
|
] }),
|
|
4522
4538
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
4523
4539
|
/* @__PURE__ */ jsxRuntime.jsx(SegmentedBalanceBar, { availableWei, inUseWei }),
|
|
@@ -4668,7 +4684,7 @@ function WalletModalContent({
|
|
|
4668
4684
|
onCloseBlockedChange,
|
|
4669
4685
|
...depositHandlers
|
|
4670
4686
|
}) {
|
|
4671
|
-
const { serviceName, hostedAuthConfig } =
|
|
4687
|
+
const { serviceName, hostedAuthConfig } = chunkFFYLKZ7J_cjs.usePrivanaContext();
|
|
4672
4688
|
const { address } = wagmi.useAccount();
|
|
4673
4689
|
const appName = serviceName ?? "Privana";
|
|
4674
4690
|
const [view, setView] = react.useState("balance");
|
|
@@ -4772,7 +4788,7 @@ function WalletModalContent({
|
|
|
4772
4788
|
onClick: onClose,
|
|
4773
4789
|
disabled: closeBlocked,
|
|
4774
4790
|
"aria-label": "Close",
|
|
4775
|
-
className:
|
|
4791
|
+
className: chunkFFYLKZ7J_cjs.cn(
|
|
4776
4792
|
"absolute top-6 right-5 z-20 flex h-5 w-5 items-center justify-center transition-colors",
|
|
4777
4793
|
closeBlocked ? "text-muted-foreground/40 cursor-not-allowed" : "text-muted-foreground hover:text-foreground cursor-pointer"
|
|
4778
4794
|
),
|
|
@@ -4900,7 +4916,7 @@ function WalletInlineModal({ className, ...handlers }) {
|
|
|
4900
4916
|
"div",
|
|
4901
4917
|
{
|
|
4902
4918
|
"data-privana": true,
|
|
4903
|
-
className:
|
|
4919
|
+
className: chunkFFYLKZ7J_cjs.cn(
|
|
4904
4920
|
"bg-card relative flex w-[560px] max-w-full flex-col gap-2 overflow-hidden rounded-2xl p-2 shadow-lg",
|
|
4905
4921
|
className
|
|
4906
4922
|
),
|
|
@@ -4911,295 +4927,295 @@ function WalletInlineModal({ className, ...handlers }) {
|
|
|
4911
4927
|
|
|
4912
4928
|
Object.defineProperty(exports, "AccountingApiError", {
|
|
4913
4929
|
enumerable: true,
|
|
4914
|
-
get: function () { return
|
|
4930
|
+
get: function () { return chunkFFYLKZ7J_cjs.AccountingApiError; }
|
|
4915
4931
|
});
|
|
4916
4932
|
Object.defineProperty(exports, "Button", {
|
|
4917
4933
|
enumerable: true,
|
|
4918
|
-
get: function () { return
|
|
4934
|
+
get: function () { return chunkFFYLKZ7J_cjs.Button; }
|
|
4919
4935
|
});
|
|
4920
4936
|
Object.defineProperty(exports, "DEFAULT_LOCK_DURATION_SECONDS", {
|
|
4921
4937
|
enumerable: true,
|
|
4922
|
-
get: function () { return
|
|
4938
|
+
get: function () { return chunkFFYLKZ7J_cjs.DEFAULT_LOCK_DURATION_SECONDS; }
|
|
4923
4939
|
});
|
|
4924
4940
|
Object.defineProperty(exports, "DEFAULT_ONRAMP_LOCK_BUFFER", {
|
|
4925
4941
|
enumerable: true,
|
|
4926
|
-
get: function () { return
|
|
4942
|
+
get: function () { return chunkFFYLKZ7J_cjs.DEFAULT_ONRAMP_LOCK_BUFFER; }
|
|
4927
4943
|
});
|
|
4928
4944
|
Object.defineProperty(exports, "HOSTED_AUTH_CLOCK_SKEW_MS", {
|
|
4929
4945
|
enumerable: true,
|
|
4930
|
-
get: function () { return
|
|
4946
|
+
get: function () { return chunkFFYLKZ7J_cjs.HOSTED_AUTH_CLOCK_SKEW_MS; }
|
|
4931
4947
|
});
|
|
4932
4948
|
Object.defineProperty(exports, "HostedAuthError", {
|
|
4933
4949
|
enumerable: true,
|
|
4934
|
-
get: function () { return
|
|
4950
|
+
get: function () { return chunkFFYLKZ7J_cjs.HostedAuthError; }
|
|
4935
4951
|
});
|
|
4936
4952
|
Object.defineProperty(exports, "HostedAuthRequiredError", {
|
|
4937
4953
|
enumerable: true,
|
|
4938
|
-
get: function () { return
|
|
4954
|
+
get: function () { return chunkFFYLKZ7J_cjs.HostedAuthRequiredError; }
|
|
4939
4955
|
});
|
|
4940
4956
|
Object.defineProperty(exports, "HostedAuthStateMismatchError", {
|
|
4941
4957
|
enumerable: true,
|
|
4942
|
-
get: function () { return
|
|
4958
|
+
get: function () { return chunkFFYLKZ7J_cjs.HostedAuthStateMismatchError; }
|
|
4943
4959
|
});
|
|
4944
4960
|
Object.defineProperty(exports, "HttpClient", {
|
|
4945
4961
|
enumerable: true,
|
|
4946
|
-
get: function () { return
|
|
4962
|
+
get: function () { return chunkFFYLKZ7J_cjs.HttpClient; }
|
|
4947
4963
|
});
|
|
4948
4964
|
Object.defineProperty(exports, "LOCK_TYPES", {
|
|
4949
4965
|
enumerable: true,
|
|
4950
|
-
get: function () { return
|
|
4966
|
+
get: function () { return chunkFFYLKZ7J_cjs.LOCK_TYPES; }
|
|
4951
4967
|
});
|
|
4952
4968
|
Object.defineProperty(exports, "MODIFY_LOCK_TYPES", {
|
|
4953
4969
|
enumerable: true,
|
|
4954
|
-
get: function () { return
|
|
4970
|
+
get: function () { return chunkFFYLKZ7J_cjs.MODIFY_LOCK_TYPES; }
|
|
4955
4971
|
});
|
|
4956
4972
|
Object.defineProperty(exports, "NETWORK_CONFIG", {
|
|
4957
4973
|
enumerable: true,
|
|
4958
|
-
get: function () { return
|
|
4974
|
+
get: function () { return chunkFFYLKZ7J_cjs.NETWORK_CONFIG; }
|
|
4959
4975
|
});
|
|
4960
4976
|
Object.defineProperty(exports, "NetworkError", {
|
|
4961
4977
|
enumerable: true,
|
|
4962
|
-
get: function () { return
|
|
4978
|
+
get: function () { return chunkFFYLKZ7J_cjs.NetworkError; }
|
|
4963
4979
|
});
|
|
4964
4980
|
Object.defineProperty(exports, "PostDepositLockError", {
|
|
4965
4981
|
enumerable: true,
|
|
4966
|
-
get: function () { return
|
|
4982
|
+
get: function () { return chunkFFYLKZ7J_cjs.PostDepositLockError; }
|
|
4967
4983
|
});
|
|
4968
4984
|
Object.defineProperty(exports, "PrivanaClient", {
|
|
4969
4985
|
enumerable: true,
|
|
4970
|
-
get: function () { return
|
|
4986
|
+
get: function () { return chunkFFYLKZ7J_cjs.PrivanaClient; }
|
|
4971
4987
|
});
|
|
4972
4988
|
Object.defineProperty(exports, "PrivanaProvider", {
|
|
4973
4989
|
enumerable: true,
|
|
4974
|
-
get: function () { return
|
|
4990
|
+
get: function () { return chunkFFYLKZ7J_cjs.PrivanaProvider; }
|
|
4975
4991
|
});
|
|
4976
4992
|
Object.defineProperty(exports, "SUPPORTED_CHAINS", {
|
|
4977
4993
|
enumerable: true,
|
|
4978
|
-
get: function () { return
|
|
4994
|
+
get: function () { return chunkFFYLKZ7J_cjs.SUPPORTED_CHAINS; }
|
|
4979
4995
|
});
|
|
4980
4996
|
Object.defineProperty(exports, "SiweAuthProvider", {
|
|
4981
4997
|
enumerable: true,
|
|
4982
|
-
get: function () { return
|
|
4998
|
+
get: function () { return chunkFFYLKZ7J_cjs.SiweAuthProvider; }
|
|
4983
4999
|
});
|
|
4984
5000
|
Object.defineProperty(exports, "Skeleton", {
|
|
4985
5001
|
enumerable: true,
|
|
4986
|
-
get: function () { return
|
|
5002
|
+
get: function () { return chunkFFYLKZ7J_cjs.Skeleton; }
|
|
4987
5003
|
});
|
|
4988
5004
|
Object.defineProperty(exports, "TRANSFER_LOCKED_TYPES", {
|
|
4989
5005
|
enumerable: true,
|
|
4990
|
-
get: function () { return
|
|
5006
|
+
get: function () { return chunkFFYLKZ7J_cjs.TRANSFER_LOCKED_TYPES; }
|
|
4991
5007
|
});
|
|
4992
5008
|
Object.defineProperty(exports, "TRANSFER_TYPES", {
|
|
4993
5009
|
enumerable: true,
|
|
4994
|
-
get: function () { return
|
|
5010
|
+
get: function () { return chunkFFYLKZ7J_cjs.TRANSFER_TYPES; }
|
|
4995
5011
|
});
|
|
4996
5012
|
Object.defineProperty(exports, "ValidationError", {
|
|
4997
5013
|
enumerable: true,
|
|
4998
|
-
get: function () { return
|
|
5014
|
+
get: function () { return chunkFFYLKZ7J_cjs.ValidationError; }
|
|
4999
5015
|
});
|
|
5000
5016
|
Object.defineProperty(exports, "WITHDRAW_FROM_LOCK_TYPES", {
|
|
5001
5017
|
enumerable: true,
|
|
5002
|
-
get: function () { return
|
|
5018
|
+
get: function () { return chunkFFYLKZ7J_cjs.WITHDRAW_FROM_LOCK_TYPES; }
|
|
5003
5019
|
});
|
|
5004
5020
|
Object.defineProperty(exports, "WITHDRAW_TYPES", {
|
|
5005
5021
|
enumerable: true,
|
|
5006
|
-
get: function () { return
|
|
5022
|
+
get: function () { return chunkFFYLKZ7J_cjs.WITHDRAW_TYPES; }
|
|
5007
5023
|
});
|
|
5008
5024
|
Object.defineProperty(exports, "applyLockBuffer", {
|
|
5009
5025
|
enumerable: true,
|
|
5010
|
-
get: function () { return
|
|
5026
|
+
get: function () { return chunkFFYLKZ7J_cjs.applyLockBuffer; }
|
|
5011
5027
|
});
|
|
5012
5028
|
Object.defineProperty(exports, "applyRefreshResponse", {
|
|
5013
5029
|
enumerable: true,
|
|
5014
|
-
get: function () { return
|
|
5030
|
+
get: function () { return chunkFFYLKZ7J_cjs.applyRefreshResponse; }
|
|
5015
5031
|
});
|
|
5016
5032
|
Object.defineProperty(exports, "buildHostedAuthSession", {
|
|
5017
5033
|
enumerable: true,
|
|
5018
|
-
get: function () { return
|
|
5034
|
+
get: function () { return chunkFFYLKZ7J_cjs.buildHostedAuthSession; }
|
|
5019
5035
|
});
|
|
5020
5036
|
Object.defineProperty(exports, "buildSiweStatement", {
|
|
5021
5037
|
enumerable: true,
|
|
5022
|
-
get: function () { return
|
|
5038
|
+
get: function () { return chunkFFYLKZ7J_cjs.buildSiweStatement; }
|
|
5023
5039
|
});
|
|
5024
5040
|
Object.defineProperty(exports, "buttonVariants", {
|
|
5025
5041
|
enumerable: true,
|
|
5026
|
-
get: function () { return
|
|
5042
|
+
get: function () { return chunkFFYLKZ7J_cjs.buttonVariants; }
|
|
5027
5043
|
});
|
|
5028
5044
|
Object.defineProperty(exports, "clampLockAmount", {
|
|
5029
5045
|
enumerable: true,
|
|
5030
|
-
get: function () { return
|
|
5046
|
+
get: function () { return chunkFFYLKZ7J_cjs.clampLockAmount; }
|
|
5031
5047
|
});
|
|
5032
5048
|
Object.defineProperty(exports, "clearHostedAuthPendingTransaction", {
|
|
5033
5049
|
enumerable: true,
|
|
5034
|
-
get: function () { return
|
|
5050
|
+
get: function () { return chunkFFYLKZ7J_cjs.clearHostedAuthPendingTransaction; }
|
|
5035
5051
|
});
|
|
5036
5052
|
Object.defineProperty(exports, "clearPendingLock", {
|
|
5037
5053
|
enumerable: true,
|
|
5038
|
-
get: function () { return
|
|
5054
|
+
get: function () { return chunkFFYLKZ7J_cjs.clearPendingLock; }
|
|
5039
5055
|
});
|
|
5040
5056
|
Object.defineProperty(exports, "createDomain", {
|
|
5041
5057
|
enumerable: true,
|
|
5042
|
-
get: function () { return
|
|
5058
|
+
get: function () { return chunkFFYLKZ7J_cjs.createDomain; }
|
|
5043
5059
|
});
|
|
5044
5060
|
Object.defineProperty(exports, "createHostedAuthPendingStorageKey", {
|
|
5045
5061
|
enumerable: true,
|
|
5046
|
-
get: function () { return
|
|
5062
|
+
get: function () { return chunkFFYLKZ7J_cjs.createHostedAuthPendingStorageKey; }
|
|
5047
5063
|
});
|
|
5048
5064
|
Object.defineProperty(exports, "createHostedAuthState", {
|
|
5049
5065
|
enumerable: true,
|
|
5050
|
-
get: function () { return
|
|
5066
|
+
get: function () { return chunkFFYLKZ7J_cjs.createHostedAuthState; }
|
|
5051
5067
|
});
|
|
5052
5068
|
Object.defineProperty(exports, "createHostedAuthStorageKey", {
|
|
5053
5069
|
enumerable: true,
|
|
5054
|
-
get: function () { return
|
|
5070
|
+
get: function () { return chunkFFYLKZ7J_cjs.createHostedAuthStorageKey; }
|
|
5055
5071
|
});
|
|
5056
5072
|
Object.defineProperty(exports, "createLockExpiry", {
|
|
5057
5073
|
enumerable: true,
|
|
5058
|
-
get: function () { return
|
|
5074
|
+
get: function () { return chunkFFYLKZ7J_cjs.createLockExpiry; }
|
|
5059
5075
|
});
|
|
5060
5076
|
Object.defineProperty(exports, "createPkceChallenge", {
|
|
5061
5077
|
enumerable: true,
|
|
5062
|
-
get: function () { return
|
|
5078
|
+
get: function () { return chunkFFYLKZ7J_cjs.createPkceChallenge; }
|
|
5063
5079
|
});
|
|
5064
5080
|
Object.defineProperty(exports, "createPkceVerifier", {
|
|
5065
5081
|
enumerable: true,
|
|
5066
|
-
get: function () { return
|
|
5082
|
+
get: function () { return chunkFFYLKZ7J_cjs.createPkceVerifier; }
|
|
5067
5083
|
});
|
|
5068
5084
|
Object.defineProperty(exports, "createSignedLockRequest", {
|
|
5069
5085
|
enumerable: true,
|
|
5070
|
-
get: function () { return
|
|
5086
|
+
get: function () { return chunkFFYLKZ7J_cjs.createSignedLockRequest; }
|
|
5071
5087
|
});
|
|
5072
5088
|
Object.defineProperty(exports, "getAccountingContract", {
|
|
5073
5089
|
enumerable: true,
|
|
5074
|
-
get: function () { return
|
|
5090
|
+
get: function () { return chunkFFYLKZ7J_cjs.getAccountingContract; }
|
|
5075
5091
|
});
|
|
5076
5092
|
Object.defineProperty(exports, "getApiUrl", {
|
|
5077
5093
|
enumerable: true,
|
|
5078
|
-
get: function () { return
|
|
5094
|
+
get: function () { return chunkFFYLKZ7J_cjs.getApiUrl; }
|
|
5079
5095
|
});
|
|
5080
5096
|
Object.defineProperty(exports, "getChainById", {
|
|
5081
5097
|
enumerable: true,
|
|
5082
|
-
get: function () { return
|
|
5098
|
+
get: function () { return chunkFFYLKZ7J_cjs.getChainById; }
|
|
5083
5099
|
});
|
|
5084
5100
|
Object.defineProperty(exports, "getChainId", {
|
|
5085
5101
|
enumerable: true,
|
|
5086
|
-
get: function () { return
|
|
5102
|
+
get: function () { return chunkFFYLKZ7J_cjs.getChainId; }
|
|
5087
5103
|
});
|
|
5088
5104
|
Object.defineProperty(exports, "getExplorerAddressUrl", {
|
|
5089
5105
|
enumerable: true,
|
|
5090
|
-
get: function () { return
|
|
5106
|
+
get: function () { return chunkFFYLKZ7J_cjs.getExplorerAddressUrl; }
|
|
5091
5107
|
});
|
|
5092
5108
|
Object.defineProperty(exports, "getExplorerLabel", {
|
|
5093
5109
|
enumerable: true,
|
|
5094
|
-
get: function () { return
|
|
5110
|
+
get: function () { return chunkFFYLKZ7J_cjs.getExplorerLabel; }
|
|
5095
5111
|
});
|
|
5096
5112
|
Object.defineProperty(exports, "isHostedAuthRefreshActive", {
|
|
5097
5113
|
enumerable: true,
|
|
5098
|
-
get: function () { return
|
|
5114
|
+
get: function () { return chunkFFYLKZ7J_cjs.isHostedAuthRefreshActive; }
|
|
5099
5115
|
});
|
|
5100
5116
|
Object.defineProperty(exports, "isHostedAuthSessionActive", {
|
|
5101
5117
|
enumerable: true,
|
|
5102
|
-
get: function () { return
|
|
5118
|
+
get: function () { return chunkFFYLKZ7J_cjs.isHostedAuthSessionActive; }
|
|
5103
5119
|
});
|
|
5104
5120
|
Object.defineProperty(exports, "isSignedLockUsable", {
|
|
5105
5121
|
enumerable: true,
|
|
5106
|
-
get: function () { return
|
|
5122
|
+
get: function () { return chunkFFYLKZ7J_cjs.isSignedLockUsable; }
|
|
5107
5123
|
});
|
|
5108
5124
|
Object.defineProperty(exports, "loadPendingLock", {
|
|
5109
5125
|
enumerable: true,
|
|
5110
|
-
get: function () { return
|
|
5126
|
+
get: function () { return chunkFFYLKZ7J_cjs.loadPendingLock; }
|
|
5111
5127
|
});
|
|
5112
5128
|
Object.defineProperty(exports, "normalizeAddress", {
|
|
5113
5129
|
enumerable: true,
|
|
5114
|
-
get: function () { return
|
|
5130
|
+
get: function () { return chunkFFYLKZ7J_cjs.normalizeAddress; }
|
|
5115
5131
|
});
|
|
5116
5132
|
Object.defineProperty(exports, "normalizeHex", {
|
|
5117
5133
|
enumerable: true,
|
|
5118
|
-
get: function () { return
|
|
5134
|
+
get: function () { return chunkFFYLKZ7J_cjs.normalizeHex; }
|
|
5119
5135
|
});
|
|
5120
5136
|
Object.defineProperty(exports, "parseHostedAuthCallback", {
|
|
5121
5137
|
enumerable: true,
|
|
5122
|
-
get: function () { return
|
|
5138
|
+
get: function () { return chunkFFYLKZ7J_cjs.parseHostedAuthCallback; }
|
|
5123
5139
|
});
|
|
5124
5140
|
Object.defineProperty(exports, "persistHostedAuthPendingTransaction", {
|
|
5125
5141
|
enumerable: true,
|
|
5126
|
-
get: function () { return
|
|
5142
|
+
get: function () { return chunkFFYLKZ7J_cjs.persistHostedAuthPendingTransaction; }
|
|
5127
5143
|
});
|
|
5128
5144
|
Object.defineProperty(exports, "readHostedAuthPendingTransaction", {
|
|
5129
5145
|
enumerable: true,
|
|
5130
|
-
get: function () { return
|
|
5146
|
+
get: function () { return chunkFFYLKZ7J_cjs.readHostedAuthPendingTransaction; }
|
|
5131
5147
|
});
|
|
5132
5148
|
Object.defineProperty(exports, "readStoredHostedAuthSession", {
|
|
5133
5149
|
enumerable: true,
|
|
5134
|
-
get: function () { return
|
|
5150
|
+
get: function () { return chunkFFYLKZ7J_cjs.readStoredHostedAuthSession; }
|
|
5135
5151
|
});
|
|
5136
5152
|
Object.defineProperty(exports, "requireDepositLockOwner", {
|
|
5137
5153
|
enumerable: true,
|
|
5138
|
-
get: function () { return
|
|
5154
|
+
get: function () { return chunkFFYLKZ7J_cjs.requireDepositLockOwner; }
|
|
5139
5155
|
});
|
|
5140
5156
|
Object.defineProperty(exports, "requireServiceAddress", {
|
|
5141
5157
|
enumerable: true,
|
|
5142
|
-
get: function () { return
|
|
5158
|
+
get: function () { return chunkFFYLKZ7J_cjs.requireServiceAddress; }
|
|
5143
5159
|
});
|
|
5144
5160
|
Object.defineProperty(exports, "savePendingLock", {
|
|
5145
5161
|
enumerable: true,
|
|
5146
|
-
get: function () { return
|
|
5162
|
+
get: function () { return chunkFFYLKZ7J_cjs.savePendingLock; }
|
|
5147
5163
|
});
|
|
5148
5164
|
Object.defineProperty(exports, "signLockMessage", {
|
|
5149
5165
|
enumerable: true,
|
|
5150
|
-
get: function () { return
|
|
5166
|
+
get: function () { return chunkFFYLKZ7J_cjs.signLockMessage; }
|
|
5151
5167
|
});
|
|
5152
5168
|
Object.defineProperty(exports, "signModifyLockMessage", {
|
|
5153
5169
|
enumerable: true,
|
|
5154
|
-
get: function () { return
|
|
5170
|
+
get: function () { return chunkFFYLKZ7J_cjs.signModifyLockMessage; }
|
|
5155
5171
|
});
|
|
5156
5172
|
Object.defineProperty(exports, "signTransferLockedMessage", {
|
|
5157
5173
|
enumerable: true,
|
|
5158
|
-
get: function () { return
|
|
5174
|
+
get: function () { return chunkFFYLKZ7J_cjs.signTransferLockedMessage; }
|
|
5159
5175
|
});
|
|
5160
5176
|
Object.defineProperty(exports, "signTransferMessage", {
|
|
5161
5177
|
enumerable: true,
|
|
5162
|
-
get: function () { return
|
|
5178
|
+
get: function () { return chunkFFYLKZ7J_cjs.signTransferMessage; }
|
|
5163
5179
|
});
|
|
5164
5180
|
Object.defineProperty(exports, "signWithdrawFromLockMessage", {
|
|
5165
5181
|
enumerable: true,
|
|
5166
|
-
get: function () { return
|
|
5182
|
+
get: function () { return chunkFFYLKZ7J_cjs.signWithdrawFromLockMessage; }
|
|
5167
5183
|
});
|
|
5168
5184
|
Object.defineProperty(exports, "signWithdrawMessage", {
|
|
5169
5185
|
enumerable: true,
|
|
5170
|
-
get: function () { return
|
|
5186
|
+
get: function () { return chunkFFYLKZ7J_cjs.signWithdrawMessage; }
|
|
5171
5187
|
});
|
|
5172
5188
|
Object.defineProperty(exports, "stripHostedAuthCallbackParams", {
|
|
5173
5189
|
enumerable: true,
|
|
5174
|
-
get: function () { return
|
|
5190
|
+
get: function () { return chunkFFYLKZ7J_cjs.stripHostedAuthCallbackParams; }
|
|
5175
5191
|
});
|
|
5176
5192
|
Object.defineProperty(exports, "submitPendingLock", {
|
|
5177
5193
|
enumerable: true,
|
|
5178
|
-
get: function () { return
|
|
5194
|
+
get: function () { return chunkFFYLKZ7J_cjs.submitPendingLock; }
|
|
5179
5195
|
});
|
|
5180
5196
|
Object.defineProperty(exports, "syncHostedAuthSessionToClient", {
|
|
5181
5197
|
enumerable: true,
|
|
5182
|
-
get: function () { return
|
|
5198
|
+
get: function () { return chunkFFYLKZ7J_cjs.syncHostedAuthSessionToClient; }
|
|
5183
5199
|
});
|
|
5184
5200
|
Object.defineProperty(exports, "useDepositVerification", {
|
|
5185
5201
|
enumerable: true,
|
|
5186
|
-
get: function () { return
|
|
5202
|
+
get: function () { return chunkFFYLKZ7J_cjs.useDepositVerification; }
|
|
5187
5203
|
});
|
|
5188
5204
|
Object.defineProperty(exports, "usePrivanaContext", {
|
|
5189
5205
|
enumerable: true,
|
|
5190
|
-
get: function () { return
|
|
5206
|
+
get: function () { return chunkFFYLKZ7J_cjs.usePrivanaContext; }
|
|
5191
5207
|
});
|
|
5192
5208
|
Object.defineProperty(exports, "useSafeAccount", {
|
|
5193
5209
|
enumerable: true,
|
|
5194
|
-
get: function () { return
|
|
5210
|
+
get: function () { return chunkFFYLKZ7J_cjs.useSafeAccount; }
|
|
5195
5211
|
});
|
|
5196
5212
|
Object.defineProperty(exports, "useSafePrivanaContext", {
|
|
5197
5213
|
enumerable: true,
|
|
5198
|
-
get: function () { return
|
|
5214
|
+
get: function () { return chunkFFYLKZ7J_cjs.useSafePrivanaContext; }
|
|
5199
5215
|
});
|
|
5200
5216
|
Object.defineProperty(exports, "useSiweAuth", {
|
|
5201
5217
|
enumerable: true,
|
|
5202
|
-
get: function () { return
|
|
5218
|
+
get: function () { return chunkFFYLKZ7J_cjs.useSiweAuth; }
|
|
5203
5219
|
});
|
|
5204
5220
|
exports.DepositInlineModal = DepositInlineModal;
|
|
5205
5221
|
exports.DepositModal = DepositModal;
|