@tokenops/sdk 1.0.0 → 1.5.1
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 +120 -26
- package/dist/{chunk-5SGMJADP.cjs → chunk-2NCLOQ56.cjs} +9 -9
- package/dist/{chunk-QIHZVLIK.js → chunk-2PWNH3UE.js} +35 -6
- package/dist/{chunk-T5LVV3KY.cjs → chunk-4WPGQSNT.cjs} +3 -3
- package/dist/{chunk-SUOG3BQS.cjs → chunk-5X5WL5CU.cjs} +266 -103
- package/dist/{chunk-56UI7LUR.cjs → chunk-67OV5CX2.cjs} +19 -0
- package/dist/{chunk-WRCUDSUJ.js → chunk-6BMP4ICG.js} +2 -2
- package/dist/{chunk-XXXDQSHE.js → chunk-6R4KNAPK.js} +5 -3
- package/dist/{chunk-XSNLAS5M.js → chunk-AOP6HMPW.js} +1 -1
- package/dist/{chunk-62DF53UQ.cjs → chunk-C7BRZXJA.cjs} +19 -21
- package/dist/{chunk-UOG4PJL5.js → chunk-DUZIIRPF.js} +181 -14
- package/dist/{chunk-Q7ARQSUH.cjs → chunk-FAXIIH5R.cjs} +3 -3
- package/dist/chunk-FT4LNBOS.js +11 -0
- package/dist/chunk-IJFQ5L4I.js +2171 -0
- package/dist/{chunk-52TC6BF7.js → chunk-IXLO7GO5.js} +210 -47
- package/dist/{chunk-CQIPRNS7.cjs → chunk-JK4XMMKM.cjs} +3 -3
- package/dist/{chunk-ITQ7WKVC.cjs → chunk-JYOTGRSO.cjs} +8 -8
- package/dist/{chunk-VDXVNZCO.cjs → chunk-KLKI352M.cjs} +85 -29
- package/dist/{chunk-5SA2HF2W.cjs → chunk-MCRBVJGZ.cjs} +24 -22
- package/dist/{chunk-ECT3NL2L.js → chunk-NTZY6IB7.js} +4 -4
- package/dist/{chunk-ZHFLRKFY.js → chunk-ODLTEGHB.js} +1 -1
- package/dist/{chunk-HGXNRR25.js → chunk-ORFTDNFZ.js} +4 -4
- package/dist/{chunk-72YGZEQE.js → chunk-OXTLPTO3.js} +9 -11
- package/dist/{chunk-HTOMTEA3.cjs → chunk-PFXURMBZ.cjs} +77 -48
- package/dist/{chunk-OLDGMKW2.cjs → chunk-PUPKNW3R.cjs} +35 -2
- package/dist/{chunk-IVE3QEGD.js → chunk-QBJ7O2B4.js} +18 -1
- package/dist/{chunk-JFLEEXKP.js → chunk-SG65XWH7.js} +58 -2
- package/dist/{chunk-K6MFFDBJ.cjs → chunk-T46YXSBP.cjs} +11 -11
- package/dist/{chunk-NS44KBV5.cjs → chunk-TEBM66WA.cjs} +12 -12
- package/dist/{chunk-6ECAHP5O.cjs → chunk-TIUKIY5V.cjs} +200 -33
- package/dist/{chunk-QCA7O2Q5.cjs → chunk-V2PXZVBF.cjs} +4 -4
- package/dist/{chunk-JFR5J4FL.cjs → chunk-W7IGCOVL.cjs} +11 -11
- package/dist/chunk-WENHUPZC.cjs +2180 -0
- package/dist/{chunk-ZXCOJY2Z.js → chunk-WMACINXO.js} +1 -1
- package/dist/{chunk-COPFW5Z4.js → chunk-XGGTQQFH.js} +31 -2
- package/dist/{chunk-CMRETRZO.js → chunk-YQIBBEFJ.js} +1 -1
- package/dist/{chunk-BE2AIZ3K.js → chunk-ZA673I3O.js} +1 -1
- package/dist/chunk-ZQUE2B3Q.cjs +33 -0
- package/dist/{chunk-FYQ2UW4T.js → chunk-ZWXJTBZO.js} +1 -1
- package/dist/core/addresses.d.ts +22 -0
- package/dist/core/errors.d.ts +41 -1
- package/dist/core/revert-mapper.d.ts +77 -0
- package/dist/core/telemetry.d.ts +0 -3
- package/dist/core/wagmi-compat.d.ts +40 -0
- package/dist/fhe/index.cjs +112 -66
- package/dist/fhe/index.d.cts +1 -1
- package/dist/fhe/index.d.ts +1 -1
- package/dist/fhe/index.js +50 -8
- package/dist/fhe/operators.d.ts +1 -1
- package/dist/fhe/react/index.cjs +7 -7
- package/dist/fhe/react/index.js +2 -2
- package/dist/fhe/sepolia-encryptor-web.d.ts +27 -1
- package/dist/fhe/sepolia-encryptor.d.ts +38 -0
- package/dist/fhe-airdrop/advanced/factory-advanced.d.ts +3 -3
- package/dist/fhe-airdrop/advanced/index.cjs +9 -8
- package/dist/fhe-airdrop/advanced/index.d.cts +2 -2
- package/dist/fhe-airdrop/advanced/index.d.ts +2 -2
- package/dist/fhe-airdrop/advanced/index.js +7 -6
- package/dist/fhe-airdrop/advanced/react/index.cjs +14 -13
- package/dist/fhe-airdrop/advanced/react/index.d.cts +1 -1
- package/dist/fhe-airdrop/advanced/react/index.d.ts +1 -1
- package/dist/fhe-airdrop/advanced/react/index.js +10 -9
- package/dist/fhe-airdrop/airdrop.d.ts +2 -0
- package/dist/fhe-airdrop/encryption.d.ts +8 -0
- package/dist/fhe-airdrop/factory.d.ts +94 -11
- package/dist/fhe-airdrop/index.cjs +61 -57
- package/dist/fhe-airdrop/index.d.cts +3 -3
- package/dist/fhe-airdrop/index.d.ts +3 -3
- package/dist/fhe-airdrop/index.js +7 -7
- package/dist/fhe-airdrop/react/index.cjs +163 -133
- package/dist/fhe-airdrop/react/index.d.cts +4 -3
- package/dist/fhe-airdrop/react/index.d.ts +4 -3
- package/dist/fhe-airdrop/react/index.js +38 -13
- package/dist/fhe-airdrop/react/useAirdropClaim.d.ts +2 -0
- package/dist/fhe-airdrop/react/useAirdropIsSignatureValid.d.ts +3 -2
- package/dist/fhe-airdrop/react/useClaim.d.ts +2 -0
- package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdrop.d.ts +8 -0
- package/dist/fhe-airdrop/react/useCreateAndFundConfidentialAirdropAndGetAddress.d.ts +8 -0
- package/dist/fhe-airdrop/react/useFundConfidentialAirdrop.d.ts +8 -0
- package/dist/fhe-airdrop/react/usePreflightCreateAirdrop.d.ts +51 -0
- package/dist/fhe-airdrop/types.d.ts +45 -0
- package/dist/fhe-disperse/encryption.d.ts +8 -0
- package/dist/fhe-disperse/index.cjs +69 -65
- package/dist/fhe-disperse/index.d.cts +1 -1
- package/dist/fhe-disperse/index.d.ts +1 -1
- package/dist/fhe-disperse/index.js +8 -8
- package/dist/fhe-disperse/react/index.cjs +90 -86
- package/dist/fhe-disperse/react/index.d.cts +1 -1
- package/dist/fhe-disperse/react/index.d.ts +1 -1
- package/dist/fhe-disperse/react/index.js +10 -10
- package/dist/fhe-disperse/react/useCalculateFee.d.ts +7 -0
- package/dist/fhe-disperse/react/useDisperse.d.ts +9 -0
- package/dist/fhe-disperse/react/usePreflightDisperse.d.ts +7 -0
- package/dist/fhe-disperse/react/useSingletonCalculateFee.d.ts +7 -0
- package/dist/fhe-disperse/react/useSingletonWithdrawTokenFee.d.ts +8 -2
- package/dist/fhe-disperse/react/useWithdrawTokenFee.d.ts +6 -0
- package/dist/fhe-disperse/singleton.d.ts +29 -0
- package/dist/fhe-disperse/subtotals.d.ts +6 -0
- package/dist/fhe-vesting/advanced/factory-advanced.d.ts +2 -2
- package/dist/fhe-vesting/advanced/index.cjs +8 -8
- package/dist/fhe-vesting/advanced/index.d.cts +2 -2
- package/dist/fhe-vesting/advanced/index.d.ts +2 -2
- package/dist/fhe-vesting/advanced/index.js +6 -6
- package/dist/fhe-vesting/advanced/react/index.cjs +15 -14
- package/dist/fhe-vesting/advanced/react/index.d.cts +1 -1
- package/dist/fhe-vesting/advanced/react/index.d.ts +1 -1
- package/dist/fhe-vesting/advanced/react/index.js +12 -11
- package/dist/fhe-vesting/encryption.d.ts +8 -0
- package/dist/fhe-vesting/factory.d.ts +6 -8
- package/dist/fhe-vesting/index.cjs +79 -75
- package/dist/fhe-vesting/index.d.cts +2 -2
- package/dist/fhe-vesting/index.d.ts +2 -2
- package/dist/fhe-vesting/index.js +9 -9
- package/dist/fhe-vesting/manager.d.ts +101 -3
- package/dist/fhe-vesting/react/index.cjs +241 -219
- package/dist/fhe-vesting/react/index.d.cts +3 -2
- package/dist/fhe-vesting/react/index.d.ts +3 -2
- package/dist/fhe-vesting/react/index.js +29 -12
- package/dist/fhe-vesting/react/useAdminClaim.d.ts +2 -0
- package/dist/fhe-vesting/react/useAdminPartialClaim.d.ts +2 -0
- package/dist/fhe-vesting/react/useBatchCreateVesting.d.ts +8 -0
- package/dist/fhe-vesting/react/useClaim.d.ts +2 -0
- package/dist/fhe-vesting/react/useCreateVesting.d.ts +8 -0
- package/dist/fhe-vesting/react/useManagerWithdrawTokenFee.d.ts +7 -1
- package/dist/fhe-vesting/react/usePartialClaim.d.ts +8 -0
- package/dist/fhe-vesting/react/usePreflightCreateVesting.d.ts +37 -0
- package/dist/fhe-vesting/react/useVestingClaim.d.ts +2 -0
- package/dist/fhe-vesting/react/useWithdrawAdmin.d.ts +6 -0
- package/dist/fhe-vesting/react/useWithdrawTokenFee.d.ts +6 -0
- package/dist/fhe-vesting/types.d.ts +34 -2
- package/dist/index.cjs +73 -49
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/testnet-faucet/abis/confidential-test-token.d.ts +1039 -0
- package/dist/testnet-faucet/abis/index.d.ts +2 -0
- package/dist/testnet-faucet/abis/test-token.d.ts +253 -0
- package/dist/testnet-faucet/errors.d.ts +21 -0
- package/dist/testnet-faucet/faucet.d.ts +173 -0
- package/dist/testnet-faucet/index.cjs +212 -0
- package/dist/testnet-faucet/index.d.cts +8 -0
- package/dist/testnet-faucet/index.d.ts +8 -0
- package/dist/testnet-faucet/index.js +7 -0
- package/dist/testnet-faucet/react/_shared.d.ts +61 -0
- package/dist/testnet-faucet/react/index.cjs +384 -0
- package/dist/testnet-faucet/react/index.d.cts +39 -0
- package/dist/testnet-faucet/react/index.d.ts +39 -0
- package/dist/testnet-faucet/react/index.js +220 -0
- package/dist/testnet-faucet/react/useConfidentialBalance.d.ts +25 -0
- package/dist/testnet-faucet/react/useFaucetDecimals.d.ts +9 -0
- package/dist/testnet-faucet/react/useFaucetMetadata.d.ts +14 -0
- package/dist/testnet-faucet/react/useFaucetRate.d.ts +11 -0
- package/dist/testnet-faucet/react/useInferredTotalSupply.d.ts +11 -0
- package/dist/testnet-faucet/react/useMaxTotalSupply.d.ts +10 -0
- package/dist/testnet-faucet/react/useMintConfidential.d.ts +35 -0
- package/dist/testnet-faucet/react/useMintUnderlying.d.ts +31 -0
- package/dist/testnet-faucet/react/useUnderlyingBalance.d.ts +19 -0
- package/dist/testnet-faucet/react/useUnderlyingDecimals.d.ts +9 -0
- package/dist/testnet-faucet/react/useUnderlyingTokenAddress.d.ts +12 -0
- package/dist/testnet-faucet/types.d.ts +92 -0
- package/dist/testnet-faucet/validate.d.ts +44 -0
- package/package.json +79 -30
|
@@ -18,6 +18,13 @@ export interface UseSingletonCalculateFeeArgs extends BaseHookOptions {
|
|
|
18
18
|
*
|
|
19
19
|
* Hook is disabled until `user`, `mode`, and `recipients` are set.
|
|
20
20
|
*
|
|
21
|
+
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
22
|
+
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
23
|
+
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
24
|
+
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
25
|
+
* transparent TTT test token uses 18 decimals. `totalTokens` follows this
|
|
26
|
+
* convention.
|
|
27
|
+
*
|
|
21
28
|
* @example
|
|
22
29
|
* const { data: fee } = useSingletonCalculateFee({
|
|
23
30
|
* user, mode: "direct", recipients: 100,
|
|
@@ -10,8 +10,8 @@ import { type DisperseHookOptions } from "./_shared.js";
|
|
|
10
10
|
* the discriminated SDK shape.
|
|
11
11
|
*
|
|
12
12
|
* `amount` and `encryptedInput` are XOR enforced by the underlying SDK call;
|
|
13
|
-
* the hook surface
|
|
14
|
-
*
|
|
13
|
+
* the hook surface accepts the relaxed shape and the mutate body routes to the
|
|
14
|
+
* right branch.
|
|
15
15
|
*/
|
|
16
16
|
export interface UseSingletonWithdrawTokenFeeArgs {
|
|
17
17
|
/** ERC-7984 token whose accumulated fee reserve to withdraw from. */
|
|
@@ -36,6 +36,12 @@ export interface UseSingletonWithdrawTokenFeeArgs {
|
|
|
36
36
|
* `amount` is encrypted by the SDK before submission; the contract caps the
|
|
37
37
|
* withdrawal at the available reserve via `FHE.min`.
|
|
38
38
|
*
|
|
39
|
+
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
40
|
+
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
41
|
+
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
42
|
+
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
43
|
+
* transparent TTT test token uses 18 decimals.
|
|
44
|
+
*
|
|
39
45
|
* **Encryptor resolution.** Pass `encryptor` per-call, or supply it at hook
|
|
40
46
|
* construction via {@link DisperseHookOptions}.`encryptor`. If neither is
|
|
41
47
|
* present, the SDK throws `Missing encryptor — pass encryptor…` verbatim.
|
|
@@ -43,6 +43,12 @@ export type UseWithdrawTokenFeeArgs = UseWithdrawTokenFeePlaintextArgs | UseWith
|
|
|
43
43
|
* never both. The contract caps the withdrawal at the available reserve via
|
|
44
44
|
* `FHE.min`.
|
|
45
45
|
*
|
|
46
|
+
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
47
|
+
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
48
|
+
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
49
|
+
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
50
|
+
* transparent TTT test token uses 18 decimals.
|
|
51
|
+
*
|
|
46
52
|
* Returns `{ hash, transferredHandle }` parsed from the `TokenFeeWithdrawn`
|
|
47
53
|
* event. The handle is decryptable by the caller via Zama's `userDecrypt`
|
|
48
54
|
* and reveals the actual transferred amount, which may be less than the
|
|
@@ -153,6 +153,13 @@ export declare class ConfidentialDisperseClient {
|
|
|
153
153
|
* subtotal1` for the result to match the on-chain computation. Both this
|
|
154
154
|
* SDK and the contract round the BPS multiplication down (floor division).
|
|
155
155
|
*
|
|
156
|
+
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
157
|
+
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
158
|
+
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
159
|
+
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
160
|
+
* transparent TTT test token uses 18 decimals. `totalTokens` follows this
|
|
161
|
+
* convention.
|
|
162
|
+
*
|
|
156
163
|
* @throws {TokenOpsSdkError} if mode is `"wallet-token-fee"` and `totalTokens` is not provided.
|
|
157
164
|
*/
|
|
158
165
|
calculateFee(args: CalculateFeeArgs): Promise<CalculatedFee>;
|
|
@@ -179,6 +186,13 @@ export declare class ConfidentialDisperseClient {
|
|
|
179
186
|
* - `hasApprovedSubwallets` (wallet modes) or `isOperator(sender, singleton)` (direct mode)
|
|
180
187
|
* - `calculateFee` / `getBatchLimits`
|
|
181
188
|
* - Structural recipient + amount validation
|
|
189
|
+
*
|
|
190
|
+
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
191
|
+
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
192
|
+
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
193
|
+
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
194
|
+
* transparent TTT test token uses 18 decimals. Pass `amounts[]` in the same
|
|
195
|
+
* units you will pass to `disperse` so the report reflects the real call.
|
|
182
196
|
*/
|
|
183
197
|
preflightDisperse(args: PreflightDisperseArgs): Promise<PreflightReport>;
|
|
184
198
|
/**
|
|
@@ -249,6 +263,15 @@ export declare class ConfidentialDisperseClient {
|
|
|
249
263
|
* 4. Computes `msg.value` for gas-fee modes; `0` for token-fee mode.
|
|
250
264
|
* 5. Dispatches to the correct contract function based on `mode`.
|
|
251
265
|
*
|
|
266
|
+
* **Silent-zero transfers.** ERC-7984 transfers do not revert when the sender's encrypted balance is insufficient — the transfer succeeds and moves an encrypted zero instead. This is by design: reverting would leak balance information. The transaction receipt alone cannot tell you whether value actually moved.
|
|
267
|
+
*
|
|
268
|
+
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
269
|
+
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
270
|
+
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
271
|
+
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
272
|
+
* transparent TTT test token uses 18 decimals. Every entry of `amounts[]`
|
|
273
|
+
* follows this convention.
|
|
274
|
+
*
|
|
252
275
|
* @throws {TokenOpsSdkError} on input validation failure (first deterministic error).
|
|
253
276
|
* @throws {TokenOpsSdkError} if no encryptor is available at call time.
|
|
254
277
|
*/
|
|
@@ -352,6 +375,12 @@ export declare class ConfidentialDisperseClient {
|
|
|
352
375
|
* encryptor, or pass `encryptedInput` directly. The contract caps the
|
|
353
376
|
* withdrawal at the available reserve via `FHE.min`.
|
|
354
377
|
*
|
|
378
|
+
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
379
|
+
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
380
|
+
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
381
|
+
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
382
|
+
* transparent TTT test token uses 18 decimals.
|
|
383
|
+
*
|
|
355
384
|
* Returns the tx hash plus the **transferred** handle parsed from the
|
|
356
385
|
* `TokenFeeWithdrawn` event. Decrypt the handle via Zama's `userDecrypt`
|
|
357
386
|
* to view the actual amount moved (which can be less than requested when
|
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
* group1 = remaining baseSize recipients → wallet1
|
|
8
8
|
*
|
|
9
9
|
* This matches `_distributeFromWallets` in `DisperseConfidential.sol`.
|
|
10
|
+
*
|
|
11
|
+
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
12
|
+
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
13
|
+
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
14
|
+
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
15
|
+
* transparent TTT test token uses 18 decimals.
|
|
10
16
|
*/
|
|
11
17
|
export declare function computeSubtotals(amounts: bigint[]): {
|
|
12
18
|
group0: bigint;
|
|
@@ -4,8 +4,8 @@ import { ConfidentialVestingFactoryClient, type ConfidentialVestingFactoryClient
|
|
|
4
4
|
* Advanced extension of {@link ConfidentialVestingFactoryClient} that re-exposes
|
|
5
5
|
* the CREATE2 address prediction read.
|
|
6
6
|
*
|
|
7
|
-
* **Why this is "advanced" surface.**
|
|
8
|
-
*
|
|
7
|
+
* **Why this is "advanced" surface.** `predictManagerAddress` is
|
|
8
|
+
* block-dependent on a live chain — the
|
|
9
9
|
* factory packs the deployment block number into the clone's immutable args,
|
|
10
10
|
* which feed into the CREATE2 init-code hash. Predict at block N, mine at
|
|
11
11
|
* N+1, and the addresses differ. The vast majority of consumers want
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../chunk-
|
|
5
|
-
require('../../chunk-
|
|
6
|
-
require('../../chunk-
|
|
7
|
-
require('../../chunk-
|
|
3
|
+
var chunkV2PXZVBF_cjs = require('../../chunk-V2PXZVBF.cjs');
|
|
4
|
+
require('../../chunk-C7BRZXJA.cjs');
|
|
5
|
+
require('../../chunk-KLKI352M.cjs');
|
|
6
|
+
require('../../chunk-PUPKNW3R.cjs');
|
|
7
|
+
require('../../chunk-JK4XMMKM.cjs');
|
|
8
8
|
require('../../chunk-VJKZWYYJ.cjs');
|
|
9
9
|
require('../../chunk-66IHPTOK.cjs');
|
|
10
|
-
require('../../chunk-
|
|
10
|
+
require('../../chunk-67OV5CX2.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
Object.defineProperty(exports, "ConfidentialVestingFactoryAdvancedClient", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkV2PXZVBF_cjs.ConfidentialVestingFactoryAdvancedClient; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "createConfidentialVestingFactoryAdvancedClient", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkV2PXZVBF_cjs.createConfidentialVestingFactoryAdvancedClient; }
|
|
21
21
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Advanced FHE-vesting primitives — power-user surface kept off the headline
|
|
3
|
-
* client to keep the
|
|
3
|
+
* client to keep the common path lean.
|
|
4
4
|
*
|
|
5
5
|
* Re-exports the {@link ConfidentialVestingFactoryAdvancedClient} subclass,
|
|
6
6
|
* which extends the headline factory client with `predictManagerAddress`. The
|
|
7
7
|
* predict read is block-dependent — see the subclass TSDoc. For the common
|
|
8
8
|
* "deploy and learn the address" case, the headline factory's
|
|
9
|
-
* `createManager` returns `{ hash, manager }` directly
|
|
9
|
+
* `createManager` returns `{ hash, manager }` directly.
|
|
10
10
|
*/
|
|
11
11
|
export { ConfidentialVestingFactoryAdvancedClient, createConfidentialVestingFactoryAdvancedClient, } from "./factory-advanced.js";
|
|
12
12
|
export type { PredictManagerArgs } from "../factory.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Advanced FHE-vesting primitives — power-user surface kept off the headline
|
|
3
|
-
* client to keep the
|
|
3
|
+
* client to keep the common path lean.
|
|
4
4
|
*
|
|
5
5
|
* Re-exports the {@link ConfidentialVestingFactoryAdvancedClient} subclass,
|
|
6
6
|
* which extends the headline factory client with `predictManagerAddress`. The
|
|
7
7
|
* predict read is block-dependent — see the subclass TSDoc. For the common
|
|
8
8
|
* "deploy and learn the address" case, the headline factory's
|
|
9
|
-
* `createManager` returns `{ hash, manager }` directly
|
|
9
|
+
* `createManager` returns `{ hash, manager }` directly.
|
|
10
10
|
*/
|
|
11
11
|
export { ConfidentialVestingFactoryAdvancedClient, createConfidentialVestingFactoryAdvancedClient, } from "./factory-advanced.js";
|
|
12
12
|
export type { PredictManagerArgs } from "../factory.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { ConfidentialVestingFactoryAdvancedClient, createConfidentialVestingFactoryAdvancedClient } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
3
|
-
import '../../chunk-
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
1
|
+
export { ConfidentialVestingFactoryAdvancedClient, createConfidentialVestingFactoryAdvancedClient } from '../../chunk-YQIBBEFJ.js';
|
|
2
|
+
import '../../chunk-OXTLPTO3.js';
|
|
3
|
+
import '../../chunk-SG65XWH7.js';
|
|
4
|
+
import '../../chunk-XGGTQQFH.js';
|
|
5
|
+
import '../../chunk-ZA673I3O.js';
|
|
6
6
|
import '../../chunk-Q2GP5UDC.js';
|
|
7
7
|
import '../../chunk-KWFFIJYX.js';
|
|
8
|
-
import '../../chunk-
|
|
8
|
+
import '../../chunk-QBJ7O2B4.js';
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../../../chunk-
|
|
5
|
-
require('../../../chunk-
|
|
6
|
-
require('../../../chunk-
|
|
7
|
-
require('../../../chunk-
|
|
8
|
-
|
|
9
|
-
require('../../../chunk-
|
|
10
|
-
require('../../../chunk-
|
|
11
|
-
|
|
12
|
-
require('../../../chunk-
|
|
3
|
+
var chunkW7IGCOVL_cjs = require('../../../chunk-W7IGCOVL.cjs');
|
|
4
|
+
require('../../../chunk-5X5WL5CU.cjs');
|
|
5
|
+
require('../../../chunk-TEBM66WA.cjs');
|
|
6
|
+
require('../../../chunk-2NCLOQ56.cjs');
|
|
7
|
+
require('../../../chunk-FAXIIH5R.cjs');
|
|
8
|
+
require('../../../chunk-FWHYQZ5E.cjs');
|
|
9
|
+
var chunkV2PXZVBF_cjs = require('../../../chunk-V2PXZVBF.cjs');
|
|
10
|
+
require('../../../chunk-C7BRZXJA.cjs');
|
|
11
|
+
require('../../../chunk-KLKI352M.cjs');
|
|
12
|
+
var chunkPUPKNW3R_cjs = require('../../../chunk-PUPKNW3R.cjs');
|
|
13
|
+
require('../../../chunk-JK4XMMKM.cjs');
|
|
13
14
|
require('../../../chunk-VJKZWYYJ.cjs');
|
|
14
15
|
require('../../../chunk-66IHPTOK.cjs');
|
|
15
|
-
require('../../../chunk-
|
|
16
|
+
require('../../../chunk-67OV5CX2.cjs');
|
|
16
17
|
var react = require('react');
|
|
17
18
|
var reactQuery = require('@tanstack/react-query');
|
|
18
19
|
var wagmi = require('wagmi');
|
|
@@ -35,12 +36,12 @@ function usePredictManagerAddress(args = {}) {
|
|
|
35
36
|
...chainId !== void 0 ? { chainId } : {}
|
|
36
37
|
});
|
|
37
38
|
const resolvedChainId = chainId ?? resolvedPublicClient?.chain?.id;
|
|
38
|
-
const resolvedAddress = address ?? (resolvedChainId === void 0 ? void 0 :
|
|
39
|
+
const resolvedAddress = address ?? (resolvedChainId === void 0 ? void 0 : chunkPUPKNW3R_cjs.DEPLOYED_ADDRESSES.fheVesting?.confidentialVestingFactory?.[resolvedChainId] ?? void 0);
|
|
39
40
|
react.useRef(void 0);
|
|
40
41
|
const client = react.useMemo(() => {
|
|
41
42
|
if (!resolvedPublicClient) return void 0;
|
|
42
43
|
if (!resolvedAddress) return void 0;
|
|
43
|
-
return
|
|
44
|
+
return chunkV2PXZVBF_cjs.createConfidentialVestingFactoryAdvancedClient({
|
|
44
45
|
publicClient: resolvedPublicClient,
|
|
45
46
|
...walletClient ? { walletClient } : {},
|
|
46
47
|
address: resolvedAddress,
|
|
@@ -48,7 +49,7 @@ function usePredictManagerAddress(args = {}) {
|
|
|
48
49
|
});
|
|
49
50
|
}, [resolvedPublicClient, walletClient, resolvedAddress, resolvedChainId]);
|
|
50
51
|
return reactQuery.useQuery({
|
|
51
|
-
queryKey:
|
|
52
|
+
queryKey: chunkW7IGCOVL_cjs.buildQueryKey(
|
|
52
53
|
"factory:predictManagerAddress",
|
|
53
54
|
resolvedChainId,
|
|
54
55
|
resolvedAddress,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* React hooks for `@tokenops/sdk/fhe-vesting/advanced`. The headline React
|
|
3
|
-
* subpath stays lean; pre-mine address prediction lives here
|
|
3
|
+
* subpath stays lean; pre-mine address prediction lives here.
|
|
4
4
|
*/
|
|
5
5
|
export { usePredictManagerAddress, type UsePredictManagerAddressArgs, } from "./usePredictManagerAddress.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* React hooks for `@tokenops/sdk/fhe-vesting/advanced`. The headline React
|
|
3
|
-
* subpath stays lean; pre-mine address prediction lives here
|
|
3
|
+
* subpath stays lean; pre-mine address prediction lives here.
|
|
4
4
|
*/
|
|
5
5
|
export { usePredictManagerAddress, type UsePredictManagerAddressArgs, } from "./usePredictManagerAddress.js";
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { buildQueryKey } from '../../../chunk-
|
|
2
|
-
import '../../../chunk-
|
|
3
|
-
import '../../../chunk-
|
|
4
|
-
import '../../../chunk-
|
|
5
|
-
import '../../../chunk-
|
|
6
|
-
import
|
|
7
|
-
import '../../../chunk-
|
|
8
|
-
import '../../../chunk-
|
|
9
|
-
import
|
|
10
|
-
import '../../../chunk-
|
|
1
|
+
import { buildQueryKey } from '../../../chunk-NTZY6IB7.js';
|
|
2
|
+
import '../../../chunk-IXLO7GO5.js';
|
|
3
|
+
import '../../../chunk-WMACINXO.js';
|
|
4
|
+
import '../../../chunk-AOP6HMPW.js';
|
|
5
|
+
import '../../../chunk-ZWXJTBZO.js';
|
|
6
|
+
import '../../../chunk-7VELUOMI.js';
|
|
7
|
+
import { createConfidentialVestingFactoryAdvancedClient } from '../../../chunk-YQIBBEFJ.js';
|
|
8
|
+
import '../../../chunk-OXTLPTO3.js';
|
|
9
|
+
import '../../../chunk-SG65XWH7.js';
|
|
10
|
+
import { DEPLOYED_ADDRESSES } from '../../../chunk-XGGTQQFH.js';
|
|
11
|
+
import '../../../chunk-ZA673I3O.js';
|
|
11
12
|
import '../../../chunk-Q2GP5UDC.js';
|
|
12
13
|
import '../../../chunk-KWFFIJYX.js';
|
|
13
|
-
import '../../../chunk-
|
|
14
|
+
import '../../../chunk-QBJ7O2B4.js';
|
|
14
15
|
import { useRef, useMemo } from 'react';
|
|
15
16
|
import { useQuery } from '@tanstack/react-query';
|
|
16
17
|
import { usePublicClient, useWalletClient } from 'wagmi';
|
|
@@ -79,6 +79,14 @@ export interface EncryptUint64BatchArgs {
|
|
|
79
79
|
* The handle and proof are bound to `contractAddress` and `userAddress` — they
|
|
80
80
|
* cannot be replayed against a different contract or sender.
|
|
81
81
|
*
|
|
82
|
+
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
83
|
+
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
84
|
+
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
85
|
+
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
86
|
+
* transparent TTT test token uses 18 decimals. `value` (and each entry of
|
|
87
|
+
* `values` in {@link encryptUint64Batch}) follows this convention when it
|
|
88
|
+
* encodes a token amount.
|
|
89
|
+
*
|
|
82
90
|
* @param args Encryption request; `value` must fit in `uint64` (0 to 2^64-1).
|
|
83
91
|
* @returns `{ handle: Hex, inputProof: Hex }` — pass both to the contract.
|
|
84
92
|
* @example
|
|
@@ -72,7 +72,7 @@ export interface PredictManagerArgs {
|
|
|
72
72
|
* Rich-return shape from {@link ConfidentialVestingFactoryClient.createManager}.
|
|
73
73
|
*
|
|
74
74
|
* Branded `hash: TxHash` and `manager: Address` so consumers can't accidentally
|
|
75
|
-
* swap them at the destructure site
|
|
75
|
+
* swap them at the destructure site.
|
|
76
76
|
*/
|
|
77
77
|
export interface CreateManagerResult {
|
|
78
78
|
/** Transaction hash of the deploy. */
|
|
@@ -99,11 +99,10 @@ export declare class ConfidentialVestingFactoryClient {
|
|
|
99
99
|
* Deploy a new `ConfidentialVestingManager` clone via the factory and return
|
|
100
100
|
* its address, parsed from the `ManagerCreated` event in the tx receipt.
|
|
101
101
|
*
|
|
102
|
-
* **This is the headline factory entry point.**
|
|
103
|
-
*
|
|
104
|
-
* the address is only knowable after the tx mines (the factory packs
|
|
102
|
+
* **This is the headline factory entry point.** It returns one rich-return
|
|
103
|
+
* shape: the address is only knowable after the tx mines (the factory packs
|
|
105
104
|
* `block.number` into the clone's immutable args), so a hash-only variant
|
|
106
|
-
*
|
|
105
|
+
* would force consumers to re-derive what the SDK already had to compute.
|
|
107
106
|
*
|
|
108
107
|
* Calls `createManagerWithOptions` when `splitEnabled` or `pausableEnabled`
|
|
109
108
|
* is provided; otherwise calls the simpler `createManager` entry point.
|
|
@@ -178,9 +177,8 @@ export declare class ConfidentialVestingFactoryClient {
|
|
|
178
177
|
* Alias for {@link ConfidentialVestingFactoryClient.implementation} that matches
|
|
179
178
|
* the contract's storage field name (`_managerImplementation`).
|
|
180
179
|
*
|
|
181
|
-
*
|
|
182
|
-
*
|
|
183
|
-
* server devs reading the Solidity reach for `factory.managerImplementation()`
|
|
180
|
+
* Named for clarity: server devs reading the Solidity reach for
|
|
181
|
+
* `factory.managerImplementation()`
|
|
184
182
|
* via autocomplete (the contract storage slot name) and hit a TS2551. The
|
|
185
183
|
* canonical `implementation()` method is retained for backwards-compat and
|
|
186
184
|
* cross-factory uniformity (fhe-airdrop exposes the same shape).
|