@oasisprotocol/privana-sdk 0.5.5 → 0.5.6
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-DLGIPF4N.js} +4 -4
- package/dist/chunk-DLGIPF4N.js.map +1 -0
- package/dist/{chunk-7VNAGKRC.cjs → chunk-TNR7AA52.cjs} +4 -4
- package/dist/chunk-TNR7AA52.cjs.map +1 -0
- package/dist/index.cjs +253 -246
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -4
- package/dist/index.d.ts +2 -4
- package/dist/index.js +12 -5
- 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 chunkTNR7AA52_cjs = require('./chunk-TNR7AA52.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 } = chunkTNR7AA52_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 chunkTNR7AA52_cjs.AccountingApiError && error.detail) {
|
|
44
|
+
return new chunkTNR7AA52_cjs.HostedAuthError(error.detail);
|
|
45
45
|
}
|
|
46
46
|
if (error instanceof Error) {
|
|
47
47
|
return error;
|
|
48
48
|
}
|
|
49
|
-
return new
|
|
49
|
+
return new chunkTNR7AA52_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
|
+
} = chunkTNR7AA52_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 ? chunkTNR7AA52_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
|
+
chunkTNR7AA52_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 chunkTNR7AA52_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 chunkTNR7AA52_cjs.HostedAuthError("Hosted redirect authentication requires a browser environment.");
|
|
81
81
|
}
|
|
82
82
|
if (!pendingStorageKey) {
|
|
83
|
-
throw new
|
|
83
|
+
throw new chunkTNR7AA52_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 = chunkTNR7AA52_cjs.createPkceVerifier();
|
|
93
|
+
const codeChallenge = await chunkTNR7AA52_cjs.createPkceChallenge(verifier);
|
|
94
|
+
const state = chunkTNR7AA52_cjs.createHostedAuthState();
|
|
95
|
+
chunkTNR7AA52_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 chunkTNR7AA52_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 chunkTNR7AA52_cjs.HostedAuthError("Hosted redirect authentication requires a browser environment.");
|
|
130
130
|
}
|
|
131
131
|
if (!pendingStorageKey) {
|
|
132
|
-
throw new
|
|
132
|
+
throw new chunkTNR7AA52_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, "", chunkTNR7AA52_cjs.stripHostedAuthCallbackParams(callbackUrl));
|
|
143
143
|
};
|
|
144
144
|
try {
|
|
145
|
-
const callback =
|
|
145
|
+
const callback = chunkTNR7AA52_cjs.parseHostedAuthCallback(callbackUrl, hostedAuthConfig.redirectUri);
|
|
146
146
|
if (!callback) {
|
|
147
147
|
return null;
|
|
148
148
|
}
|
|
149
|
-
const pending =
|
|
149
|
+
const pending = chunkTNR7AA52_cjs.readHostedAuthPendingTransaction(window.sessionStorage, pendingStorageKey);
|
|
150
150
|
if (!pending) {
|
|
151
151
|
clearPendingLogin();
|
|
152
152
|
cleanupCallbackUrl();
|
|
153
|
-
throw new
|
|
153
|
+
throw new chunkTNR7AA52_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 chunkTNR7AA52_cjs.HostedAuthStateMismatchError();
|
|
161
161
|
}
|
|
162
162
|
if ("error" in callback) {
|
|
163
163
|
clearPendingLogin();
|
|
164
164
|
cleanupCallbackUrl();
|
|
165
|
-
throw new
|
|
165
|
+
throw new chunkTNR7AA52_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 = chunkTNR7AA52_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 chunkTNR7AA52_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 = chunkTNR7AA52_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 } = chunkTNR7AA52_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: chunkTNR7AA52_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 } = chunkTNR7AA52_cjs.usePrivanaContext();
|
|
278
|
+
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkTNR7AA52_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 = chunkTNR7AA52_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 = chunkTNR7AA52_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 && chunkTNR7AA52_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 = chunkTNR7AA52_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
|
+
chunkTNR7AA52_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 } = chunkTNR7AA52_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 } = chunkTNR7AA52_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 chunkTNR7AA52_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 chunkTNR7AA52_cjs.PostDepositLockError ? err : new chunkTNR7AA52_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
|
+
} = chunkTNR7AA52_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 } = chunkTNR7AA52_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 chunkTNR7AA52_cjs.getTransactionReceipt(config, {
|
|
508
515
|
hash,
|
|
509
516
|
chainId: persisted.chainId
|
|
510
517
|
});
|
|
511
|
-
const blockNumber = await
|
|
518
|
+
const blockNumber = await chunkTNR7AA52_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 chunkTNR7AA52_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 && !chunkTNR7AA52_cjs.canUseBrowserStorage()) {
|
|
568
576
|
throw new Error("Browser storage is required for locked deposit recovery");
|
|
569
577
|
}
|
|
570
|
-
const lockAmount =
|
|
578
|
+
const lockAmount = chunkTNR7AA52_cjs.clampLockAmount(params.amount, params.postDepositLock?.maxAmount);
|
|
571
579
|
let signedLock;
|
|
572
580
|
if (params.postDepositLock) {
|
|
573
|
-
const lockOwner =
|
|
581
|
+
const lockOwner = chunkTNR7AA52_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 chunkTNR7AA52_cjs.getWalletClient(config, {
|
|
582
590
|
chainId: networkConfig.chainId
|
|
583
591
|
});
|
|
584
|
-
signedLock = await
|
|
592
|
+
signedLock = await chunkTNR7AA52_cjs.createSignedLockRequest({
|
|
585
593
|
client,
|
|
586
594
|
walletClient: signingWalletClient,
|
|
587
595
|
userAddress: lockOwner,
|
|
588
596
|
networkConfig,
|
|
589
|
-
serviceAddress:
|
|
597
|
+
serviceAddress: chunkTNR7AA52_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 chunkTNR7AA52_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 = chunkTNR7AA52_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 } = chunkTNR7AA52_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 } = chunkTNR7AA52_cjs.usePrivanaContext();
|
|
748
755
|
const queryClient = reactQuery.useQueryClient();
|
|
749
|
-
const { chainId, ensureCorrectChain } =
|
|
756
|
+
const { chainId, ensureCorrectChain } = chunkTNR7AA52_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 chunkTNR7AA52_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 } = chunkTNR7AA52_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 chunkTNR7AA52_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 } = chunkTNR7AA52_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 } = chunkTNR7AA52_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 chunkTNR7AA52_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 chunkTNR7AA52_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 } = chunkTNR7AA52_cjs.usePrivanaContext();
|
|
1188
|
+
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkTNR7AA52_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 } = chunkTNR7AA52_cjs.usePrivanaContext();
|
|
1211
|
+
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkTNR7AA52_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 } = chunkTNR7AA52_cjs.usePrivanaContext();
|
|
1233
|
+
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkTNR7AA52_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 chunkTNR7AA52_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 = chunkTNR7AA52_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 } = chunkTNR7AA52_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 } = chunkTNR7AA52_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 } = chunkTNR7AA52_cjs.usePrivanaContext();
|
|
1345
|
+
const { executePrivateRead, privateReadAddress, privateReadQueryScope, privateReadReady } = chunkTNR7AA52_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 } = chunkTNR7AA52_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 } = chunkTNR7AA52_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 } = chunkTNR7AA52_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 chunkTNR7AA52_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: chunkTNR7AA52_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: chunkTNR7AA52_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: chunkTNR7AA52_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: chunkTNR7AA52_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 = chunkTNR7AA52_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 chunkTNR7AA52_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 (!chunkTNR7AA52_cjs.setSharedBrowserStorageItem(activeSessionKey(session.owner), nextId)) {
|
|
1626
|
+
chunkTNR7AA52_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
|
+
chunkTNR7AA52_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 = chunkTNR7AA52_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
|
+
chunkTNR7AA52_cjs.removeSharedBrowserStorageItem(key);
|
|
1643
|
+
chunkTNR7AA52_cjs.removeSharedBrowserStorageItem(activeSessionKey(owner));
|
|
1637
1644
|
return void 0;
|
|
1638
1645
|
}
|
|
1639
1646
|
return parsed;
|
|
1640
1647
|
} catch {
|
|
1641
|
-
|
|
1642
|
-
|
|
1648
|
+
chunkTNR7AA52_cjs.removeSharedBrowserStorageItem(key);
|
|
1649
|
+
chunkTNR7AA52_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
|
+
chunkTNR7AA52_cjs.removeSharedBrowserStorageItem(sessionKey(owner, id));
|
|
1681
|
+
chunkTNR7AA52_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 chunkTNR7AA52_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 chunkTNR7AA52_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 chunkTNR7AA52_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 chunkTNR7AA52_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 chunkTNR7AA52_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 chunkTNR7AA52_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 chunkTNR7AA52_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 chunkTNR7AA52_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 chunkTNR7AA52_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 chunkTNR7AA52_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 } = chunkTNR7AA52_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 } = chunkTNR7AA52_cjs.usePrivateReadRequest();
|
|
1847
|
+
const { ensureCorrectChain } = chunkTNR7AA52_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 chunkTNR7AA52_cjs.PostDepositLockError ? err : new chunkTNR7AA52_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 chunkTNR7AA52_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 (!chunkTNR7AA52_cjs.canUseSharedBrowserStorage()) {
|
|
2020
2027
|
throw new Error("Browser storage is required for locked deposit recovery");
|
|
2021
2028
|
}
|
|
2022
|
-
const owner =
|
|
2029
|
+
const owner = chunkTNR7AA52_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 = chunkTNR7AA52_cjs.requireServiceAddress(serviceAddress);
|
|
2039
|
+
const lockDuration = allowance.lockDuration ?? chunkTNR7AA52_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 chunkTNR7AA52_cjs.getWalletClient(config, {
|
|
2038
2045
|
chainId: networkConfig.chainId
|
|
2039
2046
|
});
|
|
2040
|
-
const payload = await
|
|
2047
|
+
const payload = await chunkTNR7AA52_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: chunkTNR7AA52_cjs.clampLockAmount(amount, BigInt(allowance.value)),
|
|
2048
2055
|
lockDuration
|
|
2049
2056
|
});
|
|
2050
|
-
const startBlock = await
|
|
2057
|
+
const startBlock = await chunkTNR7AA52_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 chunkTNR7AA52_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 = chunkTNR7AA52_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 = chunkTNR7AA52_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 chunkTNR7AA52_cjs.getWalletClient(config, {
|
|
2197
2204
|
chainId: networkConfig.chainId
|
|
2198
2205
|
});
|
|
2199
|
-
const payload = await
|
|
2206
|
+
const payload = await chunkTNR7AA52_cjs.createSignedLockRequest({
|
|
2200
2207
|
client,
|
|
2201
2208
|
walletClient: signingWalletClient,
|
|
2202
2209
|
userAddress: owner,
|
|
@@ -2413,7 +2420,7 @@ function getChainIcon(chainId, size) {
|
|
|
2413
2420
|
}
|
|
2414
2421
|
}
|
|
2415
2422
|
function TokenSelectorView({ selectedTokenId, onSelect }) {
|
|
2416
|
-
const { enabledTokens } =
|
|
2423
|
+
const { enabledTokens } = chunkTNR7AA52_cjs.usePrivanaContext();
|
|
2417
2424
|
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
2425
|
enabledTokens.map((token) => {
|
|
2419
2426
|
const isSelected = selectedTokenId === token.id;
|
|
@@ -2422,7 +2429,7 @@ function TokenSelectorView({ selectedTokenId, onSelect }) {
|
|
|
2422
2429
|
{
|
|
2423
2430
|
type: "button",
|
|
2424
2431
|
onClick: () => onSelect(token.id),
|
|
2425
|
-
className:
|
|
2432
|
+
className: chunkTNR7AA52_cjs.cn(
|
|
2426
2433
|
"hover:bg-secondary flex w-full cursor-pointer items-center gap-3 rounded-lg px-3 py-2 text-left transition-colors",
|
|
2427
2434
|
isSelected && "bg-secondary"
|
|
2428
2435
|
),
|
|
@@ -2477,7 +2484,7 @@ function CreditCardWidgetView({
|
|
|
2477
2484
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, className: "bg-muted flex flex-col gap-6 rounded-[10px] p-5", children: [
|
|
2478
2485
|
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-foreground text-[28px] leading-8 font-medium", children: "Complete your purchase" }),
|
|
2479
2486
|
token && moonpayCurrencyCode ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2480
|
-
|
|
2487
|
+
chunkTNR7AA52_cjs.FiatOnRampForm,
|
|
2481
2488
|
{
|
|
2482
2489
|
tokenId: token.id,
|
|
2483
2490
|
currencyCode: moonpayCurrencyCode,
|
|
@@ -2766,7 +2773,7 @@ function ChevronDownIcon({
|
|
|
2766
2773
|
height: "16",
|
|
2767
2774
|
viewBox: "0 0 16 16",
|
|
2768
2775
|
fill: "none",
|
|
2769
|
-
className:
|
|
2776
|
+
className: chunkTNR7AA52_cjs.cn(
|
|
2770
2777
|
"transition-transform",
|
|
2771
2778
|
direction === "right" && "-rotate-90",
|
|
2772
2779
|
direction === "up" && "rotate-180",
|
|
@@ -2919,7 +2926,7 @@ function PolicyTermRow({
|
|
|
2919
2926
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2920
2927
|
"div",
|
|
2921
2928
|
{
|
|
2922
|
-
className:
|
|
2929
|
+
className: chunkTNR7AA52_cjs.cn(
|
|
2923
2930
|
"mt-0.5 shrink-0",
|
|
2924
2931
|
kind === "permission" ? "text-emerald-500" : "text-orange-500"
|
|
2925
2932
|
),
|
|
@@ -2992,7 +2999,7 @@ function DepositView({
|
|
|
2992
2999
|
onSubmit,
|
|
2993
3000
|
isSubmitting = false
|
|
2994
3001
|
}) {
|
|
2995
|
-
const { getChainById: getChainById2, chains, serviceName, serviceIcon, networkConfig, hostedAuthConfig } =
|
|
3002
|
+
const { getChainById: getChainById2, chains, serviceName, serviceIcon, networkConfig, hostedAuthConfig } = chunkTNR7AA52_cjs.usePrivanaContext();
|
|
2996
3003
|
const { address, isConnected } = wagmi.useAccount();
|
|
2997
3004
|
const appName = serviceName ?? "Privana";
|
|
2998
3005
|
const chain = selectedToken ? getChainById2(selectedToken.chainId) : void 0;
|
|
@@ -3016,7 +3023,7 @@ function DepositView({
|
|
|
3016
3023
|
query: { enabled: isConnectedSource && !!address && !!selectedToken && !isNative }
|
|
3017
3024
|
});
|
|
3018
3025
|
const walletBalance = isNative ? nativeBalanceData?.value : erc20Balance;
|
|
3019
|
-
const formattedWalletBalance = walletBalance != null && selectedToken ?
|
|
3026
|
+
const formattedWalletBalance = walletBalance != null && selectedToken ? chunkTNR7AA52_cjs.formatTokenAmount(walletBalance.toString(), selectedToken.decimals) : "0.00";
|
|
3020
3027
|
const {
|
|
3021
3028
|
minBuyAmount: moonpayMinBuy,
|
|
3022
3029
|
isLoading: moonpayLimitsLoading,
|
|
@@ -3029,7 +3036,7 @@ function DepositView({
|
|
|
3029
3036
|
const hasValidAmount = !!amount && parseFloat(amount) > 0;
|
|
3030
3037
|
const maxAmountDecimals = isCreditCard ? 2 : selectedToken?.decimals;
|
|
3031
3038
|
const tooManyDecimals = hasValidAmount && maxAmountDecimals != null && amount.includes(".") && amount.split(".")[1].length > maxAmountDecimals;
|
|
3032
|
-
const exceedsBalance = isConnectedSource && hasValidAmount && !tooManyDecimals && !!selectedToken && walletBalance != null &&
|
|
3039
|
+
const exceedsBalance = isConnectedSource && hasValidAmount && !tooManyDecimals && !!selectedToken && walletBalance != null && chunkTNR7AA52_cjs.parseTokenAmount(amount, selectedToken.decimals) > walletBalance;
|
|
3033
3040
|
const belowMoonpayMin = isCreditCard && hasValidAmount && moonpayMinBuy != null && parseFloat(amount) < moonpayMinBuy;
|
|
3034
3041
|
const moonpayLimitsUnready = isCreditCard && !!selectedToken?.moonpayCurrencyCode && moonpayMinBuy == null;
|
|
3035
3042
|
const creditCardUnavailable = isCreditCard && !!selectedToken && !selectedToken.moonpayCurrencyCode;
|
|
@@ -3037,7 +3044,7 @@ function DepositView({
|
|
|
3037
3044
|
const externalMinimumRequired = isExternal && !!allowance && !!selectedToken;
|
|
3038
3045
|
const externalMinimumLoading = externalMinimumRequired && externalMinimum === void 0;
|
|
3039
3046
|
const externalMinimumUnavailable = externalMinimumRequired && externalMinimum === null;
|
|
3040
|
-
const belowExternalMinimum = externalMinimumRequired && hasValidAmount && !tooManyDecimals && !!selectedToken && typeof externalMinimum === "bigint" &&
|
|
3047
|
+
const belowExternalMinimum = externalMinimumRequired && hasValidAmount && !tooManyDecimals && !!selectedToken && typeof externalMinimum === "bigint" && chunkTNR7AA52_cjs.parseTokenAmount(amount, selectedToken.decimals) < externalMinimum;
|
|
3041
3048
|
const externalNeedsWallet = isExternal && (!!allowance || !hostedAuthConfig);
|
|
3042
3049
|
const needsConnect = (isConnectedSource || externalNeedsWallet) && !isConnected;
|
|
3043
3050
|
const canDeposit = hasValidAmount && !!selectedToken && !tooManyDecimals && !exceedsBalance && !belowMoonpayMin && !moonpayLimitsUnready && !creditCardUnavailable && !externalTokenUnavailable && !externalMinimumLoading && !externalMinimumUnavailable && !belowExternalMinimum && !needsConnect;
|
|
@@ -3094,7 +3101,7 @@ function DepositView({
|
|
|
3094
3101
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3095
3102
|
"div",
|
|
3096
3103
|
{
|
|
3097
|
-
className:
|
|
3104
|
+
className: chunkTNR7AA52_cjs.cn(
|
|
3098
3105
|
"border-border bg-input flex items-center gap-2 rounded-[10px] border",
|
|
3099
3106
|
isConnectedSource ? "py-1 pr-1 pl-3" : "px-3 py-3"
|
|
3100
3107
|
),
|
|
@@ -3234,7 +3241,7 @@ function ExternalDepositView({
|
|
|
3234
3241
|
onDiscardLock,
|
|
3235
3242
|
lock
|
|
3236
3243
|
}) {
|
|
3237
|
-
const { getChainById: getChainById2, getTokenById, serviceName } =
|
|
3244
|
+
const { getChainById: getChainById2, getTokenById, serviceName } = chunkTNR7AA52_cjs.usePrivanaContext();
|
|
3238
3245
|
const appName = serviceName ?? "Privana";
|
|
3239
3246
|
const { depositAddress, isReady, isLoading } = depositAddressState;
|
|
3240
3247
|
const chain = token ? getChainById2(token.chainId) : void 0;
|
|
@@ -3250,7 +3257,7 @@ function ExternalDepositView({
|
|
|
3250
3257
|
const [nothingFound, setNothingFound] = react.useState(false);
|
|
3251
3258
|
const [credited, setCredited] = react.useState(null);
|
|
3252
3259
|
const [showCancelWarning, setShowCancelWarning] = react.useState(false);
|
|
3253
|
-
const verification =
|
|
3260
|
+
const verification = chunkTNR7AA52_cjs.useDepositVerification({
|
|
3254
3261
|
onCredited: (txHash, _response, creditedAmount) => {
|
|
3255
3262
|
if (settleAfterCredit) {
|
|
3256
3263
|
void settleAfterCredit(txHash, creditedAmount);
|
|
@@ -3374,11 +3381,11 @@ function ExternalDepositView({
|
|
|
3374
3381
|
] }),
|
|
3375
3382
|
showDepositInstructions && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3376
3383
|
!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(
|
|
3384
|
+
/* @__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(chunkTNR7AA52_cjs.Skeleton, { className: "h-full w-full rounded-[10px]" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-sm", children: "Deposit address unavailable" }) }),
|
|
3378
3385
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
3379
3386
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: "Deposit Address" }),
|
|
3380
3387
|
/* @__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(
|
|
3388
|
+
/* @__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(chunkTNR7AA52_cjs.Skeleton, { className: "h-4 w-3/4" }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm", children: "\u2014" }) }),
|
|
3382
3389
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3383
3390
|
"button",
|
|
3384
3391
|
{
|
|
@@ -3433,7 +3440,7 @@ function ExternalDepositView({
|
|
|
3433
3440
|
TransactionSuccessView,
|
|
3434
3441
|
{
|
|
3435
3442
|
title: "Deposit Credited",
|
|
3436
|
-
message: `Transfer ${
|
|
3443
|
+
message: `Transfer ${chunkTNR7AA52_cjs.shortenAddress(credited.txHash)} has been credited to your Privana balance.`,
|
|
3437
3444
|
onDone: () => {
|
|
3438
3445
|
setCredited(null);
|
|
3439
3446
|
verification.reset();
|
|
@@ -3462,7 +3469,7 @@ function ExternalDepositView({
|
|
|
3462
3469
|
{
|
|
3463
3470
|
title: "Awaiting Deposit",
|
|
3464
3471
|
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 ?
|
|
3472
|
+
remaining: listening ? chunkTNR7AA52_cjs.formatCountdown(secondsLeft) : void 0
|
|
3466
3473
|
}
|
|
3467
3474
|
),
|
|
3468
3475
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
@@ -3491,7 +3498,7 @@ function ExternalDepositView({
|
|
|
3491
3498
|
] });
|
|
3492
3499
|
}
|
|
3493
3500
|
function MoonPayGate({ enabled, children }) {
|
|
3494
|
-
const { networkConfig } =
|
|
3501
|
+
const { networkConfig } = chunkTNR7AA52_cjs.usePrivanaContext();
|
|
3495
3502
|
const apiKey = networkConfig.moonpayApiKey;
|
|
3496
3503
|
if (!enabled || !apiKey) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
3497
3504
|
return /* @__PURE__ */ jsxRuntime.jsx(moonpayReact.MoonPayProvider, { apiKey, children });
|
|
@@ -3512,7 +3519,7 @@ function MethodTabs({
|
|
|
3512
3519
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3513
3520
|
"div",
|
|
3514
3521
|
{
|
|
3515
|
-
className:
|
|
3522
|
+
className: chunkTNR7AA52_cjs.cn(
|
|
3516
3523
|
"bg-input absolute top-1 bottom-1 left-1 w-[calc(50%-8px)] rounded-md transition-transform duration-200",
|
|
3517
3524
|
activeTab === "credit-card" && "translate-x-[calc(100%+8px)]"
|
|
3518
3525
|
)
|
|
@@ -3523,7 +3530,7 @@ function MethodTabs({
|
|
|
3523
3530
|
{
|
|
3524
3531
|
type: "button",
|
|
3525
3532
|
onClick: () => onTabChange("crypto"),
|
|
3526
|
-
className:
|
|
3533
|
+
className: chunkTNR7AA52_cjs.cn(
|
|
3527
3534
|
"relative z-10 flex-1 cursor-pointer rounded-md px-3 py-[9px] text-sm font-medium transition-colors",
|
|
3528
3535
|
activeTab === "crypto" ? "text-foreground" : "text-muted-foreground"
|
|
3529
3536
|
),
|
|
@@ -3535,7 +3542,7 @@ function MethodTabs({
|
|
|
3535
3542
|
{
|
|
3536
3543
|
type: "button",
|
|
3537
3544
|
onClick: () => onTabChange("credit-card"),
|
|
3538
|
-
className:
|
|
3545
|
+
className: chunkTNR7AA52_cjs.cn(
|
|
3539
3546
|
"relative z-10 flex-1 cursor-pointer rounded-md px-3 py-[9px] text-sm font-medium transition-colors",
|
|
3540
3547
|
activeTab === "credit-card" ? "text-foreground" : "text-muted-foreground"
|
|
3541
3548
|
),
|
|
@@ -3579,7 +3586,7 @@ function DepositModalContent({
|
|
|
3579
3586
|
onCloseBlockedChange,
|
|
3580
3587
|
onExit
|
|
3581
3588
|
}) {
|
|
3582
|
-
const { serviceName, enabledTokens, defaultToken, hostedAuthConfig, getChainById: getChainById2, getTokenById } =
|
|
3589
|
+
const { serviceName, enabledTokens, defaultToken, hostedAuthConfig, getChainById: getChainById2, getTokenById } = chunkTNR7AA52_cjs.usePrivanaContext();
|
|
3583
3590
|
const { address } = wagmi.useAccount();
|
|
3584
3591
|
const appName = serviceName ?? "Privana";
|
|
3585
3592
|
const [activeTab, setActiveTab] = react.useState(defaultTab);
|
|
@@ -3714,7 +3721,7 @@ function DepositModalContent({
|
|
|
3714
3721
|
sonner.toast.error("External deposits support ERC20 tokens only");
|
|
3715
3722
|
return;
|
|
3716
3723
|
}
|
|
3717
|
-
const depositAmount =
|
|
3724
|
+
const depositAmount = chunkTNR7AA52_cjs.parseTokenAmount(args.amount, token2.decimals);
|
|
3718
3725
|
if (!allowance) {
|
|
3719
3726
|
setView("external-deposit");
|
|
3720
3727
|
return;
|
|
@@ -3747,7 +3754,7 @@ function DepositModalContent({
|
|
|
3747
3754
|
setCancelled(false);
|
|
3748
3755
|
deposit({
|
|
3749
3756
|
tokenId: token.id,
|
|
3750
|
-
amount:
|
|
3757
|
+
amount: chunkTNR7AA52_cjs.parseTokenAmount(args.amount, token.decimals),
|
|
3751
3758
|
postDepositLock: allowance ? {
|
|
3752
3759
|
maxAmount: BigInt(allowance.value),
|
|
3753
3760
|
lockDuration: allowance.lockDuration
|
|
@@ -3788,7 +3795,7 @@ function DepositModalContent({
|
|
|
3788
3795
|
];
|
|
3789
3796
|
const hasExternalLockRecovery = view === "external-deposit" && !!externalLock.session?.creditedAmount;
|
|
3790
3797
|
const externalSubmissionAmbiguous = hasExternalLockRecovery && !!lockFailure?.submissionMayHaveSucceeded;
|
|
3791
|
-
const savedExternalPayloadUsable = !!externalLock.session?.payload &&
|
|
3798
|
+
const savedExternalPayloadUsable = !!externalLock.session?.payload && chunkTNR7AA52_cjs.isSignedLockUsable(externalLock.session.payload);
|
|
3792
3799
|
const ambiguousRecoveryMustBeAbandoned = externalSubmissionAmbiguous && !savedExternalPayloadUsable;
|
|
3793
3800
|
const externalRecoveryExitLabel = externalSubmissionAmbiguous ? "Stop recovery" : "Keep funds unlocked";
|
|
3794
3801
|
const lockFailureToken = hasExternalLockRecovery && externalLock.session ? getTokenById(externalLock.session.tokenId) ?? selectedToken : selectedToken;
|
|
@@ -3858,7 +3865,7 @@ function DepositModalContent({
|
|
|
3858
3865
|
onClick: onClose,
|
|
3859
3866
|
disabled: isUnsafeToClose,
|
|
3860
3867
|
"aria-label": "Close",
|
|
3861
|
-
className:
|
|
3868
|
+
className: chunkTNR7AA52_cjs.cn(
|
|
3862
3869
|
"absolute top-6 right-5 z-20 flex h-5 w-5 items-center justify-center transition-colors",
|
|
3863
3870
|
isUnsafeToClose ? "text-muted-foreground/40 cursor-not-allowed" : "text-muted-foreground hover:text-foreground cursor-pointer"
|
|
3864
3871
|
),
|
|
@@ -4066,7 +4073,7 @@ function DepositInlineModal({ className, ...handlers }) {
|
|
|
4066
4073
|
"div",
|
|
4067
4074
|
{
|
|
4068
4075
|
"data-privana": true,
|
|
4069
|
-
className:
|
|
4076
|
+
className: chunkTNR7AA52_cjs.cn(
|
|
4070
4077
|
"bg-card relative flex w-[560px] max-w-full flex-col gap-2 overflow-hidden rounded-2xl p-2 shadow-lg",
|
|
4071
4078
|
className
|
|
4072
4079
|
),
|
|
@@ -4082,7 +4089,7 @@ function WithdrawView({
|
|
|
4082
4089
|
onPendingChange,
|
|
4083
4090
|
onWithdrawSuccess
|
|
4084
4091
|
}) {
|
|
4085
|
-
const { chains, getChainById: getChainById2 } =
|
|
4092
|
+
const { chains, getChainById: getChainById2 } = chunkTNR7AA52_cjs.usePrivanaContext();
|
|
4086
4093
|
const { isConnected, address } = wagmi.useAccount();
|
|
4087
4094
|
const [showSuccess, setShowSuccess] = react.useState(false);
|
|
4088
4095
|
const [showTimeout, setShowTimeout] = react.useState(false);
|
|
@@ -4096,7 +4103,7 @@ function WithdrawView({
|
|
|
4096
4103
|
tokenId: selectedToken?.id,
|
|
4097
4104
|
enabled: !!selectedToken
|
|
4098
4105
|
});
|
|
4099
|
-
const formattedBalance = selectedToken ?
|
|
4106
|
+
const formattedBalance = selectedToken ? chunkTNR7AA52_cjs.formatTokenAmount(balanceWei, selectedToken.decimals) : "0.00";
|
|
4100
4107
|
const { withdraw, isPending, currentStep, error, reset } = useWithdraw({
|
|
4101
4108
|
onProcessingSuccess: () => {
|
|
4102
4109
|
onAmountChange("");
|
|
@@ -4112,7 +4119,7 @@ function WithdrawView({
|
|
|
4112
4119
|
setShowTimeout(true);
|
|
4113
4120
|
}
|
|
4114
4121
|
});
|
|
4115
|
-
const explorerUrl = address && targetChain ?
|
|
4122
|
+
const explorerUrl = address && targetChain ? chunkTNR7AA52_cjs.getExplorerAddressUrl(targetChain.id, address) : void 0;
|
|
4116
4123
|
const getStepStatus = (step, after) => {
|
|
4117
4124
|
if (currentStep === step) return "active";
|
|
4118
4125
|
if (after.includes(currentStep)) return "completed";
|
|
@@ -4137,7 +4144,7 @@ function WithdrawView({
|
|
|
4137
4144
|
}, [isPending, cancelled, onPendingChange]);
|
|
4138
4145
|
const hasValidAmount = !!amount && parseFloat(amount) > 0;
|
|
4139
4146
|
const tooManyDecimals = !!hasValidAmount && !!selectedToken && amount.includes(".") && amount.split(".")[1].length > selectedToken.decimals;
|
|
4140
|
-
const exceedsBalance = !!hasValidAmount && !tooManyDecimals && !!selectedToken && !isBalanceLoading && !isBalanceError &&
|
|
4147
|
+
const exceedsBalance = !!hasValidAmount && !tooManyDecimals && !!selectedToken && !isBalanceLoading && !isBalanceError && chunkTNR7AA52_cjs.parseTokenAmount(amount, selectedToken.decimals) > BigInt(balanceWei);
|
|
4141
4148
|
const canWithdraw = isConnected && hasValidAmount && !!selectedToken && !tooManyDecimals && !exceedsBalance;
|
|
4142
4149
|
const handleMax = () => {
|
|
4143
4150
|
if (!selectedToken) return;
|
|
@@ -4149,7 +4156,7 @@ function WithdrawView({
|
|
|
4149
4156
|
setCancelled(false);
|
|
4150
4157
|
await withdraw({
|
|
4151
4158
|
tokenId: selectedToken.id,
|
|
4152
|
-
amount:
|
|
4159
|
+
amount: chunkTNR7AA52_cjs.parseTokenAmount(amount, selectedToken.decimals)
|
|
4153
4160
|
});
|
|
4154
4161
|
};
|
|
4155
4162
|
const handleCancel = () => {
|
|
@@ -4169,7 +4176,7 @@ function WithdrawView({
|
|
|
4169
4176
|
title: "Withdrawal Complete",
|
|
4170
4177
|
message: `Your ${selectedToken.symbol} withdrawal has been processed. Funds should appear in your wallet shortly.`,
|
|
4171
4178
|
explorerUrl,
|
|
4172
|
-
explorerLabel: targetChain ?
|
|
4179
|
+
explorerLabel: targetChain ? chunkTNR7AA52_cjs.getExplorerLabel(targetChain.id) : void 0,
|
|
4173
4180
|
onDone: handleDone
|
|
4174
4181
|
}
|
|
4175
4182
|
) });
|
|
@@ -4281,7 +4288,7 @@ function WithdrawModalContent({
|
|
|
4281
4288
|
onBack,
|
|
4282
4289
|
onWithdrawSuccess
|
|
4283
4290
|
}) {
|
|
4284
|
-
const { serviceName, enabledTokens, defaultToken, hostedAuthConfig } =
|
|
4291
|
+
const { serviceName, enabledTokens, defaultToken, hostedAuthConfig } = chunkTNR7AA52_cjs.usePrivanaContext();
|
|
4285
4292
|
const { address } = wagmi.useAccount();
|
|
4286
4293
|
const appName = serviceName ?? "Privana";
|
|
4287
4294
|
const [view, setView] = react.useState("form");
|
|
@@ -4407,7 +4414,7 @@ function WithdrawInlineModal({ className, onWithdrawSuccess }) {
|
|
|
4407
4414
|
"div",
|
|
4408
4415
|
{
|
|
4409
4416
|
"data-privana": true,
|
|
4410
|
-
className:
|
|
4417
|
+
className: chunkTNR7AA52_cjs.cn(
|
|
4411
4418
|
"bg-card relative flex w-[560px] max-w-full flex-col gap-2 overflow-hidden rounded-2xl p-2 shadow-lg",
|
|
4412
4419
|
className
|
|
4413
4420
|
),
|
|
@@ -4451,14 +4458,14 @@ function SegmentedBalanceBar({
|
|
|
4451
4458
|
showAvailable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4452
4459
|
"div",
|
|
4453
4460
|
{
|
|
4454
|
-
className:
|
|
4461
|
+
className: chunkTNR7AA52_cjs.cn(AVAILABLE_COLOR, "rounded-l-full", !showInUse && "rounded-r-full"),
|
|
4455
4462
|
style: { flexGrow: grow(availableWei) }
|
|
4456
4463
|
}
|
|
4457
4464
|
),
|
|
4458
4465
|
showInUse && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4459
4466
|
"div",
|
|
4460
4467
|
{
|
|
4461
|
-
className:
|
|
4468
|
+
className: chunkTNR7AA52_cjs.cn(IN_USE_COLOR, "rounded-r-full", !showAvailable && "rounded-l-full"),
|
|
4462
4469
|
style: { flexGrow: grow(inUseWei) }
|
|
4463
4470
|
}
|
|
4464
4471
|
)
|
|
@@ -4466,7 +4473,7 @@ function SegmentedBalanceBar({
|
|
|
4466
4473
|
}
|
|
4467
4474
|
function BalanceLegendItem({ color, label }) {
|
|
4468
4475
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
|
|
4469
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className:
|
|
4476
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkTNR7AA52_cjs.cn("h-2.5 w-2.5 rounded-full", color) }),
|
|
4470
4477
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground text-sm leading-5", children: label })
|
|
4471
4478
|
] });
|
|
4472
4479
|
}
|
|
@@ -4479,7 +4486,7 @@ function WalletBalanceView({
|
|
|
4479
4486
|
onAddFunds,
|
|
4480
4487
|
onWithdraw
|
|
4481
4488
|
}) {
|
|
4482
|
-
const { serviceName, serviceIcon, defaultToken } =
|
|
4489
|
+
const { serviceName, serviceIcon, defaultToken } = chunkTNR7AA52_cjs.usePrivanaContext();
|
|
4483
4490
|
const appName = serviceName ?? "Privana";
|
|
4484
4491
|
const token = defaultToken;
|
|
4485
4492
|
const {
|
|
@@ -4492,14 +4499,14 @@ function WalletBalanceView({
|
|
|
4492
4499
|
const variant = !session ? "idle" : inUseWei === 0n ? "session-zero" : availableWei === 0n ? "fully-in-use" : "mixed";
|
|
4493
4500
|
const expiry = session?.expiry;
|
|
4494
4501
|
useNow(3e4, expiry != null);
|
|
4495
|
-
const countdown = expiry != null ?
|
|
4502
|
+
const countdown = expiry != null ? chunkTNR7AA52_cjs.formatTimeRemaining(expiry) : null;
|
|
4496
4503
|
const decimals = token?.decimals ?? 18;
|
|
4497
|
-
const totalFormatted =
|
|
4498
|
-
const availableFormatted =
|
|
4499
|
-
const inUseFormatted =
|
|
4504
|
+
const totalFormatted = chunkTNR7AA52_cjs.formatTokenAmount((availableWei + inUseWei).toString(), decimals);
|
|
4505
|
+
const availableFormatted = chunkTNR7AA52_cjs.formatTokenAmount(availableWei.toString(), decimals);
|
|
4506
|
+
const inUseFormatted = chunkTNR7AA52_cjs.formatTokenAmount(inUseWei.toString(), decimals);
|
|
4500
4507
|
const hasValidAmount = !!amount && parseFloat(amount) > 0;
|
|
4501
4508
|
const tooManyDecimals = hasValidAmount && !!token && amount.includes(".") && amount.split(".")[1].length > token.decimals;
|
|
4502
|
-
const exceedsBalance = hasValidAmount && !tooManyDecimals && !!token && !isBalanceLoading && !isBalanceError &&
|
|
4509
|
+
const exceedsBalance = hasValidAmount && !tooManyDecimals && !!token && !isBalanceLoading && !isBalanceError && chunkTNR7AA52_cjs.parseTokenAmount(amount, token.decimals) > availableWei;
|
|
4503
4510
|
const canFundSession = hasValidAmount && !!token && !tooManyDecimals && !exceedsBalance && !isBalanceLoading && !isBalanceError;
|
|
4504
4511
|
const handleMax = () => {
|
|
4505
4512
|
const max = availableFormatted.replace(/\s/g, "");
|
|
@@ -4517,7 +4524,7 @@ function WalletBalanceView({
|
|
|
4517
4524
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-sm leading-[14px]", children: "Total" }),
|
|
4518
4525
|
/* @__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
4526
|
] }),
|
|
4520
|
-
isBalanceLoading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4527
|
+
isBalanceLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkTNR7AA52_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
4528
|
] }),
|
|
4522
4529
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
4523
4530
|
/* @__PURE__ */ jsxRuntime.jsx(SegmentedBalanceBar, { availableWei, inUseWei }),
|
|
@@ -4668,7 +4675,7 @@ function WalletModalContent({
|
|
|
4668
4675
|
onCloseBlockedChange,
|
|
4669
4676
|
...depositHandlers
|
|
4670
4677
|
}) {
|
|
4671
|
-
const { serviceName, hostedAuthConfig } =
|
|
4678
|
+
const { serviceName, hostedAuthConfig } = chunkTNR7AA52_cjs.usePrivanaContext();
|
|
4672
4679
|
const { address } = wagmi.useAccount();
|
|
4673
4680
|
const appName = serviceName ?? "Privana";
|
|
4674
4681
|
const [view, setView] = react.useState("balance");
|
|
@@ -4772,7 +4779,7 @@ function WalletModalContent({
|
|
|
4772
4779
|
onClick: onClose,
|
|
4773
4780
|
disabled: closeBlocked,
|
|
4774
4781
|
"aria-label": "Close",
|
|
4775
|
-
className:
|
|
4782
|
+
className: chunkTNR7AA52_cjs.cn(
|
|
4776
4783
|
"absolute top-6 right-5 z-20 flex h-5 w-5 items-center justify-center transition-colors",
|
|
4777
4784
|
closeBlocked ? "text-muted-foreground/40 cursor-not-allowed" : "text-muted-foreground hover:text-foreground cursor-pointer"
|
|
4778
4785
|
),
|
|
@@ -4900,7 +4907,7 @@ function WalletInlineModal({ className, ...handlers }) {
|
|
|
4900
4907
|
"div",
|
|
4901
4908
|
{
|
|
4902
4909
|
"data-privana": true,
|
|
4903
|
-
className:
|
|
4910
|
+
className: chunkTNR7AA52_cjs.cn(
|
|
4904
4911
|
"bg-card relative flex w-[560px] max-w-full flex-col gap-2 overflow-hidden rounded-2xl p-2 shadow-lg",
|
|
4905
4912
|
className
|
|
4906
4913
|
),
|
|
@@ -4911,295 +4918,295 @@ function WalletInlineModal({ className, ...handlers }) {
|
|
|
4911
4918
|
|
|
4912
4919
|
Object.defineProperty(exports, "AccountingApiError", {
|
|
4913
4920
|
enumerable: true,
|
|
4914
|
-
get: function () { return
|
|
4921
|
+
get: function () { return chunkTNR7AA52_cjs.AccountingApiError; }
|
|
4915
4922
|
});
|
|
4916
4923
|
Object.defineProperty(exports, "Button", {
|
|
4917
4924
|
enumerable: true,
|
|
4918
|
-
get: function () { return
|
|
4925
|
+
get: function () { return chunkTNR7AA52_cjs.Button; }
|
|
4919
4926
|
});
|
|
4920
4927
|
Object.defineProperty(exports, "DEFAULT_LOCK_DURATION_SECONDS", {
|
|
4921
4928
|
enumerable: true,
|
|
4922
|
-
get: function () { return
|
|
4929
|
+
get: function () { return chunkTNR7AA52_cjs.DEFAULT_LOCK_DURATION_SECONDS; }
|
|
4923
4930
|
});
|
|
4924
4931
|
Object.defineProperty(exports, "DEFAULT_ONRAMP_LOCK_BUFFER", {
|
|
4925
4932
|
enumerable: true,
|
|
4926
|
-
get: function () { return
|
|
4933
|
+
get: function () { return chunkTNR7AA52_cjs.DEFAULT_ONRAMP_LOCK_BUFFER; }
|
|
4927
4934
|
});
|
|
4928
4935
|
Object.defineProperty(exports, "HOSTED_AUTH_CLOCK_SKEW_MS", {
|
|
4929
4936
|
enumerable: true,
|
|
4930
|
-
get: function () { return
|
|
4937
|
+
get: function () { return chunkTNR7AA52_cjs.HOSTED_AUTH_CLOCK_SKEW_MS; }
|
|
4931
4938
|
});
|
|
4932
4939
|
Object.defineProperty(exports, "HostedAuthError", {
|
|
4933
4940
|
enumerable: true,
|
|
4934
|
-
get: function () { return
|
|
4941
|
+
get: function () { return chunkTNR7AA52_cjs.HostedAuthError; }
|
|
4935
4942
|
});
|
|
4936
4943
|
Object.defineProperty(exports, "HostedAuthRequiredError", {
|
|
4937
4944
|
enumerable: true,
|
|
4938
|
-
get: function () { return
|
|
4945
|
+
get: function () { return chunkTNR7AA52_cjs.HostedAuthRequiredError; }
|
|
4939
4946
|
});
|
|
4940
4947
|
Object.defineProperty(exports, "HostedAuthStateMismatchError", {
|
|
4941
4948
|
enumerable: true,
|
|
4942
|
-
get: function () { return
|
|
4949
|
+
get: function () { return chunkTNR7AA52_cjs.HostedAuthStateMismatchError; }
|
|
4943
4950
|
});
|
|
4944
4951
|
Object.defineProperty(exports, "HttpClient", {
|
|
4945
4952
|
enumerable: true,
|
|
4946
|
-
get: function () { return
|
|
4953
|
+
get: function () { return chunkTNR7AA52_cjs.HttpClient; }
|
|
4947
4954
|
});
|
|
4948
4955
|
Object.defineProperty(exports, "LOCK_TYPES", {
|
|
4949
4956
|
enumerable: true,
|
|
4950
|
-
get: function () { return
|
|
4957
|
+
get: function () { return chunkTNR7AA52_cjs.LOCK_TYPES; }
|
|
4951
4958
|
});
|
|
4952
4959
|
Object.defineProperty(exports, "MODIFY_LOCK_TYPES", {
|
|
4953
4960
|
enumerable: true,
|
|
4954
|
-
get: function () { return
|
|
4961
|
+
get: function () { return chunkTNR7AA52_cjs.MODIFY_LOCK_TYPES; }
|
|
4955
4962
|
});
|
|
4956
4963
|
Object.defineProperty(exports, "NETWORK_CONFIG", {
|
|
4957
4964
|
enumerable: true,
|
|
4958
|
-
get: function () { return
|
|
4965
|
+
get: function () { return chunkTNR7AA52_cjs.NETWORK_CONFIG; }
|
|
4959
4966
|
});
|
|
4960
4967
|
Object.defineProperty(exports, "NetworkError", {
|
|
4961
4968
|
enumerable: true,
|
|
4962
|
-
get: function () { return
|
|
4969
|
+
get: function () { return chunkTNR7AA52_cjs.NetworkError; }
|
|
4963
4970
|
});
|
|
4964
4971
|
Object.defineProperty(exports, "PostDepositLockError", {
|
|
4965
4972
|
enumerable: true,
|
|
4966
|
-
get: function () { return
|
|
4973
|
+
get: function () { return chunkTNR7AA52_cjs.PostDepositLockError; }
|
|
4967
4974
|
});
|
|
4968
4975
|
Object.defineProperty(exports, "PrivanaClient", {
|
|
4969
4976
|
enumerable: true,
|
|
4970
|
-
get: function () { return
|
|
4977
|
+
get: function () { return chunkTNR7AA52_cjs.PrivanaClient; }
|
|
4971
4978
|
});
|
|
4972
4979
|
Object.defineProperty(exports, "PrivanaProvider", {
|
|
4973
4980
|
enumerable: true,
|
|
4974
|
-
get: function () { return
|
|
4981
|
+
get: function () { return chunkTNR7AA52_cjs.PrivanaProvider; }
|
|
4975
4982
|
});
|
|
4976
4983
|
Object.defineProperty(exports, "SUPPORTED_CHAINS", {
|
|
4977
4984
|
enumerable: true,
|
|
4978
|
-
get: function () { return
|
|
4985
|
+
get: function () { return chunkTNR7AA52_cjs.SUPPORTED_CHAINS; }
|
|
4979
4986
|
});
|
|
4980
4987
|
Object.defineProperty(exports, "SiweAuthProvider", {
|
|
4981
4988
|
enumerable: true,
|
|
4982
|
-
get: function () { return
|
|
4989
|
+
get: function () { return chunkTNR7AA52_cjs.SiweAuthProvider; }
|
|
4983
4990
|
});
|
|
4984
4991
|
Object.defineProperty(exports, "Skeleton", {
|
|
4985
4992
|
enumerable: true,
|
|
4986
|
-
get: function () { return
|
|
4993
|
+
get: function () { return chunkTNR7AA52_cjs.Skeleton; }
|
|
4987
4994
|
});
|
|
4988
4995
|
Object.defineProperty(exports, "TRANSFER_LOCKED_TYPES", {
|
|
4989
4996
|
enumerable: true,
|
|
4990
|
-
get: function () { return
|
|
4997
|
+
get: function () { return chunkTNR7AA52_cjs.TRANSFER_LOCKED_TYPES; }
|
|
4991
4998
|
});
|
|
4992
4999
|
Object.defineProperty(exports, "TRANSFER_TYPES", {
|
|
4993
5000
|
enumerable: true,
|
|
4994
|
-
get: function () { return
|
|
5001
|
+
get: function () { return chunkTNR7AA52_cjs.TRANSFER_TYPES; }
|
|
4995
5002
|
});
|
|
4996
5003
|
Object.defineProperty(exports, "ValidationError", {
|
|
4997
5004
|
enumerable: true,
|
|
4998
|
-
get: function () { return
|
|
5005
|
+
get: function () { return chunkTNR7AA52_cjs.ValidationError; }
|
|
4999
5006
|
});
|
|
5000
5007
|
Object.defineProperty(exports, "WITHDRAW_FROM_LOCK_TYPES", {
|
|
5001
5008
|
enumerable: true,
|
|
5002
|
-
get: function () { return
|
|
5009
|
+
get: function () { return chunkTNR7AA52_cjs.WITHDRAW_FROM_LOCK_TYPES; }
|
|
5003
5010
|
});
|
|
5004
5011
|
Object.defineProperty(exports, "WITHDRAW_TYPES", {
|
|
5005
5012
|
enumerable: true,
|
|
5006
|
-
get: function () { return
|
|
5013
|
+
get: function () { return chunkTNR7AA52_cjs.WITHDRAW_TYPES; }
|
|
5007
5014
|
});
|
|
5008
5015
|
Object.defineProperty(exports, "applyLockBuffer", {
|
|
5009
5016
|
enumerable: true,
|
|
5010
|
-
get: function () { return
|
|
5017
|
+
get: function () { return chunkTNR7AA52_cjs.applyLockBuffer; }
|
|
5011
5018
|
});
|
|
5012
5019
|
Object.defineProperty(exports, "applyRefreshResponse", {
|
|
5013
5020
|
enumerable: true,
|
|
5014
|
-
get: function () { return
|
|
5021
|
+
get: function () { return chunkTNR7AA52_cjs.applyRefreshResponse; }
|
|
5015
5022
|
});
|
|
5016
5023
|
Object.defineProperty(exports, "buildHostedAuthSession", {
|
|
5017
5024
|
enumerable: true,
|
|
5018
|
-
get: function () { return
|
|
5025
|
+
get: function () { return chunkTNR7AA52_cjs.buildHostedAuthSession; }
|
|
5019
5026
|
});
|
|
5020
5027
|
Object.defineProperty(exports, "buildSiweStatement", {
|
|
5021
5028
|
enumerable: true,
|
|
5022
|
-
get: function () { return
|
|
5029
|
+
get: function () { return chunkTNR7AA52_cjs.buildSiweStatement; }
|
|
5023
5030
|
});
|
|
5024
5031
|
Object.defineProperty(exports, "buttonVariants", {
|
|
5025
5032
|
enumerable: true,
|
|
5026
|
-
get: function () { return
|
|
5033
|
+
get: function () { return chunkTNR7AA52_cjs.buttonVariants; }
|
|
5027
5034
|
});
|
|
5028
5035
|
Object.defineProperty(exports, "clampLockAmount", {
|
|
5029
5036
|
enumerable: true,
|
|
5030
|
-
get: function () { return
|
|
5037
|
+
get: function () { return chunkTNR7AA52_cjs.clampLockAmount; }
|
|
5031
5038
|
});
|
|
5032
5039
|
Object.defineProperty(exports, "clearHostedAuthPendingTransaction", {
|
|
5033
5040
|
enumerable: true,
|
|
5034
|
-
get: function () { return
|
|
5041
|
+
get: function () { return chunkTNR7AA52_cjs.clearHostedAuthPendingTransaction; }
|
|
5035
5042
|
});
|
|
5036
5043
|
Object.defineProperty(exports, "clearPendingLock", {
|
|
5037
5044
|
enumerable: true,
|
|
5038
|
-
get: function () { return
|
|
5045
|
+
get: function () { return chunkTNR7AA52_cjs.clearPendingLock; }
|
|
5039
5046
|
});
|
|
5040
5047
|
Object.defineProperty(exports, "createDomain", {
|
|
5041
5048
|
enumerable: true,
|
|
5042
|
-
get: function () { return
|
|
5049
|
+
get: function () { return chunkTNR7AA52_cjs.createDomain; }
|
|
5043
5050
|
});
|
|
5044
5051
|
Object.defineProperty(exports, "createHostedAuthPendingStorageKey", {
|
|
5045
5052
|
enumerable: true,
|
|
5046
|
-
get: function () { return
|
|
5053
|
+
get: function () { return chunkTNR7AA52_cjs.createHostedAuthPendingStorageKey; }
|
|
5047
5054
|
});
|
|
5048
5055
|
Object.defineProperty(exports, "createHostedAuthState", {
|
|
5049
5056
|
enumerable: true,
|
|
5050
|
-
get: function () { return
|
|
5057
|
+
get: function () { return chunkTNR7AA52_cjs.createHostedAuthState; }
|
|
5051
5058
|
});
|
|
5052
5059
|
Object.defineProperty(exports, "createHostedAuthStorageKey", {
|
|
5053
5060
|
enumerable: true,
|
|
5054
|
-
get: function () { return
|
|
5061
|
+
get: function () { return chunkTNR7AA52_cjs.createHostedAuthStorageKey; }
|
|
5055
5062
|
});
|
|
5056
5063
|
Object.defineProperty(exports, "createLockExpiry", {
|
|
5057
5064
|
enumerable: true,
|
|
5058
|
-
get: function () { return
|
|
5065
|
+
get: function () { return chunkTNR7AA52_cjs.createLockExpiry; }
|
|
5059
5066
|
});
|
|
5060
5067
|
Object.defineProperty(exports, "createPkceChallenge", {
|
|
5061
5068
|
enumerable: true,
|
|
5062
|
-
get: function () { return
|
|
5069
|
+
get: function () { return chunkTNR7AA52_cjs.createPkceChallenge; }
|
|
5063
5070
|
});
|
|
5064
5071
|
Object.defineProperty(exports, "createPkceVerifier", {
|
|
5065
5072
|
enumerable: true,
|
|
5066
|
-
get: function () { return
|
|
5073
|
+
get: function () { return chunkTNR7AA52_cjs.createPkceVerifier; }
|
|
5067
5074
|
});
|
|
5068
5075
|
Object.defineProperty(exports, "createSignedLockRequest", {
|
|
5069
5076
|
enumerable: true,
|
|
5070
|
-
get: function () { return
|
|
5077
|
+
get: function () { return chunkTNR7AA52_cjs.createSignedLockRequest; }
|
|
5071
5078
|
});
|
|
5072
5079
|
Object.defineProperty(exports, "getAccountingContract", {
|
|
5073
5080
|
enumerable: true,
|
|
5074
|
-
get: function () { return
|
|
5081
|
+
get: function () { return chunkTNR7AA52_cjs.getAccountingContract; }
|
|
5075
5082
|
});
|
|
5076
5083
|
Object.defineProperty(exports, "getApiUrl", {
|
|
5077
5084
|
enumerable: true,
|
|
5078
|
-
get: function () { return
|
|
5085
|
+
get: function () { return chunkTNR7AA52_cjs.getApiUrl; }
|
|
5079
5086
|
});
|
|
5080
5087
|
Object.defineProperty(exports, "getChainById", {
|
|
5081
5088
|
enumerable: true,
|
|
5082
|
-
get: function () { return
|
|
5089
|
+
get: function () { return chunkTNR7AA52_cjs.getChainById; }
|
|
5083
5090
|
});
|
|
5084
5091
|
Object.defineProperty(exports, "getChainId", {
|
|
5085
5092
|
enumerable: true,
|
|
5086
|
-
get: function () { return
|
|
5093
|
+
get: function () { return chunkTNR7AA52_cjs.getChainId; }
|
|
5087
5094
|
});
|
|
5088
5095
|
Object.defineProperty(exports, "getExplorerAddressUrl", {
|
|
5089
5096
|
enumerable: true,
|
|
5090
|
-
get: function () { return
|
|
5097
|
+
get: function () { return chunkTNR7AA52_cjs.getExplorerAddressUrl; }
|
|
5091
5098
|
});
|
|
5092
5099
|
Object.defineProperty(exports, "getExplorerLabel", {
|
|
5093
5100
|
enumerable: true,
|
|
5094
|
-
get: function () { return
|
|
5101
|
+
get: function () { return chunkTNR7AA52_cjs.getExplorerLabel; }
|
|
5095
5102
|
});
|
|
5096
5103
|
Object.defineProperty(exports, "isHostedAuthRefreshActive", {
|
|
5097
5104
|
enumerable: true,
|
|
5098
|
-
get: function () { return
|
|
5105
|
+
get: function () { return chunkTNR7AA52_cjs.isHostedAuthRefreshActive; }
|
|
5099
5106
|
});
|
|
5100
5107
|
Object.defineProperty(exports, "isHostedAuthSessionActive", {
|
|
5101
5108
|
enumerable: true,
|
|
5102
|
-
get: function () { return
|
|
5109
|
+
get: function () { return chunkTNR7AA52_cjs.isHostedAuthSessionActive; }
|
|
5103
5110
|
});
|
|
5104
5111
|
Object.defineProperty(exports, "isSignedLockUsable", {
|
|
5105
5112
|
enumerable: true,
|
|
5106
|
-
get: function () { return
|
|
5113
|
+
get: function () { return chunkTNR7AA52_cjs.isSignedLockUsable; }
|
|
5107
5114
|
});
|
|
5108
5115
|
Object.defineProperty(exports, "loadPendingLock", {
|
|
5109
5116
|
enumerable: true,
|
|
5110
|
-
get: function () { return
|
|
5117
|
+
get: function () { return chunkTNR7AA52_cjs.loadPendingLock; }
|
|
5111
5118
|
});
|
|
5112
5119
|
Object.defineProperty(exports, "normalizeAddress", {
|
|
5113
5120
|
enumerable: true,
|
|
5114
|
-
get: function () { return
|
|
5121
|
+
get: function () { return chunkTNR7AA52_cjs.normalizeAddress; }
|
|
5115
5122
|
});
|
|
5116
5123
|
Object.defineProperty(exports, "normalizeHex", {
|
|
5117
5124
|
enumerable: true,
|
|
5118
|
-
get: function () { return
|
|
5125
|
+
get: function () { return chunkTNR7AA52_cjs.normalizeHex; }
|
|
5119
5126
|
});
|
|
5120
5127
|
Object.defineProperty(exports, "parseHostedAuthCallback", {
|
|
5121
5128
|
enumerable: true,
|
|
5122
|
-
get: function () { return
|
|
5129
|
+
get: function () { return chunkTNR7AA52_cjs.parseHostedAuthCallback; }
|
|
5123
5130
|
});
|
|
5124
5131
|
Object.defineProperty(exports, "persistHostedAuthPendingTransaction", {
|
|
5125
5132
|
enumerable: true,
|
|
5126
|
-
get: function () { return
|
|
5133
|
+
get: function () { return chunkTNR7AA52_cjs.persistHostedAuthPendingTransaction; }
|
|
5127
5134
|
});
|
|
5128
5135
|
Object.defineProperty(exports, "readHostedAuthPendingTransaction", {
|
|
5129
5136
|
enumerable: true,
|
|
5130
|
-
get: function () { return
|
|
5137
|
+
get: function () { return chunkTNR7AA52_cjs.readHostedAuthPendingTransaction; }
|
|
5131
5138
|
});
|
|
5132
5139
|
Object.defineProperty(exports, "readStoredHostedAuthSession", {
|
|
5133
5140
|
enumerable: true,
|
|
5134
|
-
get: function () { return
|
|
5141
|
+
get: function () { return chunkTNR7AA52_cjs.readStoredHostedAuthSession; }
|
|
5135
5142
|
});
|
|
5136
5143
|
Object.defineProperty(exports, "requireDepositLockOwner", {
|
|
5137
5144
|
enumerable: true,
|
|
5138
|
-
get: function () { return
|
|
5145
|
+
get: function () { return chunkTNR7AA52_cjs.requireDepositLockOwner; }
|
|
5139
5146
|
});
|
|
5140
5147
|
Object.defineProperty(exports, "requireServiceAddress", {
|
|
5141
5148
|
enumerable: true,
|
|
5142
|
-
get: function () { return
|
|
5149
|
+
get: function () { return chunkTNR7AA52_cjs.requireServiceAddress; }
|
|
5143
5150
|
});
|
|
5144
5151
|
Object.defineProperty(exports, "savePendingLock", {
|
|
5145
5152
|
enumerable: true,
|
|
5146
|
-
get: function () { return
|
|
5153
|
+
get: function () { return chunkTNR7AA52_cjs.savePendingLock; }
|
|
5147
5154
|
});
|
|
5148
5155
|
Object.defineProperty(exports, "signLockMessage", {
|
|
5149
5156
|
enumerable: true,
|
|
5150
|
-
get: function () { return
|
|
5157
|
+
get: function () { return chunkTNR7AA52_cjs.signLockMessage; }
|
|
5151
5158
|
});
|
|
5152
5159
|
Object.defineProperty(exports, "signModifyLockMessage", {
|
|
5153
5160
|
enumerable: true,
|
|
5154
|
-
get: function () { return
|
|
5161
|
+
get: function () { return chunkTNR7AA52_cjs.signModifyLockMessage; }
|
|
5155
5162
|
});
|
|
5156
5163
|
Object.defineProperty(exports, "signTransferLockedMessage", {
|
|
5157
5164
|
enumerable: true,
|
|
5158
|
-
get: function () { return
|
|
5165
|
+
get: function () { return chunkTNR7AA52_cjs.signTransferLockedMessage; }
|
|
5159
5166
|
});
|
|
5160
5167
|
Object.defineProperty(exports, "signTransferMessage", {
|
|
5161
5168
|
enumerable: true,
|
|
5162
|
-
get: function () { return
|
|
5169
|
+
get: function () { return chunkTNR7AA52_cjs.signTransferMessage; }
|
|
5163
5170
|
});
|
|
5164
5171
|
Object.defineProperty(exports, "signWithdrawFromLockMessage", {
|
|
5165
5172
|
enumerable: true,
|
|
5166
|
-
get: function () { return
|
|
5173
|
+
get: function () { return chunkTNR7AA52_cjs.signWithdrawFromLockMessage; }
|
|
5167
5174
|
});
|
|
5168
5175
|
Object.defineProperty(exports, "signWithdrawMessage", {
|
|
5169
5176
|
enumerable: true,
|
|
5170
|
-
get: function () { return
|
|
5177
|
+
get: function () { return chunkTNR7AA52_cjs.signWithdrawMessage; }
|
|
5171
5178
|
});
|
|
5172
5179
|
Object.defineProperty(exports, "stripHostedAuthCallbackParams", {
|
|
5173
5180
|
enumerable: true,
|
|
5174
|
-
get: function () { return
|
|
5181
|
+
get: function () { return chunkTNR7AA52_cjs.stripHostedAuthCallbackParams; }
|
|
5175
5182
|
});
|
|
5176
5183
|
Object.defineProperty(exports, "submitPendingLock", {
|
|
5177
5184
|
enumerable: true,
|
|
5178
|
-
get: function () { return
|
|
5185
|
+
get: function () { return chunkTNR7AA52_cjs.submitPendingLock; }
|
|
5179
5186
|
});
|
|
5180
5187
|
Object.defineProperty(exports, "syncHostedAuthSessionToClient", {
|
|
5181
5188
|
enumerable: true,
|
|
5182
|
-
get: function () { return
|
|
5189
|
+
get: function () { return chunkTNR7AA52_cjs.syncHostedAuthSessionToClient; }
|
|
5183
5190
|
});
|
|
5184
5191
|
Object.defineProperty(exports, "useDepositVerification", {
|
|
5185
5192
|
enumerable: true,
|
|
5186
|
-
get: function () { return
|
|
5193
|
+
get: function () { return chunkTNR7AA52_cjs.useDepositVerification; }
|
|
5187
5194
|
});
|
|
5188
5195
|
Object.defineProperty(exports, "usePrivanaContext", {
|
|
5189
5196
|
enumerable: true,
|
|
5190
|
-
get: function () { return
|
|
5197
|
+
get: function () { return chunkTNR7AA52_cjs.usePrivanaContext; }
|
|
5191
5198
|
});
|
|
5192
5199
|
Object.defineProperty(exports, "useSafeAccount", {
|
|
5193
5200
|
enumerable: true,
|
|
5194
|
-
get: function () { return
|
|
5201
|
+
get: function () { return chunkTNR7AA52_cjs.useSafeAccount; }
|
|
5195
5202
|
});
|
|
5196
5203
|
Object.defineProperty(exports, "useSafePrivanaContext", {
|
|
5197
5204
|
enumerable: true,
|
|
5198
|
-
get: function () { return
|
|
5205
|
+
get: function () { return chunkTNR7AA52_cjs.useSafePrivanaContext; }
|
|
5199
5206
|
});
|
|
5200
5207
|
Object.defineProperty(exports, "useSiweAuth", {
|
|
5201
5208
|
enumerable: true,
|
|
5202
|
-
get: function () { return
|
|
5209
|
+
get: function () { return chunkTNR7AA52_cjs.useSiweAuth; }
|
|
5203
5210
|
});
|
|
5204
5211
|
exports.DepositInlineModal = DepositInlineModal;
|
|
5205
5212
|
exports.DepositModal = DepositModal;
|