@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 +18 -28
- package/dist/index.d.ts +88 -671
- package/dist/index.js +343 -704
- package/dist/index.js.map +1 -1
- package/dist/wagmi/index.d.ts +4 -4
- package/dist/wagmi/index.js +7 -7
- package/dist/wagmi/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -598,7 +598,7 @@ function useConfidentialIsApproved(
|
|
|
598
598
|
|
|
599
599
|
#### `useUnderlyingAllowance`
|
|
600
600
|
|
|
601
|
-
Read the ERC-20 allowance
|
|
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
|
-
|
|
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
|
|
814
|
-
|
|
|
815
|
-
| `
|
|
816
|
-
| `
|
|
817
|
-
| `
|
|
818
|
-
| `
|
|
819
|
-
| `
|
|
820
|
-
| `
|
|
821
|
-
| `
|
|
822
|
-
| `
|
|
823
|
-
| `decryptionKeys`
|
|
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 {
|
|
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:
|
|
822
|
+
queryClient.invalidateQueries({ queryKey: zamaQueryKeys.confidentialBalance.all });
|
|
833
823
|
|
|
834
824
|
// Invalidate a specific token's balance
|
|
835
825
|
queryClient.invalidateQueries({
|
|
836
|
-
queryKey:
|
|
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:
|
|
977
|
+
queryClient.invalidateQueries({ queryKey: zamaQueryKeys.confidentialBalance.all });
|
|
988
978
|
```
|
|
989
979
|
|
|
990
980
|
## Re-exports from Core SDK
|