@cofhe/react 0.0.0-beta-20260417095940 → 0.0.0-beta-20260420143138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +354 -405
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +48 -10
- package/dist/index.d.ts +48 -10
- package/dist/index.js +354 -405
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -14795,6 +14795,48 @@ type Erc20Pair = {
|
|
|
14795
14795
|
decimals: number;
|
|
14796
14796
|
logoURI?: string;
|
|
14797
14797
|
};
|
|
14798
|
+
declare const TOKEN_CONFIDENTIALITY_SUPPORT: {
|
|
14799
|
+
readonly wrapped: {
|
|
14800
|
+
readonly enabled: true;
|
|
14801
|
+
readonly publicBalanceSource: "erc20Pair";
|
|
14802
|
+
readonly operations: {
|
|
14803
|
+
readonly confidentialBalance: true;
|
|
14804
|
+
readonly transfer: true;
|
|
14805
|
+
readonly publicBalance: true;
|
|
14806
|
+
readonly shield: true;
|
|
14807
|
+
readonly unshield: true;
|
|
14808
|
+
readonly claim: true;
|
|
14809
|
+
readonly claimable: true;
|
|
14810
|
+
};
|
|
14811
|
+
};
|
|
14812
|
+
readonly pure: {
|
|
14813
|
+
readonly enabled: false;
|
|
14814
|
+
readonly publicBalanceSource: null;
|
|
14815
|
+
readonly operations: {
|
|
14816
|
+
readonly confidentialBalance: false;
|
|
14817
|
+
readonly transfer: false;
|
|
14818
|
+
readonly publicBalance: false;
|
|
14819
|
+
readonly shield: false;
|
|
14820
|
+
readonly unshield: false;
|
|
14821
|
+
readonly claim: false;
|
|
14822
|
+
readonly claimable: false;
|
|
14823
|
+
};
|
|
14824
|
+
};
|
|
14825
|
+
readonly dual: {
|
|
14826
|
+
readonly enabled: false;
|
|
14827
|
+
readonly publicBalanceSource: "token";
|
|
14828
|
+
readonly operations: {
|
|
14829
|
+
readonly confidentialBalance: false;
|
|
14830
|
+
readonly transfer: false;
|
|
14831
|
+
readonly publicBalance: false;
|
|
14832
|
+
readonly shield: false;
|
|
14833
|
+
readonly unshield: false;
|
|
14834
|
+
readonly claim: false;
|
|
14835
|
+
readonly claimable: false;
|
|
14836
|
+
};
|
|
14837
|
+
};
|
|
14838
|
+
};
|
|
14839
|
+
type TokenConfidentialityType = keyof typeof TOKEN_CONFIDENTIALITY_SUPPORT;
|
|
14798
14840
|
type Token = {
|
|
14799
14841
|
chainId: number;
|
|
14800
14842
|
address: `0x${string}`;
|
|
@@ -14804,7 +14846,7 @@ type Token = {
|
|
|
14804
14846
|
logoURI?: string;
|
|
14805
14847
|
extensions: Record<string, unknown> & {
|
|
14806
14848
|
fhenix: {
|
|
14807
|
-
confidentialityType:
|
|
14849
|
+
confidentialityType: TokenConfidentialityType;
|
|
14808
14850
|
confidentialValueType: 'uint64' | 'uint128';
|
|
14809
14851
|
/** ERC20 pair for wrapped tokens - contains underlying token info */
|
|
14810
14852
|
erc20Pair?: Erc20Pair;
|
|
@@ -15005,8 +15047,7 @@ type UseTokenShieldInput = {
|
|
|
15005
15047
|
type UseTokenShieldOptions = Omit<UseMutationOptions<`0x${string}`, Error, UseTokenShieldInput>, 'mutationFn'>;
|
|
15006
15048
|
/**
|
|
15007
15049
|
* Hook to shield tokens (convert regular balance to confidential)
|
|
15008
|
-
*
|
|
15009
|
-
* - Wrapped tokens: TBD (needs approval flow)
|
|
15050
|
+
* Wrapped tokens call `encrypt` or `encryptETH`, depending on the paired asset.
|
|
15010
15051
|
* @param options - Optional React Query mutation options
|
|
15011
15052
|
* @returns Mutation result with transaction hash
|
|
15012
15053
|
*/
|
|
@@ -15090,7 +15131,7 @@ declare function getCofheTokenUnshieldCallArgs(params: {
|
|
|
15090
15131
|
type UseTokenUnshieldMutationInput = {
|
|
15091
15132
|
/** Token object with confidentialityType */
|
|
15092
15133
|
token: Token;
|
|
15093
|
-
/** Amount to unshield (in token's smallest unit
|
|
15134
|
+
/** Amount to unshield (in token's smallest unit) */
|
|
15094
15135
|
amount: bigint;
|
|
15095
15136
|
/** Optional callback for status updates during the operation */
|
|
15096
15137
|
onStatusChange?: (message: string) => void;
|
|
@@ -15196,8 +15237,7 @@ type UseClaimUnshieldInput = {
|
|
|
15196
15237
|
type UseClaimUnshieldOptions = Omit<UseMutationOptions<`0x${string}`, Error, UseClaimUnshieldInput>, 'mutationFn'>;
|
|
15197
15238
|
/**
|
|
15198
15239
|
* Hook to claim unshielded tokens after decryption completes
|
|
15199
|
-
*
|
|
15200
|
-
* - Wrapped tokens: calls `claimAllDecrypted()`
|
|
15240
|
+
* Wrapped tokens call `claimAllDecrypted()`.
|
|
15201
15241
|
* @param options - Optional React Query mutation options
|
|
15202
15242
|
* @returns Mutation result with transaction hash
|
|
15203
15243
|
*/
|
|
@@ -15210,7 +15250,7 @@ declare function constructUnshieldClaimsQueryKey({ chainId, tokenAddress, confid
|
|
|
15210
15250
|
accountAddress: Address | undefined;
|
|
15211
15251
|
}): (string | number | undefined)[];
|
|
15212
15252
|
/**
|
|
15213
|
-
*
|
|
15253
|
+
* Unshield claims summary for wrapped tokens.
|
|
15214
15254
|
*/
|
|
15215
15255
|
type UnshieldClaimsSummary = {
|
|
15216
15256
|
/** Total amount that can be claimed now (decrypted and not claimed) */
|
|
@@ -15230,7 +15270,7 @@ type UseUnshieldClaimsInput = {
|
|
|
15230
15270
|
};
|
|
15231
15271
|
type UseUnshieldClaimsOptions = Omit<UseQueryOptions<UnshieldClaimsSummary, Error>, 'queryKey' | 'queryFn'>;
|
|
15232
15272
|
/**
|
|
15233
|
-
*
|
|
15273
|
+
* Hook to fetch wrapped-token unshield claims.
|
|
15234
15274
|
* @param input - Token object and optional account address
|
|
15235
15275
|
* @param queryOptions - Optional React Query options
|
|
15236
15276
|
* @returns Query result with UnshieldClaimsSummary
|
|
@@ -15313,8 +15353,6 @@ type UseTokensWithPublicBalancesResult = {
|
|
|
15313
15353
|
*
|
|
15314
15354
|
* Public balance source:
|
|
15315
15355
|
* - `wrapped`: underlying `erc20Pair` (or native ETH)
|
|
15316
|
-
* - `dual`: token contract `balanceOf` (ERC20)
|
|
15317
|
-
* - `pure`: skipped (no public balance)
|
|
15318
15356
|
*/
|
|
15319
15357
|
declare function useTokensWithPublicBalances({ chainId: _chainId, accountAddress, displayDecimals }?: UseTokensWithPublicBalancesInput, options?: {
|
|
15320
15358
|
enabled?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -14795,6 +14795,48 @@ type Erc20Pair = {
|
|
|
14795
14795
|
decimals: number;
|
|
14796
14796
|
logoURI?: string;
|
|
14797
14797
|
};
|
|
14798
|
+
declare const TOKEN_CONFIDENTIALITY_SUPPORT: {
|
|
14799
|
+
readonly wrapped: {
|
|
14800
|
+
readonly enabled: true;
|
|
14801
|
+
readonly publicBalanceSource: "erc20Pair";
|
|
14802
|
+
readonly operations: {
|
|
14803
|
+
readonly confidentialBalance: true;
|
|
14804
|
+
readonly transfer: true;
|
|
14805
|
+
readonly publicBalance: true;
|
|
14806
|
+
readonly shield: true;
|
|
14807
|
+
readonly unshield: true;
|
|
14808
|
+
readonly claim: true;
|
|
14809
|
+
readonly claimable: true;
|
|
14810
|
+
};
|
|
14811
|
+
};
|
|
14812
|
+
readonly pure: {
|
|
14813
|
+
readonly enabled: false;
|
|
14814
|
+
readonly publicBalanceSource: null;
|
|
14815
|
+
readonly operations: {
|
|
14816
|
+
readonly confidentialBalance: false;
|
|
14817
|
+
readonly transfer: false;
|
|
14818
|
+
readonly publicBalance: false;
|
|
14819
|
+
readonly shield: false;
|
|
14820
|
+
readonly unshield: false;
|
|
14821
|
+
readonly claim: false;
|
|
14822
|
+
readonly claimable: false;
|
|
14823
|
+
};
|
|
14824
|
+
};
|
|
14825
|
+
readonly dual: {
|
|
14826
|
+
readonly enabled: false;
|
|
14827
|
+
readonly publicBalanceSource: "token";
|
|
14828
|
+
readonly operations: {
|
|
14829
|
+
readonly confidentialBalance: false;
|
|
14830
|
+
readonly transfer: false;
|
|
14831
|
+
readonly publicBalance: false;
|
|
14832
|
+
readonly shield: false;
|
|
14833
|
+
readonly unshield: false;
|
|
14834
|
+
readonly claim: false;
|
|
14835
|
+
readonly claimable: false;
|
|
14836
|
+
};
|
|
14837
|
+
};
|
|
14838
|
+
};
|
|
14839
|
+
type TokenConfidentialityType = keyof typeof TOKEN_CONFIDENTIALITY_SUPPORT;
|
|
14798
14840
|
type Token = {
|
|
14799
14841
|
chainId: number;
|
|
14800
14842
|
address: `0x${string}`;
|
|
@@ -14804,7 +14846,7 @@ type Token = {
|
|
|
14804
14846
|
logoURI?: string;
|
|
14805
14847
|
extensions: Record<string, unknown> & {
|
|
14806
14848
|
fhenix: {
|
|
14807
|
-
confidentialityType:
|
|
14849
|
+
confidentialityType: TokenConfidentialityType;
|
|
14808
14850
|
confidentialValueType: 'uint64' | 'uint128';
|
|
14809
14851
|
/** ERC20 pair for wrapped tokens - contains underlying token info */
|
|
14810
14852
|
erc20Pair?: Erc20Pair;
|
|
@@ -15005,8 +15047,7 @@ type UseTokenShieldInput = {
|
|
|
15005
15047
|
type UseTokenShieldOptions = Omit<UseMutationOptions<`0x${string}`, Error, UseTokenShieldInput>, 'mutationFn'>;
|
|
15006
15048
|
/**
|
|
15007
15049
|
* Hook to shield tokens (convert regular balance to confidential)
|
|
15008
|
-
*
|
|
15009
|
-
* - Wrapped tokens: TBD (needs approval flow)
|
|
15050
|
+
* Wrapped tokens call `encrypt` or `encryptETH`, depending on the paired asset.
|
|
15010
15051
|
* @param options - Optional React Query mutation options
|
|
15011
15052
|
* @returns Mutation result with transaction hash
|
|
15012
15053
|
*/
|
|
@@ -15090,7 +15131,7 @@ declare function getCofheTokenUnshieldCallArgs(params: {
|
|
|
15090
15131
|
type UseTokenUnshieldMutationInput = {
|
|
15091
15132
|
/** Token object with confidentialityType */
|
|
15092
15133
|
token: Token;
|
|
15093
|
-
/** Amount to unshield (in token's smallest unit
|
|
15134
|
+
/** Amount to unshield (in token's smallest unit) */
|
|
15094
15135
|
amount: bigint;
|
|
15095
15136
|
/** Optional callback for status updates during the operation */
|
|
15096
15137
|
onStatusChange?: (message: string) => void;
|
|
@@ -15196,8 +15237,7 @@ type UseClaimUnshieldInput = {
|
|
|
15196
15237
|
type UseClaimUnshieldOptions = Omit<UseMutationOptions<`0x${string}`, Error, UseClaimUnshieldInput>, 'mutationFn'>;
|
|
15197
15238
|
/**
|
|
15198
15239
|
* Hook to claim unshielded tokens after decryption completes
|
|
15199
|
-
*
|
|
15200
|
-
* - Wrapped tokens: calls `claimAllDecrypted()`
|
|
15240
|
+
* Wrapped tokens call `claimAllDecrypted()`.
|
|
15201
15241
|
* @param options - Optional React Query mutation options
|
|
15202
15242
|
* @returns Mutation result with transaction hash
|
|
15203
15243
|
*/
|
|
@@ -15210,7 +15250,7 @@ declare function constructUnshieldClaimsQueryKey({ chainId, tokenAddress, confid
|
|
|
15210
15250
|
accountAddress: Address | undefined;
|
|
15211
15251
|
}): (string | number | undefined)[];
|
|
15212
15252
|
/**
|
|
15213
|
-
*
|
|
15253
|
+
* Unshield claims summary for wrapped tokens.
|
|
15214
15254
|
*/
|
|
15215
15255
|
type UnshieldClaimsSummary = {
|
|
15216
15256
|
/** Total amount that can be claimed now (decrypted and not claimed) */
|
|
@@ -15230,7 +15270,7 @@ type UseUnshieldClaimsInput = {
|
|
|
15230
15270
|
};
|
|
15231
15271
|
type UseUnshieldClaimsOptions = Omit<UseQueryOptions<UnshieldClaimsSummary, Error>, 'queryKey' | 'queryFn'>;
|
|
15232
15272
|
/**
|
|
15233
|
-
*
|
|
15273
|
+
* Hook to fetch wrapped-token unshield claims.
|
|
15234
15274
|
* @param input - Token object and optional account address
|
|
15235
15275
|
* @param queryOptions - Optional React Query options
|
|
15236
15276
|
* @returns Query result with UnshieldClaimsSummary
|
|
@@ -15313,8 +15353,6 @@ type UseTokensWithPublicBalancesResult = {
|
|
|
15313
15353
|
*
|
|
15314
15354
|
* Public balance source:
|
|
15315
15355
|
* - `wrapped`: underlying `erc20Pair` (or native ETH)
|
|
15316
|
-
* - `dual`: token contract `balanceOf` (ERC20)
|
|
15317
|
-
* - `pure`: skipped (no public balance)
|
|
15318
15356
|
*/
|
|
15319
15357
|
declare function useTokensWithPublicBalances({ chainId: _chainId, accountAddress, displayDecimals }?: UseTokensWithPublicBalancesInput, options?: {
|
|
15320
15358
|
enabled?: boolean;
|