@cofhe/react 0.0.0-alpha-20260602122344 → 0.0.0-alpha-20260603065951

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.
@@ -1047,6 +1047,7 @@ function CofheProvider(props) {
1047
1047
  {
1048
1048
  value: {
1049
1049
  client: cofheClient,
1050
+ transactionRenderers: props.transactionRenderers,
1050
1051
  state: {
1051
1052
  position,
1052
1053
  setPosition,
@@ -2618,32 +2619,46 @@ var TransactionStatus = /* @__PURE__ */ ((TransactionStatus3) => {
2618
2619
  TransactionStatus3["Confirmed"] = "confirmed";
2619
2620
  return TransactionStatus3;
2620
2621
  })(TransactionStatus || {});
2621
- var TransactionActionType = /* @__PURE__ */ ((TransactionActionType2) => {
2622
- TransactionActionType2["ShieldSend"] = "shieldSend";
2623
- TransactionActionType2["Shield"] = "shield";
2624
- TransactionActionType2["Unshield"] = "unshield";
2625
- TransactionActionType2["Claim"] = "claim";
2626
- TransactionActionType2["Approve"] = "approve";
2627
- return TransactionActionType2;
2628
- })(TransactionActionType || {});
2629
- var actionToStringMap = {
2630
- ["shieldSend" /* ShieldSend */]: "Shielded Transfer",
2631
- ["shield" /* Shield */]: "Shield",
2632
- ["unshield" /* Unshield */]: "Unshield",
2633
- ["claim" /* Claim */]: "Claim",
2634
- ["approve" /* Approve */]: "Approve"
2622
+ var TransactionActionType = {
2623
+ ShieldSend: "shieldSend",
2624
+ Shield: "shield",
2625
+ Unshield: "unshield",
2626
+ Claim: "claim",
2627
+ Approve: "approve"
2635
2628
  };
2636
- var actionToString = (a) => actionToStringMap[a];
2629
+ var actionToStringMap = {
2630
+ [TransactionActionType.ShieldSend]: "Shielded Transfer",
2631
+ [TransactionActionType.Shield]: "Shield",
2632
+ [TransactionActionType.Unshield]: "Unshield",
2633
+ [TransactionActionType.Claim]: "Claim",
2634
+ [TransactionActionType.Approve]: "Approve"
2635
+ };
2636
+ var actionToString = (a, fallbackTitle) => _nullishCoalesce(_nullishCoalesce(actionToStringMap[a], () => ( fallbackTitle)), () => ( a));
2637
+ var isCustomTransactionActionType = (actionType) => actionType.startsWith("custom-");
2637
2638
  var statusToStringMap = {
2638
2639
  ["pending" /* Pending */]: "Pending",
2639
2640
  ["failed" /* Failed */]: "Failed",
2640
2641
  ["confirmed" /* Confirmed */]: "Confirmed"
2641
2642
  };
2642
2643
  var statusToString = (a) => statusToStringMap[a];
2644
+ function normalizeAddressList(addresses) {
2645
+ if (!addresses || addresses.length === 0) return void 0;
2646
+ return Array.from(new Set(addresses.map((address) => address.toLowerCase())));
2647
+ }
2648
+ function transactionMatchesToken(tx, tokenAddress) {
2649
+ const normalizedTokenAddress = tokenAddress.toLowerCase();
2650
+ if ("token" in tx && tx.token.address.toLowerCase() === normalizedTokenAddress) return true;
2651
+ return _nullishCoalesce(_optionalChain([tx, 'access', _88 => _88.tokenTags, 'optionalAccess', _89 => _89.some, 'call', _90 => _90((tag) => tag.toLowerCase() === normalizedTokenAddress)]), () => ( false));
2652
+ }
2643
2653
  var bigintStorage = _middleware.createJSONStorage.call(void 0, () => localStorage, bigintJSONStorageOptions);
2644
2654
  function constructNewTx(transaction) {
2655
+ const tokenTags = normalizeAddressList([
2656
+ ..._nullishCoalesce(transaction.tokenTags, () => ( [])),
2657
+ ..."token" in transaction ? [transaction.token.address] : []
2658
+ ]);
2645
2659
  return {
2646
2660
  ...transaction,
2661
+ ...tokenTags ? { tokenTags } : {},
2647
2662
  status: "pending" /* Pending */,
2648
2663
  timestamp: Date.now()
2649
2664
  };
@@ -2679,7 +2694,7 @@ var useTransactionStore = _zustand.create.call(void 0, )(
2679
2694
  [hash]: {
2680
2695
  ...chainTxs[hash],
2681
2696
  status,
2682
- receipt: _nullishCoalesce(_optionalChain([minedData, 'optionalAccess', _88 => _88.receipt]), () => ( chainTxs[hash].receipt))
2697
+ receipt: _nullishCoalesce(_optionalChain([minedData, 'optionalAccess', _91 => _91.receipt]), () => ( chainTxs[hash].receipt))
2683
2698
  }
2684
2699
  }
2685
2700
  }
@@ -2687,7 +2702,7 @@ var useTransactionStore = _zustand.create.call(void 0, )(
2687
2702
  });
2688
2703
  },
2689
2704
  getTransaction: (chainId, hash) => {
2690
- return _optionalChain([get, 'call', _89 => _89(), 'access', _90 => _90.transactions, 'access', _91 => _91[chainId], 'optionalAccess', _92 => _92[hash]]);
2705
+ return _optionalChain([get, 'call', _92 => _92(), 'access', _93 => _93.transactions, 'access', _94 => _94[chainId], 'optionalAccess', _95 => _95[hash]]);
2691
2706
  },
2692
2707
  getAllTransactions: (chainId, account) => {
2693
2708
  const chainTxs = get().transactions[chainId];
@@ -2696,7 +2711,8 @@ var useTransactionStore = _zustand.create.call(void 0, )(
2696
2711
  getAllTransactionsByToken: (chainId, tokenAddress, account) => {
2697
2712
  const chainTxs = get().transactions[chainId];
2698
2713
  return chainTxs ? Object.values(chainTxs).filter((tx) => {
2699
- return tx.account.toLowerCase() === _optionalChain([account, 'optionalAccess', _93 => _93.toLowerCase, 'call', _94 => _94()]);
2714
+ if (!transactionMatchesToken(tx, tokenAddress)) return false;
2715
+ return !account || tx.account.toLowerCase() === account.toLowerCase();
2700
2716
  }).sort((a, b) => b.timestamp - a.timestamp) : [];
2701
2717
  },
2702
2718
  clearTransactions: (chainId) => {
@@ -2730,7 +2746,7 @@ function useCofheWriteContract(options) {
2730
2746
  const publicClient = useCofhePublicClient();
2731
2747
  const mutation = useInternalMutation({
2732
2748
  ...options,
2733
- mutationKey: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _95 => _95.mutationKey]), () => ( ["cofhe", "walletWriteContract"])),
2749
+ mutationKey: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _96 => _96.mutationKey]), () => ( ["cofhe", "walletWriteContract"])),
2734
2750
  mutationFn: async (variables) => {
2735
2751
  (0, import_ts_essentials5.assert)(walletClient, "WalletClient is required to write to a contract");
2736
2752
  (0, import_ts_essentials5.assert)(publicClient, "PublicClient is required to simulate contract before writing");
@@ -2868,7 +2884,7 @@ function useCofheTokenApprove(writeMutationOptions) {
2868
2884
  ...restOfOptions,
2869
2885
  onError: (error, variables, onMutateResult, context) => {
2870
2886
  if (passedOnError) passedOnError(error, variables, onMutateResult, context);
2871
- onTransactionSubmitError(error, "approve" /* Approve */);
2887
+ onTransactionSubmitError(error, TransactionActionType.Approve);
2872
2888
  },
2873
2889
  onSuccess: (hash, variables, onMutateResult, context) => {
2874
2890
  if (passedOnSuccess) passedOnSuccess(hash, variables, onMutateResult, context);
@@ -2879,7 +2895,7 @@ function useCofheTokenApprove(writeMutationOptions) {
2879
2895
  token,
2880
2896
  tokenAmount,
2881
2897
  chainId: token.chainId,
2882
- actionType: "approve" /* Approve */,
2898
+ actionType: TransactionActionType.Approve,
2883
2899
  account
2884
2900
  });
2885
2901
  }
@@ -3341,7 +3357,7 @@ function getShieldApproveContractConfig() {
3341
3357
  }
3342
3358
  function getShieldEthContractConfig(token) {
3343
3359
  const contracts = getShieldContractsForToken(token);
3344
- if (!_optionalChain([contracts, 'optionalAccess', _96 => _96.native])) {
3360
+ if (!_optionalChain([contracts, 'optionalAccess', _97 => _97.native])) {
3345
3361
  throw new Error(
3346
3362
  `shield ETH config is not defined for confidentialityType: ${token.extensions.fhenix.confidentialityType}`
3347
3363
  );
@@ -3350,7 +3366,7 @@ function getShieldEthContractConfig(token) {
3350
3366
  }
3351
3367
  function getShieldWrappedPairContractConfig(token) {
3352
3368
  const contracts = getShieldContractsForToken(token);
3353
- if (!_optionalChain([contracts, 'optionalAccess', _97 => _97.wrappedPair])) {
3369
+ if (!_optionalChain([contracts, 'optionalAccess', _98 => _98.wrappedPair])) {
3354
3370
  throw new Error(
3355
3371
  `shield wrapped pair config is not defined for confidentialityType: ${token.extensions.fhenix.confidentialityType}`
3356
3372
  );
@@ -3373,7 +3389,7 @@ function getClaimSingleContractConfig(confidentialityType) {
3373
3389
  }
3374
3390
  function getClaimAllContractConfig(confidentialityType) {
3375
3391
  const contracts = getContractsForType(confidentialityType).claims;
3376
- if (!_optionalChain([contracts, 'optionalAccess', _98 => _98.all])) {
3392
+ if (!_optionalChain([contracts, 'optionalAccess', _99 => _99.all])) {
3377
3393
  throw new Error(`claim-all config is not defined for confidentialityType: ${confidentialityType}`);
3378
3394
  }
3379
3395
  return contracts.all;
@@ -3424,7 +3440,7 @@ function useResolvedCofheToken({ chainId: _chainId, address }, queryOptions) {
3424
3440
  const cofheChainId = useCofheChainId();
3425
3441
  const chainId = _nullishCoalesce(_chainId, () => ( cofheChainId));
3426
3442
  return useInternalQuery({
3427
- queryKey: ["resolvedCofheToken", chainId, _optionalChain([address, 'optionalAccess', _99 => _99.toLowerCase, 'call', _100 => _100()])],
3443
+ queryKey: ["resolvedCofheToken", chainId, _optionalChain([address, 'optionalAccess', _100 => _100.toLowerCase, 'call', _101 => _101()])],
3428
3444
  queryFn: async () => {
3429
3445
  if (!publicClient) {
3430
3446
  throw new Error("PublicClient is required to resolve a token");
@@ -3511,8 +3527,8 @@ function useResolvedCofheToken({ chainId: _chainId, address }, queryOptions) {
3511
3527
  ],
3512
3528
  allowFailure: true
3513
3529
  });
3514
- const pairDecimals = _optionalChain([pairMetadata, 'access', _101 => _101[0], 'optionalAccess', _102 => _102.status]) === "success" ? pairMetadata[0].result : void 0;
3515
- const pairSymbol = _optionalChain([pairMetadata, 'access', _103 => _103[1], 'optionalAccess', _104 => _104.status]) === "success" ? pairMetadata[1].result : void 0;
3530
+ const pairDecimals = _optionalChain([pairMetadata, 'access', _102 => _102[0], 'optionalAccess', _103 => _103.status]) === "success" ? pairMetadata[0].result : void 0;
3531
+ const pairSymbol = _optionalChain([pairMetadata, 'access', _104 => _104[1], 'optionalAccess', _105 => _105.status]) === "success" ? pairMetadata[1].result : void 0;
3516
3532
  if (pairDecimals != null && pairSymbol != null) {
3517
3533
  erc20Pair = {
3518
3534
  address: pairAddress,
@@ -3538,7 +3554,7 @@ function useResolvedCofheToken({ chainId: _chainId, address }, queryOptions) {
3538
3554
  erc20Pair
3539
3555
  });
3540
3556
  },
3541
- enabled: (_nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _105 => _105.enabled]), () => ( true))) && !!publicClient && !!chainId && !!address,
3557
+ enabled: (_nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _106 => _106.enabled]), () => ( true))) && !!publicClient && !!chainId && !!address,
3542
3558
  staleTime: Infinity,
3543
3559
  ...queryOptions
3544
3560
  });
@@ -3546,7 +3562,7 @@ function useResolvedCofheToken({ chainId: _chainId, address }, queryOptions) {
3546
3562
 
3547
3563
  // src/hooks/useCofheTokenLists.ts
3548
3564
  function isSupportedToken(token) {
3549
- const confidentialityType = _optionalChain([token, 'access', _106 => _106.extensions, 'optionalAccess', _107 => _107.fhenix, 'optionalAccess', _108 => _108.confidentialityType]);
3565
+ const confidentialityType = _optionalChain([token, 'access', _107 => _107.extensions, 'optionalAccess', _108 => _108.fhenix, 'optionalAccess', _109 => _109.confidentialityType]);
3550
3566
  return isSupportedTokenConfidentialityType(confidentialityType);
3551
3567
  }
3552
3568
  var TokenListFetchError = class extends Error {
@@ -3563,8 +3579,8 @@ function getCustomTokensForChain(customTokensByChainId, chainId) {
3563
3579
  }
3564
3580
  function useCofheTokenLists({ chainId }, queryOptions) {
3565
3581
  const widgetConfig = useCofheContext().client.config.react;
3566
- const tokensListsUrls = chainId ? _optionalChain([widgetConfig, 'access', _109 => _109.tokenLists, 'optionalAccess', _110 => _110[chainId]]) : [];
3567
- const queriesOptions = _optionalChain([tokensListsUrls, 'optionalAccess', _111 => _111.map, 'call', _112 => _112((url) => ({
3582
+ const tokensListsUrls = chainId ? _optionalChain([widgetConfig, 'access', _110 => _110.tokenLists, 'optionalAccess', _111 => _111[chainId]]) : [];
3583
+ const queriesOptions = _optionalChain([tokensListsUrls, 'optionalAccess', _112 => _112.map, 'call', _113 => _113((url) => ({
3568
3584
  cacheTime: Infinity,
3569
3585
  staleTime: Infinity,
3570
3586
  refetchOnMount: false,
@@ -3644,7 +3660,7 @@ function useCofheToken({ chainId: _chainId, address }, metdataQueryOptions) {
3644
3660
  },
3645
3661
  {
3646
3662
  ...metdataQueryOptions,
3647
- enabled: (_nullishCoalesce(_optionalChain([metdataQueryOptions, 'optionalAccess', _113 => _113.enabled]), () => ( true))) && !!address && !!chainId && !tokenFromList
3663
+ enabled: (_nullishCoalesce(_optionalChain([metdataQueryOptions, 'optionalAccess', _114 => _114.enabled]), () => ( true))) && !!address && !!chainId && !tokenFromList
3648
3664
  }
3649
3665
  );
3650
3666
  return _nullishCoalesce(tokenFromList, () => ( resolvedToken.data));
@@ -3752,10 +3768,10 @@ async function fetchUnshieldClaimsSummary({
3752
3768
  }
3753
3769
  function useCofheTokenClaimable({ accountAddress: account, token }, queryOptions) {
3754
3770
  const publicClient = useCofhePublicClient();
3755
- const confidentialityType = _optionalChain([token, 'optionalAccess', _114 => _114.extensions, 'access', _115 => _115.fhenix, 'access', _116 => _116.confidentialityType]);
3771
+ const confidentialityType = _optionalChain([token, 'optionalAccess', _115 => _115.extensions, 'access', _116 => _116.fhenix, 'access', _117 => _117.confidentialityType]);
3756
3772
  const queryKey = constructUnshieldClaimsQueryKey({
3757
- chainId: _optionalChain([token, 'optionalAccess', _117 => _117.chainId]),
3758
- tokenAddress: _optionalChain([token, 'optionalAccess', _118 => _118.address]),
3773
+ chainId: _optionalChain([token, 'optionalAccess', _118 => _118.chainId]),
3774
+ tokenAddress: _optionalChain([token, 'optionalAccess', _119 => _119.address]),
3759
3775
  confidentialityType,
3760
3776
  accountAddress: account
3761
3777
  });
@@ -3776,7 +3792,7 @@ function useCofheTokenClaimable({ accountAddress: account, token }, queryOptions
3776
3792
  accountAddress: account,
3777
3793
  confidentialityType,
3778
3794
  signal,
3779
- blockHashToBeAwareOf: _optionalChain([invalidationContext, 'optionalAccess', _119 => _119.blockHashToBeAwareOf])
3795
+ blockHashToBeAwareOf: _optionalChain([invalidationContext, 'optionalAccess', _120 => _120.blockHashToBeAwareOf])
3780
3796
  });
3781
3797
  }),
3782
3798
  refetchOnMount: false,
@@ -3813,7 +3829,7 @@ function getCofheTokenClaimUnshieldedCallArgs(params) {
3813
3829
  chain: void 0
3814
3830
  };
3815
3831
  }
3816
- if (!_optionalChain([claims, 'optionalAccess', _120 => _120.length])) {
3832
+ if (!_optionalChain([claims, 'optionalAccess', _121 => _121.length])) {
3817
3833
  return void 0;
3818
3834
  }
3819
3835
  const contractConfig = getClaimAllContractConfig(confidentialityType);
@@ -3892,7 +3908,7 @@ function useCofheTokenClaimUnshielded(options) {
3892
3908
  token: input.token,
3893
3909
  tokenAmount: decryptResult.decryptedValue,
3894
3910
  chainId,
3895
- actionType: "claim" /* Claim */,
3911
+ actionType: TransactionActionType.Claim,
3896
3912
  account
3897
3913
  });
3898
3914
  } catch (error) {
@@ -3952,7 +3968,7 @@ function useCofheTokenClaimUnshielded(options) {
3952
3968
  },
3953
3969
  onError: (error, variables, onMutateResult, context) => {
3954
3970
  if (onError) onError(error, variables, onMutateResult, context);
3955
- onTransactionSubmitError(error, "claim" /* Claim */);
3971
+ onTransactionSubmitError(error, TransactionActionType.Claim);
3956
3972
  },
3957
3973
  onSuccess: async (hash, input, onMutateResult, context) => {
3958
3974
  (0, import_ts_essentials7.assert)(chainId, "Chain ID is required for claim");
@@ -3966,7 +3982,7 @@ function useCofheTokenClaimUnshielded(options) {
3966
3982
  token: input.token,
3967
3983
  tokenAmount: input.amount,
3968
3984
  chainId,
3969
- actionType: "claim" /* Claim */,
3985
+ actionType: TransactionActionType.Claim,
3970
3986
  account
3971
3987
  });
3972
3988
  },
@@ -3991,7 +4007,7 @@ function useCofheDecrypt({
3991
4007
  const enabled = !!input && BigInt(input.ctHash) > 0n && !!client && (_nullishCoalesce(userEnabled, () => ( true)));
3992
4008
  return useInternalQuery({
3993
4009
  enabled,
3994
- queryKey: ["decryptCiphertext", _optionalChain([input, 'optionalAccess', _121 => _121.ctHash, 'access', _122 => _122.toString, 'call', _123 => _123()]), _optionalChain([input, 'optionalAccess', _124 => _124.utype])],
4010
+ queryKey: ["decryptCiphertext", _optionalChain([input, 'optionalAccess', _122 => _122.ctHash, 'access', _123 => _123.toString, 'call', _124 => _124()]), _optionalChain([input, 'optionalAccess', _125 => _125.utype])],
3995
4011
  queryFn: async () => {
3996
4012
  (0, import_ts_essentials8.assert)(input, "input is guaranteed to be defined by enabled condition");
3997
4013
  const builder = client.decryptForView(input.ctHash, input.utype);
@@ -4081,9 +4097,9 @@ function useCofheTokenDecryptedBalance({ token, accountAddress, displayDecimals
4081
4097
  disabledDueToMissingValidPermit
4082
4098
  } = useCofheReadContractAndDecrypt(
4083
4099
  {
4084
- address: _optionalChain([token, 'optionalAccess', _125 => _125.address]),
4085
- abi: _optionalChain([contractConfig, 'optionalAccess', _126 => _126.abi]),
4086
- functionName: _optionalChain([contractConfig, 'optionalAccess', _127 => _127.functionName]),
4100
+ address: _optionalChain([token, 'optionalAccess', _126 => _126.address]),
4101
+ abi: _optionalChain([contractConfig, 'optionalAccess', _127 => _127.abi]),
4102
+ functionName: _optionalChain([contractConfig, 'optionalAccess', _128 => _128.functionName]),
4087
4103
  args: accountAddress ? [accountAddress] : void 0,
4088
4104
  requiresPermit: true
4089
4105
  },
@@ -4122,7 +4138,7 @@ function constructPublicTokenBalanceQueryKey({
4122
4138
  accountAddress,
4123
4139
  tokenAddress
4124
4140
  }) {
4125
- return ["tokenBalance", chainId, _optionalChain([accountAddress, 'optionalAccess', _128 => _128.toLowerCase, 'call', _129 => _129()]), _optionalChain([tokenAddress, 'optionalAccess', _130 => _130.toLowerCase, 'call', _131 => _131()])];
4141
+ return ["tokenBalance", chainId, _optionalChain([accountAddress, 'optionalAccess', _129 => _129.toLowerCase, 'call', _130 => _130()]), _optionalChain([tokenAddress, 'optionalAccess', _131 => _131.toLowerCase, 'call', _132 => _132()])];
4126
4142
  }
4127
4143
  function constructPublicTokenBalanceQueryKeyForInvalidation({
4128
4144
  chainId,
@@ -4136,8 +4152,8 @@ function constructPublicTokenBalanceQueryKeyForInvalidation({
4136
4152
  });
4137
4153
  }
4138
4154
  function getPublicTokenBalanceSource(token) {
4139
- const confidentialityType = _optionalChain([token, 'optionalAccess', _132 => _132.extensions, 'access', _133 => _133.fhenix, 'access', _134 => _134.confidentialityType]);
4140
- const underlyingErc20 = _optionalChain([token, 'optionalAccess', _135 => _135.extensions, 'access', _136 => _136.fhenix, 'access', _137 => _137.erc20Pair]);
4155
+ const confidentialityType = _optionalChain([token, 'optionalAccess', _133 => _133.extensions, 'access', _134 => _134.fhenix, 'access', _135 => _135.confidentialityType]);
4156
+ const underlyingErc20 = _optionalChain([token, 'optionalAccess', _136 => _136.extensions, 'access', _137 => _137.fhenix, 'access', _138 => _138.erc20Pair]);
4141
4157
  const publicBalanceSourceType = getPublicBalanceSourceType(confidentialityType);
4142
4158
  const tokenToFetchBalanceFrom = publicBalanceSourceType === "erc20Pair" ? underlyingErc20 : publicBalanceSourceType === "token" ? token : void 0;
4143
4159
  if (!tokenToFetchBalanceFrom) return void 0;
@@ -4152,7 +4168,7 @@ function createPublicTokenBalanceQueryOptions(params) {
4152
4168
  const baseEnabled = !!publicClient && !!accountAddress && !!tokenAddress;
4153
4169
  const enabled = baseEnabled && (_nullishCoalesce(userEnabled, () => ( true)));
4154
4170
  const queryKey = constructPublicTokenBalanceQueryKey({
4155
- chainId: _optionalChain([publicClient, 'optionalAccess', _138 => _138.chain, 'optionalAccess', _139 => _139.id]),
4171
+ chainId: _optionalChain([publicClient, 'optionalAccess', _139 => _139.chain, 'optionalAccess', _140 => _140.id]),
4156
4172
  accountAddress,
4157
4173
  tokenAddress
4158
4174
  });
@@ -4167,7 +4183,7 @@ function createPublicTokenBalanceQueryOptions(params) {
4167
4183
  const balance = await maybeWaitUntilRpcAware(
4168
4184
  publicClient,
4169
4185
  {
4170
- blockHashToBeAwareOf: _optionalChain([invalidationContext, 'optionalAccess', _140 => _140.blockHashToBeAwareOf]),
4186
+ blockHashToBeAwareOf: _optionalChain([invalidationContext, 'optionalAccess', _141 => _141.blockHashToBeAwareOf]),
4171
4187
  readDescription: isNativeToken ? "read native balance" : "read ERC20 balance",
4172
4188
  read: () => isNativeToken ? publicClient.getBalance({
4173
4189
  address: accountAddress
@@ -4206,14 +4222,14 @@ function useCofheTokenPublicBalance({ token, accountAddress, displayDecimals = 5
4206
4222
  const tokenToFetchBalanceFrom = getPublicTokenBalanceSource(token);
4207
4223
  const { data, isFetching, refetch } = useTokenBalance(
4208
4224
  {
4209
- tokenAddress: _optionalChain([tokenToFetchBalanceFrom, 'optionalAccess', _141 => _141.address]),
4225
+ tokenAddress: _optionalChain([tokenToFetchBalanceFrom, 'optionalAccess', _142 => _142.address]),
4210
4226
  accountAddress: account
4211
4227
  },
4212
4228
  {
4213
4229
  enabled: userEnabled,
4214
4230
  select: (value) => {
4215
4231
  (0, import_ts_essentials10.assert)(
4216
- typeof _optionalChain([tokenToFetchBalanceFrom, 'optionalAccess', _142 => _142.decimals]) === "number",
4232
+ typeof _optionalChain([tokenToFetchBalanceFrom, 'optionalAccess', _143 => _143.decimals]) === "number",
4217
4233
  "Token decimals must be defined to format public token balance"
4218
4234
  );
4219
4235
  return formatTokenAmount(value, tokenToFetchBalanceFrom.decimals, displayDecimals);
@@ -4239,9 +4255,9 @@ var import_ts_essentials12 = __toESM(require_dist(), 1);
4239
4255
  function useNormalizedList(items, options) {
4240
4256
  return _react.useMemo.call(void 0, () => {
4241
4257
  if (!items || items.length === 0) return [];
4242
- const filter2 = _optionalChain([options, 'optionalAccess', _143 => _143.filter]);
4243
- const dedupeKey = _optionalChain([options, 'optionalAccess', _144 => _144.dedupeKey]);
4244
- const sort = _optionalChain([options, 'optionalAccess', _145 => _145.sort]);
4258
+ const filter2 = _optionalChain([options, 'optionalAccess', _144 => _144.filter]);
4259
+ const dedupeKey = _optionalChain([options, 'optionalAccess', _145 => _145.dedupeKey]);
4260
+ const sort = _optionalChain([options, 'optionalAccess', _146 => _146.sort]);
4245
4261
  const filtered = filter2 ? items.filter(filter2) : items;
4246
4262
  const deduped = (() => {
4247
4263
  if (!dedupeKey) return filtered;
@@ -4257,7 +4273,7 @@ function useNormalizedList(items, options) {
4257
4273
  })();
4258
4274
  if (sort) deduped.sort(sort);
4259
4275
  return deduped;
4260
- }, [items, _optionalChain([options, 'optionalAccess', _146 => _146.dedupeKey]), _optionalChain([options, 'optionalAccess', _147 => _147.filter]), _optionalChain([options, 'optionalAccess', _148 => _148.sort])]);
4276
+ }, [items, _optionalChain([options, 'optionalAccess', _147 => _147.dedupeKey]), _optionalChain([options, 'optionalAccess', _148 => _148.filter]), _optionalChain([options, 'optionalAccess', _149 => _149.sort])]);
4261
4277
  }
4262
4278
 
4263
4279
  // src/hooks/useStoredTransactions.ts
@@ -4291,7 +4307,7 @@ function useStoredTransactions({
4291
4307
  [transactionsAsArray, filter2, account]
4292
4308
  );
4293
4309
  const reduced = _react.useMemo.call(void 0, () => {
4294
- return _optionalChain([reducer, 'optionalCall', _149 => _149(filtered)]);
4310
+ return _optionalChain([reducer, 'optionalCall', _150 => _150(filtered)]);
4295
4311
  }, [filtered, reducer]);
4296
4312
  const uniqueHashes = new Set(filtered.map((tx) => tx.hash));
4297
4313
  (0, import_ts_essentials11.assert)(
@@ -4317,7 +4333,7 @@ function useStoredTransactions({
4317
4333
 
4318
4334
  // src/hooks/useCofheTokensClaimable.ts
4319
4335
  function isClaimableToken(token) {
4320
- return isTokenConfidentialityTypeClaimable(_optionalChain([token, 'access', _150 => _150.extensions, 'optionalAccess', _151 => _151.fhenix, 'optionalAccess', _152 => _152.confidentialityType]));
4336
+ return isTokenConfidentialityTypeClaimable(_optionalChain([token, 'access', _151 => _151.extensions, 'optionalAccess', _152 => _152.fhenix, 'optionalAccess', _153 => _153.confidentialityType]));
4321
4337
  }
4322
4338
  function claimableDedupeKey(token) {
4323
4339
  const confidentialityType = token.extensions.fhenix.confidentialityType;
@@ -4327,10 +4343,11 @@ function claimableSort(a, b) {
4327
4343
  if (a.chainId !== b.chainId) return a.chainId - b.chainId;
4328
4344
  return a.address.toLowerCase().localeCompare(b.address.toLowerCase());
4329
4345
  }
4330
- var pendingClaimsFilter = (tx) => tx.actionType === "claim" /* Claim */ && tx.status === "pending" /* Pending */;
4331
- var pendingUnshieldsFilter = (tx) => tx.actionType === "unshield" /* Unshield */ && tx.status === "pending" /* Pending */;
4346
+ var pendingClaimsFilter = (tx) => tx.actionType === TransactionActionType.Claim && tx.status === "pending" /* Pending */;
4347
+ var pendingUnshieldsFilter = (tx) => tx.actionType === TransactionActionType.Unshield && tx.status === "pending" /* Pending */;
4332
4348
  var asBooleanByTokenAddressLowercase = (txs) => {
4333
4349
  return txs.reduce((acc, tx) => {
4350
+ if (!tx.token) return acc;
4334
4351
  const key = tx.token.address.toLowerCase();
4335
4352
  acc[key] = true;
4336
4353
  return acc;
@@ -4381,7 +4398,7 @@ function useCofheTokensClaimable({ tokens, accountAddress: account }, queryOptio
4381
4398
  accountAddress: account,
4382
4399
  confidentialityType,
4383
4400
  signal,
4384
- blockHashToBeAwareOf: _optionalChain([invalidationContext, 'optionalAccess', _153 => _153.blockHashToBeAwareOf])
4401
+ blockHashToBeAwareOf: _optionalChain([invalidationContext, 'optionalAccess', _154 => _154.blockHashToBeAwareOf])
4385
4402
  });
4386
4403
  }),
4387
4404
  refetchOnMount: false,
@@ -4446,8 +4463,8 @@ function getCofheTokenShieldCallArgs(params) {
4446
4463
  throw new Error("confidentialityType is required in token extensions");
4447
4464
  }
4448
4465
  assertTokenOperationSupported(confidentialityType, "shield");
4449
- const erc20PairAddress = _optionalChain([token, 'access', _154 => _154.extensions, 'access', _155 => _155.fhenix, 'access', _156 => _156.erc20Pair, 'optionalAccess', _157 => _157.address]);
4450
- const isEth = _optionalChain([erc20PairAddress, 'optionalAccess', _158 => _158.toLowerCase, 'call', _159 => _159()]) === ETH_ADDRESS_LOWERCASE;
4466
+ const erc20PairAddress = _optionalChain([token, 'access', _155 => _155.extensions, 'access', _156 => _156.fhenix, 'access', _157 => _157.erc20Pair, 'optionalAccess', _158 => _158.address]);
4467
+ const isEth = _optionalChain([erc20PairAddress, 'optionalAccess', _159 => _159.toLowerCase, 'call', _160 => _160()]) === ETH_ADDRESS_LOWERCASE;
4451
4468
  if (isEth) {
4452
4469
  const contractConfig2 = getShieldEthContractConfig(token);
4453
4470
  return {
@@ -4519,8 +4536,8 @@ function useCofheTokenShield(options) {
4519
4536
  }
4520
4537
  assertTokenOperationSupported(confidentialityType, "shield");
4521
4538
  let hash;
4522
- const erc20PairAddress = _optionalChain([input, 'access', _160 => _160.token, 'access', _161 => _161.extensions, 'access', _162 => _162.fhenix, 'access', _163 => _163.erc20Pair, 'optionalAccess', _164 => _164.address]);
4523
- const isEth = _optionalChain([erc20PairAddress, 'optionalAccess', _165 => _165.toLowerCase, 'call', _166 => _166()]) === ETH_ADDRESS_LOWERCASE;
4539
+ const erc20PairAddress = _optionalChain([input, 'access', _161 => _161.token, 'access', _162 => _162.extensions, 'access', _163 => _163.fhenix, 'access', _164 => _164.erc20Pair, 'optionalAccess', _165 => _165.address]);
4540
+ const isEth = _optionalChain([erc20PairAddress, 'optionalAccess', _166 => _166.toLowerCase, 'call', _167 => _167()]) === ETH_ADDRESS_LOWERCASE;
4524
4541
  const { main: shieldCallArgs } = getCofheTokenShieldCallArgs({
4525
4542
  token: input.token,
4526
4543
  amount: input.amount,
@@ -4533,7 +4550,7 @@ function useCofheTokenShield(options) {
4533
4550
  });
4534
4551
  hash = await walletClient.writeContract({ ...request, chain: void 0 });
4535
4552
  } else {
4536
- _optionalChain([input, 'access', _167 => _167.onStatusChange, 'optionalCall', _168 => _168("Please confirm shield in wallet...")]);
4553
+ _optionalChain([input, 'access', _168 => _168.onStatusChange, 'optionalCall', _169 => _169("Please confirm shield in wallet...")]);
4537
4554
  const { request: shieldRequest } = await publicClient.simulateContract({
4538
4555
  ...shieldCallArgs,
4539
4556
  account: walletClient.account
@@ -4544,7 +4561,7 @@ function useCofheTokenShield(options) {
4544
4561
  },
4545
4562
  onError: (error, variables, onMutateResult, context) => {
4546
4563
  if (onError) onError(error, variables, onMutateResult, context);
4547
- onTransactionSubmitError(error, "shield" /* Shield */);
4564
+ onTransactionSubmitError(error, TransactionActionType.Shield);
4548
4565
  },
4549
4566
  onSuccess: async (hash, input, onMutateResult, context) => {
4550
4567
  (0, import_ts_essentials13.assert)(chainId, "Chain ID is required for token shield");
@@ -4555,7 +4572,7 @@ function useCofheTokenShield(options) {
4555
4572
  token: input.token,
4556
4573
  tokenAmount: input.amount,
4557
4574
  chainId,
4558
- actionType: "shield" /* Shield */,
4575
+ actionType: TransactionActionType.Shield,
4559
4576
  account
4560
4577
  });
4561
4578
  },
@@ -4601,7 +4618,7 @@ function useCofheReadContracts(params, queryOptions) {
4601
4618
  publicClient,
4602
4619
  cofheChainId,
4603
4620
  contracts,
4604
- userEnabled: _optionalChain([queryOptions, 'optionalAccess', _169 => _169.enabled])
4621
+ userEnabled: _optionalChain([queryOptions, 'optionalAccess', _170 => _170.enabled])
4605
4622
  });
4606
4623
  const { enabled: _ignoredEnabled, ...restQueryOptions } = queryOptions || {};
4607
4624
  return useInternalQuery({
@@ -4609,7 +4626,7 @@ function useCofheReadContracts(params, queryOptions) {
4609
4626
  queryKey: constructCofheReadContractsQueryKey({
4610
4627
  cofheChainId,
4611
4628
  contracts,
4612
- allowFailure: _optionalChain([multicallOptions, 'optionalAccess', _170 => _170.allowFailure])
4629
+ allowFailure: _optionalChain([multicallOptions, 'optionalAccess', _171 => _171.allowFailure])
4613
4630
  }),
4614
4631
  queryFn: async () => {
4615
4632
  (0, import_ts_essentials14.assert)(publicClient, "PublicClient should be guaranteed by enabled check");
@@ -4685,7 +4702,7 @@ function useCofheTokensWithExistingEncryptedBalances({ chainId: _chainId, accoun
4685
4702
  {
4686
4703
  refetchOnMount: false,
4687
4704
  ...queryOptions,
4688
- enabled: (_nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _171 => _171.enabled]), () => ( true))) && !!account && tokens.length > 0
4705
+ enabled: (_nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _172 => _172.enabled]), () => ( true))) && !!account && tokens.length > 0
4689
4706
  }
4690
4707
  );
4691
4708
  const { tokensWithExistingEncryptedBalance, ctHashByTokenAddress, error } = _react.useMemo.call(void 0, () => {
@@ -4790,7 +4807,7 @@ function useCofheTokenTransfer(writeMutationOptions) {
4790
4807
  writingMutationOptions: {
4791
4808
  onError: (error, variables, onMutateResult, context) => {
4792
4809
  if (passedOnError) passedOnError(error, variables, onMutateResult, context);
4793
- onTransactionSubmitError(error, "shieldSend" /* ShieldSend */);
4810
+ onTransactionSubmitError(error, TransactionActionType.ShieldSend);
4794
4811
  },
4795
4812
  onSuccess: (hash, variables, onMutateResult, context) => {
4796
4813
  if (passedOnSuccess) passedOnSuccess(hash, variables, onMutateResult, context);
@@ -4801,7 +4818,7 @@ function useCofheTokenTransfer(writeMutationOptions) {
4801
4818
  token: extras.token,
4802
4819
  tokenAmount: extras.amount,
4803
4820
  chainId: extras.token.chainId,
4804
- actionType: "shieldSend" /* ShieldSend */,
4821
+ actionType: TransactionActionType.ShieldSend,
4805
4822
  account: extras.userAddress
4806
4823
  });
4807
4824
  },
@@ -4838,6 +4855,30 @@ function useCofheTokenTransfer(writeMutationOptions) {
4838
4855
  };
4839
4856
  }
4840
4857
 
4858
+ // src/hooks/useCofheTransactions.ts
4859
+
4860
+ function addCofheTransaction(transaction) {
4861
+ useTransactionStore.getState().addTransaction(transaction);
4862
+ }
4863
+ function useCofheTransactions() {
4864
+ const transactions = useTransactionStore((state) => state.transactions);
4865
+ const addTransaction = _react.useCallback.call(void 0, (transaction) => {
4866
+ addCofheTransaction(transaction);
4867
+ }, []);
4868
+ const clearTransactions = useTransactionStore((state) => state.clearTransactions);
4869
+ const getTransaction = useTransactionStore((state) => state.getTransaction);
4870
+ const getAllTransactions = useTransactionStore((state) => state.getAllTransactions);
4871
+ const getAllTransactionsByToken = useTransactionStore((state) => state.getAllTransactionsByToken);
4872
+ return {
4873
+ transactions,
4874
+ addTransaction,
4875
+ clearTransactions,
4876
+ getTransaction,
4877
+ getAllTransactions,
4878
+ getAllTransactionsByToken
4879
+ };
4880
+ }
4881
+
4841
4882
  // src/hooks/useCofheTokenUnshield.ts
4842
4883
 
4843
4884
 
@@ -4871,7 +4912,7 @@ function useOnceTransactionMined({
4871
4912
  });
4872
4913
  return {
4873
4914
  transaction,
4874
- isMining: _optionalChain([transaction, 'optionalAccess', _172 => _172.status]) === "pending"
4915
+ isMining: _optionalChain([transaction, 'optionalAccess', _173 => _173.status]) === "pending"
4875
4916
  };
4876
4917
  }
4877
4918
  function useStoredTransactionStatusEffect({
@@ -4882,8 +4923,8 @@ function useStoredTransactionStatusEffect({
4882
4923
  const previousTransactionRef = _react.useRef.call(void 0, void 0);
4883
4924
  _react.useEffect.call(void 0, () => {
4884
4925
  if (!onTransactionStatusChange) return;
4885
- if (_optionalChain([previousTransactionRef, 'access', _173 => _173.current, 'optionalAccess', _174 => _174.status]) !== _optionalChain([transaction, 'optionalAccess', _175 => _175.status]) && !!transaction) {
4886
- onTransactionStatusChange(_optionalChain([previousTransactionRef, 'access', _176 => _176.current, 'optionalAccess', _177 => _177.status]), transaction.status, transaction);
4926
+ if (_optionalChain([previousTransactionRef, 'access', _174 => _174.current, 'optionalAccess', _175 => _175.status]) !== _optionalChain([transaction, 'optionalAccess', _176 => _176.status]) && !!transaction) {
4927
+ onTransactionStatusChange(_optionalChain([previousTransactionRef, 'access', _177 => _177.current, 'optionalAccess', _178 => _178.status]), transaction.status, transaction);
4887
4928
  previousTransactionRef.current = transaction;
4888
4929
  }
4889
4930
  }, [onTransactionStatusChange, transaction]);
@@ -4943,7 +4984,7 @@ function useCofheTokenUnshieldMutation(options) {
4943
4984
  amount: input.amount,
4944
4985
  account: walletClient.account.address
4945
4986
  });
4946
- _optionalChain([input, 'access', _178 => _178.onStatusChange, 'optionalCall', _179 => _179("Please confirm in wallet...")]);
4987
+ _optionalChain([input, 'access', _179 => _179.onStatusChange, 'optionalCall', _180 => _180("Please confirm in wallet...")]);
4947
4988
  const { request } = await publicClient.simulateContract({
4948
4989
  ...unshieldCallArgs,
4949
4990
  account: walletClient.account
@@ -4953,7 +4994,7 @@ function useCofheTokenUnshieldMutation(options) {
4953
4994
  },
4954
4995
  onError: (error, variables, onMutateResult, context) => {
4955
4996
  if (onError) onError(error, variables, onMutateResult, context);
4956
- onTransactionSubmitError(error, "unshield" /* Unshield */);
4997
+ onTransactionSubmitError(error, TransactionActionType.Unshield);
4957
4998
  },
4958
4999
  onSuccess: async (hash, input, onMutateResult, context) => {
4959
5000
  (0, import_ts_essentials16.assert)(chainId, "Chain ID is required for token unshield");
@@ -4964,7 +5005,7 @@ function useCofheTokenUnshieldMutation(options) {
4964
5005
  token: input.token,
4965
5006
  tokenAmount: input.amount,
4966
5007
  chainId,
4967
- actionType: "unshield" /* Unshield */,
5008
+ actionType: TransactionActionType.Unshield,
4968
5009
  account
4969
5010
  });
4970
5011
  },
@@ -5048,7 +5089,7 @@ function parseCoingeckoSimpleTokenPriceUsd({
5048
5089
  }) {
5049
5090
  const key = normalizeCoingeckoContractAddress(contractAddress);
5050
5091
  const obj = responseJson;
5051
- const usd = _optionalChain([obj, 'optionalAccess', _180 => _180[key], 'optionalAccess', _181 => _181.usd]);
5092
+ const usd = _optionalChain([obj, 'optionalAccess', _181 => _181[key], 'optionalAccess', _182 => _182.usd]);
5052
5093
  if (typeof usd !== "number" || !Number.isFinite(usd)) return null;
5053
5094
  return usd;
5054
5095
  }
@@ -5057,7 +5098,7 @@ function parseCoingeckoSimplePriceUsd({
5057
5098
  coinId
5058
5099
  }) {
5059
5100
  const obj = responseJson;
5060
- const usd = _optionalChain([obj, 'optionalAccess', _182 => _182[coinId], 'optionalAccess', _183 => _183.usd]);
5101
+ const usd = _optionalChain([obj, 'optionalAccess', _183 => _183[coinId], 'optionalAccess', _184 => _184.usd]);
5061
5102
  if (typeof usd !== "number" || !Number.isFinite(usd)) return null;
5062
5103
  return usd;
5063
5104
  }
@@ -5116,8 +5157,8 @@ function useCoingeckoUsdPrice({
5116
5157
  return parseCoingeckoSimpleTokenPriceUsd({ responseJson: json, contractAddress: tokenAddress });
5117
5158
  },
5118
5159
  // Reasonable defaults; consumer can override via queryOptions.
5119
- staleTime: _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _184 => _184.staleTime]), () => ( 6e4)),
5120
- refetchOnWindowFocus: _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _185 => _185.refetchOnWindowFocus]), () => ( false)),
5160
+ staleTime: _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _185 => _185.staleTime]), () => ( 6e4)),
5161
+ refetchOnWindowFocus: _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _186 => _186.refetchOnWindowFocus]), () => ( false)),
5121
5162
  ...queryOptions
5122
5163
  });
5123
5164
  }
@@ -5218,7 +5259,7 @@ function useTransactionReceiptsByHash({ hashes, chainId: chainIdInput, enabled:
5218
5259
  const publicClient = useCofhePublicClient();
5219
5260
  const cofheChainId = useCofheChainId();
5220
5261
  const chainId = _nullishCoalesce(chainIdInput, () => ( cofheChainId));
5221
- const enabled = !!publicClient && !!chainId && enabledInput && hashes !== void 0 && _optionalChain([hashes, 'optionalAccess', _186 => _186.size]) > 0;
5262
+ const enabled = !!publicClient && !!chainId && enabledInput && hashes !== void 0 && _optionalChain([hashes, 'optionalAccess', _187 => _187.size]) > 0;
5222
5263
  const queries = _react.useMemo.call(void 0, () => {
5223
5264
  if (!hashes) return [];
5224
5265
  return Array.from(hashes).map((hash) => {
@@ -5245,7 +5286,7 @@ function useTransactionReceiptsByHash({ hashes, chainId: chainIdInput, enabled:
5245
5286
  cofheLogger.log("useTransactionReceiptsByHash - receiptsByHash recalculated");
5246
5287
  if (!hashes) return {};
5247
5288
  return Array.from(hashes).reduce((acc, hash, i) => {
5248
- if (!_optionalChain([queriesResults, 'access', _187 => _187[i], 'optionalAccess', _188 => _188.data])) return acc;
5289
+ if (!_optionalChain([queriesResults, 'access', _188 => _188[i], 'optionalAccess', _189 => _189.data])) return acc;
5249
5290
  acc[hash] = queriesResults[i].data;
5250
5291
  return acc;
5251
5292
  }, {});
@@ -5300,8 +5341,8 @@ function useCoingeckoContractMarketChartRange({
5300
5341
  return null;
5301
5342
  }
5302
5343
  },
5303
- staleTime: _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _189 => _189.staleTime]), () => ( 6e4)),
5304
- refetchOnWindowFocus: _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _190 => _190.refetchOnWindowFocus]), () => ( false)),
5344
+ staleTime: _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _190 => _190.staleTime]), () => ( 6e4)),
5345
+ refetchOnWindowFocus: _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _191 => _191.refetchOnWindowFocus]), () => ( false)),
5305
5346
  ...queryOptions
5306
5347
  });
5307
5348
  }
@@ -5319,9 +5360,9 @@ function constructTokenAllowanceQueryKey({
5319
5360
  return [
5320
5361
  "tokenAllowance",
5321
5362
  chainId,
5322
- _optionalChain([tokenAddress, 'optionalAccess', _191 => _191.toLowerCase, 'call', _192 => _192()]),
5323
- _optionalChain([ownerAddress, 'optionalAccess', _193 => _193.toLowerCase, 'call', _194 => _194()]),
5324
- _optionalChain([spenderAddress, 'optionalAccess', _195 => _195.toLowerCase, 'call', _196 => _196()])
5363
+ _optionalChain([tokenAddress, 'optionalAccess', _192 => _192.toLowerCase, 'call', _193 => _193()]),
5364
+ _optionalChain([ownerAddress, 'optionalAccess', _194 => _194.toLowerCase, 'call', _195 => _195()]),
5365
+ _optionalChain([spenderAddress, 'optionalAccess', _196 => _196.toLowerCase, 'call', _197 => _197()])
5325
5366
  ];
5326
5367
  }
5327
5368
  function constructTokenAllowanceQueryKeyForInvalidation({
@@ -5343,7 +5384,7 @@ function createTokenAllowanceQueryOptions(params) {
5343
5384
  const baseEnabled = !!publicClient && !!tokenAddress && !!ownerAddress && !!spenderAddress;
5344
5385
  const enabled = baseEnabled && (_nullishCoalesce(userEnabled, () => ( true)));
5345
5386
  const queryKey = constructTokenAllowanceQueryKey({
5346
- chainId: _optionalChain([publicClient, 'optionalAccess', _197 => _197.chain, 'optionalAccess', _198 => _198.id]),
5387
+ chainId: _optionalChain([publicClient, 'optionalAccess', _198 => _198.chain, 'optionalAccess', _199 => _199.id]),
5347
5388
  tokenAddress,
5348
5389
  ownerAddress,
5349
5390
  spenderAddress
@@ -5360,7 +5401,7 @@ function createTokenAllowanceQueryOptions(params) {
5360
5401
  const allowance = await maybeWaitUntilRpcAwareAndReadContract(
5361
5402
  publicClient,
5362
5403
  {
5363
- blockHashToBeAwareOf: _optionalChain([invalidationContext, 'optionalAccess', _199 => _199.blockHashToBeAwareOf]),
5404
+ blockHashToBeAwareOf: _optionalChain([invalidationContext, 'optionalAccess', _200 => _200.blockHashToBeAwareOf]),
5364
5405
  address: tokenAddress,
5365
5406
  abi: allowanceContract.abi,
5366
5407
  functionName: allowanceContract.functionName,
@@ -5506,7 +5547,7 @@ function usePermitForm(options = {}) {
5506
5547
  setNameError(null);
5507
5548
  setReceiverError(null);
5508
5549
  } catch (e) {
5509
- setError(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _200 => _200.message]), () => ( "Failed to create permit")));
5550
+ setError(_nullishCoalesce(_optionalChain([e, 'optionalAccess', _201 => _201.message]), () => ( "Failed to create permit")));
5510
5551
  }
5511
5552
  }, [isPermitCreationPending, permitName, isDelegate, receiver, durationSeconds, createPermitMutateAsync]);
5512
5553
  const reset = _react.useCallback.call(void 0, () => {
@@ -5546,8 +5587,8 @@ var usePermitsList = () => {
5546
5587
  const { navigateTo } = usePortalNavigation();
5547
5588
  const { openModal } = usePortalModals();
5548
5589
  const activePermitHash = _react.useMemo.call(void 0, () => {
5549
- return _optionalChain([activePermit, 'optionalAccess', _201 => _201.permit, 'access', _202 => _202.hash]);
5550
- }, [_optionalChain([activePermit, 'optionalAccess', _203 => _203.permit, 'access', _204 => _204.hash])]);
5590
+ return _optionalChain([activePermit, 'optionalAccess', _202 => _202.permit, 'access', _203 => _203.hash]);
5591
+ }, [_optionalChain([activePermit, 'optionalAccess', _204 => _204.permit, 'access', _205 => _205.hash])]);
5551
5592
  const selfPermits = _react.useMemo.call(void 0, () => {
5552
5593
  return allPermits.filter((permit) => permit.type === "self");
5553
5594
  }, [allPermits]);
@@ -5623,11 +5664,11 @@ function useReceivePermit({ onSuccess, onError } = {}) {
5623
5664
  }
5624
5665
  await client.permits.importShared(importArg);
5625
5666
  setSuccessMsg("Permit received and set active.");
5626
- _optionalChain([onSuccess, 'optionalCall', _205 => _205()]);
5667
+ _optionalChain([onSuccess, 'optionalCall', _206 => _206()]);
5627
5668
  } catch (err) {
5628
- const message = _nullishCoalesce(_optionalChain([err, 'optionalAccess', _206 => _206.message]), () => ( "Failed to import permit"));
5669
+ const message = _nullishCoalesce(_optionalChain([err, 'optionalAccess', _207 => _207.message]), () => ( "Failed to import permit"));
5629
5670
  setErrorMsg(message);
5630
- _optionalChain([onError, 'optionalCall', _207 => _207(new Error(message))]);
5671
+ _optionalChain([onError, 'optionalCall', _208 => _208(new Error(message))]);
5631
5672
  } finally {
5632
5673
  setIsSubmitting(false);
5633
5674
  }
@@ -5751,16 +5792,16 @@ var usePermitDetailsAndActions = (permitHash) => {
5751
5792
  });
5752
5793
  }
5753
5794
  });
5754
- const isActivePermit = permit != null && _optionalChain([activePermit, 'optionalAccess', _208 => _208.permit, 'access', _209 => _209.hash]) === permitHash;
5795
+ const isActivePermit = permit != null && _optionalChain([activePermit, 'optionalAccess', _209 => _209.permit, 'access', _210 => _210.hash]) === permitHash;
5755
5796
  const expirationDate = permit != null ? new Date(permit.expiration * 1e3).toLocaleString() : void 0;
5756
- const isShareablePermit = _optionalChain([permit, 'optionalAccess', _210 => _210.type]) === "sharing";
5797
+ const isShareablePermit = _optionalChain([permit, 'optionalAccess', _211 => _211.type]) === "sharing";
5757
5798
  const permitLabel = _react.useMemo.call(void 0, () => {
5758
5799
  if (!permit) return void 0;
5759
- if (_optionalChain([permit, 'access', _211 => _211.name, 'optionalAccess', _212 => _212.trim, 'call', _213 => _213()])) return permit.name;
5800
+ if (_optionalChain([permit, 'access', _212 => _212.name, 'optionalAccess', _213 => _213.trim, 'call', _214 => _214()])) return permit.name;
5760
5801
  const fallbackAddress = permit.recipient && permit.recipient !== _viem.zeroAddress ? permit.recipient : permit.issuer || _viem.zeroAddress;
5761
5802
  return _nullishCoalesce(truncateAddress(fallbackAddress, 4, 4), () => ( fallbackAddress));
5762
5803
  }, [permit]);
5763
- const expirationInfo = _react.useMemo.call(void 0, () => formatExpirationLabel(_optionalChain([permit, 'optionalAccess', _214 => _214.expiration])), [_optionalChain([permit, 'optionalAccess', _215 => _215.expiration])]);
5804
+ const expirationInfo = _react.useMemo.call(void 0, () => formatExpirationLabel(_optionalChain([permit, 'optionalAccess', _215 => _215.expiration])), [_optionalChain([permit, 'optionalAccess', _216 => _216.expiration])]);
5764
5805
  const permitJson = _react.useMemo.call(void 0, () => {
5765
5806
  if (!permit) return void 0;
5766
5807
  return _permits.PermitUtils.export(permit);
@@ -5894,7 +5935,7 @@ var CofheEncryptInput = ({
5894
5935
  onEncryptError
5895
5936
  }) => {
5896
5937
  const [textValue, setTextValue] = _react.useState.call(void 0, initialValue);
5897
- const [selectedType, setSelectedType] = _react.useState.call(void 0, _optionalChain([options, 'access', _216 => _216[0], 'optionalAccess', _217 => _217.value]) || "uint32");
5938
+ const [selectedType, setSelectedType] = _react.useState.call(void 0, _optionalChain([options, 'access', _217 => _217[0], 'optionalAccess', _218 => _218.value]) || "uint32");
5898
5939
  const [isDropdownOpen, setIsDropdownOpen] = _react.useState.call(void 0, false);
5899
5940
  const [showProgress, setShowProgress] = _react.useState.call(void 0, false);
5900
5941
  const [encryptedResult, setEncryptedResult] = _react.useState.call(void 0, null);
@@ -5926,7 +5967,7 @@ var CofheEncryptInput = ({
5926
5967
  }, [showProgressBar, isEncrypting]);
5927
5968
  _react.useEffect.call(void 0, () => {
5928
5969
  if (isEncrypting && lastEncryptionStep && encryptionProgress && encryptionProgressLabel) {
5929
- _optionalChain([onEncryptProgress, 'optionalCall', _218 => _218({
5970
+ _optionalChain([onEncryptProgress, 'optionalCall', _219 => _219({
5930
5971
  step: lastEncryptionStep.step,
5931
5972
  progress: encryptionProgress,
5932
5973
  label: encryptionProgressLabel
@@ -6017,7 +6058,7 @@ var CofheEncryptInput = ({
6017
6058
  const handleTextChange = (e) => {
6018
6059
  const value = e.target.value;
6019
6060
  setTextValue(value);
6020
- _optionalChain([onTextChange, 'optionalCall', _219 => _219(value)]);
6061
+ _optionalChain([onTextChange, 'optionalCall', _220 => _220(value)]);
6021
6062
  setEncryptedResult(null);
6022
6063
  setCopySuccess(false);
6023
6064
  debouncedValidation(value);
@@ -6048,27 +6089,27 @@ var CofheEncryptInput = ({
6048
6089
  const handleTypeSelect = async (type) => {
6049
6090
  setSelectedType(type);
6050
6091
  setIsDropdownOpen(false);
6051
- _optionalChain([onTypeChange, 'optionalCall', _220 => _220(type)]);
6092
+ _optionalChain([onTypeChange, 'optionalCall', _221 => _221(type)]);
6052
6093
  if (textValue.trim() !== "") {
6053
6094
  try {
6054
6095
  cofheLogger.log("Auto-encrypting value:", textValue, "as type:", type);
6055
- _optionalChain([onEncryptStart, 'optionalCall', _221 => _221({ value: textValue, type })]);
6096
+ _optionalChain([onEncryptStart, 'optionalCall', _222 => _222({ value: textValue, type })]);
6056
6097
  (async () => {
6057
6098
  try {
6058
6099
  const [encryptionResult] = await encrypt([_sdk.Encryptable.create(type, textValue)]);
6059
6100
  setEncryptedResult(encryptionResult);
6060
6101
  const data = { value: textValue, encrypted: encryptionResult };
6061
- _optionalChain([onEncryptComplete, 'optionalCall', _222 => _222(data)]);
6102
+ _optionalChain([onEncryptComplete, 'optionalCall', _223 => _223(data)]);
6062
6103
  } catch (error) {
6063
6104
  const errorMessage2 = error instanceof Error ? error.message : "Encryption failed";
6064
6105
  cofheLogger.error("Encryption failed:", error);
6065
- _optionalChain([onEncryptError, 'optionalCall', _223 => _223(errorMessage2)]);
6106
+ _optionalChain([onEncryptError, 'optionalCall', _224 => _224(errorMessage2)]);
6066
6107
  }
6067
6108
  })();
6068
6109
  } catch (error) {
6069
6110
  const errorMessage2 = error instanceof Error ? error.message : "Encryption setup failed";
6070
6111
  cofheLogger.error("Encryption setup failed:", error);
6071
- _optionalChain([onEncryptError, 'optionalCall', _224 => _224(errorMessage2)]);
6112
+ _optionalChain([onEncryptError, 'optionalCall', _225 => _225(errorMessage2)]);
6072
6113
  }
6073
6114
  }
6074
6115
  };
@@ -6210,7 +6251,7 @@ function abortError2(message = "Aborted") {
6210
6251
  }
6211
6252
  async function sleep2(ms, signal) {
6212
6253
  if (ms <= 0) return;
6213
- if (_optionalChain([signal, 'optionalAccess', _225 => _225.aborted])) throw abortError2();
6254
+ if (_optionalChain([signal, 'optionalAccess', _226 => _226.aborted])) throw abortError2();
6214
6255
  await new Promise((resolve, reject) => {
6215
6256
  const cleanup = () => {
6216
6257
  if (signal) signal.removeEventListener("abort", onAbort);
@@ -6236,7 +6277,7 @@ async function resolveReceiptBlockHash(receipt, publicClient, signal) {
6236
6277
  });
6237
6278
  let attempt = 0;
6238
6279
  while (true) {
6239
- if (_optionalChain([signal, 'optionalAccess', _226 => _226.aborted])) throw abortError2();
6280
+ if (_optionalChain([signal, 'optionalAccess', _227 => _227.aborted])) throw abortError2();
6240
6281
  attempt += 1;
6241
6282
  try {
6242
6283
  const block = await publicClient.getBlock({
@@ -6408,10 +6449,10 @@ function useTrackPendingTransactionsBase({
6408
6449
  receipt: normalizedReceipt
6409
6450
  });
6410
6451
  if (status === "confirmed" /* Confirmed */) onReceiptSuccess(tx, normalizedReceipt);
6411
- else _optionalChain([onReceiptFail, 'optionalCall', _227 => _227(tx, normalizedReceipt)]);
6452
+ else _optionalChain([onReceiptFail, 'optionalCall', _228 => _228(tx, normalizedReceipt)]);
6412
6453
  return normalizedReceipt;
6413
6454
  } catch (e) {
6414
- _optionalChain([onFetchFailure, 'optionalCall', _228 => _228(e, tx)]);
6455
+ _optionalChain([onFetchFailure, 'optionalCall', _229 => _229(e, tx)]);
6415
6456
  useTransactionStore.getState().updateTransactionStatus(tx.chainId, tx.hash, "failed" /* Failed */);
6416
6457
  throw e;
6417
6458
  }
@@ -6427,7 +6468,7 @@ function useTrackPendingTransactionsBase({
6427
6468
  function useHandleInvalidations() {
6428
6469
  const queryClient = useInternalQueryClient();
6429
6470
  const handleInvalidations = (tx, receipt) => {
6430
- const blockHashToBeAwareOf = _nullishCoalesce(_optionalChain([receipt, 'optionalAccess', _229 => _229.blockHash]), () => ( _optionalChain([tx, 'access', _230 => _230.receipt, 'optionalAccess', _231 => _231.blockHash])));
6471
+ const blockHashToBeAwareOf = _nullishCoalesce(_optionalChain([receipt, 'optionalAccess', _230 => _230.blockHash]), () => ( _optionalChain([tx, 'access', _231 => _231.receipt, 'optionalAccess', _232 => _232.blockHash])));
6431
6472
  invalidatePublicTokenBalanceQueries(
6432
6473
  {
6433
6474
  tokenAddress: ETH_ADDRESS_LOWERCASE,
@@ -6437,11 +6478,11 @@ function useHandleInvalidations() {
6437
6478
  queryClient,
6438
6479
  blockHashToBeAwareOf
6439
6480
  );
6440
- if (tx.actionType === "shieldSend" /* ShieldSend */) {
6481
+ if (tx.actionType === TransactionActionType.ShieldSend) {
6441
6482
  invalidateConfidentialTokenBalanceQueries(tx.token, queryClient, blockHashToBeAwareOf);
6442
- } else if (tx.actionType === "shield" /* Shield */) {
6483
+ } else if (tx.actionType === TransactionActionType.Shield) {
6443
6484
  invalidatePublicAndConfidentialTokenBalanceQueries(tx.token, tx.account, queryClient, blockHashToBeAwareOf);
6444
- } else if (tx.actionType === "unshield" /* Unshield */) {
6485
+ } else if (tx.actionType === TransactionActionType.Unshield) {
6445
6486
  invalidateConfidentialTokenBalanceQueries(tx.token, queryClient, blockHashToBeAwareOf);
6446
6487
  if (isTokenOperationSupported(tx.token.extensions.fhenix.confidentialityType, "claimable")) {
6447
6488
  invalidateClaimableQueries({
@@ -6451,7 +6492,7 @@ function useHandleInvalidations() {
6451
6492
  blockHashToBeAwareOf
6452
6493
  });
6453
6494
  }
6454
- } else if (tx.actionType === "claim" /* Claim */) {
6495
+ } else if (tx.actionType === TransactionActionType.Claim) {
6455
6496
  const publicBalanceSource = getPublicTokenBalanceSource(tx.token);
6456
6497
  if (publicBalanceSource) {
6457
6498
  invalidatePublicTokenBalanceQueries(
@@ -6470,7 +6511,7 @@ function useHandleInvalidations() {
6470
6511
  queryClient,
6471
6512
  blockHashToBeAwareOf
6472
6513
  });
6473
- } else if (tx.actionType === "approve" /* Approve */) {
6514
+ } else if (tx.actionType === TransactionActionType.Approve) {
6474
6515
  const publicBalanceSource = getPublicTokenBalanceSource(tx.token);
6475
6516
  if (publicBalanceSource && publicBalanceSource.address.toLowerCase() !== ETH_ADDRESS_LOWERCASE) {
6476
6517
  invalidateTokenAllowanceQueries(
@@ -6484,6 +6525,7 @@ function useHandleInvalidations() {
6484
6525
  blockHashToBeAwareOf
6485
6526
  );
6486
6527
  }
6528
+ } else if (isCustomTransactionActionType(tx.actionType)) {
6487
6529
  } else {
6488
6530
  cofheLogger.warn("No invalidation logic for transaction action type:", tx.actionType);
6489
6531
  }
@@ -6636,9 +6678,9 @@ var useWatchPermitStatus = () => {
6636
6678
  hidePermitSharedStatus();
6637
6679
  }
6638
6680
  };
6639
- updateStatuses(_optionalChain([activePermit, 'optionalAccess', _232 => _232.permit]));
6681
+ updateStatuses(_optionalChain([activePermit, 'optionalAccess', _233 => _233.permit]));
6640
6682
  intervalRef.current = setInterval(() => {
6641
- updateStatuses(_optionalChain([activePermit, 'optionalAccess', _233 => _233.permit]));
6683
+ updateStatuses(_optionalChain([activePermit, 'optionalAccess', _234 => _234.permit]));
6642
6684
  }, 2e3);
6643
6685
  return () => {
6644
6686
  if (intervalRef.current) {
@@ -7002,7 +7044,7 @@ var ChainIcon = ({ chainId, className }) => {
7002
7044
  var ConnectedChainIndicator = () => {
7003
7045
  const chainId = useCofheChainId();
7004
7046
  const chain = chainId ? _chains.getChainById.call(void 0, chainId) : void 0;
7005
- const currentNetwork = _optionalChain([chain, 'optionalAccess', _234 => _234.name]) || "Eth";
7047
+ const currentNetwork = _optionalChain([chain, 'optionalAccess', _235 => _235.name]) || "Eth";
7006
7048
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
7007
7049
  "div",
7008
7050
  {
@@ -7161,7 +7203,7 @@ var CofheTokenConfidentialBalance = ({
7161
7203
  hidden: disabledDueToMissingValidPermit,
7162
7204
  isFetching: isFetchingConfidential,
7163
7205
  formattedBalance: confidentialBalanceFormatted,
7164
- symbol: showSymbol ? _optionalChain([token, 'optionalAccess', _235 => _235.symbol]) : void 0
7206
+ symbol: showSymbol ? _optionalChain([token, 'optionalAccess', _236 => _236.symbol]) : void 0
7165
7207
  }
7166
7208
  );
7167
7209
  };
@@ -7185,7 +7227,7 @@ var CofheTokenPublicBalance = ({
7185
7227
  size,
7186
7228
  isFetching: isFetchingPublic,
7187
7229
  formattedBalance: publicBalanceFormatted,
7188
- symbol: showSymbol ? _optionalChain([token, 'optionalAccess', _236 => _236.symbol]) : void 0
7230
+ symbol: showSymbol ? _optionalChain([token, 'optionalAccess', _237 => _237.symbol]) : void 0
7189
7231
  }
7190
7232
  );
7191
7233
  };
@@ -7194,7 +7236,7 @@ var CofheTokenPublicBalance = ({
7194
7236
  function useCofhePinnedTokenAddress() {
7195
7237
  const widgetConfig = useCofheContext().client.config.react;
7196
7238
  const chainId = useCofheChainId();
7197
- const pinnedTokenAddress = chainId ? _optionalChain([widgetConfig, 'access', _237 => _237.pinnedTokens, 'optionalAccess', _238 => _238[_optionalChain([chainId, 'optionalAccess', _239 => _239.toString, 'call', _240 => _240()])]]) : void 0;
7239
+ const pinnedTokenAddress = chainId ? _optionalChain([widgetConfig, 'access', _238 => _238.pinnedTokens, 'optionalAccess', _239 => _239[_optionalChain([chainId, 'optionalAccess', _240 => _240.toString, 'call', _241 => _241()])]]) : void 0;
7198
7240
  return pinnedTokenAddress;
7199
7241
  }
7200
7242
 
@@ -7261,8 +7303,8 @@ var AssetCard = () => {
7261
7303
  ),
7262
7304
  children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between", children: [
7263
7305
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-3 flex-1", children: [
7264
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenIcon, { logoURI: _optionalChain([token, 'optionalAccess', _241 => _241.logoURI]), alt: _optionalChain([token, 'optionalAccess', _242 => _242.symbol]), size: "md" }),
7265
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col gap-1", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-lg font-bold cofhe-text-primary", children: _optionalChain([token, 'optionalAccess', _243 => _243.symbol]) }) })
7306
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, TokenIcon, { logoURI: _optionalChain([token, 'optionalAccess', _242 => _242.logoURI]), alt: _optionalChain([token, 'optionalAccess', _243 => _243.symbol]), size: "md" }),
7307
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col gap-1", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-lg font-bold cofhe-text-primary", children: _optionalChain([token, 'optionalAccess', _244 => _244.symbol]) }) })
7266
7308
  ] }),
7267
7309
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
7268
7310
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col items-end", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -7477,8 +7519,8 @@ var formatUsd = (n) => n.toLocaleString(void 0, {
7477
7519
  maximumFractionDigits: 0
7478
7520
  });
7479
7521
  var CustomTooltip = ({ active, payload, label }) => {
7480
- if (!active || !_optionalChain([payload, 'optionalAccess', _244 => _244.length])) return null;
7481
- const v = _optionalChain([payload, 'access', _245 => _245[0], 'optionalAccess', _246 => _246.value]);
7522
+ if (!active || !_optionalChain([payload, 'optionalAccess', _245 => _245.length])) return null;
7523
+ const v = _optionalChain([payload, 'access', _246 => _246[0], 'optionalAccess', _247 => _247.value]);
7482
7524
  if (typeof v !== "number") return null;
7483
7525
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rounded-md border cofhe-card-border cofhe-card-bg px-2 py-1 shadow-sm", children: [
7484
7526
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-xxxs opacity-70", children: typeof label === "number" ? formatTime(label) : "" }),
@@ -7566,40 +7608,66 @@ var PageContainer = ({ isModal, header, content, footer }) => {
7566
7608
 
7567
7609
 
7568
7610
 
7611
+
7612
+ var warnedMissingCustomRendererActionTypes = /* @__PURE__ */ new Set();
7569
7613
  var ActionIcon = ({ actionType }) => {
7570
7614
  const iconClassName2 = "w-5 h-5";
7571
7615
  switch (actionType) {
7572
- case "shieldSend" /* ShieldSend */:
7616
+ case TransactionActionType.ShieldSend:
7573
7617
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _go.GoArrowUpRight, { className: iconClassName2 });
7574
- case "shield" /* Shield */:
7618
+ case TransactionActionType.Shield:
7575
7619
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _tb.TbShieldPlus, { className: iconClassName2 });
7576
- case "unshield" /* Unshield */:
7620
+ case TransactionActionType.Unshield:
7577
7621
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _tb.TbShieldMinus, { className: iconClassName2 });
7578
- case "claim" /* Claim */:
7622
+ case TransactionActionType.Claim:
7579
7623
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _tb.TbShieldCheck, { className: iconClassName2 });
7580
- case "approve" /* Approve */:
7624
+ case TransactionActionType.Approve:
7581
7625
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _go.GoArrowUpRight, { className: iconClassName2 });
7582
7626
  default:
7583
7627
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _go.GoArrowUpRight, { className: iconClassName2 });
7584
7628
  }
7585
7629
  };
7630
+ function stringifyPayload(payload) {
7631
+ try {
7632
+ return JSON.stringify(payload, null, 2);
7633
+ } catch (e6) {
7634
+ return String(payload);
7635
+ }
7636
+ }
7586
7637
  var TransactionItem = ({ transaction }) => {
7638
+ const { transactionRenderers } = useCofheContext();
7639
+ const Renderer = _optionalChain([transactionRenderers, 'optionalAccess', _248 => _248[transaction.actionType]]);
7640
+ _react.useEffect.call(void 0, () => {
7641
+ if (Renderer || !isCustomTransactionActionType(transaction.actionType)) return;
7642
+ if (warnedMissingCustomRendererActionTypes.has(transaction.actionType)) return;
7643
+ warnedMissingCustomRendererActionTypes.add(transaction.actionType);
7644
+ cofheLogger.warn(
7645
+ `No custom transaction renderer registered for "${transaction.actionType}". The SDK is using the fallback JSON renderer. Register a renderer by passing transactionRenderers to CofheProvider, for example: `,
7646
+ {
7647
+ transactionRenderers: {
7648
+ [transaction.actionType]: "YourTransactionRenderer"
7649
+ }
7650
+ }
7651
+ );
7652
+ }, [Renderer, transaction.actionType]);
7653
+ if (Renderer) {
7654
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Renderer, { transaction });
7655
+ }
7656
+ const amountLabel = "token" in transaction ? `${_viem.formatUnits.call(void 0, transaction.tokenAmount, transaction.token.decimals)} ${transaction.token.symbol}` : null;
7587
7657
  const statusColorClass = transaction.status === "pending" /* Pending */ ? "text-yellow-600 dark:text-yellow-400" : transaction.status === "confirmed" /* Confirmed */ ? "text-green-600 dark:text-green-400" : "text-red-600 dark:text-red-400";
7588
7658
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "cofhe-card-bg p-3 rounded-lg border cofhe-dropdown-border", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-start gap-3", children: [
7589
7659
  /* @__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 }) }),
7590
7660
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex-1 min-w-0", children: [
7591
7661
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between gap-2", children: [
7592
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-semibold cofhe-text-primary", children: actionToString(transaction.actionType) }),
7593
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: "text-sm font-semibold cofhe-text-primary", children: [
7594
- _viem.formatUnits.call(void 0, transaction.tokenAmount, transaction.token.decimals),
7595
- " ",
7596
- transaction.token.symbol
7597
- ] })
7662
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-semibold cofhe-text-primary", children: actionToString(transaction.actionType, transaction.title) }),
7663
+ amountLabel ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-sm font-semibold cofhe-text-primary", children: amountLabel }) : null
7598
7664
  ] }),
7599
7665
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between gap-2 mt-1", children: [
7600
7666
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: cn("text-xs font-medium", statusColorClass), children: statusToString(transaction.status) }),
7601
7667
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "text-xs cofhe-text-primary opacity-60", children: formatRelativeTime(transaction.timestamp) })
7602
7668
  ] }),
7669
+ transaction.description ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "mt-1 text-xs cofhe-text-primary opacity-70", children: transaction.description }) : null,
7670
+ isCustomTransactionActionType(transaction.actionType) && transaction.payload !== void 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "pre", { className: "mt-2 max-h-24 overflow-auto rounded cofhe-card-bg p-2 text-[10px] cofhe-text-primary opacity-80", children: stringifyPayload(transaction.payload) }) : null,
7603
7671
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-1", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HashLink, { type: "tx", hash: transaction.hash, chainId: transaction.chainId, copyable: true }) })
7604
7672
  ] })
7605
7673
  ] }) });
@@ -7607,7 +7675,7 @@ var TransactionItem = ({ transaction }) => {
7607
7675
 
7608
7676
  // src/utils/isProduction.ts
7609
7677
  var isProduction = () => {
7610
- if (typeof process !== "undefined" && _optionalChain([process, 'access', _247 => _247.env, 'optionalAccess', _248 => _248.NODE_ENV]) === "development") {
7678
+ if (typeof process !== "undefined" && _optionalChain([process, 'access', _249 => _249.env, 'optionalAccess', _250 => _250.NODE_ENV]) === "development") {
7611
7679
  return false;
7612
7680
  }
7613
7681
  if (typeof import.meta !== "undefined") {
@@ -7881,7 +7949,7 @@ var PermitItem = ({ permit, onClick, activePermitHash }) => {
7881
7949
  {
7882
7950
  variant: "ghost",
7883
7951
  className: "flex flex-row w-full items-centera !justify-start gap-3 p-0.5",
7884
- onClick: () => _optionalChain([onClick, 'optionalCall', _249 => _249(permit.hash)]),
7952
+ onClick: () => _optionalChain([onClick, 'optionalCall', _251 => _251(permit.hash)]),
7885
7953
  children: [
7886
7954
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
7887
7955
  "span",
@@ -8105,7 +8173,7 @@ var permitActions = [
8105
8173
  { id: "import", label: "Import", icon: _fa.FaDownload }
8106
8174
  ];
8107
8175
  function computeDefaultActiveAccordionId({ activePermit }) {
8108
- if (_optionalChain([activePermit, 'optionalAccess', _250 => _250.type]) === "recipient") {
8176
+ if (_optionalChain([activePermit, 'optionalAccess', _252 => _252.type]) === "recipient") {
8109
8177
  return "received";
8110
8178
  }
8111
8179
  return "self";
@@ -8600,7 +8668,7 @@ var money = (n) => n.toLocaleString(void 0, {
8600
8668
  });
8601
8669
  var TokenInfoBalanceChart = ({ token, chartPoints }) => {
8602
8670
  const account = useCofheAccount();
8603
- const publicSymbol = _nullishCoalesce(_optionalChain([token, 'access', _251 => _251.extensions, 'access', _252 => _252.fhenix, 'access', _253 => _253.erc20Pair, 'optionalAccess', _254 => _254.symbol]), () => ( token.symbol));
8671
+ const publicSymbol = _nullishCoalesce(_optionalChain([token, 'access', _253 => _253.extensions, 'access', _254 => _254.fhenix, 'access', _255 => _255.erc20Pair, 'optionalAccess', _256 => _256.symbol]), () => ( token.symbol));
8604
8672
  const { data: publicBalance, isFetching: isFetchingPublicBalance } = useCofheTokenPublicBalance({ token });
8605
8673
  const { data: confidentialBalance, isFetching: isFetchingConfidentialBalance } = useCofheTokenDecryptedBalance({
8606
8674
  accountAddress: account,
@@ -8609,9 +8677,9 @@ var TokenInfoBalanceChart = ({ token, chartPoints }) => {
8609
8677
  const isFetchingBalances = isFetchingConfidentialBalance || isFetchingPublicBalance;
8610
8678
  const balancePercents = _react.useMemo.call(void 0, () => {
8611
8679
  if (!confidentialBalance && !publicBalance) return;
8612
- const confidentialUnit = _nullishCoalesce(_optionalChain([confidentialBalance, 'optionalAccess', _255 => _255.unit]), () => ( null));
8613
- const publicUnit = _nullishCoalesce(_optionalChain([publicBalance, 'optionalAccess', _256 => _256.unit]), () => ( null));
8614
- const totalUnit = _nullishCoalesce(_optionalChain([(_nullishCoalesce(_optionalChain([confidentialUnit, 'optionalAccess', _257 => _257.plus, 'call', _258 => _258(_nullishCoalesce(publicUnit, () => ( 0)))]), () => ( publicUnit))), 'optionalAccess', _259 => _259.toNumber, 'call', _260 => _260()]), () => ( 0));
8680
+ const confidentialUnit = _nullishCoalesce(_optionalChain([confidentialBalance, 'optionalAccess', _257 => _257.unit]), () => ( null));
8681
+ const publicUnit = _nullishCoalesce(_optionalChain([publicBalance, 'optionalAccess', _258 => _258.unit]), () => ( null));
8682
+ const totalUnit = _nullishCoalesce(_optionalChain([(_nullishCoalesce(_optionalChain([confidentialUnit, 'optionalAccess', _259 => _259.plus, 'call', _260 => _260(_nullishCoalesce(publicUnit, () => ( 0)))]), () => ( publicUnit))), 'optionalAccess', _261 => _261.toNumber, 'call', _262 => _262()]), () => ( 0));
8615
8683
  const confidentialPct = totalUnit && totalUnit > 0 && confidentialUnit ? parseInt(confidentialUnit.div(totalUnit).times(100).toFixed(2)) : 0;
8616
8684
  const publicPct = 100 - confidentialPct;
8617
8685
  return {
@@ -8620,8 +8688,8 @@ var TokenInfoBalanceChart = ({ token, chartPoints }) => {
8620
8688
  };
8621
8689
  }, [confidentialBalance, publicBalance]);
8622
8690
  const price = _react.useMemo.call(void 0, () => {
8623
- const lastPoint = _optionalChain([chartPoints, 'optionalAccess', _261 => _261[chartPoints.length - 1]]);
8624
- const firstPoint = _optionalChain([chartPoints, 'optionalAccess', _262 => _262[0]]);
8691
+ const lastPoint = _optionalChain([chartPoints, 'optionalAccess', _263 => _263[chartPoints.length - 1]]);
8692
+ const firstPoint = _optionalChain([chartPoints, 'optionalAccess', _264 => _264[0]]);
8625
8693
  if (!lastPoint || !firstPoint) return;
8626
8694
  return {
8627
8695
  valueUsd: lastPoint.value,
@@ -8701,7 +8769,7 @@ var TokenInfoTransactionHistoryHeader = ({ token }) => {
8701
8769
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center justify-between", children: [
8702
8770
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-bold cofhe-text-primary", children: "Activity" }),
8703
8771
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HashLink, { type: "token", hash: token.address, chainId: token.chainId, extraShort: true }),
8704
- _optionalChain([token, 'access', _263 => _263.extensions, 'access', _264 => _264.fhenix, 'access', _265 => _265.erc20Pair, 'optionalAccess', _266 => _266.address]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HashLink, { type: "token", hash: token.extensions.fhenix.erc20Pair.address, chainId: token.chainId, extraShort: true })
8772
+ _optionalChain([token, 'access', _265 => _265.extensions, 'access', _266 => _266.fhenix, 'access', _267 => _267.erc20Pair, 'optionalAccess', _268 => _268.address]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HashLink, { type: "token", hash: token.extensions.fhenix.erc20Pair.address, chainId: token.chainId, extraShort: true })
8705
8773
  ] });
8706
8774
  };
8707
8775
  var money2 = (n) => n.toLocaleString(void 0, {
@@ -8715,14 +8783,25 @@ var TokenInfoTransactionHistory = ({ token, priceUsd }) => {
8715
8783
  const { filteredTxs: tokenTxs } = useStoredTransactions({
8716
8784
  chainId: token.chainId,
8717
8785
  account,
8718
- filter: (tx) => tx.token.address.toLowerCase() === token.address.toLowerCase()
8786
+ filter: (tx) => {
8787
+ const tokenAddress = token.address.toLowerCase();
8788
+ if ("token" in tx && tx.token.address.toLowerCase() === tokenAddress) return true;
8789
+ return _nullishCoalesce(_optionalChain([tx, 'access', _269 => _269.tokenTags, 'optionalAccess', _270 => _270.some, 'call', _271 => _271((tag) => tag.toLowerCase() === tokenAddress)]), () => ( false));
8790
+ }
8719
8791
  });
8720
8792
  const activity = _react.useMemo.call(void 0, () => {
8721
8793
  return tokenTxs.slice().sort((a, b) => b.timestamp - a.timestamp).map((tx) => {
8794
+ if (!("token" in tx)) {
8795
+ return {
8796
+ kind: actionToString(tx.actionType, tx.title),
8797
+ description: tx.description
8798
+ };
8799
+ }
8722
8800
  const amountToken = parseFloat(_viem.formatUnits.call(void 0, tx.tokenAmount, tx.token.decimals));
8723
8801
  const amountUsd = typeof priceUsd === "number" && Number.isFinite(amountToken) ? amountToken * priceUsd : void 0;
8724
8802
  return {
8725
- kind: actionToString(tx.actionType),
8803
+ kind: actionToString(tx.actionType, tx.title),
8804
+ description: tx.description,
8726
8805
  amountUsd,
8727
8806
  amountToken: Number.isFinite(amountToken) ? amountToken : 0
8728
8807
  };
@@ -8741,16 +8820,19 @@ var TokenInfoTransactionHistory = ({ token, priceUsd }) => {
8741
8820
  )
8742
8821
  }
8743
8822
  ),
8744
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-col", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm font-bold cofhe-text-primary", children: item.kind }) })
8823
+ /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col", children: [
8824
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm font-bold cofhe-text-primary", children: item.kind }),
8825
+ item.description ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs opacity-70", children: item.description }) : null
8826
+ ] })
8745
8827
  ] }),
8746
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-end", children: [
8828
+ "amountToken" in item ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-end", children: [
8747
8829
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-sm font-bold cofhe-text-primary", children: typeof item.amountUsd === "number" ? money2(item.amountUsd) : "--" }),
8748
8830
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-xxxs opacity-70", children: [
8749
8831
  item.amountToken,
8750
8832
  " ",
8751
8833
  token.symbol
8752
8834
  ] })
8753
- ] })
8835
+ ] }) : null
8754
8836
  ] }, idx);
8755
8837
  }) }) }) });
8756
8838
  };
@@ -8765,13 +8847,13 @@ var TokenInfoPage = ({ token }) => {
8765
8847
  contractAddress: TMP_WBTC_ON_MAINNET.address
8766
8848
  } : {
8767
8849
  chainId: token.chainId,
8768
- contractAddress: _nullishCoalesce(_optionalChain([token, 'access', _267 => _267.extensions, 'access', _268 => _268.fhenix, 'access', _269 => _269.erc20Pair, 'optionalAccess', _270 => _270.address]), () => ( token.address))
8850
+ contractAddress: _nullishCoalesce(_optionalChain([token, 'access', _272 => _272.extensions, 'access', _273 => _273.fhenix, 'access', _274 => _274.erc20Pair, 'optionalAccess', _275 => _275.address]), () => ( token.address))
8769
8851
  },
8770
8852
  rangeMs: 24 * 36e5
8771
8853
  });
8772
8854
  const priceUsd = _react.useMemo.call(void 0, () => {
8773
- const lastPoint = _optionalChain([chartPoints, 'optionalAccess', _271 => _271[chartPoints.length - 1]]);
8774
- return _optionalChain([lastPoint, 'optionalAccess', _272 => _272.value]);
8855
+ const lastPoint = _optionalChain([chartPoints, 'optionalAccess', _276 => _276[chartPoints.length - 1]]);
8856
+ return _optionalChain([lastPoint, 'optionalAccess', _277 => _277.value]);
8775
8857
  }, [chartPoints]);
8776
8858
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
8777
8859
  PageContainer,
@@ -8872,7 +8954,7 @@ var SendPage = ({ token: _token }) => {
8872
8954
  token,
8873
8955
  accountAddress: account
8874
8956
  });
8875
- const encryptionProgressLabel = _react.useMemo.call(void 0, () => _optionalChain([lastStep, 'optionalAccess', _273 => _273.step]) && getStepConfig(lastStep).label, [lastStep]);
8957
+ const encryptionProgressLabel = _react.useMemo.call(void 0, () => _optionalChain([lastStep, 'optionalAccess', _278 => _278.step]) && getStepConfig(lastStep).label, [lastStep]);
8876
8958
  const [amount, setAmount] = _react.useState.call(void 0, "");
8877
8959
  const [recipientAddress, setRecipientAddress] = _react.useState.call(void 0, "");
8878
8960
  const [error, setError] = _react.useState.call(void 0, null);
@@ -9033,7 +9115,7 @@ function useIsUnshieldingMining(token) {
9033
9115
  const account = useCofheAccount();
9034
9116
  const filter2 = _react.useCallback.call(void 0,
9035
9117
  (tx) => {
9036
- return tx.token.address === token.address && tx.actionType === "unshield" /* Unshield */ && tx.status === "pending" /* Pending */;
9118
+ return "token" in tx && tx.token.address === token.address && tx.actionType === TransactionActionType.Unshield && tx.status === "pending" /* Pending */;
9037
9119
  },
9038
9120
  [token.address]
9039
9121
  );
@@ -9154,7 +9236,7 @@ function useShieldWithLifecycle(token) {
9154
9236
  const account = useCofheAccount();
9155
9237
  const chainId = useCofheChainId();
9156
9238
  const [shieldAmount, setShieldAmount] = _react.useState.call(void 0, "");
9157
- const shieldSourceDecimals = _nullishCoalesce(_optionalChain([token, 'access', _274 => _274.extensions, 'access', _275 => _275.fhenix, 'access', _276 => _276.erc20Pair, 'optionalAccess', _277 => _277.decimals]), () => ( token.decimals));
9239
+ const shieldSourceDecimals = _nullishCoalesce(_optionalChain([token, 'access', _279 => _279.extensions, 'access', _280 => _280.fhenix, 'access', _281 => _281.erc20Pair, 'optionalAccess', _282 => _282.decimals]), () => ( token.decimals));
9158
9240
  const { setError, setStatus, error, status } = useLifecycleStore();
9159
9241
  const { schedule: scheduleStatusClear } = useReschedulableTimeout(() => setStatus(null), AUTOCLEAR_TX_STATUS_TIMEOUT);
9160
9242
  const tokenShield = useCofheTokenShield({
@@ -9234,12 +9316,12 @@ function useShieldWithLifecycle(token) {
9234
9316
  const handleShieldMax = () => {
9235
9317
  if (publicBalanceUnit) setShieldAmount(publicBalanceUnit.toFixed());
9236
9318
  };
9237
- const isValidShieldAmount = _nullishCoalesce((shieldAmount.length > 0 && _optionalChain([publicBalanceUnit, 'optionalAccess', _278 => _278.gte, 'call', _279 => _279(shieldAmount)])), () => ( false));
9319
+ const isValidShieldAmount = _nullishCoalesce((shieldAmount.length > 0 && _optionalChain([publicBalanceUnit, 'optionalAccess', _283 => _283.gte, 'call', _284 => _284(shieldAmount)])), () => ( false));
9238
9320
  const shieldAmountWei = _react.useMemo.call(void 0, () => {
9239
9321
  if (!isValidShieldAmount) return void 0;
9240
9322
  try {
9241
9323
  return unitToWei(shieldAmount, shieldSourceDecimals);
9242
- } catch (e6) {
9324
+ } catch (e7) {
9243
9325
  return void 0;
9244
9326
  }
9245
9327
  }, [isValidShieldAmount, shieldAmount, shieldSourceDecimals]);
@@ -9247,12 +9329,12 @@ function useShieldWithLifecycle(token) {
9247
9329
  if (!account || !shieldAmountWei) return void 0;
9248
9330
  return getCofheTokenShieldCallArgs({ token, amount: shieldAmountWei, account });
9249
9331
  }, [account, shieldAmountWei, token]);
9250
- const shieldCallArgs = _optionalChain([shieldTxCallArgs, 'optionalAccess', _280 => _280.main]);
9251
- const approvalCallArgs = _optionalChain([shieldTxCallArgs, 'optionalAccess', _281 => _281.approval]);
9252
- const approvalSpender = _nullishCoalesce(_optionalChain([approvalCallArgs, 'optionalAccess', _282 => _282.args, 'optionalAccess', _283 => _283[0]]), () => ( void 0));
9332
+ const shieldCallArgs = _optionalChain([shieldTxCallArgs, 'optionalAccess', _285 => _285.main]);
9333
+ const approvalCallArgs = _optionalChain([shieldTxCallArgs, 'optionalAccess', _286 => _286.approval]);
9334
+ const approvalSpender = _nullishCoalesce(_optionalChain([approvalCallArgs, 'optionalAccess', _287 => _287.args, 'optionalAccess', _288 => _288[0]]), () => ( void 0));
9253
9335
  const { data: allowanceWei, isFetching: isFetchingAllowance } = useTokenAllowance(
9254
9336
  {
9255
- tokenAddress: _optionalChain([approvalCallArgs, 'optionalAccess', _284 => _284.address]),
9337
+ tokenAddress: _optionalChain([approvalCallArgs, 'optionalAccess', _289 => _289.address]),
9256
9338
  ownerAddress: account,
9257
9339
  spenderAddress: approvalSpender
9258
9340
  },
@@ -9289,9 +9371,9 @@ function useShieldWithLifecycle(token) {
9289
9371
  setInputAmount: setShieldAmount,
9290
9372
  onMaxClick: handleShieldMax,
9291
9373
  canWriteContract: canWrite,
9292
- sourceSymbol: _nullishCoalesce(_optionalChain([token, 'access', _285 => _285.extensions, 'access', _286 => _286.fhenix, 'access', _287 => _287.erc20Pair, 'optionalAccess', _288 => _288.symbol]), () => ( token.symbol)),
9374
+ sourceSymbol: _nullishCoalesce(_optionalChain([token, 'access', _290 => _290.extensions, 'access', _291 => _291.fhenix, 'access', _292 => _292.erc20Pair, 'optionalAccess', _293 => _293.symbol]), () => ( token.symbol)),
9293
9375
  destSymbol: token.symbol,
9294
- sourceLogoURI: _nullishCoalesce(_optionalChain([token, 'access', _289 => _289.extensions, 'access', _290 => _290.fhenix, 'access', _291 => _291.erc20Pair, 'optionalAccess', _292 => _292.logoURI]), () => ( token.logoURI)),
9376
+ sourceLogoURI: _nullishCoalesce(_optionalChain([token, 'access', _294 => _294.extensions, 'access', _295 => _295.fhenix, 'access', _296 => _296.erc20Pair, 'optionalAccess', _297 => _297.logoURI]), () => ( token.logoURI)),
9295
9377
  destLogoURI: token.logoURI,
9296
9378
  handlePrimaryAction: shouldApprove ? handleApprove : handleShield,
9297
9379
  primaryLabel: shouldApprove ? "Approve" : "Shield",
@@ -9361,7 +9443,7 @@ function useUnshieldWithLifecycle(token) {
9361
9443
  const handleUnshieldMax = () => {
9362
9444
  if (confidentialBalanceUnit) setUnshieldAmount(confidentialBalanceUnit.toFixed());
9363
9445
  };
9364
- const isValidUnshieldAmount = _nullishCoalesce((unshieldAmount.length > 0 && _optionalChain([confidentialBalanceUnit, 'optionalAccess', _293 => _293.gte, 'call', _294 => _294(unshieldAmount)])), () => ( false));
9446
+ const isValidUnshieldAmount = _nullishCoalesce((unshieldAmount.length > 0 && _optionalChain([confidentialBalanceUnit, 'optionalAccess', _298 => _298.gte, 'call', _299 => _299(unshieldAmount)])), () => ( false));
9365
9447
  const unshieldCallArgs = _react.useMemo.call(void 0, () => {
9366
9448
  if (!account || !isValidUnshieldAmount) return void 0;
9367
9449
  const amountWei = _viem.parseUnits.call(void 0, unshieldAmount, token.decimals);
@@ -9384,9 +9466,9 @@ function useUnshieldWithLifecycle(token) {
9384
9466
  onMaxClick: handleUnshieldMax,
9385
9467
  canWriteContract: canUnshield,
9386
9468
  sourceSymbol: token.symbol,
9387
- destSymbol: _nullishCoalesce(_optionalChain([token, 'access', _295 => _295.extensions, 'access', _296 => _296.fhenix, 'access', _297 => _297.erc20Pair, 'optionalAccess', _298 => _298.symbol]), () => ( token.symbol)),
9469
+ destSymbol: _nullishCoalesce(_optionalChain([token, 'access', _300 => _300.extensions, 'access', _301 => _301.fhenix, 'access', _302 => _302.erc20Pair, 'optionalAccess', _303 => _303.symbol]), () => ( token.symbol)),
9388
9470
  sourceLogoURI: token.logoURI,
9389
- destLogoURI: _nullishCoalesce(_optionalChain([token, 'access', _299 => _299.extensions, 'access', _300 => _300.fhenix, 'access', _301 => _301.erc20Pair, 'optionalAccess', _302 => _302.logoURI]), () => ( token.logoURI)),
9471
+ destLogoURI: _nullishCoalesce(_optionalChain([token, 'access', _304 => _304.extensions, 'access', _305 => _305.fhenix, 'access', _306 => _306.erc20Pair, 'optionalAccess', _307 => _307.logoURI]), () => ( token.logoURI)),
9390
9472
  handlePrimaryAction: handleUnshield,
9391
9473
  primaryLabel: "Unshield",
9392
9474
  primaryIcon: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _tb.TbShieldMinus, { className: "w-3 h-3" })
@@ -9429,7 +9511,7 @@ function ClaimingSection({ token }) {
9429
9511
  status: claimingStatus,
9430
9512
  isClaimingMining
9431
9513
  } = useClaimUnshieldedWithLifecycle();
9432
- const pairedSymbol = _nullishCoalesce(_optionalChain([token, 'access', _303 => _303.extensions, 'access', _304 => _304.fhenix, 'access', _305 => _305.erc20Pair, 'optionalAccess', _306 => _306.symbol]), () => ( token.symbol));
9514
+ const pairedSymbol = _nullishCoalesce(_optionalChain([token, 'access', _308 => _308.extensions, 'access', _309 => _309.fhenix, 'access', _310 => _310.erc20Pair, 'optionalAccess', _311 => _311.symbol]), () => ( token.symbol));
9433
9515
  const handleClaim = async () => {
9434
9516
  (0, import_ts_essentials23.assert)(unshieldedClaims, "Unshield claims data is required to claim unshielded tokens");
9435
9517
  claimUnshield.mutateAsync({
@@ -9439,9 +9521,9 @@ function ClaimingSection({ token }) {
9439
9521
  };
9440
9522
  const isUnshieldingMining = useIsUnshieldingMining(token);
9441
9523
  const claimCallArgs = _react.useMemo.call(void 0, () => {
9442
- if (isDualToken || !account || !_optionalChain([unshieldedClaims, 'optionalAccess', _307 => _307.hasClaimable])) return void 0;
9524
+ if (isDualToken || !account || !_optionalChain([unshieldedClaims, 'optionalAccess', _312 => _312.hasClaimable])) return void 0;
9443
9525
  return void 0;
9444
- }, [account, isDualToken, token, _optionalChain([unshieldedClaims, 'optionalAccess', _308 => _308.hasClaimable])]);
9526
+ }, [account, isDualToken, token, _optionalChain([unshieldedClaims, 'optionalAccess', _313 => _313.hasClaimable])]);
9445
9527
  const claimSimulation = useCofheSimulateWriteContract(claimCallArgs, {
9446
9528
  enabled: !!claimCallArgs
9447
9529
  });
@@ -9451,16 +9533,16 @@ function ClaimingSection({ token }) {
9451
9533
  );
9452
9534
  const shouldSimulateClaim = !!claimCallArgs;
9453
9535
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
9454
- _optionalChain([unshieldedClaims, 'optionalAccess', _309 => _309.hasClaimable]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
9536
+ _optionalChain([unshieldedClaims, 'optionalAccess', _314 => _314.hasClaimable]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
9455
9537
  ActionButton,
9456
9538
  {
9457
9539
  onClick: handleClaim,
9458
9540
  disabled: claimUnshield.isPending || isClaimingMining || isFetchingClaims || isUnshieldingMining || shouldSimulateClaim && claimSimulation.isFetching || shouldSimulateClaim && !!claimSimulation.error,
9459
- label: claimUnshield.isPending ? "Claiming..." : `Claim ${isFetchingClaims ? "..." : formatTokenAmount(_nullishCoalesce(_optionalChain([unshieldedClaims, 'optionalAccess', _310 => _310.claimableAmount]), () => ( 0n)), token.decimals, 5).formatted} ${pairedSymbol}`,
9541
+ label: claimUnshield.isPending ? "Claiming..." : `Claim ${isFetchingClaims ? "..." : formatTokenAmount(_nullishCoalesce(_optionalChain([unshieldedClaims, 'optionalAccess', _315 => _315.claimableAmount]), () => ( 0n)), token.decimals, 5).formatted} ${pairedSymbol}`,
9460
9542
  className: "mt-1"
9461
9543
  }
9462
9544
  ),
9463
- _optionalChain([unshieldedClaims, 'optionalAccess', _311 => _311.hasPending]) && token && !unshieldedClaims.hasClaimable && !isDualToken && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-xxs text-yellow-600 dark:text-yellow-400 text-center", children: [
9545
+ _optionalChain([unshieldedClaims, 'optionalAccess', _316 => _316.hasPending]) && token && !unshieldedClaims.hasClaimable && !isDualToken && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "p", { className: "text-xxs text-yellow-600 dark:text-yellow-400 text-center", children: [
9464
9546
  "Pending: ",
9465
9547
  formatTokenAmount(unshieldedClaims.pendingAmount, token.decimals).formatted,
9466
9548
  " ",
@@ -10145,7 +10227,7 @@ var FloatingButtonComponent = ({ onClick }) => {
10145
10227
  const { theme } = useCofheFloatingButtonContext();
10146
10228
  const { statuses } = usePortalStatuses();
10147
10229
  const { portalOpen } = usePortalUI();
10148
- const topStatusVariant = _optionalChain([statuses, 'access', _312 => _312[statuses.length - 1], 'optionalAccess', _313 => _313.variant]);
10230
+ const topStatusVariant = _optionalChain([statuses, 'access', _317 => _317[statuses.length - 1], 'optionalAccess', _318 => _318.variant]);
10149
10231
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
10150
10232
  "button",
10151
10233
  {
@@ -10192,7 +10274,7 @@ var StatusBarSection = ({ children }) => {
10192
10274
 
10193
10275
 
10194
10276
  var TokenRow = ({ token, onClick, topLabel, balanceType }) => {
10195
- const publicSymbol = _nullishCoalesce(_optionalChain([token, 'access', _314 => _314.extensions, 'access', _315 => _315.fhenix, 'access', _316 => _316.erc20Pair, 'optionalAccess', _317 => _317.symbol]), () => ( token.symbol));
10277
+ const publicSymbol = _nullishCoalesce(_optionalChain([token, 'access', _319 => _319.extensions, 'access', _320 => _320.fhenix, 'access', _321 => _321.erc20Pair, 'optionalAccess', _322 => _322.symbol]), () => ( token.symbol));
10196
10278
  const destinationSymbol = token.symbol;
10197
10279
  const showDestination = balanceType === "public" /* Public */ && !!publicSymbol && !!destinationSymbol && publicSymbol !== destinationSymbol;
10198
10280
  const account = useCofheAccount();
@@ -10212,7 +10294,7 @@ var TokenRow = ({ token, onClick, topLabel, balanceType }) => {
10212
10294
  tokenAddress: TMP_WBTC_ON_MAINNET.address
10213
10295
  } : {
10214
10296
  chainId: token.chainId,
10215
- tokenAddress: _nullishCoalesce(_optionalChain([token, 'access', _318 => _318.extensions, 'access', _319 => _319.fhenix, 'access', _320 => _320.erc20Pair, 'optionalAccess', _321 => _321.address]), () => ( token.address))
10297
+ tokenAddress: _nullishCoalesce(_optionalChain([token, 'access', _323 => _323.extensions, 'access', _324 => _324.fhenix, 'access', _325 => _325.erc20Pair, 'optionalAccess', _326 => _326.address]), () => ( token.address))
10216
10298
  }
10217
10299
  );
10218
10300
  const usdValue = balanceType === "confidential" /* Confidential */ ? confidentialBalance && price && formatUsdAmount(confidentialBalance.unit.multipliedBy(price)) : publicBalance && price && formatUsdAmount(publicBalance.unit.multipliedBy(price));
@@ -10318,7 +10400,7 @@ var TokenListModal = ({
10318
10400
  };
10319
10401
  var TokenListContent = ({ tokens, onSelectToken, balanceType }) => {
10320
10402
  const pinnedTokenAddress = useCofhePinnedTokenAddress();
10321
- const normalizedPinnedAddress = _optionalChain([pinnedTokenAddress, 'optionalAccess', _322 => _322.toLowerCase, 'call', _323 => _323()]);
10403
+ const normalizedPinnedAddress = _optionalChain([pinnedTokenAddress, 'optionalAccess', _327 => _327.toLowerCase, 'call', _328 => _328()]);
10322
10404
  const pinnedToken = normalizedPinnedAddress ? tokens.find((t) => t.address.toLowerCase() === normalizedPinnedAddress) : void 0;
10323
10405
  const nonPinnedTokens = pinnedToken ? tokens.filter((t) => t.address.toLowerCase() !== normalizedPinnedAddress) : tokens;
10324
10406
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "cofhe-token-list-container", children: tokens.length === 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs opacity-70 py-4 text-center", children: "No tokens found" }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
@@ -10455,9 +10537,9 @@ function ClaimableTokens() {
10455
10537
  ] }),
10456
10538
  content: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-4 pr-1", children: [
10457
10539
  rows.map(({ token, claimableAmount }) => {
10458
- const isUnshielding = _nullishCoalesce(_optionalChain([unshieldingInProgressByTokenAddress, 'optionalAccess', _324 => _324[token.address.toLowerCase()]]), () => ( false));
10540
+ const isUnshielding = _nullishCoalesce(_optionalChain([unshieldingInProgressByTokenAddress, 'optionalAccess', _329 => _329[token.address.toLowerCase()]]), () => ( false));
10459
10541
  const formatted = formatTokenAmount(claimableAmount, token.decimals, 5).formatted;
10460
- const isClaimingThis = _nullishCoalesce(_optionalChain([isClaimingByTokenAddress, 'optionalAccess', _325 => _325[token.address.toLowerCase()]]), () => ( false));
10542
+ const isClaimingThis = _nullishCoalesce(_optionalChain([isClaimingByTokenAddress, 'optionalAccess', _330 => _330[token.address.toLowerCase()]]), () => ( false));
10461
10543
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "grid grid-cols-[1fr,auto,auto] items-center gap-4", children: [
10462
10544
  /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-3 min-w-0", children: [
10463
10545
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
@@ -10867,7 +10949,7 @@ var ImportCustomTokenCard = ({ tokens, onSelectToken, balanceType }) => {
10867
10949
  chainId: token.chainId,
10868
10950
  address: token.address
10869
10951
  });
10870
- if (_optionalChain([normalizedAddress, 'optionalAccess', _326 => _326.toLowerCase, 'call', _327 => _327()]) === token.address.toLowerCase()) {
10952
+ if (_optionalChain([normalizedAddress, 'optionalAccess', _331 => _331.toLowerCase, 'call', _332 => _332()]) === token.address.toLowerCase()) {
10871
10953
  setAddressInput("");
10872
10954
  }
10873
10955
  }
@@ -10933,7 +11015,7 @@ var MeasuredContentRenderer = ({ children, id, isModal, onModalOverlayClick }) =
10933
11015
  if (!contentRef.current) return;
10934
11016
  const observer = new ResizeObserver((entries) => {
10935
11017
  for (const entry of entries) {
10936
- const height = _nullishCoalesce(_optionalChain([entry, 'access', _328 => _328.borderBoxSize, 'optionalAccess', _329 => _329[0], 'optionalAccess', _330 => _330.blockSize]), () => ( entry.target.getBoundingClientRect().height));
11018
+ const height = _nullishCoalesce(_optionalChain([entry, 'access', _333 => _333.borderBoxSize, 'optionalAccess', _334 => _334[0], 'optionalAccess', _335 => _335.blockSize]), () => ( entry.target.getBoundingClientRect().height));
10937
11019
  setContentHeight(id, height);
10938
11020
  }
10939
11021
  });
@@ -10950,7 +11032,7 @@ var MeasuredContentRenderer = ({ children, id, isModal, onModalOverlayClick }) =
10950
11032
  onClick: (e) => {
10951
11033
  e.preventDefault();
10952
11034
  e.stopPropagation();
10953
- _optionalChain([onModalOverlayClick, 'optionalCall', _331 => _331()]);
11035
+ _optionalChain([onModalOverlayClick, 'optionalCall', _336 => _336()]);
10954
11036
  },
10955
11037
  className: "absolute flex w-full h-full bg-[#0E2F3F]/30 origin-top translate-y-[-8px] scale-[0.95]"
10956
11038
  }
@@ -11205,5 +11287,8 @@ var CofheFloatingButtonWithProvider = (props) => {
11205
11287
 
11206
11288
 
11207
11289
 
11208
- exports.useInternalQueryClient = useInternalQueryClient; exports.asCofhePublicClient = asCofhePublicClient; exports.asCofheWalletClient = asCofheWalletClient; exports.useCofheClient = useCofheClient; exports.useCofheAutoConnect = useCofheAutoConnect; exports.createCofheConfig = createCofheConfig; exports.CofheProvider = CofheProvider; exports.useCofheContext = useCofheContext; exports.useCofheCreatePermit = useCofheCreatePermit; exports.ETH_ADDRESS_LOWERCASE = ETH_ADDRESS_LOWERCASE; exports.getBlockExplorerUrl = getBlockExplorerUrl; exports.getBlockExplorerTxUrl = getBlockExplorerTxUrl; exports.getBlockExplorerAddressUrl = getBlockExplorerAddressUrl; exports.getBlockExplorerTokenUrl = getBlockExplorerTokenUrl; exports.isEthPair = isEthPair; exports.isWrappedEthToken = isWrappedEthToken; exports.FheTypesList = FheTypesList; exports.truncateHash = truncateHash; exports.formatRelativeTime = formatRelativeTime; exports.useCofheConnection = useCofheConnection; exports.useCofhePublicClient = useCofhePublicClient; exports.useCofheWalletClient = useCofheWalletClient; exports.useCofheActivePermit = useCofheActivePermit; exports.useCofheAllPermits = useCofheAllPermits; exports.useCofheRemovePermit = useCofheRemovePermit; exports.useCofheSelectPermit = useCofheSelectPermit; exports.useCofheNavigateToCreatePermit = useCofheNavigateToCreatePermit; exports.useCofheEnabled = useCofheEnabled; exports.useCofheEncrypt = useCofheEncrypt; exports.useCofheSimulateWriteContract = useCofheSimulateWriteContract; exports.useCofheStatuses = useCofheStatuses; exports.TransactionStatus = TransactionStatus; exports.TransactionActionType = TransactionActionType; exports.actionToString = actionToString; exports.statusToString = statusToString; exports.useTransactionStore = useTransactionStore; exports.useCofheWriteContract = useCofheWriteContract; exports.useCofheTokenApprove = useCofheTokenApprove; exports.useCofheTokenLists = useCofheTokenLists; exports.useCofheTokens = useCofheTokens; exports.useCofheTokenClaimable = useCofheTokenClaimable; exports.getCofheTokenClaimUnshieldedCallArgs = getCofheTokenClaimUnshieldedCallArgs; exports.useCofheTokenClaimUnshielded = useCofheTokenClaimUnshielded; exports.useCofheReadContractAndDecrypt = useCofheReadContractAndDecrypt; exports.useCofheTokenDecryptedBalance = useCofheTokenDecryptedBalance; exports.useCofheTokenPublicBalance = useCofheTokenPublicBalance; exports.useCofheTokensClaimable = useCofheTokensClaimable; exports.getCofheTokenShieldCallArgs = getCofheTokenShieldCallArgs; exports.useCofheTokenShield = useCofheTokenShield; exports.useCofheTokensWithExistingEncryptedBalances = useCofheTokensWithExistingEncryptedBalances; exports.useCofheEncryptAndWriteContract = useCofheEncryptAndWriteContract; exports.useCofheTokenTransfer = useCofheTokenTransfer; exports.getCofheTokenUnshieldCallArgs = getCofheTokenUnshieldCallArgs; exports.useCofheTokenUnshield = useCofheTokenUnshield; exports.useCoingeckoUsdPrice = useCoingeckoUsdPrice; exports.useTokensWithPublicBalances = useTokensWithPublicBalances; exports.useTransactionReceiptsByHash = useTransactionReceiptsByHash; exports.useCoingeckoContractMarketChartRange = useCoingeckoContractMarketChartRange; exports.useTokenAllowance = useTokenAllowance; exports.CofheEncryptInput = CofheEncryptInput; exports.CofheStatusActionIntents = CofheStatusActionIntents; exports.COFHE_STATUS_IDS = COFHE_STATUS_IDS; exports.CofheFloatingButtonProvider = CofheFloatingButtonProvider; exports.sortCofheStatuses = sortCofheStatuses; exports.MainPage = MainPage; exports.SettingsPage = SettingsPage; exports.CofheFloatingButtonWithProvider = CofheFloatingButtonWithProvider;
11209
- //# sourceMappingURL=chunk-SNIXBOED.cjs.map
11290
+
11291
+
11292
+
11293
+ exports.useInternalQueryClient = useInternalQueryClient; exports.asCofhePublicClient = asCofhePublicClient; exports.asCofheWalletClient = asCofheWalletClient; exports.useCofheClient = useCofheClient; exports.useCofheAutoConnect = useCofheAutoConnect; exports.createCofheConfig = createCofheConfig; exports.CofheProvider = CofheProvider; exports.useCofheContext = useCofheContext; exports.useCofheCreatePermit = useCofheCreatePermit; exports.ETH_ADDRESS_LOWERCASE = ETH_ADDRESS_LOWERCASE; exports.getBlockExplorerUrl = getBlockExplorerUrl; exports.getBlockExplorerTxUrl = getBlockExplorerTxUrl; exports.getBlockExplorerAddressUrl = getBlockExplorerAddressUrl; exports.getBlockExplorerTokenUrl = getBlockExplorerTokenUrl; exports.isEthPair = isEthPair; exports.isWrappedEthToken = isWrappedEthToken; exports.FheTypesList = FheTypesList; exports.truncateHash = truncateHash; exports.formatRelativeTime = formatRelativeTime; exports.useCofheConnection = useCofheConnection; exports.useCofhePublicClient = useCofhePublicClient; exports.useCofheWalletClient = useCofheWalletClient; exports.useCofheActivePermit = useCofheActivePermit; exports.useCofheAllPermits = useCofheAllPermits; exports.useCofheRemovePermit = useCofheRemovePermit; exports.useCofheSelectPermit = useCofheSelectPermit; exports.useCofheNavigateToCreatePermit = useCofheNavigateToCreatePermit; exports.useCofheEnabled = useCofheEnabled; exports.useCofheEncrypt = useCofheEncrypt; exports.useCofheSimulateWriteContract = useCofheSimulateWriteContract; exports.useCofheStatuses = useCofheStatuses; exports.TransactionStatus = TransactionStatus; exports.TransactionActionType = TransactionActionType; exports.actionToString = actionToString; exports.isCustomTransactionActionType = isCustomTransactionActionType; exports.statusToString = statusToString; exports.useTransactionStore = useTransactionStore; exports.useCofheWriteContract = useCofheWriteContract; exports.useCofheTokenApprove = useCofheTokenApprove; exports.useCofheTokenLists = useCofheTokenLists; exports.useCofheTokens = useCofheTokens; exports.useCofheTokenClaimable = useCofheTokenClaimable; exports.getCofheTokenClaimUnshieldedCallArgs = getCofheTokenClaimUnshieldedCallArgs; exports.useCofheTokenClaimUnshielded = useCofheTokenClaimUnshielded; exports.useCofheReadContractAndDecrypt = useCofheReadContractAndDecrypt; exports.useCofheTokenDecryptedBalance = useCofheTokenDecryptedBalance; exports.useCofheTokenPublicBalance = useCofheTokenPublicBalance; exports.useCofheTokensClaimable = useCofheTokensClaimable; exports.getCofheTokenShieldCallArgs = getCofheTokenShieldCallArgs; exports.useCofheTokenShield = useCofheTokenShield; exports.useCofheTokensWithExistingEncryptedBalances = useCofheTokensWithExistingEncryptedBalances; exports.useCofheEncryptAndWriteContract = useCofheEncryptAndWriteContract; exports.useCofheTokenTransfer = useCofheTokenTransfer; exports.addCofheTransaction = addCofheTransaction; exports.useCofheTransactions = useCofheTransactions; exports.getCofheTokenUnshieldCallArgs = getCofheTokenUnshieldCallArgs; exports.useCofheTokenUnshield = useCofheTokenUnshield; exports.useCoingeckoUsdPrice = useCoingeckoUsdPrice; exports.useTokensWithPublicBalances = useTokensWithPublicBalances; exports.useTransactionReceiptsByHash = useTransactionReceiptsByHash; exports.useCoingeckoContractMarketChartRange = useCoingeckoContractMarketChartRange; exports.useTokenAllowance = useTokenAllowance; exports.CofheEncryptInput = CofheEncryptInput; exports.CofheStatusActionIntents = CofheStatusActionIntents; exports.COFHE_STATUS_IDS = COFHE_STATUS_IDS; exports.CofheFloatingButtonProvider = CofheFloatingButtonProvider; exports.sortCofheStatuses = sortCofheStatuses; exports.MainPage = MainPage; exports.SettingsPage = SettingsPage; exports.CofheFloatingButtonWithProvider = CofheFloatingButtonWithProvider;
11294
+ //# sourceMappingURL=chunk-4FH4QHHA.cjs.map