@cofhe/react 0.5.2 → 0.6.0
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-3YAGCPSA.cjs → chunk-6ANXPYT6.cjs} +53 -54
- package/dist/chunk-6ANXPYT6.cjs.map +1 -0
- package/dist/{chunk-N3S7TQY6.js → chunk-C5RYFTRG.js} +52 -53
- package/dist/chunk-C5RYFTRG.js.map +1 -0
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/ui-base.cjs +343 -343
- package/dist/ui-base.js +1 -1
- package/package.json +9 -7
- package/dist/chunk-3YAGCPSA.cjs.map +0 -1
- package/dist/chunk-N3S7TQY6.js.map +0 -1
package/dist/ui-base.cjs
CHANGED
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
|
|
90
90
|
|
|
91
91
|
|
|
92
|
-
var
|
|
92
|
+
var _chunk6ANXPYT6cjs = require('./chunk-6ANXPYT6.cjs');
|
|
93
93
|
|
|
94
94
|
// src/utils/debounce.ts
|
|
95
95
|
var debounce = (func, wait) => {
|
|
@@ -148,15 +148,15 @@ var SecurityIcon = createMaterialIcon(_md.MdSecurity);
|
|
|
148
148
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
149
149
|
|
|
150
150
|
// src/hooks/useTrackPendingTransactions.ts
|
|
151
|
-
var import_ts_essentials =
|
|
151
|
+
var import_ts_essentials = _chunk6ANXPYT6cjs.__toESM.call(void 0, _chunk6ANXPYT6cjs.require_dist.call(void 0, ));
|
|
152
152
|
require('@tanstack/react-query');
|
|
153
153
|
|
|
154
154
|
// src/hooks/usePendingTransactions.ts
|
|
155
155
|
var filter = (tx) => tx.status === "pending" /* Pending */;
|
|
156
156
|
function usePendingTransactions() {
|
|
157
|
-
const chainId =
|
|
158
|
-
const account =
|
|
159
|
-
const { filteredTxs } =
|
|
157
|
+
const chainId = _chunk6ANXPYT6cjs.useCofheChainId.call(void 0, );
|
|
158
|
+
const account = _chunk6ANXPYT6cjs.useCofheAccount.call(void 0, );
|
|
159
|
+
const { filteredTxs } = _chunk6ANXPYT6cjs.useStoredTransactions.call(void 0, {
|
|
160
160
|
chainId,
|
|
161
161
|
account,
|
|
162
162
|
filter
|
|
@@ -167,12 +167,12 @@ function usePendingTransactions() {
|
|
|
167
167
|
// src/hooks/useTrackPendingTransactions.ts
|
|
168
168
|
|
|
169
169
|
function invalidateConfidentialTokenBalanceQueries(token, queryClient) {
|
|
170
|
-
const tokenBalanceQueryKey =
|
|
170
|
+
const tokenBalanceQueryKey = _chunk6ANXPYT6cjs.constructCofheReadContractQueryForInvalidation.call(void 0, {
|
|
171
171
|
cofheChainId: token.chainId,
|
|
172
172
|
address: token.address,
|
|
173
|
-
functionName:
|
|
173
|
+
functionName: _chunk6ANXPYT6cjs.getTokenContractConfig.call(void 0, token.extensions.fhenix.confidentialityType).functionName
|
|
174
174
|
});
|
|
175
|
-
|
|
175
|
+
_chunk6ANXPYT6cjs.cofheLogger.log("Invalidating shield/send read contract queries for token:", token);
|
|
176
176
|
queryClient.invalidateQueries({
|
|
177
177
|
queryKey: tokenBalanceQueryKey,
|
|
178
178
|
// TODO: it can potentially invalidate irrelevenat queries who happen to belong to the same contract but different function. Not sure if worth fixing
|
|
@@ -184,12 +184,12 @@ function invalidatePublicTokenBalanceQueries({
|
|
|
184
184
|
chainId,
|
|
185
185
|
accountAddress
|
|
186
186
|
}, queryClient) {
|
|
187
|
-
const tokenBalanceQueryKey =
|
|
187
|
+
const tokenBalanceQueryKey = _chunk6ANXPYT6cjs.constructPublicTokenBalanceQueryKeyForInvalidation.call(void 0, {
|
|
188
188
|
chainId,
|
|
189
189
|
tokenAddress,
|
|
190
190
|
accountAddress
|
|
191
191
|
});
|
|
192
|
-
|
|
192
|
+
_chunk6ANXPYT6cjs.cofheLogger.log("Invalidating public token balance read contract queries for token:", tokenBalanceQueryKey);
|
|
193
193
|
queryClient.invalidateQueries({
|
|
194
194
|
queryKey: tokenBalanceQueryKey
|
|
195
195
|
});
|
|
@@ -213,7 +213,7 @@ function invalidateTokenAllowanceQueries({
|
|
|
213
213
|
ownerAddress,
|
|
214
214
|
spenderAddress
|
|
215
215
|
}, queryClient) {
|
|
216
|
-
const queryKey =
|
|
216
|
+
const queryKey = _chunk6ANXPYT6cjs.constructTokenAllowanceQueryKeyForInvalidation.call(void 0, {
|
|
217
217
|
chainId,
|
|
218
218
|
tokenAddress,
|
|
219
219
|
ownerAddress,
|
|
@@ -227,7 +227,7 @@ function useTrackPendingTransactionsBase({
|
|
|
227
227
|
onFetchFailure
|
|
228
228
|
}) {
|
|
229
229
|
const accountsPendingTxs = usePendingTransactions();
|
|
230
|
-
const publicClient =
|
|
230
|
+
const publicClient = _chunk6ANXPYT6cjs.useCofhePublicClient.call(void 0, );
|
|
231
231
|
const queries = accountsPendingTxs.map((tx) => ({
|
|
232
232
|
queryKey: ["tx-receipt", tx.chainId, tx.hash],
|
|
233
233
|
queryFn: async () => {
|
|
@@ -239,11 +239,11 @@ function useTrackPendingTransactionsBase({
|
|
|
239
239
|
const status = receipt.status === "success" ? "confirmed" /* Confirmed */ : "failed" /* Failed */;
|
|
240
240
|
if (status === "confirmed" /* Confirmed */) onReceiptSuccess(tx, receipt);
|
|
241
241
|
else _optionalChain([onReceiptFail, 'optionalCall', _5 => _5(tx, receipt)]);
|
|
242
|
-
|
|
242
|
+
_chunk6ANXPYT6cjs.useTransactionStore.getState().updateTransactionStatus(tx.chainId, tx.hash, status);
|
|
243
243
|
return receipt;
|
|
244
244
|
} catch (e) {
|
|
245
245
|
_optionalChain([onFetchFailure, 'optionalCall', _6 => _6(e, tx)]);
|
|
246
|
-
|
|
246
|
+
_chunk6ANXPYT6cjs.useTransactionStore.getState().updateTransactionStatus(tx.chainId, tx.hash, "failed" /* Failed */);
|
|
247
247
|
throw e;
|
|
248
248
|
}
|
|
249
249
|
},
|
|
@@ -251,18 +251,18 @@ function useTrackPendingTransactionsBase({
|
|
|
251
251
|
refetchOnWindowFocus: false,
|
|
252
252
|
refetchOnReconnect: true
|
|
253
253
|
}));
|
|
254
|
-
|
|
254
|
+
_chunk6ANXPYT6cjs.useInternalQueries.call(void 0, {
|
|
255
255
|
queries
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
258
|
function useHandleInvalidations() {
|
|
259
|
-
const queryClient =
|
|
260
|
-
const { upsert: upsertDecryptionWatcher, byKey } =
|
|
261
|
-
|
|
259
|
+
const queryClient = _chunk6ANXPYT6cjs.useInternalQueryClient.call(void 0, );
|
|
260
|
+
const { upsert: upsertDecryptionWatcher, byKey } = _chunk6ANXPYT6cjs.useDecryptionWatchersStore.call(void 0, );
|
|
261
|
+
_chunk6ANXPYT6cjs.cofheLogger.log("Scheduled invalidations store:", byKey);
|
|
262
262
|
const handleInvalidations = (tx) => {
|
|
263
263
|
invalidatePublicTokenBalanceQueries(
|
|
264
264
|
{
|
|
265
|
-
tokenAddress:
|
|
265
|
+
tokenAddress: _chunk6ANXPYT6cjs.ETH_ADDRESS_LOWERCASE,
|
|
266
266
|
chainId: tx.chainId,
|
|
267
267
|
accountAddress: tx.account
|
|
268
268
|
},
|
|
@@ -281,7 +281,7 @@ function useHandleInvalidations() {
|
|
|
281
281
|
chainId: tx.chainId,
|
|
282
282
|
triggerTxHash: tx.hash,
|
|
283
283
|
queryKeys: [
|
|
284
|
-
|
|
284
|
+
_chunk6ANXPYT6cjs.constructUnshieldClaimsQueryKeyForInvalidation.call(void 0, {
|
|
285
285
|
chainId: tx.token.chainId,
|
|
286
286
|
tokenAddress: tx.token.address,
|
|
287
287
|
confidentialityType: tx.token.extensions.fhenix.confidentialityType,
|
|
@@ -300,7 +300,7 @@ function useHandleInvalidations() {
|
|
|
300
300
|
},
|
|
301
301
|
queryClient
|
|
302
302
|
);
|
|
303
|
-
|
|
303
|
+
_chunk6ANXPYT6cjs.invalidateClaimableQueries.call(void 0, {
|
|
304
304
|
token: tx.token,
|
|
305
305
|
accountAddress: tx.account,
|
|
306
306
|
queryClient
|
|
@@ -308,7 +308,7 @@ function useHandleInvalidations() {
|
|
|
308
308
|
} else if (tx.actionType === "approve" /* Approve */) {
|
|
309
309
|
const underlying = _optionalChain([tx, 'access', _12 => _12.token, 'access', _13 => _13.extensions, 'access', _14 => _14.fhenix, 'access', _15 => _15.erc20Pair, 'optionalAccess', _16 => _16.address]);
|
|
310
310
|
(0, import_ts_essentials.assert)(underlying, "erc20Pair is required for approve transaction invalidation");
|
|
311
|
-
if (underlying.toLowerCase() !==
|
|
311
|
+
if (underlying.toLowerCase() !== _chunk6ANXPYT6cjs.ETH_ADDRESS_LOWERCASE) {
|
|
312
312
|
invalidateTokenAllowanceQueries(
|
|
313
313
|
{
|
|
314
314
|
chainId: tx.token.chainId,
|
|
@@ -320,7 +320,7 @@ function useHandleInvalidations() {
|
|
|
320
320
|
);
|
|
321
321
|
}
|
|
322
322
|
} else {
|
|
323
|
-
|
|
323
|
+
_chunk6ANXPYT6cjs.cofheLogger.warn("No invalidation logic for transaction action type:", tx.actionType);
|
|
324
324
|
}
|
|
325
325
|
};
|
|
326
326
|
return handleInvalidations;
|
|
@@ -340,7 +340,7 @@ function useOnceTransactionSubmitted(onSubmit) {
|
|
|
340
340
|
}
|
|
341
341
|
function useTrackPendingTransactions() {
|
|
342
342
|
const handleInvalidations = useHandleInvalidations();
|
|
343
|
-
const { onTransactionMined, onWatchReceiptFailure, onTransactionSubmitted } =
|
|
343
|
+
const { onTransactionMined, onWatchReceiptFailure, onTransactionSubmitted } = _chunk6ANXPYT6cjs.useTransactionGlobalLifecycle.call(void 0, );
|
|
344
344
|
useOnceTransactionSubmitted(onTransactionSubmitted);
|
|
345
345
|
useTrackPendingTransactionsBase({
|
|
346
346
|
// 2.a. tx mined successfully
|
|
@@ -361,7 +361,7 @@ function useTrackPendingTransactions() {
|
|
|
361
361
|
|
|
362
362
|
// src/hooks/useTrackDecryptingTransactions.ts
|
|
363
363
|
|
|
364
|
-
var import_ts_essentials2 =
|
|
364
|
+
var import_ts_essentials2 = _chunk6ANXPYT6cjs.__toESM.call(void 0, _chunk6ANXPYT6cjs.require_dist.call(void 0, ));
|
|
365
365
|
|
|
366
366
|
// src/hooks/useCofheReadDecryptionResults.ts
|
|
367
367
|
|
|
@@ -418,8 +418,8 @@ var TASK_MANAGER_ABI = [
|
|
|
418
418
|
];
|
|
419
419
|
var DECRYPTION_RESULT_POLLING_INTERVAL_MS = 5e3;
|
|
420
420
|
function useCofheReadDecryptionResults(ciphertexts) {
|
|
421
|
-
const publicClient =
|
|
422
|
-
const chainId =
|
|
421
|
+
const publicClient = _chunk6ANXPYT6cjs.useCofhePublicClient.call(void 0, );
|
|
422
|
+
const chainId = _chunk6ANXPYT6cjs.useCofheChainId.call(void 0, );
|
|
423
423
|
const queries = _react.useMemo.call(void 0, () => {
|
|
424
424
|
return Array.from(ciphertexts).map((ct) => {
|
|
425
425
|
return {
|
|
@@ -460,7 +460,7 @@ function useCofheReadDecryptionResults(ciphertexts) {
|
|
|
460
460
|
};
|
|
461
461
|
});
|
|
462
462
|
}, [chainId, ciphertexts, publicClient]);
|
|
463
|
-
const results =
|
|
463
|
+
const results = _chunk6ANXPYT6cjs.useInternalQueries.call(void 0, { queries });
|
|
464
464
|
const isDecryptedByCt = _react.useMemo.call(void 0, () => {
|
|
465
465
|
return results.reduce((record, res, index) => {
|
|
466
466
|
const ct = Array.from(ciphertexts)[index];
|
|
@@ -473,12 +473,12 @@ function useCofheReadDecryptionResults(ciphertexts) {
|
|
|
473
473
|
|
|
474
474
|
// src/hooks/useTrackDecryptingTransactions.ts
|
|
475
475
|
function useHandleInvalidationsAfterDecryption() {
|
|
476
|
-
const queryClient =
|
|
476
|
+
const queryClient = _chunk6ANXPYT6cjs.useInternalQueryClient.call(void 0, );
|
|
477
477
|
return _react.useCallback.call(void 0,
|
|
478
478
|
async (_tx, decryptionWatcher) => {
|
|
479
|
-
|
|
479
|
+
_chunk6ANXPYT6cjs.cofheLogger.log("Invalidating queries for decryption watcher:", decryptionWatcher);
|
|
480
480
|
for (const queryKey of decryptionWatcher.queryKeys) {
|
|
481
|
-
|
|
481
|
+
_chunk6ANXPYT6cjs.cofheLogger.log("Invalidating query due to observed decryption:", queryKey);
|
|
482
482
|
await queryClient.invalidateQueries({ queryKey });
|
|
483
483
|
}
|
|
484
484
|
},
|
|
@@ -487,14 +487,14 @@ function useHandleInvalidationsAfterDecryption() {
|
|
|
487
487
|
}
|
|
488
488
|
var filter2 = (tx) => tx.isPendingDecryption && tx.status === "confirmed" /* Confirmed */;
|
|
489
489
|
function useTrackDecryptingTransactionsBase({ onDecryptionResolve }) {
|
|
490
|
-
const chainId =
|
|
491
|
-
const account =
|
|
492
|
-
const { hashes, filteredTxsByHash: minedTxsPendingDecryptionByHash } =
|
|
490
|
+
const chainId = _chunk6ANXPYT6cjs.useCofheChainId.call(void 0, );
|
|
491
|
+
const account = _chunk6ANXPYT6cjs.useCofheAccount.call(void 0, );
|
|
492
|
+
const { hashes, filteredTxsByHash: minedTxsPendingDecryptionByHash } = _chunk6ANXPYT6cjs.useStoredTransactions.call(void 0, {
|
|
493
493
|
filter: filter2,
|
|
494
494
|
account,
|
|
495
495
|
chainId
|
|
496
496
|
});
|
|
497
|
-
const { receiptsByHash } =
|
|
497
|
+
const { receiptsByHash } = _chunk6ANXPYT6cjs.useTransactionReceiptsByHash.call(void 0, {
|
|
498
498
|
hashes
|
|
499
499
|
});
|
|
500
500
|
const minedTxsWithCiphertextsToWatch = _react.useMemo.call(void 0, () => {
|
|
@@ -515,8 +515,8 @@ function useTrackDecryptingTransactionsBase({ onDecryptionResolve }) {
|
|
|
515
515
|
return new Set(minedTxsWithCiphertextsToWatch.map(({ ciphertextToWatch }) => ciphertextToWatch));
|
|
516
516
|
}, [minedTxsWithCiphertextsToWatch]);
|
|
517
517
|
const decryptionResults = useCofheReadDecryptionResults(ciphertextsToWatch);
|
|
518
|
-
const queryClient =
|
|
519
|
-
const { setDecryptionObservedAt } =
|
|
518
|
+
const queryClient = _chunk6ANXPYT6cjs.useInternalQueryClient.call(void 0, );
|
|
519
|
+
const { setDecryptionObservedAt } = _chunk6ANXPYT6cjs.useDecryptionWatchersStore.call(void 0, );
|
|
520
520
|
_react.useEffect.call(void 0, () => {
|
|
521
521
|
const txsWithDecryptionResults = minedTxsWithCiphertextsToWatch.filter(({ ciphertextToWatch }) => decryptionResults[ciphertextToWatch] !== void 0).map((item) => {
|
|
522
522
|
const decryptionResult = decryptionResults[item.ciphertextToWatch];
|
|
@@ -527,13 +527,13 @@ function useTrackDecryptingTransactionsBase({ onDecryptionResolve }) {
|
|
|
527
527
|
};
|
|
528
528
|
});
|
|
529
529
|
for (const { tx, decryptionResult, receipt, ciphertextToWatch } of txsWithDecryptionResults) {
|
|
530
|
-
|
|
530
|
+
_chunk6ANXPYT6cjs.useTransactionStore.getState().setTransactionDecryptionStatus(
|
|
531
531
|
tx.chainId,
|
|
532
532
|
tx.hash,
|
|
533
533
|
false
|
|
534
534
|
// no longer pending decryption
|
|
535
535
|
);
|
|
536
|
-
|
|
536
|
+
_chunk6ANXPYT6cjs.cofheLogger.log("Decryption completed for tx, invalidating relevant queries", {
|
|
537
537
|
tx,
|
|
538
538
|
decryptionResult,
|
|
539
539
|
receipt,
|
|
@@ -551,14 +551,14 @@ function useTrackDecryptingTransactionsBase({ onDecryptionResolve }) {
|
|
|
551
551
|
});
|
|
552
552
|
}
|
|
553
553
|
function useOnDecryptionCallback({ onDecryptionResolve }) {
|
|
554
|
-
const { byKey } =
|
|
554
|
+
const { byKey } = _chunk6ANXPYT6cjs.useDecryptionWatchersStore.call(void 0, );
|
|
555
555
|
const watchersWithObservedDecryption = _react.useMemo.call(void 0,
|
|
556
556
|
() => Object.values(byKey).filter((item) => item.decryptionObservedAt !== void 0),
|
|
557
557
|
[byKey]
|
|
558
558
|
);
|
|
559
|
-
|
|
559
|
+
_chunk6ANXPYT6cjs.cofheLogger.log("All observed decryptions:", watchersWithObservedDecryption);
|
|
560
560
|
const handleDecryptionResolve = _react.useCallback.call(void 0, async () => {
|
|
561
|
-
const transactionStore =
|
|
561
|
+
const transactionStore = _chunk6ANXPYT6cjs.useTransactionStore.getState().transactions;
|
|
562
562
|
for (const sch of watchersWithObservedDecryption) {
|
|
563
563
|
const tx = _optionalChain([transactionStore, 'access', _24 => _24[sch.chainId], 'optionalAccess', _25 => _25[sch.triggerTxHash]]);
|
|
564
564
|
onDecryptionResolve(tx, sch);
|
|
@@ -571,7 +571,7 @@ function useOnDecryptionCallback({ onDecryptionResolve }) {
|
|
|
571
571
|
}, [handleDecryptionResolve]);
|
|
572
572
|
_react.useEffect.call(void 0, () => {
|
|
573
573
|
if (watchersWithObservedDecryption.length > 0) {
|
|
574
|
-
|
|
574
|
+
_chunk6ANXPYT6cjs.cofheLogger.log("All observed decryption query keys subject to invalidate:", watchersWithObservedDecryption);
|
|
575
575
|
stableHandleDecryptionResolve.current();
|
|
576
576
|
}
|
|
577
577
|
}, [watchersWithObservedDecryption]);
|
|
@@ -596,10 +596,10 @@ function safeParseDecryptRequestLog(log, account) {
|
|
|
596
596
|
}
|
|
597
597
|
function useTrackDecryptingTransactions() {
|
|
598
598
|
const handleInvalidationsAfterDecryption = useHandleInvalidationsAfterDecryption();
|
|
599
|
-
const { onTransactionDecrypted } =
|
|
599
|
+
const { onTransactionDecrypted } = _chunk6ANXPYT6cjs.useTransactionGlobalLifecycle.call(void 0, );
|
|
600
600
|
useTrackDecryptingTransactionsBase({
|
|
601
601
|
onDecryptionResolve: async (decryptionCausingTx, decryptionWatcher) => {
|
|
602
|
-
|
|
602
|
+
_chunk6ANXPYT6cjs.cofheLogger.log("Decryption resolved for tx:", decryptionCausingTx, "with watcher:", decryptionWatcher);
|
|
603
603
|
handleInvalidationsAfterDecryption(decryptionCausingTx, decryptionWatcher);
|
|
604
604
|
onTransactionDecrypted(decryptionCausingTx, decryptionWatcher);
|
|
605
605
|
}
|
|
@@ -614,7 +614,7 @@ var STATUS_ID_PERMIT_EXPIRED = "permit-expired";
|
|
|
614
614
|
var STATUS_ID_PERMIT_EXPIRING_SOON = "permit-expiring-soon";
|
|
615
615
|
var STATUS_ID_PERMIT_SHARED = "permit-shared";
|
|
616
616
|
var showMissingPermitStatus = () => {
|
|
617
|
-
|
|
617
|
+
_chunk6ANXPYT6cjs.usePortalStatuses.getState().addStatus({
|
|
618
618
|
id: STATUS_ID_MISSING_PERMIT,
|
|
619
619
|
variant: "error",
|
|
620
620
|
title: "Missing permit",
|
|
@@ -622,17 +622,17 @@ var showMissingPermitStatus = () => {
|
|
|
622
622
|
action: {
|
|
623
623
|
label: "FIX",
|
|
624
624
|
onClick: () => {
|
|
625
|
-
|
|
626
|
-
|
|
625
|
+
_chunk6ANXPYT6cjs.usePortalUI.getState().openPortal();
|
|
626
|
+
_chunk6ANXPYT6cjs.usePortalNavigation.getState().replace("permits" /* Permits */);
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
629
|
});
|
|
630
630
|
};
|
|
631
631
|
var hideMissingPermitStatus = () => {
|
|
632
|
-
|
|
632
|
+
_chunk6ANXPYT6cjs.usePortalStatuses.getState().removeStatus(STATUS_ID_MISSING_PERMIT);
|
|
633
633
|
};
|
|
634
634
|
var showPermitExpiredStatus = () => {
|
|
635
|
-
|
|
635
|
+
_chunk6ANXPYT6cjs.usePortalStatuses.getState().addStatus({
|
|
636
636
|
id: STATUS_ID_PERMIT_EXPIRED,
|
|
637
637
|
variant: "error",
|
|
638
638
|
title: "Permit expired",
|
|
@@ -640,17 +640,17 @@ var showPermitExpiredStatus = () => {
|
|
|
640
640
|
action: {
|
|
641
641
|
label: "FIX",
|
|
642
642
|
onClick: () => {
|
|
643
|
-
|
|
644
|
-
|
|
643
|
+
_chunk6ANXPYT6cjs.usePortalUI.getState().openPortal();
|
|
644
|
+
_chunk6ANXPYT6cjs.usePortalNavigation.getState().replace("permits" /* Permits */);
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
647
|
});
|
|
648
648
|
};
|
|
649
649
|
var hidePermitExpiredStatus = () => {
|
|
650
|
-
|
|
650
|
+
_chunk6ANXPYT6cjs.usePortalStatuses.getState().removeStatus(STATUS_ID_PERMIT_EXPIRED);
|
|
651
651
|
};
|
|
652
652
|
var showPermitExpiringSoonStatus = (permit) => {
|
|
653
|
-
|
|
653
|
+
_chunk6ANXPYT6cjs.usePortalStatuses.getState().addStatus({
|
|
654
654
|
id: STATUS_ID_PERMIT_EXPIRING_SOON,
|
|
655
655
|
variant: "warning",
|
|
656
656
|
title: "Permit expiring soon",
|
|
@@ -658,37 +658,37 @@ var showPermitExpiringSoonStatus = (permit) => {
|
|
|
658
658
|
action: {
|
|
659
659
|
label: "FIX",
|
|
660
660
|
onClick: () => {
|
|
661
|
-
|
|
662
|
-
|
|
661
|
+
_chunk6ANXPYT6cjs.usePortalUI.getState().openPortal();
|
|
662
|
+
_chunk6ANXPYT6cjs.usePortalNavigation.getState().replace("permits" /* Permits */);
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
665
|
});
|
|
666
666
|
};
|
|
667
667
|
var hidePermitExpiringSoonStatus = () => {
|
|
668
|
-
|
|
668
|
+
_chunk6ANXPYT6cjs.usePortalStatuses.getState().removeStatus(STATUS_ID_PERMIT_EXPIRING_SOON);
|
|
669
669
|
};
|
|
670
670
|
var showPermitSharedStatus = (permit) => {
|
|
671
|
-
|
|
671
|
+
_chunk6ANXPYT6cjs.usePortalStatuses.getState().addStatus({
|
|
672
672
|
id: STATUS_ID_PERMIT_SHARED,
|
|
673
673
|
variant: "info",
|
|
674
674
|
title: "Imported permit active",
|
|
675
|
-
description: `Viewing ${
|
|
675
|
+
description: `Viewing ${_chunk6ANXPYT6cjs.truncateHash.call(void 0, permit.issuer, 4, 4)}'s data`
|
|
676
676
|
});
|
|
677
677
|
};
|
|
678
678
|
var hidePermitSharedStatus = () => {
|
|
679
|
-
|
|
679
|
+
_chunk6ANXPYT6cjs.usePortalStatuses.getState().removeStatus(STATUS_ID_PERMIT_SHARED);
|
|
680
680
|
};
|
|
681
681
|
var useWatchPermitStatus = () => {
|
|
682
682
|
const intervalRef = _react.useRef.call(void 0, null);
|
|
683
|
-
const activePermit =
|
|
684
|
-
const connected =
|
|
683
|
+
const activePermit = _chunk6ANXPYT6cjs.useCofheActivePermit.call(void 0, );
|
|
684
|
+
const connected = _chunk6ANXPYT6cjs.useCofheIsConnected.call(void 0, );
|
|
685
685
|
_react.useEffect.call(void 0, () => {
|
|
686
686
|
const updateStatuses = (permit) => {
|
|
687
|
-
const hasCreatedFirstPermit =
|
|
688
|
-
const missingPermitStatusShown =
|
|
689
|
-
const expiredStatusShown =
|
|
690
|
-
const expiringSoonStatusShown =
|
|
691
|
-
const sharedStatusShown =
|
|
687
|
+
const hasCreatedFirstPermit = _chunk6ANXPYT6cjs.usePortalPersisted.getState().hasCreatedFirstPermit;
|
|
688
|
+
const missingPermitStatusShown = _chunk6ANXPYT6cjs.usePortalStatuses.getState().hasStatus(STATUS_ID_MISSING_PERMIT);
|
|
689
|
+
const expiredStatusShown = _chunk6ANXPYT6cjs.usePortalStatuses.getState().hasStatus(STATUS_ID_PERMIT_EXPIRED);
|
|
690
|
+
const expiringSoonStatusShown = _chunk6ANXPYT6cjs.usePortalStatuses.getState().hasStatus(STATUS_ID_PERMIT_EXPIRING_SOON);
|
|
691
|
+
const sharedStatusShown = _chunk6ANXPYT6cjs.usePortalStatuses.getState().hasStatus(STATUS_ID_PERMIT_SHARED);
|
|
692
692
|
if (permit == null) {
|
|
693
693
|
if (hasCreatedFirstPermit && !missingPermitStatusShown && connected) {
|
|
694
694
|
showMissingPermitStatus();
|
|
@@ -748,10 +748,10 @@ var useWatchPermitStatus = () => {
|
|
|
748
748
|
|
|
749
749
|
// src/hooks/useCofheClaimableTokens.ts
|
|
750
750
|
function useCofheClaimableTokens() {
|
|
751
|
-
const account =
|
|
752
|
-
const chainId =
|
|
753
|
-
const allTokens =
|
|
754
|
-
const result =
|
|
751
|
+
const account = _chunk6ANXPYT6cjs.useCofheAccount.call(void 0, );
|
|
752
|
+
const chainId = _chunk6ANXPYT6cjs.useCofheChainId.call(void 0, );
|
|
753
|
+
const allTokens = _chunk6ANXPYT6cjs.useCofheTokens.call(void 0, chainId);
|
|
754
|
+
const result = _chunk6ANXPYT6cjs.useCofheTokensClaimable.call(void 0, {
|
|
755
755
|
accountAddress: account,
|
|
756
756
|
tokens: allTokens
|
|
757
757
|
});
|
|
@@ -761,7 +761,7 @@ function useCofheClaimableTokens() {
|
|
|
761
761
|
// src/hooks/useWatchClaimablesStatus.ts
|
|
762
762
|
var CLAIMS_AVAILABLE_STATUS_ID = "claims-available";
|
|
763
763
|
var showClaimsAvailableStatus = ({ onClick }) => {
|
|
764
|
-
|
|
764
|
+
_chunk6ANXPYT6cjs.usePortalStatuses.getState().addStatus({
|
|
765
765
|
id: CLAIMS_AVAILABLE_STATUS_ID,
|
|
766
766
|
variant: "info",
|
|
767
767
|
title: "",
|
|
@@ -774,14 +774,14 @@ var showClaimsAvailableStatus = ({ onClick }) => {
|
|
|
774
774
|
});
|
|
775
775
|
};
|
|
776
776
|
var hideClaimsAvailableStatus = () => {
|
|
777
|
-
|
|
777
|
+
_chunk6ANXPYT6cjs.usePortalStatuses.getState().removeStatus(CLAIMS_AVAILABLE_STATUS_ID);
|
|
778
778
|
};
|
|
779
779
|
var useWatchClaimablesStatus = () => {
|
|
780
780
|
const { totalTokensClaimable } = useCofheClaimableTokens();
|
|
781
|
-
const { navigateTo } =
|
|
782
|
-
const { openPortal } =
|
|
781
|
+
const { navigateTo } = _chunk6ANXPYT6cjs.usePortalNavigation.call(void 0, );
|
|
782
|
+
const { openPortal } = _chunk6ANXPYT6cjs.usePortalUI.call(void 0, );
|
|
783
783
|
_react.useEffect.call(void 0, () => {
|
|
784
|
-
const claimsAvailableStatusShown =
|
|
784
|
+
const claimsAvailableStatusShown = _chunk6ANXPYT6cjs.usePortalStatuses.getState().hasStatus(CLAIMS_AVAILABLE_STATUS_ID);
|
|
785
785
|
if (totalTokensClaimable > 0 && !claimsAvailableStatusShown) {
|
|
786
786
|
showClaimsAvailableStatus({
|
|
787
787
|
onClick: () => {
|
|
@@ -800,7 +800,7 @@ var useWatchClaimablesStatus = () => {
|
|
|
800
800
|
|
|
801
801
|
var CofheFloatingButtonContext = _react.createContext.call(void 0, null);
|
|
802
802
|
var CofheFloatingButtonProvider = ({ children }) => {
|
|
803
|
-
const { state } =
|
|
803
|
+
const { state } = _chunk6ANXPYT6cjs.useCofheContext.call(void 0, );
|
|
804
804
|
const theme = state.theme;
|
|
805
805
|
const effectivePosition = state.position;
|
|
806
806
|
const isLeftSide = effectivePosition.includes("left");
|
|
@@ -842,7 +842,7 @@ var FhenixLogoIcon = ({ theme, className }) => {
|
|
|
842
842
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
843
843
|
"img",
|
|
844
844
|
{
|
|
845
|
-
className:
|
|
845
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0, "w-10 h-10", className),
|
|
846
846
|
src: theme === "dark" ? fhenix_icon_white_default : fhenix_icon_black_default,
|
|
847
847
|
alt: "Fhenix Logo Icon"
|
|
848
848
|
}
|
|
@@ -858,14 +858,14 @@ var statusVariantStyles = {
|
|
|
858
858
|
};
|
|
859
859
|
var FloatingButtonComponent = ({ onClick }) => {
|
|
860
860
|
const { theme } = useCofheFloatingButtonContext();
|
|
861
|
-
const { statuses } =
|
|
862
|
-
const { portalOpen } =
|
|
861
|
+
const { statuses } = _chunk6ANXPYT6cjs.usePortalStatuses.call(void 0, );
|
|
862
|
+
const { portalOpen } = _chunk6ANXPYT6cjs.usePortalUI.call(void 0, );
|
|
863
863
|
const topStatusVariant = _optionalChain([statuses, 'access', _40 => _40[statuses.length - 1], 'optionalAccess', _41 => _41.variant]);
|
|
864
864
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
865
865
|
"button",
|
|
866
866
|
{
|
|
867
867
|
onClick,
|
|
868
|
-
className:
|
|
868
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
869
869
|
"cofhe-panel cofhe-floating-icon",
|
|
870
870
|
"w-12 h-12",
|
|
871
871
|
"flex items-center justify-center cursor-pointer flex-shrink-0",
|
|
@@ -886,8 +886,8 @@ var _react3 = require('motion/react');
|
|
|
886
886
|
|
|
887
887
|
var StatusBarSection = ({ children }) => {
|
|
888
888
|
const { isLeftSide } = useCofheFloatingButtonContext();
|
|
889
|
-
const { statuses } =
|
|
890
|
-
const { statusPanelOpen } =
|
|
889
|
+
const { statuses } = _chunk6ANXPYT6cjs.usePortalStatuses.call(void 0, );
|
|
890
|
+
const { statusPanelOpen } = _chunk6ANXPYT6cjs.usePortalUI.call(void 0, );
|
|
891
891
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react3.AnimatePresence, { children: (statusPanelOpen || statuses.length > 0) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
892
892
|
_react3.motion.div,
|
|
893
893
|
{
|
|
@@ -935,7 +935,7 @@ var AnimatedZStackItem = ({
|
|
|
935
935
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
936
936
|
_react3.motion.div,
|
|
937
937
|
{
|
|
938
|
-
className:
|
|
938
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0, "w-full h-full absolute origin-top", invIndex === 0 && "events-none", className),
|
|
939
939
|
initial: entryStyle,
|
|
940
940
|
exit: entryStyle,
|
|
941
941
|
animate: animStyle,
|
|
@@ -968,8 +968,8 @@ var AnimatedZStack = ({
|
|
|
968
968
|
|
|
969
969
|
var ConnectionStatus = () => {
|
|
970
970
|
const { theme } = useCofheFloatingButtonContext();
|
|
971
|
-
const { navigateTo } =
|
|
972
|
-
const { connected } =
|
|
971
|
+
const { navigateTo } = _chunk6ANXPYT6cjs.usePortalNavigation.call(void 0, );
|
|
972
|
+
const { connected } = _chunk6ANXPYT6cjs.useCofheConnection.call(void 0, );
|
|
973
973
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "cofhe-panel w-full h-full flex px-4 items-center justify-between", children: [
|
|
974
974
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, FhenixLogoIcon, { theme, className: "w-10 h-10" }),
|
|
975
975
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex items-center gap-1 ml-auto mr-2", children: connected ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
@@ -983,7 +983,7 @@ var ConnectionStatus = () => {
|
|
|
983
983
|
"button",
|
|
984
984
|
{
|
|
985
985
|
onClick: () => navigateTo("settings" /* Settings */),
|
|
986
|
-
className:
|
|
986
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0, "p-1 rounded cofhe-hover-overlay transition-colors", "cofhe-text-primary"),
|
|
987
987
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _md.MdOutlineSettings, { className: "w-4 h-4" })
|
|
988
988
|
}
|
|
989
989
|
)
|
|
@@ -1004,21 +1004,21 @@ var ActiveStatusContent = ({ status }) => {
|
|
|
1004
1004
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1005
1005
|
"div",
|
|
1006
1006
|
{
|
|
1007
|
-
className:
|
|
1007
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1008
1008
|
"cofhe-panel w-full h-full flex px-4 items-center justify-between",
|
|
1009
1009
|
statusBorderColorMap[status.variant]
|
|
1010
1010
|
),
|
|
1011
1011
|
children: [
|
|
1012
1012
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, FhenixLogoIcon, { theme, className: "w-10 h-10" }),
|
|
1013
1013
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col ml-2 mr-auto", children: [
|
|
1014
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className:
|
|
1015
|
-
status.description != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className:
|
|
1014
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: _chunk6ANXPYT6cjs.cn.call(void 0, "text-sm font-medium", statusTextColorMap[status.variant]), children: status.title }),
|
|
1015
|
+
status.description != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: _chunk6ANXPYT6cjs.cn.call(void 0, "text-xs", statusTextColorMap[status.variant]), children: status.description })
|
|
1016
1016
|
] }),
|
|
1017
1017
|
status.action != null && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1018
1018
|
"button",
|
|
1019
1019
|
{
|
|
1020
1020
|
onClick: _optionalChain([status, 'access', _42 => _42.action, 'optionalAccess', _43 => _43.onClick]),
|
|
1021
|
-
className:
|
|
1021
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0, "p-1 rounded cofhe-hover-overlay transition-colors", "cofhe-text-primary"),
|
|
1022
1022
|
children: status.action.label
|
|
1023
1023
|
}
|
|
1024
1024
|
)
|
|
@@ -1053,7 +1053,7 @@ function sortStatuses(a, b) {
|
|
|
1053
1053
|
return aIndex - bIndex;
|
|
1054
1054
|
}
|
|
1055
1055
|
var StatusBarContent = () => {
|
|
1056
|
-
const { statuses } =
|
|
1056
|
+
const { statuses } = _chunk6ANXPYT6cjs.usePortalStatuses.call(void 0, );
|
|
1057
1057
|
const sortedStatuses = _react.useMemo.call(void 0, () => statuses.sort(sortStatuses), [statuses]);
|
|
1058
1058
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, AnimatedZStack, { children: [
|
|
1059
1059
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ConnectionStatus, {}),
|
|
@@ -1080,16 +1080,16 @@ var AddressButton = ({ address, className, icon, showCopyIcon = true }) => {
|
|
|
1080
1080
|
setCopied(true);
|
|
1081
1081
|
setTimeout(() => setCopied(false), 2e3);
|
|
1082
1082
|
} catch (err) {
|
|
1083
|
-
|
|
1083
|
+
_chunk6ANXPYT6cjs.cofheLogger.error("Failed to copy address:", err);
|
|
1084
1084
|
}
|
|
1085
1085
|
};
|
|
1086
|
-
const truncatedAddress =
|
|
1086
|
+
const truncatedAddress = _chunk6ANXPYT6cjs.truncateAddress.call(void 0, address) || "Not connected";
|
|
1087
1087
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1088
1088
|
"button",
|
|
1089
1089
|
{
|
|
1090
1090
|
onClick: handleCopyAddress,
|
|
1091
1091
|
disabled: !address,
|
|
1092
|
-
className:
|
|
1092
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1093
1093
|
"flex items-center gap-2 px-2 py-1 rounded cofhe-hover-overlay transition-colors",
|
|
1094
1094
|
"cofhe-text-primary text-sm",
|
|
1095
1095
|
className
|
|
@@ -1133,21 +1133,21 @@ var chainIcons = {
|
|
|
1133
1133
|
var ChainIcon = ({ chainId, className }) => {
|
|
1134
1134
|
const Icon = chainId ? chainIcons[chainId] : void 0;
|
|
1135
1135
|
if (Icon) {
|
|
1136
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Icon, { className:
|
|
1136
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Icon, { className: _chunk6ANXPYT6cjs.cn.call(void 0, "w-4 h-4 flex-shrink-0", className) });
|
|
1137
1137
|
}
|
|
1138
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className:
|
|
1138
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunk6ANXPYT6cjs.cn.call(void 0, "w-4 h-4 rounded-full cofhe-icon-bg flex items-center justify-center flex-shrink-0", className), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-[8px]", children: "\u27E0" }) });
|
|
1139
1139
|
};
|
|
1140
1140
|
|
|
1141
1141
|
// src/components/CofheFloatingButton/components/ConnectedChainIndicator.tsx
|
|
1142
1142
|
|
|
1143
1143
|
var ConnectedChainIndicator = () => {
|
|
1144
|
-
const chainId =
|
|
1144
|
+
const chainId = _chunk6ANXPYT6cjs.useCofheChainId.call(void 0, );
|
|
1145
1145
|
const chain = chainId ? _chains.getChainById.call(void 0, chainId) : void 0;
|
|
1146
1146
|
const currentNetwork = _optionalChain([chain, 'optionalAccess', _44 => _44.name]) || "Eth";
|
|
1147
1147
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1148
1148
|
"div",
|
|
1149
1149
|
{
|
|
1150
|
-
className:
|
|
1150
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1151
1151
|
"flex items-center gap-1 px-2 py-1 rounded cofhe-hover-overlay transition-colors",
|
|
1152
1152
|
"cofhe-text-primary text-sm outline-none border cofhe-dropdown-border",
|
|
1153
1153
|
"disabled:opacity-50 disabled:cursor-not-allowed"
|
|
@@ -1163,7 +1163,7 @@ var ConnectedChainIndicator = () => {
|
|
|
1163
1163
|
// src/components/CofheFloatingButton/pages/MainPage/WalletHeader.tsx
|
|
1164
1164
|
|
|
1165
1165
|
var WalletHeader = () => {
|
|
1166
|
-
const walletAddress =
|
|
1166
|
+
const walletAddress = _chunk6ANXPYT6cjs.useCofheAccount.call(void 0, );
|
|
1167
1167
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between", children: [
|
|
1168
1168
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, AddressButton, { address: walletAddress, icon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _md.MdOutlineAccountBalanceWallet, { className: "w-4 h-4" }) }),
|
|
1169
1169
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex items-center gap-2", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ConnectedChainIndicator, {}) })
|
|
@@ -1195,7 +1195,7 @@ var TokenIcon = ({
|
|
|
1195
1195
|
_react.useEffect.call(void 0, () => {
|
|
1196
1196
|
setIconError(false);
|
|
1197
1197
|
}, [logoURI]);
|
|
1198
|
-
const containerClassName = className ||
|
|
1198
|
+
const containerClassName = className || _chunk6ANXPYT6cjs.cn.call(void 0, sizeClasses[size], "rounded-full cofhe-icon-bg flex items-center justify-center flex-shrink-0 overflow-hidden");
|
|
1199
1199
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: containerClassName, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1200
1200
|
"img",
|
|
1201
1201
|
{
|
|
@@ -1219,7 +1219,7 @@ var LoadingDots = ({ size = "md", className, variant = "primary" }) => {
|
|
|
1219
1219
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1220
1220
|
"span",
|
|
1221
1221
|
{
|
|
1222
|
-
className:
|
|
1222
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1223
1223
|
"cofhe-loading-dots",
|
|
1224
1224
|
sizeClasses2[size],
|
|
1225
1225
|
variant === "primary" ? "cofhe-text-primary" : "opacity-70",
|
|
@@ -1250,13 +1250,13 @@ var TokenBalanceView = ({
|
|
|
1250
1250
|
isFetching,
|
|
1251
1251
|
hidden
|
|
1252
1252
|
}) => {
|
|
1253
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className:
|
|
1253
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: _chunk6ANXPYT6cjs.cn.call(void 0, sizeClasses3[size], "font-medium cofhe-text-primary", className), children: [
|
|
1254
1254
|
hidden ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ConfidentialValuePlaceholder, {}) : isFetching ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, LoadingDots, { size }) : formattedBalance,
|
|
1255
1255
|
symbol && ` ${symbol}`
|
|
1256
1256
|
] });
|
|
1257
1257
|
};
|
|
1258
1258
|
var ConfidentialValuePlaceholder = () => {
|
|
1259
|
-
const navigateToGeneratePermit =
|
|
1259
|
+
const navigateToGeneratePermit = _chunk6ANXPYT6cjs.useCofheNavigateToCreatePermit.call(void 0, );
|
|
1260
1260
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1261
1261
|
"span",
|
|
1262
1262
|
{
|
|
@@ -1283,13 +1283,13 @@ var CofheTokenConfidentialBalance = ({
|
|
|
1283
1283
|
className,
|
|
1284
1284
|
size = "md"
|
|
1285
1285
|
}) => {
|
|
1286
|
-
const account =
|
|
1286
|
+
const account = _chunk6ANXPYT6cjs.useCofheAccount.call(void 0, );
|
|
1287
1287
|
const effectiveAccountAddress = _nullishCoalesce(accountAddress, () => ( account));
|
|
1288
1288
|
const {
|
|
1289
1289
|
data: { formatted: confidentialBalanceFormatted } = {},
|
|
1290
1290
|
isFetching: isFetchingConfidential,
|
|
1291
1291
|
disabledDueToMissingValidPermit
|
|
1292
|
-
} =
|
|
1292
|
+
} = _chunk6ANXPYT6cjs.useCofheTokenDecryptedBalance.call(void 0, {
|
|
1293
1293
|
token,
|
|
1294
1294
|
accountAddress: effectiveAccountAddress,
|
|
1295
1295
|
displayDecimals: decimalPrecision
|
|
@@ -1314,9 +1314,9 @@ var CofheTokenPublicBalance = ({
|
|
|
1314
1314
|
className,
|
|
1315
1315
|
size = "md"
|
|
1316
1316
|
}) => {
|
|
1317
|
-
const account =
|
|
1317
|
+
const account = _chunk6ANXPYT6cjs.useCofheAccount.call(void 0, );
|
|
1318
1318
|
const effectiveAccountAddress = _nullishCoalesce(accountAddress, () => ( account));
|
|
1319
|
-
const { data: { formatted: publicBalanceFormatted } = {}, isFetching: isFetchingPublic } =
|
|
1319
|
+
const { data: { formatted: publicBalanceFormatted } = {}, isFetching: isFetchingPublic } = _chunk6ANXPYT6cjs.useCofheTokenPublicBalance.call(void 0,
|
|
1320
1320
|
{ token, accountAddress: effectiveAccountAddress, displayDecimals: decimalPrecision }
|
|
1321
1321
|
);
|
|
1322
1322
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1333,8 +1333,8 @@ var CofheTokenPublicBalance = ({
|
|
|
1333
1333
|
|
|
1334
1334
|
// src/hooks/useCofhePinnedTokenAddress.ts
|
|
1335
1335
|
function useCofhePinnedTokenAddress() {
|
|
1336
|
-
const widgetConfig =
|
|
1337
|
-
const chainId =
|
|
1336
|
+
const widgetConfig = _chunk6ANXPYT6cjs.useCofheContext.call(void 0, ).client.config.react;
|
|
1337
|
+
const chainId = _chunk6ANXPYT6cjs.useCofheChainId.call(void 0, );
|
|
1338
1338
|
const pinnedTokenAddress = chainId ? _optionalChain([widgetConfig, 'access', _47 => _47.pinnedTokens, 'optionalAccess', _48 => _48[_optionalChain([chainId, 'optionalAccess', _49 => _49.toString, 'call', _50 => _50()])]]) : void 0;
|
|
1339
1339
|
return pinnedTokenAddress;
|
|
1340
1340
|
}
|
|
@@ -1342,7 +1342,7 @@ function useCofhePinnedTokenAddress() {
|
|
|
1342
1342
|
// src/hooks/useCofhePinnedToken.ts
|
|
1343
1343
|
function useCofhePinnedToken({ enabled } = {}) {
|
|
1344
1344
|
const pinnedTokenAddress = useCofhePinnedTokenAddress();
|
|
1345
|
-
const token =
|
|
1345
|
+
const token = _chunk6ANXPYT6cjs.useCofheToken.call(void 0,
|
|
1346
1346
|
{
|
|
1347
1347
|
address: pinnedTokenAddress
|
|
1348
1348
|
},
|
|
@@ -1357,18 +1357,18 @@ function useCofhePinnedToken({ enabled } = {}) {
|
|
|
1357
1357
|
// src/components/CofheFloatingButton/pages/MainPage/AssetCard.tsx
|
|
1358
1358
|
|
|
1359
1359
|
var AssetCard = () => {
|
|
1360
|
-
const { navigateTo } =
|
|
1361
|
-
const { connected } =
|
|
1360
|
+
const { navigateTo } = _chunk6ANXPYT6cjs.usePortalNavigation.call(void 0, );
|
|
1361
|
+
const { connected } = _chunk6ANXPYT6cjs.useCofheConnection.call(void 0, );
|
|
1362
1362
|
const {
|
|
1363
1363
|
client: {
|
|
1364
1364
|
config: {
|
|
1365
1365
|
react: { projectName }
|
|
1366
1366
|
}
|
|
1367
1367
|
}
|
|
1368
|
-
} =
|
|
1368
|
+
} = _chunk6ANXPYT6cjs.useCofheContext.call(void 0, );
|
|
1369
1369
|
const pinnedToken = useCofhePinnedToken();
|
|
1370
|
-
const chainId =
|
|
1371
|
-
const fallbackToken = chainId ?
|
|
1370
|
+
const chainId = _chunk6ANXPYT6cjs.useCofheChainId.call(void 0, );
|
|
1371
|
+
const fallbackToken = chainId ? _chunk6ANXPYT6cjs.DEFAULT_TOKEN_BY_CHAIN_ID[chainId] : void 0;
|
|
1372
1372
|
const token = _nullishCoalesce(pinnedToken, () => ( fallbackToken));
|
|
1373
1373
|
const projectLabel = projectName ? `"${projectName}"` : "this app";
|
|
1374
1374
|
if (!connected) {
|
|
@@ -1395,7 +1395,7 @@ var AssetCard = () => {
|
|
|
1395
1395
|
"div",
|
|
1396
1396
|
{
|
|
1397
1397
|
onClick: handleClick,
|
|
1398
|
-
className:
|
|
1398
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1399
1399
|
"cofhe-card-bg p-4 cursor-pointer",
|
|
1400
1400
|
"hover:opacity-90 transition-opacity",
|
|
1401
1401
|
"border cofhe-card-border"
|
|
@@ -1429,7 +1429,7 @@ var _go = require('react-icons/go');
|
|
|
1429
1429
|
var _ai = require('react-icons/ai');
|
|
1430
1430
|
var _tb = require('react-icons/tb');
|
|
1431
1431
|
var _fa = require('react-icons/fa');
|
|
1432
|
-
var import_ts_essentials3 =
|
|
1432
|
+
var import_ts_essentials3 = _chunk6ANXPYT6cjs.__toESM.call(void 0, _chunk6ANXPYT6cjs.require_dist.call(void 0, ), 1);
|
|
1433
1433
|
|
|
1434
1434
|
// src/components/CofheFloatingButton/components/ActionButton.tsx
|
|
1435
1435
|
|
|
@@ -1447,7 +1447,7 @@ var ActionButton = ({
|
|
|
1447
1447
|
{
|
|
1448
1448
|
onClick,
|
|
1449
1449
|
disabled,
|
|
1450
|
-
className:
|
|
1450
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1451
1451
|
"w-full font-medium flex items-center justify-center gap-1",
|
|
1452
1452
|
variant === "tab" ? "py-2 px-2 text-sm" : "py-1.5 px-2 text-xs",
|
|
1453
1453
|
"cofhe-nav-button",
|
|
@@ -1480,7 +1480,7 @@ var AmountInput = ({
|
|
|
1480
1480
|
type: "text",
|
|
1481
1481
|
inputMode: "decimal",
|
|
1482
1482
|
value,
|
|
1483
|
-
onChange: (e) => onChange(
|
|
1483
|
+
onChange: (e) => onChange(_chunk6ANXPYT6cjs.sanitizeNumericInput.call(void 0, e.target.value)),
|
|
1484
1484
|
placeholder,
|
|
1485
1485
|
className: "flex-1 min-w-0 bg-transparent text-sm font-medium cofhe-text-primary outline-none placeholder:opacity-50 text-center border-b cofhe-card-border pb-1"
|
|
1486
1486
|
}
|
|
@@ -1504,7 +1504,7 @@ var Button = ({
|
|
|
1504
1504
|
}) => {
|
|
1505
1505
|
const content = _nullishCoalesce(label, () => ( children));
|
|
1506
1506
|
const isVertical = iconPosition === "top";
|
|
1507
|
-
const baseClasses =
|
|
1507
|
+
const baseClasses = _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1508
1508
|
"inline-flex items-center justify-center",
|
|
1509
1509
|
isVertical && "flex-col",
|
|
1510
1510
|
"font-medium",
|
|
@@ -1520,18 +1520,18 @@ var Button = ({
|
|
|
1520
1520
|
// xl: isVertical ? 'px-6 py-3 text-base gap-2' : 'px-6 py-3 text-base gap-2.5',
|
|
1521
1521
|
};
|
|
1522
1522
|
const variantClassesLight = {
|
|
1523
|
-
primary:
|
|
1524
|
-
default:
|
|
1523
|
+
primary: _chunk6ANXPYT6cjs.cn.call(void 0, "bg-[#80E6E6] hover:bg-[#6DD5D5]", "text-[#003366]", "border-[#666666]", "focus:ring-[#80E6E6]"),
|
|
1524
|
+
default: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1525
1525
|
"bg-white hover:bg-[#6DD5D5]",
|
|
1526
1526
|
"text-[#003366]",
|
|
1527
1527
|
"border-[#666666]",
|
|
1528
1528
|
"hover:border-[#4A4A4A]",
|
|
1529
1529
|
"focus:ring-gray-300"
|
|
1530
1530
|
),
|
|
1531
|
-
error:
|
|
1532
|
-
warning:
|
|
1533
|
-
ghost:
|
|
1534
|
-
outline:
|
|
1531
|
+
error: _chunk6ANXPYT6cjs.cn.call(void 0, "bg-[#FFB399] hover:bg-[#FF9F80]", "text-[#003366]", "border-[#666666]", "focus:ring-[#FFB399]"),
|
|
1532
|
+
warning: _chunk6ANXPYT6cjs.cn.call(void 0, "bg-[#FFD699] hover:bg-[#FFC966]", "text-[#003366]", "border-[#666666]", "focus:ring-[#FFD699]"),
|
|
1533
|
+
ghost: _chunk6ANXPYT6cjs.cn.call(void 0, "bg-transparent hover:bg-gray-100", "text-[#003366]", "border-transparent", "focus:ring-gray-300"),
|
|
1534
|
+
outline: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1535
1535
|
"bg-white hover:bg-gray-50",
|
|
1536
1536
|
"text-[#003366]",
|
|
1537
1537
|
"border-[#666666]",
|
|
@@ -1540,38 +1540,38 @@ var Button = ({
|
|
|
1540
1540
|
)
|
|
1541
1541
|
};
|
|
1542
1542
|
const variantClassesDark = {
|
|
1543
|
-
primary:
|
|
1543
|
+
primary: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1544
1544
|
"dark:bg-[#2E9D9D] dark:hover:bg-[#268585]",
|
|
1545
1545
|
"dark:text-white",
|
|
1546
1546
|
"dark:border-[##858585]",
|
|
1547
1547
|
"dark:focus:ring-[#2E9D9D]"
|
|
1548
1548
|
),
|
|
1549
|
-
default:
|
|
1549
|
+
default: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1550
1550
|
"dark:bg-[#595959] dark:hover:bg-[#268585]",
|
|
1551
1551
|
"dark:text-white",
|
|
1552
1552
|
"dark:border-[##858585]",
|
|
1553
1553
|
"dark:hover:border-[#9E9E9E]",
|
|
1554
1554
|
"dark:focus:ring-gray-600"
|
|
1555
1555
|
),
|
|
1556
|
-
error:
|
|
1556
|
+
error: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1557
1557
|
"dark:bg-[#D9532E] dark:hover:bg-[#C0441F]",
|
|
1558
1558
|
"dark:text-white",
|
|
1559
1559
|
"dark:border-[##858585]",
|
|
1560
1560
|
"dark:focus:ring-[#D9532E]"
|
|
1561
1561
|
),
|
|
1562
|
-
warning:
|
|
1562
|
+
warning: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1563
1563
|
"dark:bg-[#E67E22] dark:hover:bg-[#D35400]",
|
|
1564
1564
|
"dark:text-white",
|
|
1565
1565
|
"dark:border-[##858585]",
|
|
1566
1566
|
"dark:focus:ring-[#E67E22]"
|
|
1567
1567
|
),
|
|
1568
|
-
ghost:
|
|
1568
|
+
ghost: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1569
1569
|
"dark:bg-transparent dark:hover:bg-[#374151]",
|
|
1570
1570
|
"dark:text-white",
|
|
1571
1571
|
"dark:border-transparent",
|
|
1572
1572
|
"dark:focus:ring-gray-600"
|
|
1573
1573
|
),
|
|
1574
|
-
outline:
|
|
1574
|
+
outline: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1575
1575
|
"dark:bg-[#595959] dark:hover:bg-[#4A4A4A]",
|
|
1576
1576
|
"dark:text-white",
|
|
1577
1577
|
"dark:border-[##858585]",
|
|
@@ -1579,7 +1579,7 @@ var Button = ({
|
|
|
1579
1579
|
"dark:focus:ring-gray-600"
|
|
1580
1580
|
)
|
|
1581
1581
|
};
|
|
1582
|
-
const buttonClasses =
|
|
1582
|
+
const buttonClasses = _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1583
1583
|
baseClasses,
|
|
1584
1584
|
sizeClasses4[size],
|
|
1585
1585
|
variantClassesLight[variant],
|
|
@@ -1649,7 +1649,7 @@ var TokenPriceChart = ({ points, className, height = 150 }) => {
|
|
|
1649
1649
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1650
1650
|
"div",
|
|
1651
1651
|
{
|
|
1652
|
-
className:
|
|
1652
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1653
1653
|
"w-full",
|
|
1654
1654
|
// Tailwind-driven theming for Recharts (SVG) using `currentColor` + nested selectors
|
|
1655
1655
|
themeClasses.accent,
|
|
@@ -1695,7 +1695,7 @@ var TokenPriceChart = ({ points, className, height = 150 }) => {
|
|
|
1695
1695
|
|
|
1696
1696
|
|
|
1697
1697
|
var PageContainer = ({ isModal, header, content, footer }) => {
|
|
1698
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
1698
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunk6ANXPYT6cjs.cn.call(void 0, "flex flex-col max-h-[500px] w-full gap-4", isModal ? "" : "h-full"), children: [
|
|
1699
1699
|
header && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-shrink-0", children: header }),
|
|
1700
1700
|
content && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-1 min-h-0 overflow-y-auto", children: content }),
|
|
1701
1701
|
footer && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-shrink-0", children: footer })
|
|
@@ -1730,7 +1730,7 @@ var TransactionItem = ({ transaction }) => {
|
|
|
1730
1730
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-8 h-8 rounded-full cofhe-icon-bg flex items-center justify-center flex-shrink-0 cofhe-text-primary", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ActionIcon, { actionType: transaction.actionType }) }),
|
|
1731
1731
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex-1 min-w-0", children: [
|
|
1732
1732
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between gap-2", children: [
|
|
1733
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-semibold cofhe-text-primary", children:
|
|
1733
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-semibold cofhe-text-primary", children: _chunk6ANXPYT6cjs.actionToString.call(void 0, transaction.actionType) }),
|
|
1734
1734
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "text-sm font-semibold cofhe-text-primary", children: [
|
|
1735
1735
|
_viem.formatUnits.call(void 0, transaction.tokenAmount, transaction.token.decimals),
|
|
1736
1736
|
" ",
|
|
@@ -1738,10 +1738,10 @@ var TransactionItem = ({ transaction }) => {
|
|
|
1738
1738
|
] })
|
|
1739
1739
|
] }),
|
|
1740
1740
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between gap-2 mt-1", children: [
|
|
1741
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className:
|
|
1742
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs cofhe-text-primary opacity-60", children:
|
|
1741
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: _chunk6ANXPYT6cjs.cn.call(void 0, "text-xs font-medium", statusColorClass), children: _chunk6ANXPYT6cjs.statusToString.call(void 0, transaction.status) }),
|
|
1742
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs cofhe-text-primary opacity-60", children: _chunk6ANXPYT6cjs.formatRelativeTime.call(void 0, transaction.timestamp) })
|
|
1743
1743
|
] }),
|
|
1744
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-1", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1744
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-1", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6ANXPYT6cjs.HashLink, { type: "tx", hash: transaction.hash, chainId: transaction.chainId, copyable: true }) })
|
|
1745
1745
|
] })
|
|
1746
1746
|
] }) });
|
|
1747
1747
|
};
|
|
@@ -1771,7 +1771,7 @@ var ShieldIcon = () => {
|
|
|
1771
1771
|
badgeText && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1772
1772
|
"span",
|
|
1773
1773
|
{
|
|
1774
|
-
className:
|
|
1774
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
1775
1775
|
"pointer-events-none",
|
|
1776
1776
|
"absolute top-0 right-0",
|
|
1777
1777
|
"translate-x-[35%] -translate-y-[35%]",
|
|
@@ -1817,11 +1817,11 @@ var debugNavItem = {
|
|
|
1817
1817
|
};
|
|
1818
1818
|
var navItems = [...baseNavItems, ...!isProduction() ? [debugNavItem] : []];
|
|
1819
1819
|
var BottomNavigation = () => {
|
|
1820
|
-
const { navigateTo } =
|
|
1821
|
-
const { openPortal } =
|
|
1820
|
+
const { navigateTo } = _chunk6ANXPYT6cjs.usePortalNavigation.call(void 0, );
|
|
1821
|
+
const { openPortal } = _chunk6ANXPYT6cjs.usePortalUI.call(void 0, );
|
|
1822
1822
|
const pinnedToken = useCofhePinnedToken();
|
|
1823
|
-
const chainId =
|
|
1824
|
-
const fallbackToken = chainId ?
|
|
1823
|
+
const chainId = _chunk6ANXPYT6cjs.useCofheChainId.call(void 0, );
|
|
1824
|
+
const fallbackToken = chainId ? _chunk6ANXPYT6cjs.DEFAULT_TOKEN_BY_CHAIN_ID[chainId] : void 0;
|
|
1825
1825
|
const defaultToken = _nullishCoalesce(pinnedToken, () => ( fallbackToken));
|
|
1826
1826
|
const handleNavClick = (page) => {
|
|
1827
1827
|
openPortal();
|
|
@@ -1857,7 +1857,7 @@ var BottomNavigation = () => {
|
|
|
1857
1857
|
// src/components/CofheFloatingButton/pages/MainPage.tsx
|
|
1858
1858
|
|
|
1859
1859
|
var MainPage = () => {
|
|
1860
|
-
const { connected } =
|
|
1860
|
+
const { connected } = _chunk6ANXPYT6cjs.useCofheConnection.call(void 0, );
|
|
1861
1861
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1862
1862
|
PageContainer,
|
|
1863
1863
|
{
|
|
@@ -1895,7 +1895,7 @@ var useSettingsStore = _zustand.create.call(void 0, )(
|
|
|
1895
1895
|
// src/components/CofheFloatingButton/pages/SettingsPage.tsx
|
|
1896
1896
|
|
|
1897
1897
|
var SettingsPage = () => {
|
|
1898
|
-
const { navigateBack } =
|
|
1898
|
+
const { navigateBack } = _chunk6ANXPYT6cjs.usePortalNavigation.call(void 0, );
|
|
1899
1899
|
const { shieldPageVariant, setShieldPageVariant } = useSettingsStore();
|
|
1900
1900
|
const variants = Object.values(ShieldPageVariant);
|
|
1901
1901
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -1977,7 +1977,7 @@ var AccordionSection = ({
|
|
|
1977
1977
|
Button,
|
|
1978
1978
|
{
|
|
1979
1979
|
variant: "ghost",
|
|
1980
|
-
className:
|
|
1980
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0, "!justify-start flex-1 text-md py-2", triggerClassName),
|
|
1981
1981
|
"aria-expanded": isOpen,
|
|
1982
1982
|
onClick: () => toggle(id),
|
|
1983
1983
|
children: [
|
|
@@ -1989,7 +1989,7 @@ var AccordionSection = ({
|
|
|
1989
1989
|
),
|
|
1990
1990
|
accessory ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "shrink-0", children: accessory }) : null
|
|
1991
1991
|
] }),
|
|
1992
|
-
isOpen ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
1992
|
+
isOpen ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunk6ANXPYT6cjs.cn.call(void 0, "relative", contentClassName), children: [
|
|
1993
1993
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1994
1994
|
"span",
|
|
1995
1995
|
{
|
|
@@ -2027,7 +2027,7 @@ var PermitItem = ({ permit, onClick, activePermitHash }) => {
|
|
|
2027
2027
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2028
2028
|
"span",
|
|
2029
2029
|
{
|
|
2030
|
-
className:
|
|
2030
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
2031
2031
|
"inline-flex items-center justify-center px-1 py-1 text-sm font-semibold h-6 w-24",
|
|
2032
2032
|
statusStyles[status]
|
|
2033
2033
|
),
|
|
@@ -2106,7 +2106,7 @@ var PermitStripedVariantOpacities = {
|
|
|
2106
2106
|
var PermitStripedBackground = ({ variant, className, children }) => {
|
|
2107
2107
|
const color = PermitStripedVariantColors[variant];
|
|
2108
2108
|
const opacity = PermitStripedVariantOpacities[variant];
|
|
2109
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StripedBackground, { stripeColor: "currentColor", className:
|
|
2109
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, StripedBackground, { stripeColor: "currentColor", className: _chunk6ANXPYT6cjs.cn.call(void 0, color, opacity, className), children });
|
|
2110
2110
|
};
|
|
2111
2111
|
|
|
2112
2112
|
// src/components/CofheFloatingButton/components/PermitCard.tsx
|
|
@@ -2118,7 +2118,7 @@ var PermitTypeLabel = {
|
|
|
2118
2118
|
recipient: "Imported"
|
|
2119
2119
|
};
|
|
2120
2120
|
var CopyButton2 = ({ hash }) => {
|
|
2121
|
-
const { copiedKeys, copyWithFeedback } =
|
|
2121
|
+
const { copiedKeys, copyWithFeedback } = _chunk6ANXPYT6cjs.useCopyFeedback.call(void 0, );
|
|
2122
2122
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { type: "button", onClick: () => copyWithFeedback(hash, hash), children: copiedKeys.has(hash) ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _fa6.FaCheck, {}) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _fa6.FaRegCopy, {}) });
|
|
2123
2123
|
};
|
|
2124
2124
|
var BasePermitCard = ({
|
|
@@ -2126,8 +2126,8 @@ var BasePermitCard = ({
|
|
|
2126
2126
|
className,
|
|
2127
2127
|
header
|
|
2128
2128
|
}) => {
|
|
2129
|
-
const activePermitHash =
|
|
2130
|
-
const expirationInfo =
|
|
2129
|
+
const activePermitHash = _chunk6ANXPYT6cjs.useCofheActivePermitHash.call(void 0, );
|
|
2130
|
+
const expirationInfo = _chunk6ANXPYT6cjs.formatExpirationLabel.call(void 0, permit.expiration);
|
|
2131
2131
|
const metadataTags = _react.useMemo.call(void 0, () => {
|
|
2132
2132
|
const isActivePermit = permit.hash === activePermitHash;
|
|
2133
2133
|
const tags = [];
|
|
@@ -2139,7 +2139,7 @@ var BasePermitCard = ({
|
|
|
2139
2139
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2140
2140
|
"div",
|
|
2141
2141
|
{
|
|
2142
|
-
className:
|
|
2142
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
2143
2143
|
"relative gap-3 border border-[#0E2F3F]/15 bg-[#F8FAFB] p-3 py-4 font-mono text-xs text-[#0E2F3F] dark:border-white/10 dark:bg-[#121212] dark:text-white/80",
|
|
2144
2144
|
className
|
|
2145
2145
|
),
|
|
@@ -2164,7 +2164,7 @@ var BasePermitCard = ({
|
|
|
2164
2164
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "b", { children: permit.name }),
|
|
2165
2165
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "br", {}),
|
|
2166
2166
|
"Issuer: ",
|
|
2167
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "b", { children:
|
|
2167
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "b", { children: _chunk6ANXPYT6cjs.truncateAddress.call(void 0, permit.issuer, 6, 6) }),
|
|
2168
2168
|
" ",
|
|
2169
2169
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CopyButton2, { hash: permit.issuer }),
|
|
2170
2170
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "br", {}),
|
|
@@ -2182,7 +2182,7 @@ var BasePermitCard = ({
|
|
|
2182
2182
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "br", {}),
|
|
2183
2183
|
permit.recipient != null && permit.recipient !== _viem.zeroAddress && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2184
2184
|
"Recipient: ",
|
|
2185
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "b", { children:
|
|
2185
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "b", { children: _chunk6ANXPYT6cjs.truncateAddress.call(void 0, permit.recipient, 6, 6) }),
|
|
2186
2186
|
" ",
|
|
2187
2187
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CopyButton2, { hash: permit.recipient }),
|
|
2188
2188
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "br", {})
|
|
@@ -2192,7 +2192,7 @@ var BasePermitCard = ({
|
|
|
2192
2192
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "br", {}),
|
|
2193
2193
|
" ",
|
|
2194
2194
|
"Contract: ",
|
|
2195
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "b", { children:
|
|
2195
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "b", { children: _chunk6ANXPYT6cjs.truncateAddress.call(void 0, permit.validatorContract, 6, 6) }),
|
|
2196
2196
|
" ",
|
|
2197
2197
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, CopyButton2, { hash: permit.validatorContract }),
|
|
2198
2198
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "br", {}),
|
|
@@ -2219,12 +2219,12 @@ var PermitCard = ({
|
|
|
2219
2219
|
className,
|
|
2220
2220
|
header
|
|
2221
2221
|
}) => {
|
|
2222
|
-
const permit =
|
|
2222
|
+
const permit = _chunk6ANXPYT6cjs.useCofhePermit.call(void 0, hash);
|
|
2223
2223
|
if (permit == null) {
|
|
2224
2224
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2225
2225
|
"div",
|
|
2226
2226
|
{
|
|
2227
|
-
className:
|
|
2227
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
2228
2228
|
"flex flex-col gap-3 border border-[#0E2F3F]/15 bg-[#F8FAFB] p-3 py-4 font-mono text-xs text-[#0E2F3F] dark:border-white/10 dark:bg-[#121212] dark:text-white/80",
|
|
2229
2229
|
className
|
|
2230
2230
|
),
|
|
@@ -2252,10 +2252,10 @@ function computeDefaultActiveAccordionId({ activePermit }) {
|
|
|
2252
2252
|
return "self";
|
|
2253
2253
|
}
|
|
2254
2254
|
var PermitsListPage = () => {
|
|
2255
|
-
const { activePermitHash, selfPermits, delegatedPermits, importedPermits, handlePermitAction, handleOpenPermit } =
|
|
2256
|
-
const { navigateBack } =
|
|
2257
|
-
const { openModal } =
|
|
2258
|
-
const { permit } = _nullishCoalesce(
|
|
2255
|
+
const { activePermitHash, selfPermits, delegatedPermits, importedPermits, handlePermitAction, handleOpenPermit } = _chunk6ANXPYT6cjs.usePermitsList.call(void 0, );
|
|
2256
|
+
const { navigateBack } = _chunk6ANXPYT6cjs.usePortalNavigation.call(void 0, );
|
|
2257
|
+
const { openModal } = _chunk6ANXPYT6cjs.usePortalModals.call(void 0, );
|
|
2258
|
+
const { permit } = _nullishCoalesce(_chunk6ANXPYT6cjs.useCofheActivePermit.call(void 0, ), () => ( {}));
|
|
2259
2259
|
const defaultActiveAccordionId = computeDefaultActiveAccordionId({
|
|
2260
2260
|
generatedPermitsCount: selfPermits.length,
|
|
2261
2261
|
receivedPermitsCount: importedPermits.length,
|
|
@@ -2412,8 +2412,8 @@ var GeneratePermitPage = ({
|
|
|
2412
2412
|
onBack,
|
|
2413
2413
|
cause
|
|
2414
2414
|
}) => {
|
|
2415
|
-
const { navigateBack, navigateTo, pageHistory } =
|
|
2416
|
-
const { addToast } =
|
|
2415
|
+
const { navigateBack, navigateTo, pageHistory } = _chunk6ANXPYT6cjs.usePortalNavigation.call(void 0, );
|
|
2416
|
+
const { addToast } = _chunk6ANXPYT6cjs.usePortalToasts.call(void 0, );
|
|
2417
2417
|
const {
|
|
2418
2418
|
permitName,
|
|
2419
2419
|
error,
|
|
@@ -2424,7 +2424,7 @@ var GeneratePermitPage = ({
|
|
|
2424
2424
|
handleNameChange,
|
|
2425
2425
|
setDurationSeconds,
|
|
2426
2426
|
handleSubmit
|
|
2427
|
-
} =
|
|
2427
|
+
} = _chunk6ANXPYT6cjs.usePermitForm.call(void 0, {
|
|
2428
2428
|
isDelegate: false,
|
|
2429
2429
|
onSuccess: () => {
|
|
2430
2430
|
onSuccessNavigateTo ? onSuccessNavigateTo() : navigateTo("permits" /* Permits */);
|
|
@@ -2441,7 +2441,7 @@ var GeneratePermitPage = ({
|
|
|
2441
2441
|
});
|
|
2442
2442
|
}
|
|
2443
2443
|
});
|
|
2444
|
-
const { presets, units, customCount, customUnit, selectPreset, setCustomCount, setCustomUnit, applyCustom } =
|
|
2444
|
+
const { presets, units, customCount, customUnit, selectPreset, setCustomCount, setCustomUnit, applyCustom } = _chunk6ANXPYT6cjs.usePermitDuration.call(void 0, { onDurationChange: setDurationSeconds, initialSeconds: durationSeconds });
|
|
2445
2445
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2446
2446
|
PageContainer,
|
|
2447
2447
|
{
|
|
@@ -2525,8 +2525,8 @@ var ReceiverSection = ({ receiver, receiverError, onReceiverChange }) => /* @__P
|
|
|
2525
2525
|
// src/components/CofheFloatingButton/pages/permits/DelegatePermitPage/index.tsx
|
|
2526
2526
|
|
|
2527
2527
|
var DelegatePermitPage = ({ onSuccessNavigateTo, onCancel, onBack }) => {
|
|
2528
|
-
const { navigateBack, navigateTo, pageHistory } =
|
|
2529
|
-
const { addToast } =
|
|
2528
|
+
const { navigateBack, navigateTo, pageHistory } = _chunk6ANXPYT6cjs.usePortalNavigation.call(void 0, );
|
|
2529
|
+
const { addToast } = _chunk6ANXPYT6cjs.usePortalToasts.call(void 0, );
|
|
2530
2530
|
const {
|
|
2531
2531
|
permitName,
|
|
2532
2532
|
receiver,
|
|
@@ -2540,7 +2540,7 @@ var DelegatePermitPage = ({ onSuccessNavigateTo, onCancel, onBack }) => {
|
|
|
2540
2540
|
handleReceiverChange,
|
|
2541
2541
|
setDurationSeconds,
|
|
2542
2542
|
handleSubmit
|
|
2543
|
-
} =
|
|
2543
|
+
} = _chunk6ANXPYT6cjs.usePermitForm.call(void 0, {
|
|
2544
2544
|
isDelegate: true,
|
|
2545
2545
|
onSuccess: () => {
|
|
2546
2546
|
onSuccessNavigateTo ? onSuccessNavigateTo() : navigateTo("permits" /* Permits */);
|
|
@@ -2558,7 +2558,7 @@ var DelegatePermitPage = ({ onSuccessNavigateTo, onCancel, onBack }) => {
|
|
|
2558
2558
|
});
|
|
2559
2559
|
}
|
|
2560
2560
|
});
|
|
2561
|
-
const { presets, units, customCount, customUnit, selectPreset, setCustomCount, setCustomUnit, applyCustom } =
|
|
2561
|
+
const { presets, units, customCount, customUnit, selectPreset, setCustomCount, setCustomUnit, applyCustom } = _chunk6ANXPYT6cjs.usePermitDuration.call(void 0, { onDurationChange: setDurationSeconds, initialSeconds: durationSeconds });
|
|
2562
2562
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2563
2563
|
PageContainer,
|
|
2564
2564
|
{
|
|
@@ -2628,8 +2628,8 @@ var fhenix_permit_receive_default = SvgFhenixPermitReceive;
|
|
|
2628
2628
|
// src/components/CofheFloatingButton/pages/permits/ImportPermitPage/index.tsx
|
|
2629
2629
|
|
|
2630
2630
|
var ImportPermitPage = () => {
|
|
2631
|
-
const { navigateBack } =
|
|
2632
|
-
const { addToast } =
|
|
2631
|
+
const { navigateBack } = _chunk6ANXPYT6cjs.usePortalNavigation.call(void 0, );
|
|
2632
|
+
const { addToast } = _chunk6ANXPYT6cjs.usePortalToasts.call(void 0, );
|
|
2633
2633
|
const {
|
|
2634
2634
|
importedPermit,
|
|
2635
2635
|
permitData,
|
|
@@ -2640,7 +2640,7 @@ var ImportPermitPage = () => {
|
|
|
2640
2640
|
errorMsg,
|
|
2641
2641
|
successMsg,
|
|
2642
2642
|
submit
|
|
2643
|
-
} =
|
|
2643
|
+
} = _chunk6ANXPYT6cjs.useReceivePermit.call(void 0, {
|
|
2644
2644
|
onSuccess: () => {
|
|
2645
2645
|
navigateBack();
|
|
2646
2646
|
addToast({
|
|
@@ -2654,7 +2654,7 @@ var ImportPermitPage = () => {
|
|
|
2654
2654
|
title: "Failed to import permit",
|
|
2655
2655
|
description: error.message
|
|
2656
2656
|
});
|
|
2657
|
-
|
|
2657
|
+
_chunk6ANXPYT6cjs.cofheLogger.error("Error importing permit", error);
|
|
2658
2658
|
}
|
|
2659
2659
|
});
|
|
2660
2660
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -2740,9 +2740,9 @@ var money = (n) => n.toLocaleString(void 0, {
|
|
|
2740
2740
|
maximumFractionDigits: 2
|
|
2741
2741
|
});
|
|
2742
2742
|
var TokenInfoBalanceChart = ({ token, chartPoints }) => {
|
|
2743
|
-
const account =
|
|
2744
|
-
const { data: publicBalance, isFetching: isFetchingPublicBalance } =
|
|
2745
|
-
const { data: confidentialBalance, isFetching: isFetchingConfidentialBalance } =
|
|
2743
|
+
const account = _chunk6ANXPYT6cjs.useCofheAccount.call(void 0, );
|
|
2744
|
+
const { data: publicBalance, isFetching: isFetchingPublicBalance } = _chunk6ANXPYT6cjs.useCofheTokenPublicBalance.call(void 0, { token });
|
|
2745
|
+
const { data: confidentialBalance, isFetching: isFetchingConfidentialBalance } = _chunk6ANXPYT6cjs.useCofheTokenDecryptedBalance.call(void 0, {
|
|
2746
2746
|
accountAddress: account,
|
|
2747
2747
|
token
|
|
2748
2748
|
});
|
|
@@ -2840,8 +2840,8 @@ var TokenInfoBalanceChart = ({ token, chartPoints }) => {
|
|
|
2840
2840
|
var TokenInfoTransactionHistoryHeader = ({ token }) => {
|
|
2841
2841
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between", children: [
|
|
2842
2842
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-bold cofhe-text-primary", children: "Activity" }),
|
|
2843
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2844
|
-
_optionalChain([token, 'access', _77 => _77.extensions, 'access', _78 => _78.fhenix, 'access', _79 => _79.erc20Pair, 'optionalAccess', _80 => _80.address]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2843
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6ANXPYT6cjs.HashLink, { type: "token", hash: token.address, chainId: token.chainId, extraShort: true }),
|
|
2844
|
+
_optionalChain([token, 'access', _77 => _77.extensions, 'access', _78 => _78.fhenix, 'access', _79 => _79.erc20Pair, 'optionalAccess', _80 => _80.address]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6ANXPYT6cjs.HashLink, { type: "token", hash: token.extensions.fhenix.erc20Pair.address, chainId: token.chainId, extraShort: true })
|
|
2845
2845
|
] });
|
|
2846
2846
|
};
|
|
2847
2847
|
var money2 = (n) => n.toLocaleString(void 0, {
|
|
@@ -2851,8 +2851,8 @@ var money2 = (n) => n.toLocaleString(void 0, {
|
|
|
2851
2851
|
maximumFractionDigits: 2
|
|
2852
2852
|
});
|
|
2853
2853
|
var TokenInfoTransactionHistory = ({ token, priceUsd }) => {
|
|
2854
|
-
const account =
|
|
2855
|
-
const { filteredTxs: tokenTxs } =
|
|
2854
|
+
const account = _chunk6ANXPYT6cjs.useCofheAccount.call(void 0, );
|
|
2855
|
+
const { filteredTxs: tokenTxs } = _chunk6ANXPYT6cjs.useStoredTransactions.call(void 0, {
|
|
2856
2856
|
chainId: token.chainId,
|
|
2857
2857
|
account,
|
|
2858
2858
|
filter: (tx) => tx.token.address.toLowerCase() === token.address.toLowerCase()
|
|
@@ -2862,7 +2862,7 @@ var TokenInfoTransactionHistory = ({ token, priceUsd }) => {
|
|
|
2862
2862
|
const amountToken = parseFloat(_viem.formatUnits.call(void 0, tx.tokenAmount, tx.token.decimals));
|
|
2863
2863
|
const amountUsd = typeof priceUsd === "number" && Number.isFinite(amountToken) ? amountToken * priceUsd : void 0;
|
|
2864
2864
|
return {
|
|
2865
|
-
kind:
|
|
2865
|
+
kind: _chunk6ANXPYT6cjs.actionToString.call(void 0, tx.actionType),
|
|
2866
2866
|
amountUsd,
|
|
2867
2867
|
amountToken: Number.isFinite(amountToken) ? amountToken : 0
|
|
2868
2868
|
};
|
|
@@ -2874,7 +2874,7 @@ var TokenInfoTransactionHistory = ({ token, priceUsd }) => {
|
|
|
2874
2874
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2875
2875
|
"div",
|
|
2876
2876
|
{
|
|
2877
|
-
className:
|
|
2877
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
2878
2878
|
"w-8 h-8 rounded-full",
|
|
2879
2879
|
"bg-cyan-200/70 dark:bg-cyan-900/40",
|
|
2880
2880
|
"flex items-center justify-center"
|
|
@@ -2898,11 +2898,11 @@ var TokenInfoTransactionHistory = ({ token, priceUsd }) => {
|
|
|
2898
2898
|
// src/components/CofheFloatingButton/pages/TokenInfoPage.tsx
|
|
2899
2899
|
|
|
2900
2900
|
var TokenInfoPage = ({ token }) => {
|
|
2901
|
-
const { navigateBack, navigateTo } =
|
|
2902
|
-
const { data: chartPoints } =
|
|
2901
|
+
const { navigateBack, navigateTo } = _chunk6ANXPYT6cjs.usePortalNavigation.call(void 0, );
|
|
2902
|
+
const { data: chartPoints } = _chunk6ANXPYT6cjs.useCoingeckoContractMarketChartRange.call(void 0, {
|
|
2903
2903
|
...token.chainId === _chains.sepolia.id ? {
|
|
2904
|
-
chainId:
|
|
2905
|
-
contractAddress:
|
|
2904
|
+
chainId: _chunk6ANXPYT6cjs.TMP_WBTC_ON_MAINNET.chainId,
|
|
2905
|
+
contractAddress: _chunk6ANXPYT6cjs.TMP_WBTC_ON_MAINNET.address
|
|
2906
2906
|
} : {
|
|
2907
2907
|
chainId: token.chainId,
|
|
2908
2908
|
contractAddress: _optionalChain([token, 'access', _81 => _81.extensions, 'access', _82 => _82.fhenix, 'access', _83 => _83.erc20Pair, 'optionalAccess', _84 => _84.address])
|
|
@@ -2965,14 +2965,14 @@ var TokenInfoPage = ({ token }) => {
|
|
|
2965
2965
|
// src/components/CofheFloatingButton/pages/SendPage.tsx
|
|
2966
2966
|
|
|
2967
2967
|
|
|
2968
|
-
var import_ts_essentials4 =
|
|
2968
|
+
var import_ts_essentials4 = _chunk6ANXPYT6cjs.__toESM.call(void 0, _chunk6ANXPYT6cjs.require_dist.call(void 0, ), 1);
|
|
2969
2969
|
|
|
2970
2970
|
var SendPage = ({ token: _token }) => {
|
|
2971
2971
|
const [overriddenToken, setOverriddenToken] = _react.useState.call(void 0, null);
|
|
2972
2972
|
const token = _nullishCoalesce(overriddenToken, () => ( _token));
|
|
2973
|
-
const { navigateBack } =
|
|
2974
|
-
const { openModal } =
|
|
2975
|
-
const account =
|
|
2973
|
+
const { navigateBack } = _chunk6ANXPYT6cjs.usePortalNavigation.call(void 0, );
|
|
2974
|
+
const { openModal } = _chunk6ANXPYT6cjs.usePortalModals.call(void 0, );
|
|
2975
|
+
const account = _chunk6ANXPYT6cjs.useCofheAccount.call(void 0, );
|
|
2976
2976
|
const {
|
|
2977
2977
|
encryptAmountAndSendToken,
|
|
2978
2978
|
data: txHash,
|
|
@@ -2982,37 +2982,37 @@ var SendPage = ({ token: _token }) => {
|
|
|
2982
2982
|
stepsState: { lastStep },
|
|
2983
2983
|
isEncrypting: isEncryptingInput
|
|
2984
2984
|
}
|
|
2985
|
-
} =
|
|
2985
|
+
} = _chunk6ANXPYT6cjs.useCofheTokenTransfer.call(void 0, {
|
|
2986
2986
|
onError: (error2) => {
|
|
2987
|
-
const errorMessage = _nullishCoalesce(
|
|
2987
|
+
const errorMessage = _nullishCoalesce(_chunk6ANXPYT6cjs.cofheHumanizeViemError.call(void 0, error2), () => ( (error2 instanceof Error ? error2.message : "Failed to send tokens")));
|
|
2988
2988
|
setError(errorMessage);
|
|
2989
|
-
|
|
2989
|
+
_chunk6ANXPYT6cjs.cofheLogger.error("Send tx submit error:", error2);
|
|
2990
2990
|
},
|
|
2991
2991
|
onMutate: () => {
|
|
2992
2992
|
setError(null);
|
|
2993
2993
|
setSuccess(null);
|
|
2994
2994
|
},
|
|
2995
2995
|
onSuccess: (hash) => {
|
|
2996
|
-
setSuccess(`Transaction sent! Hash: ${
|
|
2996
|
+
setSuccess(`Transaction sent! Hash: ${_chunk6ANXPYT6cjs.truncateAddress.call(void 0, hash)}. Is being mined...`);
|
|
2997
2997
|
setAmount("");
|
|
2998
2998
|
setRecipientAddress("");
|
|
2999
2999
|
}
|
|
3000
3000
|
});
|
|
3001
|
-
|
|
3001
|
+
_chunk6ANXPYT6cjs.useOnceTransactionMined.call(void 0, {
|
|
3002
3002
|
txHash,
|
|
3003
3003
|
onceMined: (transaction) => {
|
|
3004
3004
|
if (transaction.status === "confirmed") {
|
|
3005
|
-
setSuccess(`Transaction confirmed! Hash: ${
|
|
3005
|
+
setSuccess(`Transaction confirmed! Hash: ${_chunk6ANXPYT6cjs.truncateAddress.call(void 0, transaction.hash)}`);
|
|
3006
3006
|
} else if (transaction.status === "failed") {
|
|
3007
|
-
setError(`Transaction failed! Hash: ${
|
|
3007
|
+
setError(`Transaction failed! Hash: ${_chunk6ANXPYT6cjs.truncateAddress.call(void 0, transaction.hash)}`);
|
|
3008
3008
|
}
|
|
3009
3009
|
}
|
|
3010
3010
|
});
|
|
3011
|
-
const { data: { unit: confidentialUnitBalance } = {} } =
|
|
3011
|
+
const { data: { unit: confidentialUnitBalance } = {} } = _chunk6ANXPYT6cjs.useCofheTokenDecryptedBalance.call(void 0, {
|
|
3012
3012
|
token,
|
|
3013
3013
|
accountAddress: account
|
|
3014
3014
|
});
|
|
3015
|
-
const encryptionProgressLabel = _react.useMemo.call(void 0, () => _optionalChain([lastStep, 'optionalAccess', _87 => _87.step]) &&
|
|
3015
|
+
const encryptionProgressLabel = _react.useMemo.call(void 0, () => _optionalChain([lastStep, 'optionalAccess', _87 => _87.step]) && _chunk6ANXPYT6cjs.getStepConfig.call(void 0, lastStep).label, [lastStep]);
|
|
3016
3016
|
const [amount, setAmount] = _react.useState.call(void 0, "");
|
|
3017
3017
|
const [recipientAddress, setRecipientAddress] = _react.useState.call(void 0, "");
|
|
3018
3018
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
@@ -3021,7 +3021,7 @@ var SendPage = ({ token: _token }) => {
|
|
|
3021
3021
|
const isValidAmount = _nullishCoalesce((amount.length > 0 && confidentialUnitBalance && confidentialUnitBalance.gte(amount)), () => ( false));
|
|
3022
3022
|
const handleSend = async () => {
|
|
3023
3023
|
(0, import_ts_essentials4.assert)(_viem.isAddress.call(void 0, recipientAddress), "Recipient address is not valid");
|
|
3024
|
-
const amountWei =
|
|
3024
|
+
const amountWei = _chunk6ANXPYT6cjs.unitToWei.call(void 0, amount, token.decimals);
|
|
3025
3025
|
(0, import_ts_essentials4.assert)(amountWei <= _viem.maxUint128, "Amount exceeds maximum supported value (uint128 max)");
|
|
3026
3026
|
(0, import_ts_essentials4.assert)(account, "Sender account is required");
|
|
3027
3027
|
await encryptAmountAndSendToken({
|
|
@@ -3036,7 +3036,7 @@ var SendPage = ({ token: _token }) => {
|
|
|
3036
3036
|
const handleMaxAmount = () => {
|
|
3037
3037
|
if (confidentialUnitBalance) setAmount(confidentialUnitBalance.toFixed());
|
|
3038
3038
|
};
|
|
3039
|
-
const { tokensWithExistingEncryptedBalance } =
|
|
3039
|
+
const { tokensWithExistingEncryptedBalance } = _chunk6ANXPYT6cjs.useCofheTokensWithExistingEncryptedBalances.call(void 0, );
|
|
3040
3040
|
const disabled = !isValidAddress || !isValidAmount || isSending || isEncryptingInput;
|
|
3041
3041
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3042
3042
|
PageContainer,
|
|
@@ -3065,7 +3065,7 @@ var SendPage = ({ token: _token }) => {
|
|
|
3065
3065
|
inputMode: "decimal",
|
|
3066
3066
|
value: amount,
|
|
3067
3067
|
onChange: (e) => {
|
|
3068
|
-
setAmount(
|
|
3068
|
+
setAmount(_chunk6ANXPYT6cjs.sanitizeNumericInput.call(void 0, e.target.value));
|
|
3069
3069
|
},
|
|
3070
3070
|
placeholder: "0.00",
|
|
3071
3071
|
className: "flex-1 min-w-0 bg-transparent text-2xl font-bold cofhe-text-primary outline-none placeholder:opacity-50"
|
|
@@ -3128,7 +3128,7 @@ var SendPage = ({ token: _token }) => {
|
|
|
3128
3128
|
value: recipientAddress,
|
|
3129
3129
|
onChange: (e) => setRecipientAddress(e.target.value),
|
|
3130
3130
|
placeholder: "0x...",
|
|
3131
|
-
className:
|
|
3131
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
3132
3132
|
"w-full bg-transparent cofhe-text-primary outline-none border-b pb-2 px-2",
|
|
3133
3133
|
"placeholder:opacity-50",
|
|
3134
3134
|
isValidAddress ? "border-green-500" : recipientAddress ? "border-red-500" : "cofhe-card-border"
|
|
@@ -3145,7 +3145,7 @@ var SendPage = ({ token: _token }) => {
|
|
|
3145
3145
|
{
|
|
3146
3146
|
onClick: handleSend,
|
|
3147
3147
|
disabled,
|
|
3148
|
-
className:
|
|
3148
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
3149
3149
|
"cofhe-send-button w-full py-3 px-4 font-small",
|
|
3150
3150
|
"flex items-center justify-center gap-2",
|
|
3151
3151
|
disabled ? "cofhe-send-button-disabled" : "cofhe-send-button-enabled"
|
|
@@ -3165,19 +3165,19 @@ var SendPage = ({ token: _token }) => {
|
|
|
3165
3165
|
var _lu = require('react-icons/lu');
|
|
3166
3166
|
|
|
3167
3167
|
|
|
3168
|
-
var import_ts_essentials5 =
|
|
3168
|
+
var import_ts_essentials5 = _chunk6ANXPYT6cjs.__toESM.call(void 0, _chunk6ANXPYT6cjs.require_dist.call(void 0, ), 1);
|
|
3169
3169
|
|
|
3170
3170
|
// src/hooks/useIsUnshieldingMining.ts
|
|
3171
3171
|
|
|
3172
3172
|
function useIsUnshieldingMining(token) {
|
|
3173
|
-
const account =
|
|
3173
|
+
const account = _chunk6ANXPYT6cjs.useCofheAccount.call(void 0, );
|
|
3174
3174
|
const filter3 = _react.useCallback.call(void 0,
|
|
3175
3175
|
(tx) => {
|
|
3176
3176
|
return tx.token.address === token.address && tx.actionType === "unshield" /* Unshield */ && tx.status === "pending" /* Pending */;
|
|
3177
3177
|
},
|
|
3178
3178
|
[token.address]
|
|
3179
3179
|
);
|
|
3180
|
-
const allPendingTxs =
|
|
3180
|
+
const allPendingTxs = _chunk6ANXPYT6cjs.useStoredTransactions.call(void 0, {
|
|
3181
3181
|
chainId: token.chainId,
|
|
3182
3182
|
account,
|
|
3183
3183
|
filter: filter3
|
|
@@ -3201,14 +3201,14 @@ function useLifecycleStore() {
|
|
|
3201
3201
|
}
|
|
3202
3202
|
function humanizeSimulationError(error, fallbackMessage) {
|
|
3203
3203
|
if (!error) return null;
|
|
3204
|
-
const cofheErrorMessage =
|
|
3204
|
+
const cofheErrorMessage = _chunk6ANXPYT6cjs.cofheHumanizeViemError.call(void 0, error);
|
|
3205
3205
|
if (cofheErrorMessage) return cofheErrorMessage;
|
|
3206
3206
|
if (error instanceof _viem.ContractFunctionExecutionError) return error.shortMessage;
|
|
3207
3207
|
return fallbackMessage;
|
|
3208
3208
|
}
|
|
3209
3209
|
function TxHashWithActions({ hash, chainId }) {
|
|
3210
|
-
const href = chainId ?
|
|
3211
|
-
const ellipsed =
|
|
3210
|
+
const href = chainId ? _chunk6ANXPYT6cjs.getBlockExplorerTxUrl.call(void 0, chainId, hash) : void 0;
|
|
3211
|
+
const ellipsed = _chunk6ANXPYT6cjs.truncateHash.call(void 0, hash);
|
|
3212
3212
|
const handleOpenExplorer = () => {
|
|
3213
3213
|
if (href) {
|
|
3214
3214
|
window.open(href, "_blank", "noopener,noreferrer");
|
|
@@ -3216,7 +3216,7 @@ function TxHashWithActions({ hash, chainId }) {
|
|
|
3216
3216
|
};
|
|
3217
3217
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "inline-flex items-center gap-1.5 align-baseline", children: [
|
|
3218
3218
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "font-mono", children: ellipsed }),
|
|
3219
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3219
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6ANXPYT6cjs.CopyButton, { text: hash, size: 14 }),
|
|
3220
3220
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3221
3221
|
"button",
|
|
3222
3222
|
{
|
|
@@ -3225,7 +3225,7 @@ function TxHashWithActions({ hash, chainId }) {
|
|
|
3225
3225
|
disabled: !href,
|
|
3226
3226
|
"aria-label": "Open transaction in explorer",
|
|
3227
3227
|
title: href ? "Open in explorer" : "Explorer not available for this chain",
|
|
3228
|
-
className:
|
|
3228
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
3229
3229
|
"cofhe-text-primary opacity-50 hover:opacity-100 transition-opacity cursor-pointer",
|
|
3230
3230
|
!href && "cursor-default opacity-30"
|
|
3231
3231
|
),
|
|
@@ -3236,9 +3236,9 @@ function TxHashWithActions({ hash, chainId }) {
|
|
|
3236
3236
|
}
|
|
3237
3237
|
function useClaimUnshieldedWithLifecycle() {
|
|
3238
3238
|
const { setError, setStatus, error, status } = useLifecycleStore();
|
|
3239
|
-
const chainId =
|
|
3240
|
-
const { schedule: scheduleStatusClear } =
|
|
3241
|
-
const claimUnshield =
|
|
3239
|
+
const chainId = _chunk6ANXPYT6cjs.useCofheChainId.call(void 0, );
|
|
3240
|
+
const { schedule: scheduleStatusClear } = _chunk6ANXPYT6cjs.useReschedulableTimeout.call(void 0, () => setStatus(null), AUTOCLEAR_TX_STATUS_TIMEOUT);
|
|
3241
|
+
const claimUnshield = _chunk6ANXPYT6cjs.useCofheTokenClaimUnshielded.call(void 0, {
|
|
3242
3242
|
onMutate: () => {
|
|
3243
3243
|
setError(null);
|
|
3244
3244
|
setStatus({ message: "Preparing claim transaction...", type: "info" });
|
|
@@ -3254,13 +3254,13 @@ function useClaimUnshieldedWithLifecycle() {
|
|
|
3254
3254
|
});
|
|
3255
3255
|
},
|
|
3256
3256
|
onError: (error2) => {
|
|
3257
|
-
const errorMessage = _nullishCoalesce(
|
|
3257
|
+
const errorMessage = _nullishCoalesce(_chunk6ANXPYT6cjs.cofheHumanizeViemError.call(void 0, error2), () => ( (error2 instanceof Error ? error2.message : "Failed to claim unshielded tokens")));
|
|
3258
3258
|
setError(errorMessage);
|
|
3259
3259
|
setStatus(null);
|
|
3260
|
-
|
|
3260
|
+
_chunk6ANXPYT6cjs.cofheLogger.error("Claim tx submit error:", error2);
|
|
3261
3261
|
}
|
|
3262
3262
|
});
|
|
3263
|
-
const { isMining: isClaimingMining } =
|
|
3263
|
+
const { isMining: isClaimingMining } = _chunk6ANXPYT6cjs.useOnceTransactionMined.call(void 0, {
|
|
3264
3264
|
txHash: claimUnshield.data,
|
|
3265
3265
|
onceMined: (transaction) => {
|
|
3266
3266
|
if (transaction.status === "confirmed") {
|
|
@@ -3291,12 +3291,12 @@ function useClaimUnshieldedWithLifecycle() {
|
|
|
3291
3291
|
};
|
|
3292
3292
|
}
|
|
3293
3293
|
function useShieldWithLifecycle(token) {
|
|
3294
|
-
const account =
|
|
3295
|
-
const chainId =
|
|
3294
|
+
const account = _chunk6ANXPYT6cjs.useCofheAccount.call(void 0, );
|
|
3295
|
+
const chainId = _chunk6ANXPYT6cjs.useCofheChainId.call(void 0, );
|
|
3296
3296
|
const [shieldAmount, setShieldAmount] = _react.useState.call(void 0, "");
|
|
3297
3297
|
const { setError, setStatus, error, status } = useLifecycleStore();
|
|
3298
|
-
const { schedule: scheduleStatusClear } =
|
|
3299
|
-
const tokenShield =
|
|
3298
|
+
const { schedule: scheduleStatusClear } = _chunk6ANXPYT6cjs.useReschedulableTimeout.call(void 0, () => setStatus(null), AUTOCLEAR_TX_STATUS_TIMEOUT);
|
|
3299
|
+
const tokenShield = _chunk6ANXPYT6cjs.useCofheTokenShield.call(void 0, {
|
|
3300
3300
|
onMutate: () => {
|
|
3301
3301
|
setError(null);
|
|
3302
3302
|
setStatus({ message: "Preparing shielding transaction...", type: "info" });
|
|
@@ -3313,10 +3313,10 @@ function useShieldWithLifecycle(token) {
|
|
|
3313
3313
|
setShieldAmount("");
|
|
3314
3314
|
},
|
|
3315
3315
|
onError: (error2) => {
|
|
3316
|
-
const errorMessage = _nullishCoalesce(
|
|
3316
|
+
const errorMessage = _nullishCoalesce(_chunk6ANXPYT6cjs.cofheHumanizeViemError.call(void 0, error2), () => ( (error2 instanceof Error ? error2.message : "Failed to shield tokens")));
|
|
3317
3317
|
setError(errorMessage);
|
|
3318
3318
|
setStatus(null);
|
|
3319
|
-
|
|
3319
|
+
_chunk6ANXPYT6cjs.cofheLogger.error("Shield tx submit error:", error2);
|
|
3320
3320
|
}
|
|
3321
3321
|
});
|
|
3322
3322
|
const { tokenApprove, isApprovingMining } = useApproveWithLifecycle({
|
|
@@ -3325,7 +3325,7 @@ function useShieldWithLifecycle(token) {
|
|
|
3325
3325
|
setStatus,
|
|
3326
3326
|
scheduleStatusClear
|
|
3327
3327
|
});
|
|
3328
|
-
const { isMining: isTokenShieldMining } =
|
|
3328
|
+
const { isMining: isTokenShieldMining } = _chunk6ANXPYT6cjs.useOnceTransactionMined.call(void 0, {
|
|
3329
3329
|
txHash: tokenShield.data,
|
|
3330
3330
|
onceMined: (transaction) => {
|
|
3331
3331
|
if (transaction.status === "confirmed") {
|
|
@@ -3349,7 +3349,7 @@ function useShieldWithLifecycle(token) {
|
|
|
3349
3349
|
}
|
|
3350
3350
|
});
|
|
3351
3351
|
const handleShield = async () => {
|
|
3352
|
-
const amountWei =
|
|
3352
|
+
const amountWei = _chunk6ANXPYT6cjs.unitToWei.call(void 0, shieldAmount, token.decimals);
|
|
3353
3353
|
await tokenShield.mutateAsync({
|
|
3354
3354
|
token,
|
|
3355
3355
|
amount: amountWei,
|
|
@@ -3365,11 +3365,11 @@ function useShieldWithLifecycle(token) {
|
|
|
3365
3365
|
extras: { token, tokenAmount: shieldAmountWei, account }
|
|
3366
3366
|
});
|
|
3367
3367
|
};
|
|
3368
|
-
const { data: { unit: publicBalanceUnit } = {}, isFetching: isFetchingPublic } =
|
|
3368
|
+
const { data: { unit: publicBalanceUnit } = {}, isFetching: isFetchingPublic } = _chunk6ANXPYT6cjs.useCofheTokenPublicBalance.call(void 0, {
|
|
3369
3369
|
token,
|
|
3370
3370
|
accountAddress: account
|
|
3371
3371
|
});
|
|
3372
|
-
const { data: { unit: confidentialBalanceUnit } = {}, isFetching: isFetchingConfidential } =
|
|
3372
|
+
const { data: { unit: confidentialBalanceUnit } = {}, isFetching: isFetchingConfidential } = _chunk6ANXPYT6cjs.useCofheTokenDecryptedBalance.call(void 0, { token, accountAddress: account });
|
|
3373
3373
|
const handleShieldMax = () => {
|
|
3374
3374
|
if (publicBalanceUnit) setShieldAmount(publicBalanceUnit.toFixed());
|
|
3375
3375
|
};
|
|
@@ -3377,19 +3377,19 @@ function useShieldWithLifecycle(token) {
|
|
|
3377
3377
|
const shieldAmountWei = _react.useMemo.call(void 0, () => {
|
|
3378
3378
|
if (!isValidShieldAmount) return void 0;
|
|
3379
3379
|
try {
|
|
3380
|
-
return
|
|
3380
|
+
return _chunk6ANXPYT6cjs.unitToWei.call(void 0, shieldAmount, token.decimals);
|
|
3381
3381
|
} catch (e2) {
|
|
3382
3382
|
return void 0;
|
|
3383
3383
|
}
|
|
3384
3384
|
}, [isValidShieldAmount, shieldAmount, token.decimals]);
|
|
3385
3385
|
const shieldTxCallArgs = _react.useMemo.call(void 0, () => {
|
|
3386
3386
|
if (!account || !shieldAmountWei) return void 0;
|
|
3387
|
-
return
|
|
3387
|
+
return _chunk6ANXPYT6cjs.getCofheTokenShieldCallArgs.call(void 0, { token, amount: shieldAmountWei, account });
|
|
3388
3388
|
}, [account, shieldAmountWei, token]);
|
|
3389
3389
|
const shieldCallArgs = _optionalChain([shieldTxCallArgs, 'optionalAccess', _90 => _90.main]);
|
|
3390
3390
|
const approvalCallArgs = _optionalChain([shieldTxCallArgs, 'optionalAccess', _91 => _91.approval]);
|
|
3391
3391
|
const approvalSpender = _nullishCoalesce(_optionalChain([approvalCallArgs, 'optionalAccess', _92 => _92.args, 'optionalAccess', _93 => _93[0]]), () => ( void 0));
|
|
3392
|
-
const { data: allowanceWei, isFetching: isFetchingAllowance } =
|
|
3392
|
+
const { data: allowanceWei, isFetching: isFetchingAllowance } = _chunk6ANXPYT6cjs.useTokenAllowance.call(void 0,
|
|
3393
3393
|
{
|
|
3394
3394
|
tokenAddress: _optionalChain([approvalCallArgs, 'optionalAccess', _94 => _94.address]),
|
|
3395
3395
|
ownerAddress: account,
|
|
@@ -3403,16 +3403,16 @@ function useShieldWithLifecycle(token) {
|
|
|
3403
3403
|
const isAllowanceKnown = !requiresApproval || typeof allowanceWei === "bigint";
|
|
3404
3404
|
const hasSufficientAllowance = !requiresApproval || typeof allowanceWei === "bigint" && typeof shieldAmountWei === "bigint" && allowanceWei >= shieldAmountWei;
|
|
3405
3405
|
const shouldApprove = requiresApproval && typeof allowanceWei === "bigint" && typeof shieldAmountWei === "bigint" && allowanceWei < shieldAmountWei;
|
|
3406
|
-
const approvalSimulation =
|
|
3406
|
+
const approvalSimulation = _chunk6ANXPYT6cjs.useCofheSimulateWriteContract.call(void 0, approvalCallArgs, {
|
|
3407
3407
|
enabled: shouldApprove
|
|
3408
3408
|
});
|
|
3409
|
-
const shieldSimulation =
|
|
3409
|
+
const shieldSimulation = _chunk6ANXPYT6cjs.useCofheSimulateWriteContract.call(void 0, shieldCallArgs, {
|
|
3410
3410
|
enabled: !!shieldCallArgs && !shouldApprove
|
|
3411
3411
|
});
|
|
3412
3412
|
const simulationError = _react.useMemo.call(void 0, () => {
|
|
3413
3413
|
const relevantError = shouldApprove ? approvalSimulation.error : shieldSimulation.error;
|
|
3414
3414
|
if (!relevantError) return null;
|
|
3415
|
-
const cofheErrorMessage =
|
|
3415
|
+
const cofheErrorMessage = _chunk6ANXPYT6cjs.cofheHumanizeViemError.call(void 0, relevantError);
|
|
3416
3416
|
if (cofheErrorMessage) return cofheErrorMessage;
|
|
3417
3417
|
if (relevantError instanceof _viem.ContractFunctionExecutionError) return relevantError.shortMessage;
|
|
3418
3418
|
return shouldApprove ? "Failed to simulate approval transaction" : "Failed to simulate shield transaction";
|
|
@@ -3438,12 +3438,12 @@ function useShieldWithLifecycle(token) {
|
|
|
3438
3438
|
};
|
|
3439
3439
|
}
|
|
3440
3440
|
function useUnshieldWithLifecycle(token) {
|
|
3441
|
-
const account =
|
|
3442
|
-
const chainId =
|
|
3441
|
+
const account = _chunk6ANXPYT6cjs.useCofheAccount.call(void 0, );
|
|
3442
|
+
const chainId = _chunk6ANXPYT6cjs.useCofheChainId.call(void 0, );
|
|
3443
3443
|
const { setError, setStatus, error, status } = useLifecycleStore();
|
|
3444
|
-
const { schedule: scheduleStatusClear } =
|
|
3444
|
+
const { schedule: scheduleStatusClear } = _chunk6ANXPYT6cjs.useReschedulableTimeout.call(void 0, () => setStatus(null), AUTOCLEAR_TX_STATUS_TIMEOUT);
|
|
3445
3445
|
const [unshieldAmount, setUnshieldAmount] = _react.useState.call(void 0, "");
|
|
3446
|
-
const tokenUnshield =
|
|
3446
|
+
const tokenUnshield = _chunk6ANXPYT6cjs.useCofheTokenUnshield.call(void 0, {
|
|
3447
3447
|
onUserSignatureRequest: (hash) => {
|
|
3448
3448
|
() => {
|
|
3449
3449
|
setError(null);
|
|
@@ -3462,10 +3462,10 @@ function useUnshieldWithLifecycle(token) {
|
|
|
3462
3462
|
setUnshieldAmount("");
|
|
3463
3463
|
},
|
|
3464
3464
|
onTransactionSubmitError: (error2) => {
|
|
3465
|
-
const errorMessage = _nullishCoalesce(
|
|
3465
|
+
const errorMessage = _nullishCoalesce(_chunk6ANXPYT6cjs.cofheHumanizeViemError.call(void 0, error2), () => ( (error2 instanceof Error ? error2.message : "Failed to unshield tokens")));
|
|
3466
3466
|
setError(errorMessage);
|
|
3467
3467
|
setStatus(null);
|
|
3468
|
-
|
|
3468
|
+
_chunk6ANXPYT6cjs.cofheLogger.error("Unshield tx submit error:", error2);
|
|
3469
3469
|
},
|
|
3470
3470
|
onceMined: (transaction) => {
|
|
3471
3471
|
if (transaction.status === "confirmed") {
|
|
@@ -3500,7 +3500,7 @@ function useUnshieldWithLifecycle(token) {
|
|
|
3500
3500
|
onStatusChange: (message) => setStatus({ message, type: "info" })
|
|
3501
3501
|
});
|
|
3502
3502
|
};
|
|
3503
|
-
const { data: { unit: confidentialBalanceUnit } = {}, isFetching: isFetchingConfidential } =
|
|
3503
|
+
const { data: { unit: confidentialBalanceUnit } = {}, isFetching: isFetchingConfidential } = _chunk6ANXPYT6cjs.useCofheTokenDecryptedBalance.call(void 0, { token, accountAddress: account });
|
|
3504
3504
|
const handleUnshieldMax = () => {
|
|
3505
3505
|
if (confidentialBalanceUnit) setUnshieldAmount(confidentialBalanceUnit.toFixed());
|
|
3506
3506
|
};
|
|
@@ -3508,9 +3508,9 @@ function useUnshieldWithLifecycle(token) {
|
|
|
3508
3508
|
const unshieldCallArgs = _react.useMemo.call(void 0, () => {
|
|
3509
3509
|
if (!account || !isValidUnshieldAmount) return void 0;
|
|
3510
3510
|
const amountWei = _viem.parseUnits.call(void 0, unshieldAmount, token.decimals);
|
|
3511
|
-
return
|
|
3511
|
+
return _chunk6ANXPYT6cjs.getCofheTokenUnshieldCallArgs.call(void 0, { token, amount: amountWei, account });
|
|
3512
3512
|
}, [account, isValidUnshieldAmount, token, unshieldAmount]);
|
|
3513
|
-
const unshieldSimulation =
|
|
3513
|
+
const unshieldSimulation = _chunk6ANXPYT6cjs.useCofheSimulateWriteContract.call(void 0, unshieldCallArgs, {
|
|
3514
3514
|
enabled: !!unshieldCallArgs
|
|
3515
3515
|
});
|
|
3516
3516
|
const simulationError = _react.useMemo.call(void 0,
|
|
@@ -3560,12 +3560,12 @@ function UnshieldTab({
|
|
|
3560
3560
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ShieldAndUnshieldPageView, { token, mode, setMode, setToken, ...unshieldViewProps });
|
|
3561
3561
|
}
|
|
3562
3562
|
function ClaimingSection({ token }) {
|
|
3563
|
-
const account =
|
|
3563
|
+
const account = _chunk6ANXPYT6cjs.useCofheAccount.call(void 0, );
|
|
3564
3564
|
const {
|
|
3565
3565
|
data: unshieldedClaims,
|
|
3566
3566
|
isFetching: isFetchingClaims,
|
|
3567
3567
|
isWaitingForDecryption: isWaitingForNewClaimsDecryption
|
|
3568
|
-
} =
|
|
3568
|
+
} = _chunk6ANXPYT6cjs.useCofheTokenClaimable.call(void 0, {
|
|
3569
3569
|
token,
|
|
3570
3570
|
accountAddress: account
|
|
3571
3571
|
});
|
|
@@ -3586,9 +3586,9 @@ function ClaimingSection({ token }) {
|
|
|
3586
3586
|
const isUnshieldingMining = useIsUnshieldingMining(token);
|
|
3587
3587
|
const claimCallArgs = _react.useMemo.call(void 0, () => {
|
|
3588
3588
|
if (!account || !_optionalChain([unshieldedClaims, 'optionalAccess', _117 => _117.hasClaimable])) return void 0;
|
|
3589
|
-
return
|
|
3589
|
+
return _chunk6ANXPYT6cjs.getCofheTokenClaimUnshieldedCallArgs.call(void 0, { token, account });
|
|
3590
3590
|
}, [account, token, _optionalChain([unshieldedClaims, 'optionalAccess', _118 => _118.hasClaimable])]);
|
|
3591
|
-
const claimSimulation =
|
|
3591
|
+
const claimSimulation = _chunk6ANXPYT6cjs.useCofheSimulateWriteContract.call(void 0, claimCallArgs, {
|
|
3592
3592
|
enabled: !!claimCallArgs
|
|
3593
3593
|
});
|
|
3594
3594
|
const claimSimulationError = _react.useMemo.call(void 0,
|
|
@@ -3601,13 +3601,13 @@ function ClaimingSection({ token }) {
|
|
|
3601
3601
|
{
|
|
3602
3602
|
onClick: handleClaim,
|
|
3603
3603
|
disabled: claimUnshield.isPending || isClaimingMining || isFetchingClaims || isWaitingForNewClaimsDecryption || isUnshieldingMining || !claimCallArgs || claimSimulation.isFetching || !!claimSimulation.error,
|
|
3604
|
-
label: claimUnshield.isPending ? "Claiming..." : `Claim ${isFetchingClaims || isWaitingForNewClaimsDecryption ? "..." :
|
|
3604
|
+
label: claimUnshield.isPending ? "Claiming..." : `Claim ${isFetchingClaims || isWaitingForNewClaimsDecryption ? "..." : _chunk6ANXPYT6cjs.formatTokenAmount.call(void 0, unshieldedClaims.claimableAmount, token.decimals, 5).formatted} ${pairedSymbol}`,
|
|
3605
3605
|
className: "mt-1"
|
|
3606
3606
|
}
|
|
3607
3607
|
),
|
|
3608
3608
|
_optionalChain([unshieldedClaims, 'optionalAccess', _120 => _120.hasPending]) && token && !unshieldedClaims.hasClaimable && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-xxs text-yellow-600 dark:text-yellow-400 text-center", children: [
|
|
3609
3609
|
"Pending: ",
|
|
3610
|
-
|
|
3610
|
+
_chunk6ANXPYT6cjs.formatTokenAmount.call(void 0, unshieldedClaims.pendingAmount, token.decimals).formatted,
|
|
3611
3611
|
" ",
|
|
3612
3612
|
pairedSymbol
|
|
3613
3613
|
] }),
|
|
@@ -3620,14 +3620,14 @@ function StatusAndError({ status, error }) {
|
|
|
3620
3620
|
status && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3621
3621
|
"div",
|
|
3622
3622
|
{
|
|
3623
|
-
className:
|
|
3623
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
3624
3624
|
"rounded-lg p-2 border",
|
|
3625
3625
|
status.type === "success" ? "bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800" : "bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800"
|
|
3626
3626
|
),
|
|
3627
3627
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3628
3628
|
"p",
|
|
3629
3629
|
{
|
|
3630
|
-
className:
|
|
3630
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
3631
3631
|
"text-xs",
|
|
3632
3632
|
status.type === "success" ? "text-green-800 dark:text-green-200" : "text-blue-800 dark:text-blue-200"
|
|
3633
3633
|
),
|
|
@@ -3658,14 +3658,14 @@ var ShieldAndUnshieldPageView = ({
|
|
|
3658
3658
|
primaryLabel,
|
|
3659
3659
|
primaryIcon
|
|
3660
3660
|
}) => {
|
|
3661
|
-
const { navigateBack } =
|
|
3662
|
-
const { openModal } =
|
|
3663
|
-
const isShieldableToken =
|
|
3664
|
-
const { tokensWithExistingEncryptedBalance } =
|
|
3665
|
-
const { tokensWithPublicBalances } =
|
|
3661
|
+
const { navigateBack } = _chunk6ANXPYT6cjs.usePortalNavigation.call(void 0, );
|
|
3662
|
+
const { openModal } = _chunk6ANXPYT6cjs.usePortalModals.call(void 0, );
|
|
3663
|
+
const isShieldableToken = _chunk6ANXPYT6cjs.isTokenOperationSupported.call(void 0, token.extensions.fhenix.confidentialityType, "shield");
|
|
3664
|
+
const { tokensWithExistingEncryptedBalance } = _chunk6ANXPYT6cjs.useCofheTokensWithExistingEncryptedBalances.call(void 0, );
|
|
3665
|
+
const { tokensWithPublicBalances } = _chunk6ANXPYT6cjs.useTokensWithPublicBalances.call(void 0, );
|
|
3666
3666
|
const selectableTokens = _react.useMemo.call(void 0,
|
|
3667
3667
|
() => (mode === "unshield" ? tokensWithExistingEncryptedBalance : tokensWithPublicBalances).filter(
|
|
3668
|
-
(candidate) =>
|
|
3668
|
+
(candidate) => _chunk6ANXPYT6cjs.isTokenOperationSupported.call(void 0, candidate.extensions.fhenix.confidentialityType, mode)
|
|
3669
3669
|
),
|
|
3670
3670
|
[mode, tokensWithExistingEncryptedBalance, tokensWithPublicBalances]
|
|
3671
3671
|
);
|
|
@@ -3791,7 +3791,7 @@ function useApproveWithLifecycle({
|
|
|
3791
3791
|
setStatus,
|
|
3792
3792
|
scheduleStatusClear
|
|
3793
3793
|
}) {
|
|
3794
|
-
const tokenApprove =
|
|
3794
|
+
const tokenApprove = _chunk6ANXPYT6cjs.useCofheTokenApprove.call(void 0, {
|
|
3795
3795
|
onMutate: () => {
|
|
3796
3796
|
setError(null);
|
|
3797
3797
|
setStatus({ message: "Preparing approval transaction...", type: "info" });
|
|
@@ -3807,13 +3807,13 @@ function useApproveWithLifecycle({
|
|
|
3807
3807
|
});
|
|
3808
3808
|
},
|
|
3809
3809
|
onError: (error) => {
|
|
3810
|
-
const errorMessage = _nullishCoalesce(
|
|
3810
|
+
const errorMessage = _nullishCoalesce(_chunk6ANXPYT6cjs.cofheHumanizeViemError.call(void 0, error), () => ( (error instanceof Error ? error.message : "Failed to approve tokens")));
|
|
3811
3811
|
setError(errorMessage);
|
|
3812
3812
|
setStatus(null);
|
|
3813
|
-
|
|
3813
|
+
_chunk6ANXPYT6cjs.cofheLogger.error("Approve tx submit error:", error);
|
|
3814
3814
|
}
|
|
3815
3815
|
});
|
|
3816
|
-
const { isMining: isApprovingMining } =
|
|
3816
|
+
const { isMining: isApprovingMining } = _chunk6ANXPYT6cjs.useOnceTransactionMined.call(void 0, {
|
|
3817
3817
|
txHash: tokenApprove.data,
|
|
3818
3818
|
onceMined: async (transaction) => {
|
|
3819
3819
|
if (transaction.status === "confirmed") {
|
|
@@ -3845,10 +3845,10 @@ function useApproveWithLifecycle({
|
|
|
3845
3845
|
// src/components/CofheFloatingButton/pages/ActivityPage.tsx
|
|
3846
3846
|
|
|
3847
3847
|
var ActivityPage = () => {
|
|
3848
|
-
const { navigateBack } =
|
|
3849
|
-
const chainId =
|
|
3850
|
-
const account =
|
|
3851
|
-
const { filteredTxs: transactions } =
|
|
3848
|
+
const { navigateBack } = _chunk6ANXPYT6cjs.usePortalNavigation.call(void 0, );
|
|
3849
|
+
const chainId = _chunk6ANXPYT6cjs.useCofheChainId.call(void 0, );
|
|
3850
|
+
const account = _chunk6ANXPYT6cjs.useCofheAccount.call(void 0, );
|
|
3851
|
+
const { filteredTxs: transactions } = _chunk6ANXPYT6cjs.useStoredTransactions.call(void 0, {
|
|
3852
3852
|
chainId,
|
|
3853
3853
|
account
|
|
3854
3854
|
});
|
|
@@ -3878,10 +3878,10 @@ var _accounts = require('viem/accounts');
|
|
|
3878
3878
|
|
|
3879
3879
|
|
|
3880
3880
|
var DebugPage = () => {
|
|
3881
|
-
const { navigateBack } =
|
|
3882
|
-
const { statuses, addStatus, removeStatus } =
|
|
3883
|
-
const { addToast } =
|
|
3884
|
-
const { openModal } =
|
|
3881
|
+
const { navigateBack } = _chunk6ANXPYT6cjs.usePortalNavigation.call(void 0, );
|
|
3882
|
+
const { statuses, addStatus, removeStatus } = _chunk6ANXPYT6cjs.usePortalStatuses.call(void 0, );
|
|
3883
|
+
const { addToast } = _chunk6ANXPYT6cjs.usePortalToasts.call(void 0, );
|
|
3884
|
+
const { openModal } = _chunk6ANXPYT6cjs.usePortalModals.call(void 0, );
|
|
3885
3885
|
const [modalSelection, setModalSelection] = _react.useState.call(void 0, void 0);
|
|
3886
3886
|
const [activeTab, setActiveTab] = _react.useState.call(void 0, "modal");
|
|
3887
3887
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -3999,7 +3999,7 @@ var DebugPage = () => {
|
|
|
3999
3999
|
{
|
|
4000
4000
|
onClick: () => {
|
|
4001
4001
|
addToast(
|
|
4002
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4002
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk6ANXPYT6cjs.ToastPrimitiveBase, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { children: "Custom content" }) })
|
|
4003
4003
|
);
|
|
4004
4004
|
},
|
|
4005
4005
|
children: "Custom content toast"
|
|
@@ -4049,7 +4049,7 @@ var DebugPage = () => {
|
|
|
4049
4049
|
onClick: () => {
|
|
4050
4050
|
addToast(
|
|
4051
4051
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4052
|
-
|
|
4052
|
+
_chunk6ANXPYT6cjs.ToastPrimitive,
|
|
4053
4053
|
{
|
|
4054
4054
|
variant: "info",
|
|
4055
4055
|
title: "Info toast",
|
|
@@ -4068,7 +4068,7 @@ var DebugPage = () => {
|
|
|
4068
4068
|
onClick: () => {
|
|
4069
4069
|
addToast(
|
|
4070
4070
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4071
|
-
|
|
4071
|
+
_chunk6ANXPYT6cjs.ToastPrimitive,
|
|
4072
4072
|
{
|
|
4073
4073
|
variant: "success",
|
|
4074
4074
|
title: "Success toast",
|
|
@@ -4087,7 +4087,7 @@ var DebugPage = () => {
|
|
|
4087
4087
|
onClick: () => {
|
|
4088
4088
|
addToast(
|
|
4089
4089
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4090
|
-
|
|
4090
|
+
_chunk6ANXPYT6cjs.ToastPrimitive,
|
|
4091
4091
|
{
|
|
4092
4092
|
variant: "error",
|
|
4093
4093
|
title: "Error toast",
|
|
@@ -4106,7 +4106,7 @@ var DebugPage = () => {
|
|
|
4106
4106
|
onClick: () => {
|
|
4107
4107
|
addToast(
|
|
4108
4108
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4109
|
-
|
|
4109
|
+
_chunk6ANXPYT6cjs.ToastPrimitive,
|
|
4110
4110
|
{
|
|
4111
4111
|
variant: "warning",
|
|
4112
4112
|
title: "Warning toast",
|
|
@@ -4217,7 +4217,7 @@ var DebugPage = () => {
|
|
|
4217
4217
|
);
|
|
4218
4218
|
};
|
|
4219
4219
|
var FirstPermitDebug = () => {
|
|
4220
|
-
const { hasCreatedFirstPermit, setHasCreatedFirstPermit } =
|
|
4220
|
+
const { hasCreatedFirstPermit, setHasCreatedFirstPermit } = _chunk6ANXPYT6cjs.usePortalPersisted.call(void 0, );
|
|
4221
4221
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
4222
4222
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { children: [
|
|
4223
4223
|
"Has created first permit: ",
|
|
@@ -4235,7 +4235,7 @@ var FirstPermitDebug = () => {
|
|
|
4235
4235
|
] });
|
|
4236
4236
|
};
|
|
4237
4237
|
var CreateSelfExpiringPermitButton = () => {
|
|
4238
|
-
const cofheClient =
|
|
4238
|
+
const cofheClient = _chunk6ANXPYT6cjs.useCofheClient.call(void 0, );
|
|
4239
4239
|
const create2 = async () => {
|
|
4240
4240
|
const { account } = cofheClient.getSnapshot();
|
|
4241
4241
|
if (!account) throw new Error("No connected account found");
|
|
@@ -4245,12 +4245,12 @@ var CreateSelfExpiringPermitButton = () => {
|
|
|
4245
4245
|
issuer: account,
|
|
4246
4246
|
expiration
|
|
4247
4247
|
});
|
|
4248
|
-
|
|
4248
|
+
_chunk6ANXPYT6cjs.usePortalPersisted.getState().setHasCreatedFirstPermit(true);
|
|
4249
4249
|
};
|
|
4250
4250
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: create2, children: "Create self permit (expires in 2 minutes)" });
|
|
4251
4251
|
};
|
|
4252
4252
|
var CreateAndUseReceivingPermitButton = () => {
|
|
4253
|
-
const cofheClient =
|
|
4253
|
+
const cofheClient = _chunk6ANXPYT6cjs.useCofheClient.call(void 0, );
|
|
4254
4254
|
const receiveAndUse = async () => {
|
|
4255
4255
|
const { account, publicClient } = cofheClient.getSnapshot();
|
|
4256
4256
|
if (!account) throw new Error("No connected account found");
|
|
@@ -4274,7 +4274,7 @@ var CreateAndUseReceivingPermitButton = () => {
|
|
|
4274
4274
|
}
|
|
4275
4275
|
);
|
|
4276
4276
|
await cofheClient.permits.importShared(sharedPermit);
|
|
4277
|
-
|
|
4277
|
+
_chunk6ANXPYT6cjs.usePortalPersisted.getState().setHasCreatedFirstPermit(true);
|
|
4278
4278
|
};
|
|
4279
4279
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { onClick: receiveAndUse, children: "Create and use receiving permit" });
|
|
4280
4280
|
};
|
|
@@ -4286,8 +4286,8 @@ var TokenRow = ({ token, onClick, topLabel, balanceType }) => {
|
|
|
4286
4286
|
const publicSymbol = _nullishCoalesce(_optionalChain([token, 'access', _121 => _121.extensions, 'access', _122 => _122.fhenix, 'access', _123 => _123.erc20Pair, 'optionalAccess', _124 => _124.symbol]), () => ( token.symbol));
|
|
4287
4287
|
const destinationSymbol = token.symbol;
|
|
4288
4288
|
const showDestination = balanceType === "public" /* Public */ && !!publicSymbol && !!destinationSymbol && publicSymbol !== destinationSymbol;
|
|
4289
|
-
const account =
|
|
4290
|
-
const { data: confidentialBalance } =
|
|
4289
|
+
const account = _chunk6ANXPYT6cjs.useCofheAccount.call(void 0, );
|
|
4290
|
+
const { data: confidentialBalance } = _chunk6ANXPYT6cjs.useCofheTokenDecryptedBalance.call(void 0,
|
|
4291
4291
|
{
|
|
4292
4292
|
token,
|
|
4293
4293
|
accountAddress: account
|
|
@@ -4296,22 +4296,22 @@ var TokenRow = ({ token, onClick, topLabel, balanceType }) => {
|
|
|
4296
4296
|
enabled: balanceType === "confidential" /* Confidential */
|
|
4297
4297
|
}
|
|
4298
4298
|
);
|
|
4299
|
-
const { data: publicBalance } =
|
|
4300
|
-
const { data: price } =
|
|
4299
|
+
const { data: publicBalance } = _chunk6ANXPYT6cjs.useCofheTokenPublicBalance.call(void 0, { token, accountAddress: account });
|
|
4300
|
+
const { data: price } = _chunk6ANXPYT6cjs.useCoingeckoUsdPrice.call(void 0,
|
|
4301
4301
|
token.chainId === _chains.sepolia.id ? {
|
|
4302
|
-
chainId:
|
|
4303
|
-
tokenAddress:
|
|
4302
|
+
chainId: _chunk6ANXPYT6cjs.TMP_WBTC_ON_MAINNET.chainId,
|
|
4303
|
+
tokenAddress: _chunk6ANXPYT6cjs.TMP_WBTC_ON_MAINNET.address
|
|
4304
4304
|
} : {
|
|
4305
4305
|
chainId: token.chainId,
|
|
4306
4306
|
tokenAddress: _optionalChain([token, 'access', _125 => _125.extensions, 'access', _126 => _126.fhenix, 'access', _127 => _127.erc20Pair, 'optionalAccess', _128 => _128.address])
|
|
4307
4307
|
}
|
|
4308
4308
|
);
|
|
4309
|
-
const usdValue = balanceType === "confidential" /* Confidential */ ? confidentialBalance && price &&
|
|
4309
|
+
const usdValue = balanceType === "confidential" /* Confidential */ ? confidentialBalance && price && _chunk6ANXPYT6cjs.formatUsdAmount.call(void 0, confidentialBalance.unit.multipliedBy(price)) : publicBalance && price && _chunk6ANXPYT6cjs.formatUsdAmount.call(void 0, publicBalance.unit.multipliedBy(price));
|
|
4310
4310
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
4311
4311
|
"div",
|
|
4312
4312
|
{
|
|
4313
4313
|
onClick,
|
|
4314
|
-
className:
|
|
4314
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
4315
4315
|
"flex items-center justify-between px-3 py-2 rounded-lg",
|
|
4316
4316
|
"cofhe-hover-overlay transition-colors",
|
|
4317
4317
|
"cursor-pointer"
|
|
@@ -4369,7 +4369,7 @@ var TokenListModal = ({
|
|
|
4369
4369
|
onSelectToken,
|
|
4370
4370
|
balanceType
|
|
4371
4371
|
}) => {
|
|
4372
|
-
const { openModal } =
|
|
4372
|
+
const { openModal } = _chunk6ANXPYT6cjs.usePortalModals.call(void 0, );
|
|
4373
4373
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4374
4374
|
PageContainer,
|
|
4375
4375
|
{
|
|
@@ -4442,10 +4442,10 @@ var TokenListContent = ({ tokens, onSelectToken, balanceType }) => {
|
|
|
4442
4442
|
// src/components/CofheFloatingButton/pages/PortfolioPage.tsx
|
|
4443
4443
|
|
|
4444
4444
|
var PortfolioPage = () => {
|
|
4445
|
-
const { navigateBack, navigateTo } =
|
|
4446
|
-
const { openModal } =
|
|
4447
|
-
const chainId =
|
|
4448
|
-
const allTokens =
|
|
4445
|
+
const { navigateBack, navigateTo } = _chunk6ANXPYT6cjs.usePortalNavigation.call(void 0, );
|
|
4446
|
+
const { openModal } = _chunk6ANXPYT6cjs.usePortalModals.call(void 0, );
|
|
4447
|
+
const chainId = _chunk6ANXPYT6cjs.useCofheChainId.call(void 0, );
|
|
4448
|
+
const allTokens = _chunk6ANXPYT6cjs.useCofheTokens.call(void 0, chainId);
|
|
4449
4449
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4450
4450
|
PageContainer,
|
|
4451
4451
|
{
|
|
@@ -4499,7 +4499,7 @@ var PortfolioPage = () => {
|
|
|
4499
4499
|
|
|
4500
4500
|
// src/components/CofheFloatingButton/pages/ClaimableTokens.tsx
|
|
4501
4501
|
|
|
4502
|
-
var import_ts_essentials6 =
|
|
4502
|
+
var import_ts_essentials6 = _chunk6ANXPYT6cjs.__toESM.call(void 0, _chunk6ANXPYT6cjs.require_dist.call(void 0, ), 1);
|
|
4503
4503
|
|
|
4504
4504
|
function ClaimableTokens() {
|
|
4505
4505
|
const chainsClaimableTokens = useCofheClaimableTokens();
|
|
@@ -4507,10 +4507,10 @@ function ClaimableTokens() {
|
|
|
4507
4507
|
const unshieldingInProgressByTokenAddress = chainsClaimableTokens.isUnshieldingInProgressByTokenAddress;
|
|
4508
4508
|
const waitingByTokenAddress = chainsClaimableTokens.isWaitingForDecryptionByTokenAddress;
|
|
4509
4509
|
const isClaimingByTokenAddress = chainsClaimableTokens.isClaimingByTokenAddress;
|
|
4510
|
-
const { navigateBack } =
|
|
4511
|
-
const chainId =
|
|
4512
|
-
const allTokens =
|
|
4513
|
-
const claimMutation =
|
|
4510
|
+
const { navigateBack } = _chunk6ANXPYT6cjs.usePortalNavigation.call(void 0, );
|
|
4511
|
+
const chainId = _chunk6ANXPYT6cjs.useCofheChainId.call(void 0, );
|
|
4512
|
+
const allTokens = _chunk6ANXPYT6cjs.useCofheTokens.call(void 0, chainId);
|
|
4513
|
+
const claimMutation = _chunk6ANXPYT6cjs.useCofheTokenClaimUnshielded.call(void 0, );
|
|
4514
4514
|
const rows = _react.useMemo.call(void 0, () => {
|
|
4515
4515
|
const byLower = new Map(allTokens.map((t) => [t.address.toLowerCase(), t]));
|
|
4516
4516
|
return Object.entries(claimableByTokenAddress).filter(([_t, amount]) => amount > 0n).map(([tokenAddress, claimableAmount]) => {
|
|
@@ -4542,7 +4542,7 @@ function ClaimableTokens() {
|
|
|
4542
4542
|
rows.map(({ token, claimableAmount }) => {
|
|
4543
4543
|
const isDecrypting = _nullishCoalesce(_optionalChain([waitingByTokenAddress, 'optionalAccess', _131 => _131[token.address]]), () => ( false));
|
|
4544
4544
|
const isUnshielding = _nullishCoalesce(_optionalChain([unshieldingInProgressByTokenAddress, 'optionalAccess', _132 => _132[token.address.toLowerCase()]]), () => ( false));
|
|
4545
|
-
const formatted =
|
|
4545
|
+
const formatted = _chunk6ANXPYT6cjs.formatTokenAmount.call(void 0, claimableAmount, token.decimals, 5).formatted;
|
|
4546
4546
|
const isClaimingThis = _nullishCoalesce(_optionalChain([isClaimingByTokenAddress, 'optionalAccess', _133 => _133[token.address.toLowerCase()]]), () => ( false));
|
|
4547
4547
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-[1fr,auto,auto] items-center gap-4", children: [
|
|
4548
4548
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
@@ -4552,7 +4552,7 @@ function ClaimableTokens() {
|
|
|
4552
4552
|
logoURI: token.logoURI,
|
|
4553
4553
|
alt: token.name,
|
|
4554
4554
|
size: "md",
|
|
4555
|
-
className:
|
|
4555
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
4556
4556
|
"w-10 h-10 rounded-full",
|
|
4557
4557
|
"cofhe-icon-bg",
|
|
4558
4558
|
"border border-[var(--cofhe-button-default-border)]",
|
|
@@ -4685,8 +4685,8 @@ var PermitDetailsModal = ({ hash, onClose }) => {
|
|
|
4685
4685
|
handleCopySharablePermitData,
|
|
4686
4686
|
handleRemovePermit,
|
|
4687
4687
|
isCopyComplete
|
|
4688
|
-
} =
|
|
4689
|
-
const { openModal } =
|
|
4688
|
+
} = _chunk6ANXPYT6cjs.usePermitDetailsAndActions.call(void 0, hash);
|
|
4689
|
+
const { openModal } = _chunk6ANXPYT6cjs.usePortalModals.call(void 0, );
|
|
4690
4690
|
const [confirmDelete, setConfirmDelete] = _react.useState.call(void 0, false);
|
|
4691
4691
|
const handlePermitSelect = _react.useCallback.call(void 0, () => {
|
|
4692
4692
|
handleSelectActivePermit();
|
|
@@ -4765,7 +4765,7 @@ var PermitDetailsModal = ({ hash, onClose }) => {
|
|
|
4765
4765
|
" button below. When this permit is active, you will be able to view ",
|
|
4766
4766
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "b", { children: "issuer" }),
|
|
4767
4767
|
"'s (",
|
|
4768
|
-
|
|
4768
|
+
_chunk6ANXPYT6cjs.truncateAddress.call(void 0, permit.issuer, 4, 4),
|
|
4769
4769
|
") encrypted data."
|
|
4770
4770
|
] })
|
|
4771
4771
|
] }),
|
|
@@ -4862,10 +4862,10 @@ var PermitInfoModal = ({ onClose }) => {
|
|
|
4862
4862
|
|
|
4863
4863
|
var ImportCustomTokenCard = ({ tokens, onSelectToken, balanceType }) => {
|
|
4864
4864
|
const [addressInput, setAddressInput] = _react.useState.call(void 0, "");
|
|
4865
|
-
const chainId =
|
|
4866
|
-
const addCustomToken =
|
|
4867
|
-
const removeCustomToken =
|
|
4868
|
-
const customTokensByChainId =
|
|
4865
|
+
const chainId = _chunk6ANXPYT6cjs.useCofheChainId.call(void 0, );
|
|
4866
|
+
const addCustomToken = _chunk6ANXPYT6cjs.useCustomTokensStore.call(void 0, (state) => state.addCustomToken);
|
|
4867
|
+
const removeCustomToken = _chunk6ANXPYT6cjs.useCustomTokensStore.call(void 0, (state) => state.removeCustomToken);
|
|
4868
|
+
const customTokensByChainId = _chunk6ANXPYT6cjs.useCustomTokensStore.call(void 0, (state) => state.customTokensByChainId);
|
|
4869
4869
|
const trimmedAddress = addressInput.trim();
|
|
4870
4870
|
const normalizedAddress = _viem.isAddress.call(void 0, trimmedAddress) ? trimmedAddress : void 0;
|
|
4871
4871
|
const importedCustomTokens = _react.useMemo.call(void 0, () => {
|
|
@@ -4876,7 +4876,7 @@ var ImportCustomTokenCard = ({ tokens, onSelectToken, balanceType }) => {
|
|
|
4876
4876
|
if (!normalizedAddress) return void 0;
|
|
4877
4877
|
return tokens.find((token) => token.address.toLowerCase() === normalizedAddress.toLowerCase());
|
|
4878
4878
|
}, [normalizedAddress, tokens]);
|
|
4879
|
-
const resolvedToken =
|
|
4879
|
+
const resolvedToken = _chunk6ANXPYT6cjs.useResolvedCofheToken.call(void 0,
|
|
4880
4880
|
{ address: normalizedAddress },
|
|
4881
4881
|
{
|
|
4882
4882
|
enabled: !!normalizedAddress && !existingToken,
|
|
@@ -4908,7 +4908,7 @@ var ImportCustomTokenCard = ({ tokens, onSelectToken, balanceType }) => {
|
|
|
4908
4908
|
" \xB7 ",
|
|
4909
4909
|
previewToken.name
|
|
4910
4910
|
] }),
|
|
4911
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "opacity-70", children: _nullishCoalesce(
|
|
4911
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "opacity-70", children: _nullishCoalesce(_chunk6ANXPYT6cjs.getTokenConfidentialityLabel.call(void 0, previewToken.extensions.fhenix.confidentialityType), () => ( "Confidential token")) }),
|
|
4912
4912
|
balanceType === "public" && previewToken.extensions.fhenix.confidentialityType === "wrapped" && !previewToken.extensions.fhenix.erc20Pair && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xxxs opacity-70", children: "Public-balance actions may stay unavailable until the token's paired asset can be discovered." })
|
|
4913
4913
|
] }),
|
|
4914
4914
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -5013,7 +5013,7 @@ var modals = {
|
|
|
5013
5013
|
// src/components/CofheFloatingButton/ContentSection.tsx
|
|
5014
5014
|
|
|
5015
5015
|
var MeasuredContentRenderer = ({ children, id, isModal, onModalOverlayClick }) => {
|
|
5016
|
-
const { setContentHeight, removeContentHeight } =
|
|
5016
|
+
const { setContentHeight, removeContentHeight } = _chunk6ANXPYT6cjs.usePortalUI.call(void 0, );
|
|
5017
5017
|
const contentRef = _react.useRef.call(void 0, null);
|
|
5018
5018
|
_react.useEffect.call(void 0, () => {
|
|
5019
5019
|
if (!contentRef.current) return;
|
|
@@ -5041,7 +5041,7 @@ var MeasuredContentRenderer = ({ children, id, isModal, onModalOverlayClick }) =
|
|
|
5041
5041
|
className: "absolute flex w-full h-full bg-[#0E2F3F]/30 origin-top translate-y-[-8px] scale-[0.95]"
|
|
5042
5042
|
}
|
|
5043
5043
|
),
|
|
5044
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "relative flex w-full h-full overflow-y-hidden pointer-events-none", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className:
|
|
5044
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "relative flex w-full h-full overflow-y-hidden pointer-events-none", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunk6ANXPYT6cjs.cn.call(void 0, "cofhe-panel absolute flex left-0 w-full p-4 top-0 pointer-events-auto"), ref: contentRef, children }) })
|
|
5045
5045
|
] });
|
|
5046
5046
|
};
|
|
5047
5047
|
var ContentRenderer = ({ page }) => {
|
|
@@ -5061,10 +5061,10 @@ var ModalRenderer = ({ modal }) => {
|
|
|
5061
5061
|
};
|
|
5062
5062
|
var ContentSection = ({ overriddingPage }) => {
|
|
5063
5063
|
const { isTopSide } = useCofheFloatingButtonContext();
|
|
5064
|
-
const { contentPanelOpen } =
|
|
5065
|
-
const { modalStack } =
|
|
5066
|
-
const maxContentHeight =
|
|
5067
|
-
const currentPage =
|
|
5064
|
+
const { contentPanelOpen } = _chunk6ANXPYT6cjs.usePortalUI.call(void 0, );
|
|
5065
|
+
const { modalStack } = _chunk6ANXPYT6cjs.usePortalModals.call(void 0, );
|
|
5066
|
+
const maxContentHeight = _chunk6ANXPYT6cjs.usePortalUIMaxContentHeight.call(void 0, );
|
|
5067
|
+
const currentPage = _chunk6ANXPYT6cjs.usePortalCurrentPage.call(void 0, );
|
|
5068
5068
|
const pageOrOverridingPage = _nullishCoalesce(overriddingPage, () => ( currentPage));
|
|
5069
5069
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react3.AnimatePresence, { children: contentPanelOpen && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5070
5070
|
_react3.motion.div,
|
|
@@ -5088,7 +5088,7 @@ var ContentSection = ({ overriddingPage }) => {
|
|
|
5088
5088
|
|
|
5089
5089
|
|
|
5090
5090
|
var ToastClearer = ({ id, paused, remainingMs }) => {
|
|
5091
|
-
const { removeToast } =
|
|
5091
|
+
const { removeToast } = _chunk6ANXPYT6cjs.usePortalToasts.call(void 0, );
|
|
5092
5092
|
const timerRef = _react.useRef.call(void 0, null);
|
|
5093
5093
|
_react.useEffect.call(void 0, () => {
|
|
5094
5094
|
if (remainingMs <= 0) {
|
|
@@ -5119,7 +5119,7 @@ var ToastComponent = ({
|
|
|
5119
5119
|
content
|
|
5120
5120
|
}) => {
|
|
5121
5121
|
const { isTopSide } = useCofheFloatingButtonContext();
|
|
5122
|
-
const { pauseToast, removeToast } =
|
|
5122
|
+
const { pauseToast, removeToast } = _chunk6ANXPYT6cjs.usePortalToasts.call(void 0, );
|
|
5123
5123
|
const handlePause = (paused2) => {
|
|
5124
5124
|
pauseToast(id, paused2);
|
|
5125
5125
|
};
|
|
@@ -5143,7 +5143,7 @@ var ToastComponent = ({
|
|
|
5143
5143
|
animate: { opacity: 1, y: 0 },
|
|
5144
5144
|
exit: { opacity: 0, y: isTopSide ? 4 : -4 },
|
|
5145
5145
|
transition: { duration: 0.2, ease: "easeOut" },
|
|
5146
|
-
className:
|
|
5146
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0, "min-h-8 bg-white border items-center justify-start w-full max-w-full"),
|
|
5147
5147
|
children: [
|
|
5148
5148
|
injectedContent,
|
|
5149
5149
|
duration != "infinite" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ToastClearer, { id, paused, remainingMs })
|
|
@@ -5153,7 +5153,7 @@ var ToastComponent = ({
|
|
|
5153
5153
|
);
|
|
5154
5154
|
};
|
|
5155
5155
|
var ToastsSection = () => {
|
|
5156
|
-
const { toasts } =
|
|
5156
|
+
const { toasts } = _chunk6ANXPYT6cjs.usePortalToasts.call(void 0, );
|
|
5157
5157
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col gap-3 w-full max-w-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react3.AnimatePresence, { children: toasts.map((toast) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, ToastComponent, { ...toast }, toast.id)) }) });
|
|
5158
5158
|
};
|
|
5159
5159
|
|
|
@@ -5173,15 +5173,15 @@ var CofheFloatingButtonBase = ({
|
|
|
5173
5173
|
overriddingPage
|
|
5174
5174
|
}) => {
|
|
5175
5175
|
const { effectivePosition, isTopSide, isLeftSide, theme } = useCofheFloatingButtonContext();
|
|
5176
|
-
const { togglePortal } =
|
|
5177
|
-
const { clearAllModals } =
|
|
5178
|
-
const { clearNavigationHistory } =
|
|
5176
|
+
const { togglePortal } = _chunk6ANXPYT6cjs.usePortalUI.call(void 0, );
|
|
5177
|
+
const { clearAllModals } = _chunk6ANXPYT6cjs.usePortalModals.call(void 0, );
|
|
5178
|
+
const { clearNavigationHistory } = _chunk6ANXPYT6cjs.usePortalNavigation.call(void 0, );
|
|
5179
5179
|
const darkMode = theme === "dark";
|
|
5180
5180
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
5181
5181
|
"div",
|
|
5182
5182
|
{
|
|
5183
5183
|
"data-testid": testId,
|
|
5184
|
-
className:
|
|
5184
|
+
className: _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
5185
5185
|
"cofhe-floating-button",
|
|
5186
5186
|
darkMode && "dark",
|
|
5187
5187
|
positionType,
|
|
@@ -5195,7 +5195,7 @@ var CofheFloatingButtonBase = ({
|
|
|
5195
5195
|
children: [
|
|
5196
5196
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ToastsSection, {}),
|
|
5197
5197
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, ContentSection, { overriddingPage }),
|
|
5198
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className:
|
|
5198
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunk6ANXPYT6cjs.cn.call(void 0, "flex w-full gap-3 items-center", isLeftSide ? "flex-row" : "flex-row-reverse"), children: [
|
|
5199
5199
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
5200
5200
|
FloatingButtonComponent,
|
|
5201
5201
|
{
|
|
@@ -5232,7 +5232,7 @@ var CofheEncryptInput = ({
|
|
|
5232
5232
|
testId,
|
|
5233
5233
|
placeholder = "Enter number or address...",
|
|
5234
5234
|
initialValue = "",
|
|
5235
|
-
options =
|
|
5235
|
+
options = _chunk6ANXPYT6cjs.FheTypesList,
|
|
5236
5236
|
size = "md",
|
|
5237
5237
|
hasError = false,
|
|
5238
5238
|
errorMessage,
|
|
@@ -5257,16 +5257,16 @@ var CofheEncryptInput = ({
|
|
|
5257
5257
|
encryptInputsAsync: encrypt,
|
|
5258
5258
|
isEncrypting,
|
|
5259
5259
|
stepsState: { lastStep: lastEncryptionStep }
|
|
5260
|
-
} =
|
|
5260
|
+
} = _chunk6ANXPYT6cjs.useCofheEncrypt.call(void 0, );
|
|
5261
5261
|
const { progress: encryptionProgress, label: encryptionProgressLabel } = _react.useMemo.call(void 0, () => {
|
|
5262
|
-
return lastEncryptionStep ?
|
|
5262
|
+
return lastEncryptionStep ? _chunk6ANXPYT6cjs.getStepConfig.call(void 0, lastEncryptionStep) : {
|
|
5263
5263
|
progress: void 0,
|
|
5264
5264
|
label: void 0
|
|
5265
5265
|
};
|
|
5266
5266
|
}, [lastEncryptionStep]);
|
|
5267
5267
|
const debouncedValidation = _react.useRef.call(void 0,
|
|
5268
5268
|
debounce((value) => {
|
|
5269
|
-
|
|
5269
|
+
_chunk6ANXPYT6cjs.cofheLogger.log("Debounced validation for:", value);
|
|
5270
5270
|
}, debounceMs)
|
|
5271
5271
|
).current;
|
|
5272
5272
|
_react.useEffect.call(void 0, () => {
|
|
@@ -5300,14 +5300,14 @@ var CofheEncryptInput = ({
|
|
|
5300
5300
|
md: { input: "px-4 py-3 text-sm", dropdown: "px-3 py-2 text-sm", button: "px-4 py-2 text-sm" },
|
|
5301
5301
|
lg: { input: "px-5 py-4 text-base", dropdown: "px-4 py-3 text-base", button: "px-6 py-3 text-base" }
|
|
5302
5302
|
};
|
|
5303
|
-
const inputContainerClasses =
|
|
5303
|
+
const inputContainerClasses = _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
5304
5304
|
"relative flex items-center bg-white dark:bg-gray-800 border rounded-lg transition-colors",
|
|
5305
5305
|
"focus-within:ring-2 focus-within:ring-blue-500 focus-within:border-blue-500",
|
|
5306
5306
|
hasError ? "border-red-500 focus-within:ring-red-500 focus-within:border-red-500" : "border-gray-300 dark:border-gray-600",
|
|
5307
5307
|
(disabled || isEncrypting) && "bg-gray-100 dark:bg-gray-700 opacity-50",
|
|
5308
5308
|
className
|
|
5309
5309
|
);
|
|
5310
|
-
const inputClasses =
|
|
5310
|
+
const inputClasses = _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
5311
5311
|
"flex-1 bg-transparent border-0 outline-none placeholder-gray-400 dark:placeholder-gray-500",
|
|
5312
5312
|
"text-gray-900 dark:text-white",
|
|
5313
5313
|
sizeClasses4[size].input,
|
|
@@ -5315,7 +5315,7 @@ var CofheEncryptInput = ({
|
|
|
5315
5315
|
// Make space for the dropdown button
|
|
5316
5316
|
(disabled || isEncrypting) && "cursor-not-allowed"
|
|
5317
5317
|
);
|
|
5318
|
-
const dropdownButtonClasses =
|
|
5318
|
+
const dropdownButtonClasses = _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
5319
5319
|
"absolute right-0 top-0 bottom-0",
|
|
5320
5320
|
"flex items-center gap-1 px-2 rounded-r-md border-l border-gray-300 dark:border-gray-600",
|
|
5321
5321
|
"bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600",
|
|
@@ -5324,7 +5324,7 @@ var CofheEncryptInput = ({
|
|
|
5324
5324
|
(disabled || isEncrypting) && "cursor-not-allowed opacity-50",
|
|
5325
5325
|
isDropdownOpen && "bg-gray-200 dark:bg-gray-600"
|
|
5326
5326
|
);
|
|
5327
|
-
const dropdownItemClasses = (isSelected, isCompatible) =>
|
|
5327
|
+
const dropdownItemClasses = (isSelected, isCompatible) => _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
5328
5328
|
"px-3 py-2 text-sm transition-colors",
|
|
5329
5329
|
isCompatible ? "cursor-pointer hover:bg-blue-50 dark:hover:bg-blue-900/30 hover:text-blue-700 dark:hover:text-blue-300" : "cursor-not-allowed opacity-50 bg-gray-50 dark:bg-gray-700",
|
|
5330
5330
|
isSelected && isCompatible ? "bg-blue-100 dark:bg-blue-900/50 text-blue-700 dark:text-blue-300 font-medium" : isCompatible ? "text-gray-700 dark:text-gray-300" : "text-gray-400 dark:text-gray-500"
|
|
@@ -5335,15 +5335,15 @@ var CofheEncryptInput = ({
|
|
|
5335
5335
|
warning: "bg-yellow-600 dark:bg-yellow-500",
|
|
5336
5336
|
error: "bg-red-600 dark:bg-red-500"
|
|
5337
5337
|
};
|
|
5338
|
-
const progressContainerClasses =
|
|
5338
|
+
const progressContainerClasses = _chunk6ANXPYT6cjs.cn.call(void 0,
|
|
5339
5339
|
"w-full bg-gray-200 dark:bg-gray-700 rounded-full h-1 overflow-hidden",
|
|
5340
5340
|
// Debug: Add border to see container
|
|
5341
5341
|
"border"
|
|
5342
5342
|
);
|
|
5343
|
-
const progressBarClasses = (variant = "primary") =>
|
|
5343
|
+
const progressBarClasses = (variant = "primary") => _chunk6ANXPYT6cjs.cn.call(void 0, "h-full transition-all duration-300 ease-out rounded-full", progressVariantClasses[variant]);
|
|
5344
5344
|
const isTypeCompatible = (typeValue, inputValue) => {
|
|
5345
5345
|
if (!inputValue.trim()) return true;
|
|
5346
|
-
const typeInfo =
|
|
5346
|
+
const typeInfo = _chunk6ANXPYT6cjs.FheTypesList.find((type) => type.value === typeValue);
|
|
5347
5347
|
if (!typeInfo) return false;
|
|
5348
5348
|
if (typeValue === "bool") {
|
|
5349
5349
|
const lowerValue = inputValue.toLowerCase();
|
|
@@ -5389,13 +5389,13 @@ var CofheEncryptInput = ({
|
|
|
5389
5389
|
2
|
|
5390
5390
|
);
|
|
5391
5391
|
await navigator.clipboard.writeText(textToCopy);
|
|
5392
|
-
|
|
5392
|
+
_chunk6ANXPYT6cjs.cofheLogger.log("Copied to clipboard:", textToCopy);
|
|
5393
5393
|
setCopySuccess(true);
|
|
5394
5394
|
setTimeout(() => {
|
|
5395
5395
|
setCopySuccess(false);
|
|
5396
5396
|
}, 2e3);
|
|
5397
5397
|
} catch (error) {
|
|
5398
|
-
|
|
5398
|
+
_chunk6ANXPYT6cjs.cofheLogger.error("Failed to copy to clipboard:", error);
|
|
5399
5399
|
}
|
|
5400
5400
|
};
|
|
5401
5401
|
const handleTypeSelect = async (type) => {
|
|
@@ -5404,7 +5404,7 @@ var CofheEncryptInput = ({
|
|
|
5404
5404
|
_optionalChain([onTypeChange, 'optionalCall', _144 => _144(type)]);
|
|
5405
5405
|
if (textValue.trim() !== "") {
|
|
5406
5406
|
try {
|
|
5407
|
-
|
|
5407
|
+
_chunk6ANXPYT6cjs.cofheLogger.log("Auto-encrypting value:", textValue, "as type:", type);
|
|
5408
5408
|
_optionalChain([onEncryptStart, 'optionalCall', _145 => _145({ value: textValue, type })]);
|
|
5409
5409
|
(async () => {
|
|
5410
5410
|
try {
|
|
@@ -5414,13 +5414,13 @@ var CofheEncryptInput = ({
|
|
|
5414
5414
|
_optionalChain([onEncryptComplete, 'optionalCall', _146 => _146(data)]);
|
|
5415
5415
|
} catch (error) {
|
|
5416
5416
|
const errorMessage2 = error instanceof Error ? error.message : "Encryption failed";
|
|
5417
|
-
|
|
5417
|
+
_chunk6ANXPYT6cjs.cofheLogger.error("Encryption failed:", error);
|
|
5418
5418
|
_optionalChain([onEncryptError, 'optionalCall', _147 => _147(errorMessage2)]);
|
|
5419
5419
|
}
|
|
5420
5420
|
})();
|
|
5421
5421
|
} catch (error) {
|
|
5422
5422
|
const errorMessage2 = error instanceof Error ? error.message : "Encryption setup failed";
|
|
5423
|
-
|
|
5423
|
+
_chunk6ANXPYT6cjs.cofheLogger.error("Encryption setup failed:", error);
|
|
5424
5424
|
_optionalChain([onEncryptError, 'optionalCall', _148 => _148(errorMessage2)]);
|
|
5425
5425
|
}
|
|
5426
5426
|
}
|
|
@@ -5539,5 +5539,5 @@ var CofheEncryptInput = ({
|
|
|
5539
5539
|
|
|
5540
5540
|
|
|
5541
5541
|
|
|
5542
|
-
exports.CofheEncryptInput = CofheEncryptInput; exports.CofheFloatingButtonWithProvider = CofheFloatingButtonWithProvider; exports.FheTypesList =
|
|
5542
|
+
exports.CofheEncryptInput = CofheEncryptInput; exports.CofheFloatingButtonWithProvider = CofheFloatingButtonWithProvider; exports.FheTypesList = _chunk6ANXPYT6cjs.FheTypesList; exports.MainPage = MainPage; exports.SettingsPage = SettingsPage;
|
|
5543
5543
|
//# sourceMappingURL=ui-base.cjs.map
|