@tokenops/sdk 1.1.1 → 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 +18 -8
- package/dist/{chunk-5SGMJADP.cjs → chunk-2NCLOQ56.cjs} +9 -9
- package/dist/{chunk-FXCW7LVB.js → chunk-2PWNH3UE.js} +35 -6
- package/dist/{chunk-FPQBFIUW.cjs → chunk-4WPGQSNT.cjs} +3 -3
- package/dist/{chunk-OYLZEEHF.cjs → chunk-5X5WL5CU.cjs} +265 -101
- 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-SAGJIEQK.cjs → chunk-C7BRZXJA.cjs} +14 -14
- package/dist/{chunk-OQZAZIAS.js → chunk-DUZIIRPF.js} +174 -5
- package/dist/{chunk-Q7ARQSUH.cjs → chunk-FAXIIH5R.cjs} +3 -3
- package/dist/chunk-FT4LNBOS.js +11 -0
- package/dist/{chunk-QE7ZONJ2.js → chunk-IJFQ5L4I.js} +4 -4
- package/dist/{chunk-X56UVEXS.js → chunk-IXLO7GO5.js} +209 -45
- 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-3PQ2RFPC.js → chunk-NTZY6IB7.js} +4 -4
- package/dist/{chunk-JJ4R5QXF.js → chunk-ODLTEGHB.js} +1 -1
- package/dist/{chunk-XWDVPV42.js → chunk-ORFTDNFZ.js} +4 -4
- package/dist/{chunk-IR5AK5U5.js → chunk-OXTLPTO3.js} +4 -4
- package/dist/{chunk-23F7JIK5.cjs → chunk-PFXURMBZ.cjs} +77 -48
- package/dist/{chunk-3ZRHDTEX.cjs → chunk-PUPKNW3R.cjs} +2 -2
- package/dist/{chunk-IVE3QEGD.js → chunk-QBJ7O2B4.js} +18 -1
- package/dist/{chunk-JFLEEXKP.js → chunk-SG65XWH7.js} +58 -2
- package/dist/{chunk-G7G75C46.cjs → chunk-T46YXSBP.cjs} +11 -11
- package/dist/{chunk-NS44KBV5.cjs → chunk-TEBM66WA.cjs} +12 -12
- package/dist/{chunk-SYHXDHWX.cjs → chunk-TIUKIY5V.cjs} +193 -24
- package/dist/{chunk-W7JHOK7G.cjs → chunk-V2PXZVBF.cjs} +4 -4
- package/dist/{chunk-SEKC7H5Y.cjs → chunk-W7IGCOVL.cjs} +11 -11
- package/dist/{chunk-5KHIQG7Y.cjs → chunk-WENHUPZC.cjs} +31 -31
- package/dist/{chunk-ZXCOJY2Z.js → chunk-WMACINXO.js} +1 -1
- package/dist/{chunk-M7V2EDPB.js → chunk-XGGTQQFH.js} +1 -1
- package/dist/{chunk-ITQBDRWX.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/errors.d.ts +41 -1
- package/dist/core/revert-mapper.d.ts +77 -0
- 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/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/index.cjs +9 -8
- 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.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 +86 -1
- 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 +6 -0
- 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/index.cjs +8 -8
- 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.js +12 -11
- package/dist/fhe-vesting/encryption.d.ts +8 -0
- 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 +100 -1
- 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 +6 -0
- 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 -0
- package/dist/index.cjs +61 -53
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/testnet-faucet/index.cjs +58 -54
- package/dist/testnet-faucet/index.d.cts +1 -1
- package/dist/testnet-faucet/index.d.ts +1 -1
- package/dist/testnet-faucet/index.js +5 -5
- package/dist/testnet-faucet/react/index.cjs +60 -55
- package/dist/testnet-faucet/react/index.d.cts +3 -2
- package/dist/testnet-faucet/react/index.d.ts +3 -2
- package/dist/testnet-faucet/react/index.js +11 -10
- package/dist/testnet-faucet/react/useConfidentialBalance.d.ts +3 -2
- package/dist/testnet-faucet/react/useUnderlyingBalance.d.ts +2 -2
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -720,17 +720,27 @@ See [Testnet Faucet — React hooks on docs.tokenops.xyz](https://docs.tokenops.
|
|
|
720
720
|
|
|
721
721
|
## Peer dependencies
|
|
722
722
|
|
|
723
|
-
| Package | Range
|
|
724
|
-
| ----------------------- |
|
|
725
|
-
| `viem` | `^2.47`
|
|
726
|
-
| `@zama-fhe/sdk` | `^3.0.0`
|
|
727
|
-
| `@zama-fhe/react-sdk` | `^3.0.0`
|
|
728
|
-
| `react` | `>=18`
|
|
729
|
-
| `wagmi` | `^2`
|
|
730
|
-
| `@tanstack/react-query` | `^5`
|
|
723
|
+
| Package | Range | Required for |
|
|
724
|
+
| ----------------------- | ------------ | ------------------------------------------------------------------------------ |
|
|
725
|
+
| `viem` | `^2.47` | all subpaths (hard required) |
|
|
726
|
+
| `@zama-fhe/sdk` | `^3.0.0` | encryption + decryption + FHE write flows on every FHE subpath (optional peer) |
|
|
727
|
+
| `@zama-fhe/react-sdk` | `^3.0.0` | `/react` hook subpaths that submit encrypted inputs (optional peer) |
|
|
728
|
+
| `react` | `>=18` | `/react` hook subpaths (optional peer) |
|
|
729
|
+
| `wagmi` | `^2 \|\| ^3` | `/react` hook subpaths (optional peer) |
|
|
730
|
+
| `@tanstack/react-query` | `^5` | `/react` hook subpaths (optional peer) |
|
|
731
731
|
|
|
732
732
|
All peers except `viem` are marked `optional` via `peerDependenciesMeta` so read-only / ABI-only consumers can install the package without pulling them in. Install `@zama-fhe/sdk` explicitly the first time you encrypt, decrypt, or submit an FHE write; install the React peers if you use any `/react` hook subpath.
|
|
733
733
|
|
|
734
|
+
### wagmi v2 and v3
|
|
735
|
+
|
|
736
|
+
The SDK supports both wagmi majors. wagmi v3 renamed `useAccount` → `useConnection`; the SDK resolves the right hook internally at runtime, so no code change is needed on your side when you upgrade — the hooks' public API is identical under both majors. CI typechecks and runs the hook suites against both.
|
|
737
|
+
|
|
738
|
+
**Still seeing `ERESOLVE` after upgrading to wagmi v3?** The error is almost certainly coming from _another_ package in your dependency tree, not from `@tokenops/sdk` (which accepts `^2.0.0 || ^3.0.0`). To diagnose:
|
|
739
|
+
|
|
740
|
+
1. Read the `ERESOLVE` output carefully — npm names the package whose peer range could not be satisfied (`Could not resolve dependency: peer wagmi@"^2.x" from <package>@<version>`). If `<package>` is not `@tokenops/sdk`, that package still pins wagmi v2.
|
|
741
|
+
2. Confirm with `npm ls wagmi` (or `pnpm why wagmi`) — it prints every dependent and the range each one declares.
|
|
742
|
+
3. Fix by upgrading the offending package to a wagmi-v3-compatible release, or — if none exists yet — stay on wagmi v2 (fully supported by this SDK) until it does. npm's `--legacy-peer-deps` / pnpm's looser peer handling can silence the error, but you are then running that package against a wagmi major it does not declare support for.
|
|
743
|
+
|
|
734
744
|
## Design
|
|
735
745
|
|
|
736
746
|
- **Single package, subpath exports.** No companion `@tokenops/react-sdk` — hooks live at `@tokenops/sdk/<product>/react`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk67OV5CX2_cjs = require('./chunk-67OV5CX2.cjs');
|
|
4
4
|
|
|
5
5
|
// src/fhe/scale-ratio.ts
|
|
6
6
|
var FHE_SPLIT_DENOMINATOR = 90090000n;
|
|
@@ -15,7 +15,7 @@ function scaleRatio({
|
|
|
15
15
|
width = "uint128"
|
|
16
16
|
}) {
|
|
17
17
|
if (denominator <= 0n) {
|
|
18
|
-
throw new
|
|
18
|
+
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
19
19
|
method: "scaleRatio",
|
|
20
20
|
argument: "denominator",
|
|
21
21
|
reason: `must be > 0, got ${denominator}`,
|
|
@@ -23,7 +23,7 @@ function scaleRatio({
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
if (numerator < 0n) {
|
|
26
|
-
throw new
|
|
26
|
+
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
27
27
|
method: "scaleRatio",
|
|
28
28
|
argument: "numerator",
|
|
29
29
|
reason: `must be >= 0, got ${numerator}`,
|
|
@@ -31,7 +31,7 @@ function scaleRatio({
|
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
if (minDenominator <= 0n) {
|
|
34
|
-
throw new
|
|
34
|
+
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
35
35
|
method: "scaleRatio",
|
|
36
36
|
argument: "minDenominator",
|
|
37
37
|
reason: `must be > 0, got ${minDenominator}`,
|
|
@@ -51,7 +51,7 @@ function scaleRatio({
|
|
|
51
51
|
function assertWithinWidth(value, width, label) {
|
|
52
52
|
const max = width === "uint64" ? MAX_UINT64 : MAX_UINT128;
|
|
53
53
|
if (value > max) {
|
|
54
|
-
throw new
|
|
54
|
+
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
55
55
|
method: "scaleRatio",
|
|
56
56
|
argument: label,
|
|
57
57
|
reason: `exceeds ${width} range`,
|
|
@@ -78,7 +78,7 @@ var share = {
|
|
|
78
78
|
const n = toIntegerBigInt(numerator, "share.fraction", "numerator");
|
|
79
79
|
const m = toIntegerBigInt(denominator, "share.fraction", "denominator");
|
|
80
80
|
if (m <= 0n || m > MAX_FRACTION_DENOMINATOR) {
|
|
81
|
-
throw new
|
|
81
|
+
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
82
82
|
method: "share.fraction",
|
|
83
83
|
argument: "denominator",
|
|
84
84
|
reason: `must be in 1..${MAX_FRACTION_DENOMINATOR}, got ${m}`,
|
|
@@ -86,7 +86,7 @@ var share = {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
if (n < 0n || n > m) {
|
|
89
|
-
throw new
|
|
89
|
+
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
90
90
|
method: "share.fraction",
|
|
91
91
|
argument: "numerator",
|
|
92
92
|
reason: `must be in 0..${m} (denominator), got ${n}`,
|
|
@@ -111,7 +111,7 @@ var share = {
|
|
|
111
111
|
basisPoints(bps) {
|
|
112
112
|
const value = toIntegerBigInt(bps, "share.basisPoints", "bps");
|
|
113
113
|
if (value < 0n || value > BASIS_POINT_SCALE) {
|
|
114
|
-
throw new
|
|
114
|
+
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
115
115
|
method: "share.basisPoints",
|
|
116
116
|
argument: "bps",
|
|
117
117
|
reason: `must be in 0..${BASIS_POINT_SCALE}, got ${value}`,
|
|
@@ -124,7 +124,7 @@ var share = {
|
|
|
124
124
|
function toIntegerBigInt(value, method, argument) {
|
|
125
125
|
if (typeof value === "bigint") return value;
|
|
126
126
|
if (!Number.isInteger(value)) {
|
|
127
|
-
throw new
|
|
127
|
+
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
128
128
|
method,
|
|
129
129
|
argument,
|
|
130
130
|
reason: `must be an integer, got ${value}`,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { mapZamaError } from './chunk-
|
|
2
|
-
import { getFhevmAclAddress, requireFhevmAclAddress, ACL_ALLOWED_EVENT } from './chunk-
|
|
3
|
-
import { SDK_VERSION, isContractRevert, mapContractRevert } from './chunk-
|
|
4
|
-
import { getFheDisperseSingletonAddress } from './chunk-
|
|
5
|
-
import { normaliseAddress } from './chunk-
|
|
1
|
+
import { mapZamaError } from './chunk-WMACINXO.js';
|
|
2
|
+
import { getFhevmAclAddress, requireFhevmAclAddress, ACL_ALLOWED_EVENT } from './chunk-ZWXJTBZO.js';
|
|
3
|
+
import { SDK_VERSION, isContractRevert, mapContractRevert } from './chunk-SG65XWH7.js';
|
|
4
|
+
import { getFheDisperseSingletonAddress } from './chunk-XGGTQQFH.js';
|
|
5
|
+
import { normaliseAddress } from './chunk-ZA673I3O.js';
|
|
6
6
|
import { withTelemetry } from './chunk-Q2GP5UDC.js';
|
|
7
7
|
import { asExternalInputProof, asEncryptedHandle } from './chunk-KWFFIJYX.js';
|
|
8
|
-
import { InvalidArgumentError, TokenOpsSdkError, DeploymentAddressUnavailableError, PausedError, InsufficientFeeError, MissingEncryptorError, ReceiptEventAmbiguousError, MissingWalletClientError, MissingAccountError, BatchTooLargeError } from './chunk-
|
|
8
|
+
import { InvalidArgumentError, TokenOpsSdkError, DeploymentAddressUnavailableError, PausedError, InsufficientFeeError, MissingEncryptorError, ReceiptEventAmbiguousError, MissingWalletClientError, MissingAccountError, BatchTooLargeError } from './chunk-QBJ7O2B4.js';
|
|
9
9
|
import { bytesToHex, keccak256, encodePacked, parseEventLogs, isAddress, getCreate2Address } from 'viem';
|
|
10
10
|
|
|
11
11
|
// src/fhe-disperse/abis/singleton.ts
|
|
@@ -2166,6 +2166,13 @@ var ConfidentialDisperseClient = class {
|
|
|
2166
2166
|
* subtotal1` for the result to match the on-chain computation. Both this
|
|
2167
2167
|
* SDK and the contract round the BPS multiplication down (floor division).
|
|
2168
2168
|
*
|
|
2169
|
+
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
2170
|
+
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
2171
|
+
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
2172
|
+
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
2173
|
+
* transparent TTT test token uses 18 decimals. `totalTokens` follows this
|
|
2174
|
+
* convention.
|
|
2175
|
+
*
|
|
2169
2176
|
* @throws {TokenOpsSdkError} if mode is `"wallet-token-fee"` and `totalTokens` is not provided.
|
|
2170
2177
|
*/
|
|
2171
2178
|
async calculateFee(args) {
|
|
@@ -2229,6 +2236,13 @@ var ConfidentialDisperseClient = class {
|
|
|
2229
2236
|
* - `hasApprovedSubwallets` (wallet modes) or `isOperator(sender, singleton)` (direct mode)
|
|
2230
2237
|
* - `calculateFee` / `getBatchLimits`
|
|
2231
2238
|
* - Structural recipient + amount validation
|
|
2239
|
+
*
|
|
2240
|
+
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
2241
|
+
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
2242
|
+
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
2243
|
+
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
2244
|
+
* transparent TTT test token uses 18 decimals. Pass `amounts[]` in the same
|
|
2245
|
+
* units you will pass to `disperse` so the report reflects the real call.
|
|
2232
2246
|
*/
|
|
2233
2247
|
async preflightDisperse(args) {
|
|
2234
2248
|
const { user, token, recipients, amounts, mode } = args;
|
|
@@ -2474,6 +2488,15 @@ var ConfidentialDisperseClient = class {
|
|
|
2474
2488
|
* 4. Computes `msg.value` for gas-fee modes; `0` for token-fee mode.
|
|
2475
2489
|
* 5. Dispatches to the correct contract function based on `mode`.
|
|
2476
2490
|
*
|
|
2491
|
+
* **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.
|
|
2492
|
+
*
|
|
2493
|
+
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
2494
|
+
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
2495
|
+
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
2496
|
+
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
2497
|
+
* transparent TTT test token uses 18 decimals. Every entry of `amounts[]`
|
|
2498
|
+
* follows this convention.
|
|
2499
|
+
*
|
|
2477
2500
|
* @throws {TokenOpsSdkError} on input validation failure (first deterministic error).
|
|
2478
2501
|
* @throws {TokenOpsSdkError} if no encryptor is available at call time.
|
|
2479
2502
|
*/
|
|
@@ -2789,6 +2812,12 @@ var ConfidentialDisperseClient = class {
|
|
|
2789
2812
|
* encryptor, or pass `encryptedInput` directly. The contract caps the
|
|
2790
2813
|
* withdrawal at the available reserve via `FHE.min`.
|
|
2791
2814
|
*
|
|
2815
|
+
* **Amount units:** TokenOps confidential (ERC-7984) tokens use a 6-decimals
|
|
2816
|
+
* convention (1 token = 1_000_000 base units), not the 18 decimals typical of
|
|
2817
|
+
* ERC-20. Amount parameters are base units of the token's actual decimals:
|
|
2818
|
+
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
2819
|
+
* transparent TTT test token uses 18 decimals.
|
|
2820
|
+
*
|
|
2792
2821
|
* Returns the tx hash plus the **transferred** handle parsed from the
|
|
2793
2822
|
* `TokenFeeWithdrawn` event. Decrypt the handle via Zama's `userDecrypt`
|
|
2794
2823
|
* to view the actual amount moved (which can be less than requested when
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkTIUKIY5V_cjs = require('./chunk-TIUKIY5V.cjs');
|
|
4
4
|
|
|
5
5
|
// src/fhe-airdrop/advanced/factory-advanced.ts
|
|
6
|
-
var ConfidentialAirdropFactoryAdvancedClient = class extends
|
|
6
|
+
var ConfidentialAirdropFactoryAdvancedClient = class extends chunkTIUKIY5V_cjs.ConfidentialAirdropFactoryClient {
|
|
7
7
|
/**
|
|
8
8
|
* Compute the deterministic CREATE2 address for an airdrop clone without
|
|
9
9
|
* deploying it.
|
|
@@ -21,7 +21,7 @@ var ConfidentialAirdropFactoryAdvancedClient = class extends chunkSYHXDHWX_cjs.C
|
|
|
21
21
|
async predictAirdropAddress(args) {
|
|
22
22
|
return this.publicClient.readContract({
|
|
23
23
|
address: this.address,
|
|
24
|
-
abi:
|
|
24
|
+
abi: chunkTIUKIY5V_cjs.confidentialAirdropFactoryAbi,
|
|
25
25
|
functionName: "predictAirdropAddress",
|
|
26
26
|
args: [toAbiParams(args.params), args.userSalt, args.deployer, args.gasFee]
|
|
27
27
|
});
|