@tokenops/sdk 2.0.0-alpha.2 → 2.0.0-alpha.3
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/CHANGELOG.md +39 -3
- package/README.md +11 -5
- package/dist/{chunk-PZZK3O3S.cjs → chunk-4AWQJQXY.cjs} +391 -43
- package/dist/{chunk-SPLNGUFF.js → chunk-4IB4IY5Y.js} +1 -1
- package/dist/{chunk-A4DCEE33.js → chunk-6HCT4QIX.js} +11 -10
- package/dist/{chunk-MM5BV5CS.cjs → chunk-6XOAYDC6.cjs} +4 -4
- package/dist/{chunk-FEDX7B6T.cjs → chunk-AHU2HMNE.cjs} +3 -3
- package/dist/{chunk-IGO5XSPS.js → chunk-BPIVVCSQ.js} +2 -2
- package/dist/{chunk-X7WBPCEU.js → chunk-BXX5TETM.js} +375 -27
- package/dist/{chunk-GADGBQJO.js → chunk-GCJFAY4X.js} +2 -2
- package/dist/{chunk-IUKKNJ2R.cjs → chunk-GKYZQJGP.cjs} +7 -7
- package/dist/{chunk-3YHBO2DL.cjs → chunk-IEKTGJ4J.cjs} +2 -2
- package/dist/{chunk-UHHMVBLU.cjs → chunk-JVNJSDQ4.cjs} +2 -2
- package/dist/{chunk-VW356KR3.js → chunk-LEYYG4RF.js} +126 -3
- package/dist/{chunk-PYYSB5ZN.js → chunk-NGU4JYIR.js} +1 -1
- package/dist/{chunk-FT5H2Q7Y.cjs → chunk-PG3WXT3K.cjs} +11 -10
- package/dist/{chunk-44YJPMQC.js → chunk-PK6Q6J5F.js} +1 -1
- package/dist/{chunk-EBLBPUPI.cjs → chunk-TND5NDV7.cjs} +18 -10
- package/dist/{chunk-EYDA6Q6C.js → chunk-U3TBQRT7.js} +10 -2
- package/dist/{chunk-WJMEBBU7.js → chunk-WRWRA4TN.js} +1 -1
- package/dist/{chunk-FHWSBGWE.cjs → chunk-YABHXJNH.cjs} +5 -5
- package/dist/{chunk-AREQJHKA.cjs → chunk-YTIYTV4K.cjs} +129 -2
- package/dist/core/addresses.d.ts +4 -4
- package/dist/core/errors.d.ts +1 -1
- package/dist/fhe-airdrop/abis/airdrop-base.d.ts +19 -0
- package/dist/fhe-airdrop/abis/ecdsa.d.ts +19 -0
- package/dist/fhe-airdrop/abis/factory.d.ts +113 -0
- package/dist/fhe-airdrop/abis/merkle.d.ts +19 -0
- package/dist/fhe-airdrop/advanced/index.cjs +4 -4
- package/dist/fhe-airdrop/advanced/index.js +1 -1
- package/dist/fhe-airdrop/advanced/react/index.cjs +110 -80
- package/dist/fhe-airdrop/advanced/react/index.d.cts +1 -0
- package/dist/fhe-airdrop/advanced/react/index.d.ts +1 -0
- package/dist/fhe-airdrop/advanced/react/index.js +34 -5
- package/dist/fhe-airdrop/advanced/react/useDisableCustomFee.d.ts +2 -1
- package/dist/fhe-airdrop/advanced/react/useFactoryRenounceRole.d.ts +4 -3
- package/dist/fhe-airdrop/advanced/react/useFactoryRevokeRole.d.ts +9 -7
- package/dist/fhe-airdrop/advanced/react/useFactoryRoleMembers.d.ts +6 -5
- package/dist/fhe-airdrop/advanced/react/useSetCustomFee.d.ts +2 -1
- package/dist/fhe-airdrop/advanced/react/useSetDefaultGasFee.d.ts +5 -3
- package/dist/fhe-airdrop/advanced/react/useSetMaxGasFee.d.ts +33 -0
- package/dist/fhe-airdrop/airdrop-base.d.ts +47 -8
- package/dist/fhe-airdrop/constants.d.ts +9 -1
- package/dist/fhe-airdrop/ecdsa.d.ts +13 -0
- package/dist/fhe-airdrop/errors.d.ts +59 -0
- package/dist/fhe-airdrop/factory.d.ts +62 -22
- package/dist/fhe-airdrop/guards.d.ts +87 -2
- package/dist/fhe-airdrop/index.cjs +67 -55
- package/dist/fhe-airdrop/index.d.cts +3 -3
- package/dist/fhe-airdrop/index.d.ts +3 -3
- package/dist/fhe-airdrop/index.js +4 -4
- package/dist/fhe-airdrop/react/index.cjs +237 -177
- package/dist/fhe-airdrop/react/index.d.cts +4 -1
- package/dist/fhe-airdrop/react/index.d.ts +4 -1
- package/dist/fhe-airdrop/react/index.js +72 -15
- package/dist/fhe-airdrop/react/keys.d.ts +8 -0
- package/dist/fhe-airdrop/react/useFactoryFees.d.ts +11 -4
- package/dist/fhe-airdrop/react/useIsAirdrop.d.ts +44 -0
- package/dist/fhe-airdrop/react/useRefreshComplianceBalance.d.ts +36 -0
- package/dist/fhe-airdrop/react/useResolveGasFee.d.ts +30 -0
- package/dist/fhe-airdrop/types.d.ts +13 -0
- package/dist/fhe-disperse/index.cjs +21 -21
- package/dist/fhe-disperse/index.js +2 -2
- package/dist/fhe-disperse/react/index.cjs +22 -22
- package/dist/fhe-disperse/react/index.js +3 -3
- package/dist/fhe-vesting/advanced/index.cjs +5 -5
- package/dist/fhe-vesting/advanced/index.js +3 -3
- package/dist/fhe-vesting/advanced/react/index.cjs +7 -7
- package/dist/fhe-vesting/advanced/react/index.js +4 -4
- package/dist/fhe-vesting/index.cjs +8 -8
- package/dist/fhe-vesting/index.js +2 -2
- package/dist/fhe-vesting/react/index.cjs +114 -114
- package/dist/fhe-vesting/react/index.js +3 -3
- package/dist/index.cjs +18 -18
- package/dist/index.js +1 -1
- package/dist/testnet-faucet/index.cjs +14 -14
- package/dist/testnet-faucet/index.js +2 -2
- package/dist/testnet-faucet/react/index.cjs +8 -8
- package/dist/testnet-faucet/react/index.js +3 -3
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SDK_VERSION } from './chunk-NWFMBLSQ.js';
|
|
2
2
|
import { isContractRevert, mapContractRevert } from './chunk-4RAAATVY.js';
|
|
3
|
-
import { getConfidentialTestTokenAddress, getTestTokenAddress } from './chunk-
|
|
3
|
+
import { getConfidentialTestTokenAddress, getTestTokenAddress } from './chunk-6HCT4QIX.js';
|
|
4
4
|
import { normaliseAddress } from './chunk-ZA673I3O.js';
|
|
5
5
|
import { asEncryptedHandle, asTxHash } from './chunk-KWFFIJYX.js';
|
|
6
6
|
import { TokenOpsSdkError, UnsupportedChainError, DeploymentAddressUnavailableError, TokenOpsContractError, ReceiptEventNotFoundError, ReceiptEventAmbiguousError, MissingWalletClientError, MissingAccountError, InvalidArgumentError } from './chunk-QBJ7O2B4.js';
|
|
@@ -8,28 +8,29 @@ var DEPLOYED_ADDRESSES = {
|
|
|
8
8
|
// mainnet omitted — not deployed.
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
|
-
// Airdrop v2 (tokenops-fhe-airdrop-v2 @
|
|
11
|
+
// Airdrop v2 (tokenops-fhe-airdrop-v2 @ c5c12c2). The four contracts deploy
|
|
12
12
|
// together in one scripted run, so a chain either has all of them or none —
|
|
13
13
|
// which is what `chainsWithDeployment` assumes.
|
|
14
14
|
//
|
|
15
|
-
// Every address moved at
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
15
|
+
// Every address moved again at c5c12c2. The internal-audit round changed the
|
|
16
|
+
// factory and all three implementations, and CREATE3 returns a consumed salt's
|
|
17
|
+
// EXISTING address without comparing codehashes - so the run bumps the canonical
|
|
18
|
+
// salt version (2.0.0 → 2.0.2) rather than redeploying over itself. A campaign
|
|
19
|
+
// planned against the previous factory therefore predicts an address the new
|
|
20
|
+
// factory will never produce; `PredictionDriftError` is what catches that.
|
|
20
21
|
fheAirdrop: {
|
|
21
22
|
airdropFactory: {
|
|
22
|
-
[sepolia.id]: "
|
|
23
|
+
[sepolia.id]: "0xA10ff713cfeE5348313Cda0B2CA1b190A1194cab"
|
|
23
24
|
// mainnet omitted — ZamaConfig-gated, not deployed.
|
|
24
25
|
},
|
|
25
26
|
ecdsaImplementation: {
|
|
26
|
-
[sepolia.id]: "
|
|
27
|
+
[sepolia.id]: "0x8d4E8F379f73D5488a76B6C3CC8a2fD489936BDe"
|
|
27
28
|
},
|
|
28
29
|
merkleImplementation: {
|
|
29
|
-
[sepolia.id]: "
|
|
30
|
+
[sepolia.id]: "0x4B4F43Ed9aB3F9D10468b59C03d14f55A9d4E82F"
|
|
30
31
|
},
|
|
31
32
|
complianceManagerImplementation: {
|
|
32
|
-
[sepolia.id]: "
|
|
33
|
+
[sepolia.id]: "0x14bdE71e6b32b50dF1a5Dca1bccD150a319168e2"
|
|
33
34
|
}
|
|
34
35
|
},
|
|
35
36
|
fheDisperse: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkJVNJSDQ4_cjs = require('./chunk-JVNJSDQ4.cjs');
|
|
4
4
|
|
|
5
5
|
// src/fhe-vesting/advanced/factory-advanced.ts
|
|
6
|
-
var ConfidentialVestingFactoryAdvancedClient = class extends
|
|
6
|
+
var ConfidentialVestingFactoryAdvancedClient = class extends chunkJVNJSDQ4_cjs.ConfidentialVestingFactoryClient {
|
|
7
7
|
/**
|
|
8
8
|
* Compute the deterministic CREATE2 clone address as the factory would have
|
|
9
9
|
* computed it at `args.blockNumber`.
|
|
@@ -20,7 +20,7 @@ var ConfidentialVestingFactoryAdvancedClient = class extends chunkUHHMVBLU_cjs.C
|
|
|
20
20
|
if (hasOptions) {
|
|
21
21
|
return this.publicClient.readContract({
|
|
22
22
|
address: this.address,
|
|
23
|
-
abi:
|
|
23
|
+
abi: chunkJVNJSDQ4_cjs.confidentialVestingFactoryAbi,
|
|
24
24
|
functionName: "predictManagerAddressWithOptions",
|
|
25
25
|
args: [
|
|
26
26
|
args.token,
|
|
@@ -34,7 +34,7 @@ var ConfidentialVestingFactoryAdvancedClient = class extends chunkUHHMVBLU_cjs.C
|
|
|
34
34
|
}
|
|
35
35
|
return this.publicClient.readContract({
|
|
36
36
|
address: this.address,
|
|
37
|
-
abi:
|
|
37
|
+
abi: chunkJVNJSDQ4_cjs.confidentialVestingFactoryAbi,
|
|
38
38
|
functionName: "predictManagerAddress",
|
|
39
39
|
args: [args.token, args.userSalt, args.deployer],
|
|
40
40
|
blockNumber: args.blockNumber
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkUG5RKLU2_cjs = require('./chunk-UG5RKLU2.cjs');
|
|
4
4
|
var chunkMVDQMV25_cjs = require('./chunk-MVDQMV25.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkPG3WXT3K_cjs = require('./chunk-PG3WXT3K.cjs');
|
|
6
6
|
var chunkJK4XMMKM_cjs = require('./chunk-JK4XMMKM.cjs');
|
|
7
7
|
var chunk66IHPTOK_cjs = require('./chunk-66IHPTOK.cjs');
|
|
8
8
|
var chunk67OV5CX2_cjs = require('./chunk-67OV5CX2.cjs');
|
|
@@ -1826,7 +1826,7 @@ var TestnetFaucetClient = class {
|
|
|
1826
1826
|
this.#chainId = chainId;
|
|
1827
1827
|
assertTestnetFaucetChain(chainId);
|
|
1828
1828
|
const addressOverride = config.address ? chunkJK4XMMKM_cjs.normaliseAddress(config.address) : void 0;
|
|
1829
|
-
const resolved = addressOverride ?? (chainId === void 0 ? void 0 :
|
|
1829
|
+
const resolved = addressOverride ?? (chainId === void 0 ? void 0 : chunkPG3WXT3K_cjs.getConfidentialTestTokenAddress(chainId));
|
|
1830
1830
|
if (!resolved) {
|
|
1831
1831
|
throw new chunk67OV5CX2_cjs.DeploymentAddressUnavailableError({
|
|
1832
1832
|
reason: chainId === void 0 ? "chain-id-missing" : "registry-not-deployed",
|
|
@@ -1864,7 +1864,7 @@ var TestnetFaucetClient = class {
|
|
|
1864
1864
|
*/
|
|
1865
1865
|
async underlyingToken() {
|
|
1866
1866
|
if (this.#cachedUnderlying) return this.#cachedUnderlying;
|
|
1867
|
-
const fromRegistry = this.#cttAddressIsOverride || this.#chainId === void 0 ? void 0 :
|
|
1867
|
+
const fromRegistry = this.#cttAddressIsOverride || this.#chainId === void 0 ? void 0 : chunkPG3WXT3K_cjs.getTestTokenAddress(this.#chainId);
|
|
1868
1868
|
const resolved = fromRegistry ?? await this.#readCtt("underlying");
|
|
1869
1869
|
this.#cachedUnderlying = chunkJK4XMMKM_cjs.normaliseAddress(resolved);
|
|
1870
1870
|
return this.#cachedUnderlying;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createConfidentialVestingManagerClient } from './chunk-TWT3STIX.js';
|
|
2
2
|
import { resolveEncryptor } from './chunk-6GNR22OV.js';
|
|
3
|
-
import { createConfidentialVestingFactoryClient } from './chunk-
|
|
4
|
-
import { getFheVestingFactoryAddress } from './chunk-
|
|
3
|
+
import { createConfidentialVestingFactoryClient } from './chunk-WRWRA4TN.js';
|
|
4
|
+
import { getFheVestingFactoryAddress } from './chunk-6HCT4QIX.js';
|
|
5
5
|
import { DeploymentAddressUnavailableError } from './chunk-QBJ7O2B4.js';
|
|
6
6
|
import { useMemo, useRef, useEffect } from 'react';
|
|
7
7
|
import { usePublicClient, useWalletClient } from 'wagmi';
|