@tokenops/sdk 1.5.1 → 1.6.0
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 +158 -2
- package/SECURITY.md +7 -1
- package/dist/{chunk-67OV5CX2.cjs → chunk-2RNW4MIJ.cjs} +18 -0
- package/dist/{chunk-KLKI352M.cjs → chunk-43RFBQ73.cjs} +29 -29
- package/dist/{chunk-ZA673I3O.js → chunk-46T67CE2.js} +1 -1
- package/dist/{chunk-6BMP4ICG.js → chunk-4KJ66YRH.js} +61 -3
- package/dist/{chunk-JYOTGRSO.cjs → chunk-4ZCXK4VI.cjs} +68 -8
- package/dist/{chunk-SG65XWH7.js → chunk-6WSNS3UV.js} +1 -1
- package/dist/{chunk-V2PXZVBF.cjs → chunk-7G7UOQV4.cjs} +4 -4
- package/dist/{chunk-WENHUPZC.cjs → chunk-AYGRYDBX.cjs} +35 -36
- package/dist/{chunk-2NCLOQ56.cjs → chunk-BD4LZBVF.cjs} +85 -9
- package/dist/{chunk-5X5WL5CU.cjs → chunk-BK7YIVLK.cjs} +110 -149
- package/dist/{chunk-W7IGCOVL.cjs → chunk-CBRL2PJA.cjs} +12 -11
- package/dist/{chunk-ORFTDNFZ.js → chunk-CNP4L3GF.js} +4 -4
- package/dist/{chunk-QBJ7O2B4.js → chunk-DRSPMIZ7.js} +11 -1
- package/dist/{chunk-C7BRZXJA.cjs → chunk-EUKPOXWR.cjs} +15 -16
- package/dist/{chunk-YQIBBEFJ.js → chunk-HETNKZEE.js} +1 -1
- package/dist/{chunk-ODLTEGHB.js → chunk-KSDSXJ34.js} +1 -1
- package/dist/{chunk-TIUKIY5V.cjs → chunk-LBWRFZR3.cjs} +58 -40
- package/dist/{chunk-WMACINXO.js → chunk-NFW7AUEX.js} +1 -1
- package/dist/{chunk-4WPGQSNT.cjs → chunk-OL6SHN3D.cjs} +3 -3
- package/dist/{chunk-AOP6HMPW.js → chunk-PD7ME2BT.js} +75 -2
- package/dist/{chunk-2PWNH3UE.js → chunk-QET3Q4JP.js} +65 -9
- package/dist/{chunk-XGGTQQFH.js → chunk-QKKBBH7I.js} +2 -2
- package/dist/{chunk-6R4KNAPK.js → chunk-S2XD75JM.js} +10 -3
- package/dist/{chunk-MCRBVJGZ.cjs → chunk-SPGSO5SO.cjs} +29 -22
- package/dist/{chunk-FAXIIH5R.cjs → chunk-SYHNZSZZ.cjs} +3 -3
- package/dist/{chunk-IXLO7GO5.js → chunk-TN65XNTI.js} +47 -83
- package/dist/chunk-U57COLUE.js +56 -0
- package/dist/{chunk-DUZIIRPF.js → chunk-UE5XK2SY.js} +27 -9
- package/dist/{chunk-TEBM66WA.cjs → chunk-UJS4N2XM.cjs} +12 -12
- package/dist/{chunk-OXTLPTO3.js → chunk-V5D7BHW3.js} +4 -5
- package/dist/{chunk-NTZY6IB7.js → chunk-VHSNYUYV.js} +5 -4
- package/dist/{chunk-JK4XMMKM.cjs → chunk-VR3FREBX.cjs} +3 -3
- package/dist/{chunk-T46YXSBP.cjs → chunk-WO72UBQD.cjs} +11 -11
- package/dist/chunk-WOEETTH7.cjs +59 -0
- package/dist/{chunk-IJFQ5L4I.js → chunk-WTK6JDSI.js} +4 -5
- package/dist/{chunk-PUPKNW3R.cjs → chunk-WUXUWTFW.cjs} +3 -3
- package/dist/{chunk-PFXURMBZ.cjs → chunk-YFIWCYHC.cjs} +112 -54
- package/dist/{chunk-ZWXJTBZO.js → chunk-YPYCWLYP.js} +1 -1
- package/dist/core/addresses.d.ts +1 -1
- package/dist/core/errors.d.ts +1 -1
- package/dist/fhe/index.cjs +84 -64
- package/dist/fhe/index.d.cts +1 -0
- package/dist/fhe/index.d.ts +1 -0
- package/dist/fhe/index.js +21 -9
- package/dist/fhe/mock-erc7984.d.ts +4 -4
- package/dist/fhe/operators.d.ts +142 -2
- package/dist/fhe/react/index.cjs +21 -8
- package/dist/fhe/react/index.d.cts +2 -0
- package/dist/fhe/react/index.d.ts +2 -0
- package/dist/fhe/react/index.js +8 -3
- package/dist/fhe/react/useEnsureOperator.d.ts +56 -0
- package/dist/fhe/react/useIsOperator.d.ts +54 -0
- package/dist/fhe/sepolia-encryptor-web.d.ts +18 -3
- package/dist/fhe-airdrop/advanced/index.cjs +8 -9
- package/dist/fhe-airdrop/advanced/index.js +6 -7
- package/dist/fhe-airdrop/advanced/react/index.cjs +13 -14
- package/dist/fhe-airdrop/advanced/react/index.js +9 -10
- package/dist/fhe-airdrop/airdrop.d.ts +7 -0
- package/dist/fhe-airdrop/index.cjs +66 -67
- package/dist/fhe-airdrop/index.js +7 -8
- package/dist/fhe-airdrop/react/index.cjs +148 -137
- package/dist/fhe-airdrop/react/index.d.cts +3 -1
- package/dist/fhe-airdrop/react/index.d.ts +3 -1
- package/dist/fhe-airdrop/react/index.js +16 -14
- package/dist/fhe-airdrop/react/useAccessClaimAmount.d.ts +17 -11
- package/dist/fhe-airdrop/react/useClaim.d.ts +8 -0
- package/dist/fhe-airdrop/react/useSignClaimAuthorization.d.ts +1 -1
- package/dist/fhe-airdrop/types.d.ts +14 -3
- package/dist/fhe-disperse/errors.d.ts +55 -0
- package/dist/fhe-disperse/index.cjs +74 -67
- 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 -9
- package/dist/fhe-disperse/react/index.cjs +105 -88
- package/dist/fhe-disperse/react/index.d.cts +3 -1
- package/dist/fhe-disperse/react/index.d.ts +3 -1
- package/dist/fhe-disperse/react/index.js +12 -11
- package/dist/fhe-vesting/advanced/index.cjs +8 -9
- package/dist/fhe-vesting/advanced/index.js +6 -7
- package/dist/fhe-vesting/advanced/react/index.cjs +14 -15
- package/dist/fhe-vesting/advanced/react/index.js +11 -12
- package/dist/fhe-vesting/index.cjs +75 -76
- package/dist/fhe-vesting/index.js +9 -10
- package/dist/fhe-vesting/manager.d.ts +19 -0
- package/dist/fhe-vesting/react/index.cjs +245 -227
- package/dist/fhe-vesting/react/index.d.cts +6 -4
- package/dist/fhe-vesting/react/index.d.ts +6 -4
- package/dist/fhe-vesting/react/index.js +27 -21
- package/dist/fhe-vesting/react/useAccessClaimableAmount.d.ts +11 -3
- package/dist/fhe-vesting/react/useAccessSettledAmount.d.ts +11 -3
- package/dist/fhe-vesting/react/useAccessTotalAllocation.d.ts +11 -3
- package/dist/fhe-vesting/react/useAccessVestedAmount.d.ts +11 -3
- package/dist/fhe-vesting/react/useAdminGetClaimableAmount.d.ts +1 -1
- package/dist/fhe-vesting/react/useAdminGetSettledAmount.d.ts +1 -1
- package/dist/fhe-vesting/react/useAdminGetTotalAllocation.d.ts +1 -1
- package/dist/fhe-vesting/react/useAdminGetVestedAmount.d.ts +1 -1
- package/dist/fhe-vesting/react/useAdminPartialClaim.d.ts +8 -0
- package/dist/fhe-vesting/react/useClaim.d.ts +1 -1
- package/dist/fhe-vesting/react/useDiscloseHandleToParty.d.ts +1 -1
- package/dist/fhe-vesting/react/useManagerDiscloseHandleToParty.d.ts +1 -1
- package/dist/fhe-vesting/react/usePartialClaim.d.ts +1 -1
- package/dist/fhe-vesting/react/useVestingInfo.d.ts +1 -1
- package/dist/fhe-vesting/types.d.ts +12 -1
- package/dist/index.cjs +87 -88
- package/dist/index.js +2 -3
- package/dist/testnet-faucet/index.cjs +55 -56
- package/dist/testnet-faucet/index.js +5 -6
- package/dist/testnet-faucet/react/index.cjs +53 -54
- package/dist/testnet-faucet/react/index.js +7 -8
- package/package.json +13 -8
- package/dist/chunk-66IHPTOK.cjs +0 -20
- package/dist/chunk-KWFFIJYX.js +0 -11
- package/dist/fhe-airdrop/react/useAirdropClaim.d.ts +0 -27
- package/dist/fhe-airdrop/react/useGetClaimAmount.d.ts +0 -30
- package/dist/fhe-vesting/react/useGetClaimableAmount.d.ts +0 -13
- package/dist/fhe-vesting/react/useGetSettledAmount.d.ts +0 -14
- package/dist/fhe-vesting/react/useGetTotalAllocation.d.ts +0 -13
- package/dist/fhe-vesting/react/useGetVestedAmount.d.ts +0 -25
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk2RNW4MIJ_cjs = require('./chunk-2RNW4MIJ.cjs');
|
|
4
4
|
|
|
5
5
|
// src/core/zama-error-mapper.ts
|
|
6
6
|
function mapZamaError(error, args) {
|
|
7
|
-
if (error instanceof
|
|
7
|
+
if (error instanceof chunk2RNW4MIJ_cjs.TokenOpsSdkError) return error;
|
|
8
8
|
const zama = readZamaError(error);
|
|
9
9
|
if (zama?.code) {
|
|
10
10
|
switch (zama.code) {
|
|
11
11
|
case "SIGNING_REJECTED":
|
|
12
|
-
return new
|
|
12
|
+
return new chunk2RNW4MIJ_cjs.UserRejectedSignatureError({ ...args, cause: error });
|
|
13
13
|
case "SIGNING_FAILED":
|
|
14
|
-
return new
|
|
14
|
+
return new chunk2RNW4MIJ_cjs.SigningFailedError({ ...args, cause: error });
|
|
15
15
|
case "RELAYER_REQUEST_FAILED":
|
|
16
|
-
return new
|
|
16
|
+
return new chunk2RNW4MIJ_cjs.RelayerUnreachableError({
|
|
17
17
|
...args,
|
|
18
18
|
statusCode: zama.statusCode,
|
|
19
19
|
cause: error
|
|
20
20
|
});
|
|
21
21
|
case "ENCRYPTION_FAILED":
|
|
22
|
-
return new
|
|
22
|
+
return new chunk2RNW4MIJ_cjs.EncryptionFailedError({ ...args, cause: error });
|
|
23
23
|
case "DECRYPTION_FAILED":
|
|
24
|
-
return new
|
|
24
|
+
return new chunk2RNW4MIJ_cjs.DecryptionFailedError({ ...args, cause: error });
|
|
25
25
|
case "CONFIGURATION":
|
|
26
|
-
return new
|
|
26
|
+
return new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
27
27
|
method: args.method,
|
|
28
28
|
argument: "config",
|
|
29
29
|
reason: "Zama SDK configuration is invalid (chain id, type, or signer state).",
|
|
@@ -34,13 +34,13 @@ function mapZamaError(error, args) {
|
|
|
34
34
|
const message = readMessage(error);
|
|
35
35
|
if (message) {
|
|
36
36
|
if (USER_REJECTION_PATTERNS.some((pat) => pat.test(message))) {
|
|
37
|
-
return new
|
|
37
|
+
return new chunk2RNW4MIJ_cjs.UserRejectedSignatureError({ ...args, cause: error });
|
|
38
38
|
}
|
|
39
39
|
if (USER_DECRYPT_NOT_ALLOWED_PATTERNS.some((pat) => pat.test(message))) {
|
|
40
|
-
return new
|
|
40
|
+
return new chunk2RNW4MIJ_cjs.UserDecryptNotAllowedError({ method: args.method, cause: error });
|
|
41
41
|
}
|
|
42
42
|
if (INVALID_INPUT_PATTERNS.some((pat) => pat.test(message))) {
|
|
43
|
-
return new
|
|
43
|
+
return new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
44
44
|
method: args.method,
|
|
45
45
|
argument: "input",
|
|
46
46
|
reason: "encrypted input value rejected by FHE SDK \u2014 see `error.cause` for details",
|
|
@@ -48,7 +48,7 @@ function mapZamaError(error, args) {
|
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
return args.operation === "encrypt" ? new
|
|
51
|
+
return args.operation === "encrypt" ? new chunk2RNW4MIJ_cjs.EncryptionFailedError({ ...args, cause: error }) : new chunk2RNW4MIJ_cjs.DecryptionFailedError({ ...args, cause: error });
|
|
52
52
|
}
|
|
53
53
|
function readZamaError(err) {
|
|
54
54
|
if (typeof err !== "object" || err === null) return void 0;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { SDK_VERSION, mapContractRevert, isContractRevert } from './chunk-
|
|
2
|
-
import { getFheVestingFactoryAddress } from './chunk-
|
|
3
|
-
import { normaliseAddress } from './chunk-
|
|
1
|
+
import { SDK_VERSION, mapContractRevert, isContractRevert } from './chunk-6WSNS3UV.js';
|
|
2
|
+
import { getFheVestingFactoryAddress } from './chunk-QKKBBH7I.js';
|
|
3
|
+
import { normaliseAddress } from './chunk-46T67CE2.js';
|
|
4
|
+
import { DeploymentAddressUnavailableError, TokenOpsSdkError, asTxHash, MissingWalletClientError, MissingAccountError } from './chunk-DRSPMIZ7.js';
|
|
4
5
|
import { withTelemetry } from './chunk-Q2GP5UDC.js';
|
|
5
|
-
import { asTxHash } from './chunk-KWFFIJYX.js';
|
|
6
|
-
import { DeploymentAddressUnavailableError, TokenOpsSdkError, MissingWalletClientError, MissingAccountError } from './chunk-QBJ7O2B4.js';
|
|
7
6
|
import { parseEventLogs } from 'viem';
|
|
8
7
|
|
|
9
8
|
// src/fhe-vesting/abis/factory.ts
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { createConfidentialVestingManagerClient
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { createConfidentialVestingManagerClient } from './chunk-TN65XNTI.js';
|
|
2
|
+
import { resolveEncryptor } from './chunk-PD7ME2BT.js';
|
|
3
|
+
import { createConfidentialVestingFactoryClient } from './chunk-V5D7BHW3.js';
|
|
4
|
+
import { getFheVestingFactoryAddress } from './chunk-QKKBBH7I.js';
|
|
5
|
+
import { DeploymentAddressUnavailableError } from './chunk-DRSPMIZ7.js';
|
|
5
6
|
import { useMemo, useRef, useEffect } from 'react';
|
|
6
7
|
import { usePublicClient, useWalletClient } from 'wagmi';
|
|
7
8
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk2RNW4MIJ_cjs = require('./chunk-2RNW4MIJ.cjs');
|
|
4
4
|
var viem = require('viem');
|
|
5
5
|
|
|
6
6
|
function normaliseAddress(input) {
|
|
7
7
|
if (typeof input !== "string") {
|
|
8
|
-
throw new
|
|
8
|
+
throw new chunk2RNW4MIJ_cjs.TokenOpsValidationError("normaliseAddress: input is not a string", {
|
|
9
9
|
method: "normaliseAddress",
|
|
10
10
|
args: { input: typeof input }
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
if (!viem.isAddress(input, { strict: false })) {
|
|
14
|
-
throw new
|
|
14
|
+
throw new chunk2RNW4MIJ_cjs.TokenOpsValidationError(
|
|
15
15
|
`normaliseAddress: '${input}' is not a valid 0x-prefixed 20-byte hex address`,
|
|
16
16
|
{
|
|
17
17
|
method: "normaliseAddress",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunkSPGSO5SO_cjs = require('./chunk-SPGSO5SO.cjs');
|
|
4
|
+
var chunkLBWRFZR3_cjs = require('./chunk-LBWRFZR3.cjs');
|
|
5
|
+
var chunkWUXUWTFW_cjs = require('./chunk-WUXUWTFW.cjs');
|
|
6
|
+
var chunk2RNW4MIJ_cjs = require('./chunk-2RNW4MIJ.cjs');
|
|
7
7
|
var react = require('react');
|
|
8
8
|
var wagmi = require('wagmi');
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ var FHE_AIRDROP_NAMESPACE = "fhe-airdrop";
|
|
|
12
12
|
function tryResolveFactoryAddress(override, chainId) {
|
|
13
13
|
if (override) return override;
|
|
14
14
|
if (chainId === void 0) return void 0;
|
|
15
|
-
return
|
|
15
|
+
return chunkWUXUWTFW_cjs.getFheAirdropFactoryAddress(chainId);
|
|
16
16
|
}
|
|
17
17
|
function useMemoFactoryClient(opts = {}) {
|
|
18
18
|
const publicClient = wagmi.usePublicClient({ chainId: opts.chainId });
|
|
@@ -25,14 +25,14 @@ function useMemoFactoryClient(opts = {}) {
|
|
|
25
25
|
const client = react.useMemo(() => {
|
|
26
26
|
if (!publicClient) return void 0;
|
|
27
27
|
if (!resolvedAddress) return void 0;
|
|
28
|
-
return
|
|
28
|
+
return chunkLBWRFZR3_cjs.createConfidentialAirdropFactoryClient({
|
|
29
29
|
publicClient,
|
|
30
30
|
...walletClient ? { walletClient } : {},
|
|
31
31
|
address: resolvedAddress,
|
|
32
32
|
...chainId !== void 0 ? { chainId } : {},
|
|
33
33
|
// Lazy — invoked per-encryption inside the headless client. Picks up
|
|
34
34
|
// whichever EncryptorSource the consumer last passed in.
|
|
35
|
-
encryptor: () =>
|
|
35
|
+
encryptor: () => chunkLBWRFZR3_cjs.resolveEncryptor(encryptorSourceRef.current)
|
|
36
36
|
});
|
|
37
37
|
}, [publicClient, walletClient, resolvedAddress, chainId]);
|
|
38
38
|
return {
|
|
@@ -47,16 +47,16 @@ function useMemoFactoryClient(opts = {}) {
|
|
|
47
47
|
function computeFactoryResolutionError(override, chainId) {
|
|
48
48
|
if (override) return void 0;
|
|
49
49
|
if (chainId === void 0) {
|
|
50
|
-
return new
|
|
50
|
+
return new chunk2RNW4MIJ_cjs.DeploymentAddressUnavailableError({
|
|
51
51
|
reason: "chain-id-missing",
|
|
52
52
|
product: "fheAirdrop",
|
|
53
53
|
contract: "confidentialAirdropFactory",
|
|
54
54
|
clientLabel: "ConfidentialAirdropFactoryClient"
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
-
const resolved =
|
|
57
|
+
const resolved = chunkWUXUWTFW_cjs.getFheAirdropFactoryAddress(chainId);
|
|
58
58
|
if (!resolved) {
|
|
59
|
-
return new
|
|
59
|
+
return new chunk2RNW4MIJ_cjs.DeploymentAddressUnavailableError({
|
|
60
60
|
reason: "registry-not-deployed",
|
|
61
61
|
product: "fheAirdrop",
|
|
62
62
|
contract: "confidentialAirdropFactory",
|
|
@@ -73,7 +73,7 @@ function useMemoAirdropClient(opts) {
|
|
|
73
73
|
const client = react.useMemo(() => {
|
|
74
74
|
if (!publicClient) return void 0;
|
|
75
75
|
if (!opts.address) return void 0;
|
|
76
|
-
return
|
|
76
|
+
return chunkSPGSO5SO_cjs.createConfidentialAirdropClient({
|
|
77
77
|
publicClient,
|
|
78
78
|
...walletClient ? { walletClient } : {},
|
|
79
79
|
address: opts.address,
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkZQUE2B3Q_cjs = require('./chunk-ZQUE2B3Q.cjs');
|
|
4
|
+
var chunk4ZCXK4VI_cjs = require('./chunk-4ZCXK4VI.cjs');
|
|
5
|
+
var chunk2RNW4MIJ_cjs = require('./chunk-2RNW4MIJ.cjs');
|
|
6
|
+
var reactQuery = require('@tanstack/react-query');
|
|
7
|
+
var wagmi = require('wagmi');
|
|
8
|
+
|
|
9
|
+
function useIsOperator(options = {}) {
|
|
10
|
+
const publicClient = wagmi.usePublicClient({ chainId: options.chainId });
|
|
11
|
+
const { address: connected } = chunkZQUE2B3Q_cjs.useWagmiAccount();
|
|
12
|
+
const chainId = options.chainId ?? publicClient?.chain?.id;
|
|
13
|
+
const holder = options.holder ?? connected;
|
|
14
|
+
const { token, spender, telemetry } = options;
|
|
15
|
+
return reactQuery.useQuery({
|
|
16
|
+
queryKey: [
|
|
17
|
+
"tokenops-sdk",
|
|
18
|
+
"fhe",
|
|
19
|
+
"isOperator",
|
|
20
|
+
chainId ?? null,
|
|
21
|
+
token ? token.toLowerCase() : null,
|
|
22
|
+
holder ? holder.toLowerCase() : null,
|
|
23
|
+
spender ? spender.toLowerCase() : null
|
|
24
|
+
],
|
|
25
|
+
queryFn: () => chunk4ZCXK4VI_cjs.isOperator({
|
|
26
|
+
publicClient,
|
|
27
|
+
token,
|
|
28
|
+
holder,
|
|
29
|
+
spender,
|
|
30
|
+
...telemetry ? { telemetry } : {}
|
|
31
|
+
}),
|
|
32
|
+
enabled: !!publicClient && !!token && !!holder && !!spender && options.enabled !== false,
|
|
33
|
+
staleTime: 0
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function useEnsureOperator(options = {}) {
|
|
37
|
+
const publicClient = wagmi.usePublicClient({ chainId: options.chainId });
|
|
38
|
+
const { data: walletClient } = wagmi.useWalletClient({ chainId: options.chainId });
|
|
39
|
+
const telemetry = options.telemetry;
|
|
40
|
+
return reactQuery.useMutation({
|
|
41
|
+
mutationFn: async (vars) => {
|
|
42
|
+
if (!publicClient) throw new chunk2RNW4MIJ_cjs.MissingPublicClientError("useEnsureOperator");
|
|
43
|
+
if (!walletClient) throw new chunk2RNW4MIJ_cjs.MissingWalletClientError("useEnsureOperator");
|
|
44
|
+
return chunk4ZCXK4VI_cjs.ensureOperator({
|
|
45
|
+
publicClient,
|
|
46
|
+
walletClient,
|
|
47
|
+
token: vars.token,
|
|
48
|
+
spender: vars.spender,
|
|
49
|
+
deadline: vars.deadline,
|
|
50
|
+
...vars.account !== void 0 ? { account: vars.account } : {},
|
|
51
|
+
...vars.waitForReceipt !== void 0 ? { waitForReceipt: vars.waitForReceipt } : {},
|
|
52
|
+
...telemetry ? { telemetry } : {}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
exports.useEnsureOperator = useEnsureOperator;
|
|
59
|
+
exports.useIsOperator = useIsOperator;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { SDK_VERSION, isContractRevert, mapContractRevert } from './chunk-
|
|
2
|
-
import { getConfidentialTestTokenAddress, getTestTokenAddress } from './chunk-
|
|
3
|
-
import { normaliseAddress } from './chunk-
|
|
1
|
+
import { SDK_VERSION, isContractRevert, mapContractRevert } from './chunk-6WSNS3UV.js';
|
|
2
|
+
import { getConfidentialTestTokenAddress, getTestTokenAddress } from './chunk-QKKBBH7I.js';
|
|
3
|
+
import { normaliseAddress } from './chunk-46T67CE2.js';
|
|
4
|
+
import { TokenOpsSdkError, UnsupportedChainError, DeploymentAddressUnavailableError, asEncryptedHandle, TokenOpsContractError, ReceiptEventNotFoundError, ReceiptEventAmbiguousError, asTxHash, MissingWalletClientError, MissingAccountError, InvalidArgumentError } from './chunk-DRSPMIZ7.js';
|
|
4
5
|
import { withTelemetry } from './chunk-Q2GP5UDC.js';
|
|
5
|
-
import { asEncryptedHandle, asTxHash } from './chunk-KWFFIJYX.js';
|
|
6
|
-
import { TokenOpsSdkError, UnsupportedChainError, DeploymentAddressUnavailableError, TokenOpsContractError, ReceiptEventNotFoundError, ReceiptEventAmbiguousError, MissingWalletClientError, MissingAccountError, InvalidArgumentError } from './chunk-QBJ7O2B4.js';
|
|
7
6
|
import { sepolia } from 'viem/chains';
|
|
8
7
|
import { parseEventLogs } from 'viem';
|
|
9
8
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk2RNW4MIJ_cjs = require('./chunk-2RNW4MIJ.cjs');
|
|
4
4
|
var chains = require('viem/chains');
|
|
5
5
|
|
|
6
6
|
var DEPLOYED_ADDRESSES = {
|
|
7
7
|
fheVesting: {
|
|
8
8
|
confidentialVestingFactory: {
|
|
9
|
-
[chains.sepolia.id]: "
|
|
9
|
+
[chains.sepolia.id]: "0x059d6Bb8ff9a13E794fe416d4757d7310CdC69ab"
|
|
10
10
|
// mainnet omitted — not deployed.
|
|
11
11
|
}
|
|
12
12
|
},
|
|
@@ -50,7 +50,7 @@ function requireDeployedAddress(product, contract, chainId) {
|
|
|
50
50
|
const contractEntry = productEntry[contract];
|
|
51
51
|
const entry = contractEntry?.[chainId];
|
|
52
52
|
if (entry) return entry;
|
|
53
|
-
throw new
|
|
53
|
+
throw new chunk2RNW4MIJ_cjs.DeploymentAddressUnavailableError({
|
|
54
54
|
reason: entry === null ? "registry-not-deployed" : "registry-unknown-chain",
|
|
55
55
|
product: String(product),
|
|
56
56
|
contract: String(contract),
|