@zama-fhe/react-sdk 1.0.0-alpha.13 → 1.0.0-alpha.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -598,7 +598,7 @@ function useConfidentialIsApproved(
598
598
 
599
599
  #### `useUnderlyingAllowance`
600
600
 
601
- Read the ERC-20 allowance of the underlying token for the wrapper.
601
+ Read the underlying ERC-20 allowance granted to the wrapper.
602
602
 
603
603
  ```ts
604
604
  function useUnderlyingAllowance(
@@ -794,46 +794,36 @@ const { data: value } = useUserDecryptedValue("0xHandleHash");
794
794
 
795
795
  ## Query Keys
796
796
 
797
- Exported query key factories for manual cache management (invalidation, prefetching, removal).
797
+ Use `zamaQueryKeys` for manual cache management (invalidation, prefetching, removal).
798
798
 
799
799
  ```ts
800
- import {
801
- confidentialBalanceQueryKeys,
802
- confidentialBalancesQueryKeys,
803
- confidentialHandleQueryKeys,
804
- confidentialHandlesQueryKeys,
805
- isAllowedQueryKeys,
806
- underlyingAllowanceQueryKeys,
807
- activityFeedQueryKeys,
808
- feeQueryKeys,
809
- decryptionKeys,
810
- } from "@zama-fhe/react-sdk";
800
+ import { zamaQueryKeys, decryptionKeys } from "@zama-fhe/react-sdk";
811
801
  ```
812
802
 
813
- | Factory | Keys | Description |
814
- | ------------------------------- | ---------------------------------------------------------------------------------------- | ----------------------------------- |
815
- | `confidentialBalanceQueryKeys` | `.all`, `.token(address)`, `.owner(address, owner)` | Single-token decrypted balance. |
816
- | `confidentialBalancesQueryKeys` | `.all`, `.tokens(addresses, owner)` | Multi-token batch balances. |
817
- | `confidentialHandleQueryKeys` | `.all`, `.token(address)`, `.owner(address, owner)` | Single-token encrypted handle. |
818
- | `confidentialHandlesQueryKeys` | `.all`, `.tokens(addresses, owner)` | Multi-token batch handles. |
819
- | `isAllowedQueryKeys` | `.all`, `.token(address)` | Session signature status. |
820
- | `underlyingAllowanceQueryKeys` | `.all`, `.token(address, wrapper)` | Underlying ERC-20 allowance. |
821
- | `activityFeedQueryKeys` | `.all`, `.token(address)` | Activity feed items. |
822
- | `feeQueryKeys` | `.shieldFee(...)`, `.unshieldFee(...)`, `.batchTransferFee(addr)`, `.feeRecipient(addr)` | Fee manager queries. |
823
- | `decryptionKeys` | `.value(handle)` | Individual decrypted handle values. |
803
+ | Factory | Keys | Description |
804
+ | ------------------------------------ | ---------------------------------------------------------------------------------------- | ----------------------------------- |
805
+ | `zamaQueryKeys.confidentialBalance` | `.all`, `.token(address)`, `.owner(address, owner)` | Single-token decrypted balance. |
806
+ | `zamaQueryKeys.confidentialBalances` | `.all`, `.tokens(addresses, owner)` | Multi-token batch balances. |
807
+ | `zamaQueryKeys.confidentialHandle` | `.all`, `.token(address)`, `.owner(address, owner)` | Single-token encrypted handle. |
808
+ | `zamaQueryKeys.confidentialHandles` | `.all`, `.tokens(addresses, owner)` | Multi-token batch handles. |
809
+ | `zamaQueryKeys.isAllowed` | `.all` | Session signature status. |
810
+ | `zamaQueryKeys.underlyingAllowance` | `.all`, `.token(address)`, `.scope(address, owner, wrapper)` | Underlying ERC-20 allowance. |
811
+ | `zamaQueryKeys.activityFeed` | `.all`, `.token(address)`, `.scope(address, userAddress, logsKey, decrypt)` | Activity feed items. |
812
+ | `zamaQueryKeys.fees` | `.shieldFee(...)`, `.unshieldFee(...)`, `.batchTransferFee(addr)`, `.feeRecipient(addr)` | Fee manager queries. |
813
+ | `decryptionKeys` | `.value(handle)` | Individual decrypted handle values. |
824
814
 
825
815
  ```tsx
826
816
  import { useQueryClient } from "@tanstack/react-query";
827
- import { confidentialBalanceQueryKeys } from "@zama-fhe/react-sdk";
817
+ import { zamaQueryKeys } from "@zama-fhe/react-sdk";
828
818
 
829
819
  const queryClient = useQueryClient();
830
820
 
831
821
  // Invalidate all balances
832
- queryClient.invalidateQueries({ queryKey: confidentialBalanceQueryKeys.all });
822
+ queryClient.invalidateQueries({ queryKey: zamaQueryKeys.confidentialBalance.all });
833
823
 
834
824
  // Invalidate a specific token's balance
835
825
  queryClient.invalidateQueries({
836
- queryKey: confidentialBalanceQueryKeys.token("0xTokenAddress"),
826
+ queryKey: zamaQueryKeys.confidentialBalance.token("0xTokenAddress"),
837
827
  });
838
828
  ```
839
829
 
@@ -984,7 +974,7 @@ To force a refresh:
984
974
 
985
975
  ```tsx
986
976
  const queryClient = useQueryClient();
987
- queryClient.invalidateQueries({ queryKey: confidentialBalanceQueryKeys.all });
977
+ queryClient.invalidateQueries({ queryKey: zamaQueryKeys.confidentialBalance.all });
988
978
  ```
989
979
 
990
980
  ## Re-exports from Core SDK