@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,14 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkUJS4N2XM_cjs = require('./chunk-UJS4N2XM.cjs');
|
|
4
|
+
var chunkBD4LZBVF_cjs = require('./chunk-BD4LZBVF.cjs');
|
|
5
|
+
var chunkSYHNZSZZ_cjs = require('./chunk-SYHNZSZZ.cjs');
|
|
6
6
|
var chunkFWHYQZ5E_cjs = require('./chunk-FWHYQZ5E.cjs');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var chunk43RFBQ73_cjs = require('./chunk-43RFBQ73.cjs');
|
|
8
|
+
var chunkVR3FREBX_cjs = require('./chunk-VR3FREBX.cjs');
|
|
9
|
+
var chunk2RNW4MIJ_cjs = require('./chunk-2RNW4MIJ.cjs');
|
|
9
10
|
var chunkVJKZWYYJ_cjs = require('./chunk-VJKZWYYJ.cjs');
|
|
10
|
-
var chunk66IHPTOK_cjs = require('./chunk-66IHPTOK.cjs');
|
|
11
|
-
var chunk67OV5CX2_cjs = require('./chunk-67OV5CX2.cjs');
|
|
12
11
|
var viem = require('viem');
|
|
13
12
|
|
|
14
13
|
// src/fhe-vesting/abis/manager.ts
|
|
@@ -989,81 +988,9 @@ var confidentialVestingManagerAbi = [
|
|
|
989
988
|
type: "function"
|
|
990
989
|
}
|
|
991
990
|
];
|
|
992
|
-
function resolveEncryptor(source) {
|
|
993
|
-
if (source === void 0) return void 0;
|
|
994
|
-
return typeof source === "function" ? source() : source;
|
|
995
|
-
}
|
|
996
|
-
var MAX_UINT64 = (1n << 64n) - 1n;
|
|
997
|
-
function assertUint64(value, label) {
|
|
998
|
-
if (value < 0n || value > MAX_UINT64) {
|
|
999
|
-
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
1000
|
-
method: "encryptUint64",
|
|
1001
|
-
argument: label,
|
|
1002
|
-
reason: `does not fit in uint64 (0..2^64-1)`,
|
|
1003
|
-
value
|
|
1004
|
-
});
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
async function encryptUint64({
|
|
1008
|
-
encryptor,
|
|
1009
|
-
contractAddress,
|
|
1010
|
-
userAddress,
|
|
1011
|
-
value
|
|
1012
|
-
}) {
|
|
1013
|
-
assertUint64(value, "value");
|
|
1014
|
-
const { handles, inputProof } = await encryptor.encrypt({
|
|
1015
|
-
values: [{ value, type: "euint64" }],
|
|
1016
|
-
contractAddress,
|
|
1017
|
-
userAddress
|
|
1018
|
-
});
|
|
1019
|
-
if (handles.length !== 1) {
|
|
1020
|
-
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
1021
|
-
method: "encryptUint64",
|
|
1022
|
-
argument: "handles",
|
|
1023
|
-
reason: `expected 1 handle, got ${handles.length}`,
|
|
1024
|
-
value: handles.length
|
|
1025
|
-
});
|
|
1026
|
-
}
|
|
1027
|
-
return {
|
|
1028
|
-
handle: chunk66IHPTOK_cjs.asEncryptedHandle(viem.bytesToHex(handles[0])),
|
|
1029
|
-
inputProof: chunk66IHPTOK_cjs.asExternalInputProof(viem.bytesToHex(inputProof))
|
|
1030
|
-
};
|
|
1031
|
-
}
|
|
1032
|
-
async function encryptUint64Batch({
|
|
1033
|
-
encryptor,
|
|
1034
|
-
contractAddress,
|
|
1035
|
-
userAddress,
|
|
1036
|
-
values
|
|
1037
|
-
}) {
|
|
1038
|
-
if (values.length === 0) {
|
|
1039
|
-
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
1040
|
-
method: "encryptUint64Batch",
|
|
1041
|
-
argument: "values",
|
|
1042
|
-
reason: "must be non-empty"
|
|
1043
|
-
});
|
|
1044
|
-
}
|
|
1045
|
-
values.forEach((v, i) => assertUint64(v, `values[${i}]`));
|
|
1046
|
-
const { handles, inputProof } = await encryptor.encrypt({
|
|
1047
|
-
values: values.map((value) => ({ value, type: "euint64" })),
|
|
1048
|
-
contractAddress,
|
|
1049
|
-
userAddress
|
|
1050
|
-
});
|
|
1051
|
-
if (handles.length !== values.length) {
|
|
1052
|
-
throw new chunk67OV5CX2_cjs.InvalidArgumentError({
|
|
1053
|
-
method: "encryptUint64Batch",
|
|
1054
|
-
argument: "handles",
|
|
1055
|
-
reason: `expected ${values.length} handles, got ${handles.length}`,
|
|
1056
|
-
value: handles.length
|
|
1057
|
-
});
|
|
1058
|
-
}
|
|
1059
|
-
return {
|
|
1060
|
-
handles: handles.map((h) => chunk66IHPTOK_cjs.asEncryptedHandle(viem.bytesToHex(h))),
|
|
1061
|
-
inputProof: chunk66IHPTOK_cjs.asExternalInputProof(viem.bytesToHex(inputProof))
|
|
1062
|
-
};
|
|
1063
|
-
}
|
|
1064
991
|
|
|
1065
992
|
// src/fhe-vesting/errors.ts
|
|
1066
|
-
var VestingNotFoundError = class extends
|
|
993
|
+
var VestingNotFoundError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
|
|
1067
994
|
name = "VestingNotFoundError";
|
|
1068
995
|
constructor(args) {
|
|
1069
996
|
super(`${args.method}: no vesting schedule found for ${args.vestingId}.`, {
|
|
@@ -1077,7 +1004,7 @@ var VestingNotFoundError = class extends chunk67OV5CX2_cjs.TokenOpsSdkError {
|
|
|
1077
1004
|
});
|
|
1078
1005
|
}
|
|
1079
1006
|
};
|
|
1080
|
-
var NotVestingRecipientError = class extends
|
|
1007
|
+
var NotVestingRecipientError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
|
|
1081
1008
|
name = "NotVestingRecipientError";
|
|
1082
1009
|
constructor(args) {
|
|
1083
1010
|
super(`${args.method}: caller is not the recipient of vesting ${args.vestingId}.`, {
|
|
@@ -1093,7 +1020,7 @@ var NotVestingRecipientError = class extends chunk67OV5CX2_cjs.TokenOpsSdkError
|
|
|
1093
1020
|
});
|
|
1094
1021
|
}
|
|
1095
1022
|
};
|
|
1096
|
-
var ClaimLockedError = class extends
|
|
1023
|
+
var ClaimLockedError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
|
|
1097
1024
|
name = "ClaimLockedError";
|
|
1098
1025
|
constructor(args) {
|
|
1099
1026
|
const detail = args.unlocksAt !== void 0 ? ` Unlocks at unix timestamp ${args.unlocksAt}.` : "";
|
|
@@ -1109,7 +1036,7 @@ var ClaimLockedError = class extends chunk67OV5CX2_cjs.TokenOpsSdkError {
|
|
|
1109
1036
|
});
|
|
1110
1037
|
}
|
|
1111
1038
|
};
|
|
1112
|
-
var VestingRevokedError = class extends
|
|
1039
|
+
var VestingRevokedError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
|
|
1113
1040
|
name = "VestingRevokedError";
|
|
1114
1041
|
constructor(args) {
|
|
1115
1042
|
const detail = args.revokedAt !== void 0 ? ` at unix timestamp ${args.revokedAt}` : "";
|
|
@@ -1125,7 +1052,7 @@ var VestingRevokedError = class extends chunk67OV5CX2_cjs.TokenOpsSdkError {
|
|
|
1125
1052
|
});
|
|
1126
1053
|
}
|
|
1127
1054
|
};
|
|
1128
|
-
var VestingNotRevocableError = class extends
|
|
1055
|
+
var VestingNotRevocableError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
|
|
1129
1056
|
name = "VestingNotRevocableError";
|
|
1130
1057
|
constructor(args) {
|
|
1131
1058
|
super(`${args.method}: vesting ${args.vestingId} was created as non-revocable.`, {
|
|
@@ -1139,7 +1066,7 @@ var VestingNotRevocableError = class extends chunk67OV5CX2_cjs.TokenOpsSdkError
|
|
|
1139
1066
|
});
|
|
1140
1067
|
}
|
|
1141
1068
|
};
|
|
1142
|
-
var VestingExpiredError = class extends
|
|
1069
|
+
var VestingExpiredError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
|
|
1143
1070
|
name = "VestingExpiredError";
|
|
1144
1071
|
constructor(args) {
|
|
1145
1072
|
super(`${args.method}: vesting ${args.vestingId} has already ended.`, {
|
|
@@ -1154,7 +1081,7 @@ var VestingExpiredError = class extends chunk67OV5CX2_cjs.TokenOpsSdkError {
|
|
|
1154
1081
|
});
|
|
1155
1082
|
}
|
|
1156
1083
|
};
|
|
1157
|
-
var TransferAlreadyPendingError = class extends
|
|
1084
|
+
var TransferAlreadyPendingError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
|
|
1158
1085
|
name = "TransferAlreadyPendingError";
|
|
1159
1086
|
constructor(args) {
|
|
1160
1087
|
super(`${args.method}: a transfer is already pending for vesting ${args.vestingId}.`, {
|
|
@@ -1170,7 +1097,7 @@ var TransferAlreadyPendingError = class extends chunk67OV5CX2_cjs.TokenOpsSdkErr
|
|
|
1170
1097
|
});
|
|
1171
1098
|
}
|
|
1172
1099
|
};
|
|
1173
|
-
var NoPendingTransferError = class extends
|
|
1100
|
+
var NoPendingTransferError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
|
|
1174
1101
|
name = "NoPendingTransferError";
|
|
1175
1102
|
constructor(args) {
|
|
1176
1103
|
super(`${args.method}: no pending transfer for vesting ${args.vestingId}.`, {
|
|
@@ -1184,7 +1111,7 @@ var NoPendingTransferError = class extends chunk67OV5CX2_cjs.TokenOpsSdkError {
|
|
|
1184
1111
|
});
|
|
1185
1112
|
}
|
|
1186
1113
|
};
|
|
1187
|
-
var NotPendingRecipientError = class extends
|
|
1114
|
+
var NotPendingRecipientError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
|
|
1188
1115
|
name = "NotPendingRecipientError";
|
|
1189
1116
|
constructor(args) {
|
|
1190
1117
|
super(`${args.method}: caller is not the pending recipient of vesting ${args.vestingId}.`, {
|
|
@@ -1200,7 +1127,7 @@ var NotPendingRecipientError = class extends chunk67OV5CX2_cjs.TokenOpsSdkError
|
|
|
1200
1127
|
});
|
|
1201
1128
|
}
|
|
1202
1129
|
};
|
|
1203
|
-
var TransferExpiredError = class extends
|
|
1130
|
+
var TransferExpiredError = class extends chunk2RNW4MIJ_cjs.TokenOpsSdkError {
|
|
1204
1131
|
name = "TransferExpiredError";
|
|
1205
1132
|
constructor(args) {
|
|
1206
1133
|
super(`${args.method}: pending transfer for vesting ${args.vestingId} has expired.`, {
|
|
@@ -1253,7 +1180,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
1253
1180
|
constructor(config) {
|
|
1254
1181
|
this.publicClient = config.publicClient;
|
|
1255
1182
|
this.walletClient = config.walletClient;
|
|
1256
|
-
this.address =
|
|
1183
|
+
this.address = chunkVR3FREBX_cjs.normaliseAddress(config.address);
|
|
1257
1184
|
this.encryptor = config.encryptor;
|
|
1258
1185
|
this.#telemetry = config.telemetry;
|
|
1259
1186
|
this.#aclAddressOverride = config.aclAddress;
|
|
@@ -1262,8 +1189,8 @@ var ConfidentialVestingManagerClient = class {
|
|
|
1262
1189
|
surface: "manager",
|
|
1263
1190
|
chainId: chainIdForInit ?? null,
|
|
1264
1191
|
hasWallet: !!this.walletClient,
|
|
1265
|
-
aclResolved: !!config.aclAddress || chainIdForInit !== void 0 && !!
|
|
1266
|
-
sdkVersion:
|
|
1192
|
+
aclResolved: !!config.aclAddress || chainIdForInit !== void 0 && !!chunkSYHNZSZZ_cjs.getFhevmAclAddress(chainIdForInit),
|
|
1193
|
+
sdkVersion: chunk43RFBQ73_cjs.SDK_VERSION
|
|
1267
1194
|
});
|
|
1268
1195
|
}
|
|
1269
1196
|
/**
|
|
@@ -1274,7 +1201,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
1274
1201
|
*/
|
|
1275
1202
|
get aclAddress() {
|
|
1276
1203
|
if (this.#cachedAclAddress) return this.#cachedAclAddress;
|
|
1277
|
-
this.#cachedAclAddress = this.#aclAddressOverride ??
|
|
1204
|
+
this.#cachedAclAddress = this.#aclAddressOverride ?? chunkSYHNZSZZ_cjs.requireFhevmAclAddress(this.publicClient.chain?.id, "ConfidentialVestingManagerClient");
|
|
1278
1205
|
return this.#cachedAclAddress;
|
|
1279
1206
|
}
|
|
1280
1207
|
// ============================================================
|
|
@@ -1517,11 +1444,11 @@ var ConfidentialVestingManagerClient = class {
|
|
|
1517
1444
|
);
|
|
1518
1445
|
}
|
|
1519
1446
|
if (paused) {
|
|
1520
|
-
blockers.push(new
|
|
1447
|
+
blockers.push(new chunk2RNW4MIJ_cjs.PausedError({ method: "claim", contractAddress: this.address }));
|
|
1521
1448
|
}
|
|
1522
1449
|
if (feeInfo.feeType === 0 /* Gas */ && callerBalance < feeInfo.fee) {
|
|
1523
1450
|
blockers.push(
|
|
1524
|
-
new
|
|
1451
|
+
new chunk2RNW4MIJ_cjs.InsufficientFeeError({
|
|
1525
1452
|
method: "claim",
|
|
1526
1453
|
contractAddress: this.address,
|
|
1527
1454
|
feeKind: "gas",
|
|
@@ -1556,6 +1483,11 @@ var ConfidentialVestingManagerClient = class {
|
|
|
1556
1483
|
* - Operator: creator has approved this manager as an ERC-7984 operator on
|
|
1557
1484
|
* the distribution token, required for the manager's
|
|
1558
1485
|
* `confidentialTransferFrom` pull ({@link OperatorNotApprovedError} blocker).
|
|
1486
|
+
* If the bound `token` does not implement the ERC-7984 `isOperator`
|
|
1487
|
+
* view — a revert, or a zero-data response for an EOA / undeployed
|
|
1488
|
+
* address — operator status is undetermined rather than the call
|
|
1489
|
+
* throwing: `isOperatorSet` reports `false` and the read failure becomes
|
|
1490
|
+
* an {@link InvalidArgumentError} blocker on `token` instead (TOK-436).
|
|
1559
1491
|
*
|
|
1560
1492
|
* **Not preflight-detectable — read before trusting `ready: true`:**
|
|
1561
1493
|
* - The creator's confidential token balance is an encrypted `euint64` the
|
|
@@ -1587,18 +1519,22 @@ var ConfidentialVestingManagerClient = class {
|
|
|
1587
1519
|
this.token(),
|
|
1588
1520
|
this.#read("VESTING_CREATOR_ROLE")
|
|
1589
1521
|
]);
|
|
1590
|
-
const [hasCreatorRole,
|
|
1522
|
+
const [hasCreatorRole, operatorRead] = await Promise.all([
|
|
1591
1523
|
this.hasRole(creatorRole, args.creator),
|
|
1592
1524
|
this.publicClient.readContract({
|
|
1593
1525
|
address: token,
|
|
1594
1526
|
abi: chunkFWHYQZ5E_cjs.erc7984OperatorAbi,
|
|
1595
1527
|
functionName: "isOperator",
|
|
1596
1528
|
args: [args.creator, this.address]
|
|
1529
|
+
}).then((v) => ({ ok: true, value: v })).catch((err) => {
|
|
1530
|
+
if (isNotErc7984Failure(err)) return { ok: false, err };
|
|
1531
|
+
throw err;
|
|
1597
1532
|
})
|
|
1598
1533
|
]);
|
|
1534
|
+
const isOperatorSet = operatorRead.ok ? operatorRead.value : false;
|
|
1599
1535
|
if (!hasCreatorRole) {
|
|
1600
1536
|
pushBlocker(
|
|
1601
|
-
new
|
|
1537
|
+
new chunk2RNW4MIJ_cjs.AccessDeniedError({
|
|
1602
1538
|
method: "createVesting",
|
|
1603
1539
|
contractAddress: this.address,
|
|
1604
1540
|
account: args.creator,
|
|
@@ -1606,9 +1542,18 @@ var ConfidentialVestingManagerClient = class {
|
|
|
1606
1542
|
})
|
|
1607
1543
|
);
|
|
1608
1544
|
}
|
|
1609
|
-
if (!
|
|
1545
|
+
if (!operatorRead.ok) {
|
|
1610
1546
|
pushBlocker(
|
|
1611
|
-
new
|
|
1547
|
+
new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
1548
|
+
method: "createVesting",
|
|
1549
|
+
argument: "token",
|
|
1550
|
+
reason: "does not implement the ERC-7984 `isOperator(address,address)` view \u2014 it is not a confidential token (or the address holds no contract on this chain)",
|
|
1551
|
+
value: token
|
|
1552
|
+
})
|
|
1553
|
+
);
|
|
1554
|
+
} else if (!isOperatorSet) {
|
|
1555
|
+
pushBlocker(
|
|
1556
|
+
new chunk2RNW4MIJ_cjs.OperatorNotApprovedError({
|
|
1612
1557
|
method: "createVesting",
|
|
1613
1558
|
contractAddress: this.address,
|
|
1614
1559
|
tokenAddress: token,
|
|
@@ -1699,6 +1644,13 @@ var ConfidentialVestingManagerClient = class {
|
|
|
1699
1644
|
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
1700
1645
|
* transparent TTT test token uses 18 decimals.
|
|
1701
1646
|
*
|
|
1647
|
+
* Prerequisites: caller must have set this manager as an operator on the
|
|
1648
|
+
* token: `token.setOperator(managerAddress, deadline)` — or use
|
|
1649
|
+
* `ensureOperator()` from `@tokenops/sdk/fhe`. Skipping it fails with
|
|
1650
|
+
* {@link OperatorNotApprovedError} (the SDK's mapping of the on-chain
|
|
1651
|
+
* `ERC7984UnauthorizedSpender` revert, whose message is the canonical
|
|
1652
|
+
* `OPERATOR_NOT_APPROVED_REMEDIATION` copy).
|
|
1653
|
+
*
|
|
1702
1654
|
* @returns Transaction hash. Parse the `VestingCreated` event to extract the `vestingId`.
|
|
1703
1655
|
* @example
|
|
1704
1656
|
* const hash = await manager.createVesting({
|
|
@@ -1748,12 +1700,19 @@ var ConfidentialVestingManagerClient = class {
|
|
|
1748
1700
|
* for the CTTT test token (6 decimals) `1_000_000n` = 1 CTTT, while the
|
|
1749
1701
|
* transparent TTT test token uses 18 decimals.
|
|
1750
1702
|
*
|
|
1703
|
+
* Prerequisites: caller must have set this manager as an operator on the
|
|
1704
|
+
* token: `token.setOperator(managerAddress, deadline)` — or use
|
|
1705
|
+
* `ensureOperator()` from `@tokenops/sdk/fhe`. Skipping it fails with
|
|
1706
|
+
* {@link OperatorNotApprovedError} (the SDK's mapping of the on-chain
|
|
1707
|
+
* `ERC7984UnauthorizedSpender` revert, whose message is the canonical
|
|
1708
|
+
* `OPERATOR_NOT_APPROVED_REMEDIATION` copy).
|
|
1709
|
+
*
|
|
1751
1710
|
* @returns Transaction hash.
|
|
1752
1711
|
*/
|
|
1753
1712
|
async batchCreateVesting(args) {
|
|
1754
1713
|
return chunkVJKZWYYJ_cjs.withTelemetry(this.#telemetry, "fhe-vesting.manager.batchCreateVesting", async () => {
|
|
1755
1714
|
if (args.items.length === 0) {
|
|
1756
|
-
throw new
|
|
1715
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
1757
1716
|
method: "batchCreateVesting",
|
|
1758
1717
|
argument: "items",
|
|
1759
1718
|
reason: "must be non-empty"
|
|
@@ -1764,21 +1723,21 @@ var ConfidentialVestingManagerClient = class {
|
|
|
1764
1723
|
);
|
|
1765
1724
|
const wallet = this.#requireWallet("batchCreateVesting");
|
|
1766
1725
|
const account = this.#resolveAccount(wallet, args.account, "batchCreateVesting");
|
|
1767
|
-
const encryptor = args.encryptor ?? resolveEncryptor(this.encryptor);
|
|
1726
|
+
const encryptor = args.encryptor ?? chunkBD4LZBVF_cjs.resolveEncryptor(this.encryptor);
|
|
1768
1727
|
if (!encryptor) {
|
|
1769
|
-
throw new
|
|
1728
|
+
throw new chunk2RNW4MIJ_cjs.MissingEncryptorError("batchCreateVesting");
|
|
1770
1729
|
}
|
|
1771
1730
|
const userAddress = accountAddress(account);
|
|
1772
1731
|
let batch;
|
|
1773
1732
|
try {
|
|
1774
|
-
batch = await encryptUint64Batch({
|
|
1733
|
+
batch = await chunkBD4LZBVF_cjs.encryptUint64Batch({
|
|
1775
1734
|
encryptor,
|
|
1776
1735
|
contractAddress: this.address,
|
|
1777
1736
|
userAddress,
|
|
1778
1737
|
values: args.items.map((it) => it.amount)
|
|
1779
1738
|
});
|
|
1780
1739
|
} catch (err) {
|
|
1781
|
-
throw
|
|
1740
|
+
throw chunkUJS4N2XM_cjs.mapZamaError(err, { method: "batchCreateVesting", operation: "encrypt" });
|
|
1782
1741
|
}
|
|
1783
1742
|
try {
|
|
1784
1743
|
return await wallet.writeContract({
|
|
@@ -1962,7 +1921,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
1962
1921
|
*/
|
|
1963
1922
|
async batchRevokeVesting(vestingIds, account) {
|
|
1964
1923
|
if (vestingIds.length === 0) {
|
|
1965
|
-
throw new
|
|
1924
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
1966
1925
|
method: "batchRevokeVesting",
|
|
1967
1926
|
argument: "vestingIds",
|
|
1968
1927
|
reason: "must be non-empty"
|
|
@@ -2018,7 +1977,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2018
1977
|
async splitVesting(args) {
|
|
2019
1978
|
const wallet = this.#requireWallet("splitVesting");
|
|
2020
1979
|
const account = this.#resolveAccount(wallet, args.account, "splitVesting");
|
|
2021
|
-
const { numerator, denominator } = args.preScaled ? { numerator: args.numerator, denominator: args.denominator } :
|
|
1980
|
+
const { numerator, denominator } = args.preScaled ? { numerator: args.numerator, denominator: args.denominator } : chunkBD4LZBVF_cjs.scaleRatio({
|
|
2022
1981
|
numerator: args.numerator,
|
|
2023
1982
|
denominator: args.denominator,
|
|
2024
1983
|
// The encrypted numerator is submitted via `encryptUint64`, so
|
|
@@ -2028,7 +1987,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2028
1987
|
width: "uint64"
|
|
2029
1988
|
});
|
|
2030
1989
|
if (denominator < 10000n) {
|
|
2031
|
-
throw new
|
|
1990
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2032
1991
|
method: "splitVesting",
|
|
2033
1992
|
argument: "denominator",
|
|
2034
1993
|
reason: "must be \u2265 10000 (the contract's MIN_SPLIT_DENOMINATOR floor)",
|
|
@@ -2036,7 +1995,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2036
1995
|
});
|
|
2037
1996
|
}
|
|
2038
1997
|
if (args.newRecipient === ZERO_ADDRESS) {
|
|
2039
|
-
throw new
|
|
1998
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2040
1999
|
method: "splitVesting",
|
|
2041
2000
|
argument: "newRecipient",
|
|
2042
2001
|
reason: "must not be the zero address"
|
|
@@ -2076,7 +2035,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2076
2035
|
(ev) => ev.args.originalVestingId.toLowerCase() === args.vestingId.toLowerCase() && ev.args.newRecipient.toLowerCase() === args.newRecipient.toLowerCase()
|
|
2077
2036
|
);
|
|
2078
2037
|
if (matches.length === 0) {
|
|
2079
|
-
throw new
|
|
2038
|
+
throw new chunk2RNW4MIJ_cjs.ReceiptEventNotFoundError({
|
|
2080
2039
|
method: "splitVesting",
|
|
2081
2040
|
eventName: "VestingSplit",
|
|
2082
2041
|
contractAddress: this.address,
|
|
@@ -2085,7 +2044,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2085
2044
|
});
|
|
2086
2045
|
}
|
|
2087
2046
|
if (matches.length > 1) {
|
|
2088
|
-
throw new
|
|
2047
|
+
throw new chunk2RNW4MIJ_cjs.ReceiptEventAmbiguousError({
|
|
2089
2048
|
method: "splitVesting",
|
|
2090
2049
|
eventName: "VestingSplit",
|
|
2091
2050
|
contractAddress: this.address,
|
|
@@ -2106,7 +2065,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2106
2065
|
*/
|
|
2107
2066
|
async initiateVestingTransfer(args) {
|
|
2108
2067
|
if (!viem.isAddress(args.newRecipient, { strict: true })) {
|
|
2109
|
-
throw new
|
|
2068
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2110
2069
|
method: "initiateVestingTransfer",
|
|
2111
2070
|
argument: "newRecipient",
|
|
2112
2071
|
reason: "must be a valid EIP-55 checksummed address",
|
|
@@ -2114,14 +2073,14 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2114
2073
|
});
|
|
2115
2074
|
}
|
|
2116
2075
|
if (args.newRecipient === ZERO_ADDRESS) {
|
|
2117
|
-
throw new
|
|
2076
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2118
2077
|
method: "initiateVestingTransfer",
|
|
2119
2078
|
argument: "newRecipient",
|
|
2120
2079
|
reason: "must not be the zero address"
|
|
2121
2080
|
});
|
|
2122
2081
|
}
|
|
2123
2082
|
if (args.transferDurationSeconds <= 0) {
|
|
2124
|
-
throw new
|
|
2083
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2125
2084
|
method: "initiateVestingTransfer",
|
|
2126
2085
|
argument: "transferDurationSeconds",
|
|
2127
2086
|
reason: "must be > 0",
|
|
@@ -2160,7 +2119,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2160
2119
|
*/
|
|
2161
2120
|
async directVestingTransfer(vestingId, newOwner, account) {
|
|
2162
2121
|
if (!viem.isAddress(newOwner, { strict: true })) {
|
|
2163
|
-
throw new
|
|
2122
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2164
2123
|
method: "directVestingTransfer",
|
|
2165
2124
|
argument: "newOwner",
|
|
2166
2125
|
reason: "must be a valid EIP-55 checksummed address",
|
|
@@ -2168,7 +2127,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2168
2127
|
});
|
|
2169
2128
|
}
|
|
2170
2129
|
if (newOwner === ZERO_ADDRESS) {
|
|
2171
|
-
throw new
|
|
2130
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2172
2131
|
method: "directVestingTransfer",
|
|
2173
2132
|
argument: "newOwner",
|
|
2174
2133
|
reason: "must not be the zero address"
|
|
@@ -2208,14 +2167,14 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2208
2167
|
*/
|
|
2209
2168
|
async batchDiscloseToParty(args) {
|
|
2210
2169
|
if (args.vestingIds.length === 0) {
|
|
2211
|
-
throw new
|
|
2170
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2212
2171
|
method: "batchDiscloseToParty",
|
|
2213
2172
|
argument: "vestingIds",
|
|
2214
2173
|
reason: "must be non-empty"
|
|
2215
2174
|
});
|
|
2216
2175
|
}
|
|
2217
2176
|
if (args.vestingIds.length !== args.disclosureTypes.length) {
|
|
2218
|
-
throw new
|
|
2177
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2219
2178
|
method: "batchDiscloseToParty",
|
|
2220
2179
|
argument: "disclosureTypes",
|
|
2221
2180
|
reason: `length mismatch: vestingIds=${args.vestingIds.length}, disclosureTypes=${args.disclosureTypes.length}`
|
|
@@ -2248,14 +2207,14 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2248
2207
|
*/
|
|
2249
2208
|
async adminBatchDiscloseToParty(args) {
|
|
2250
2209
|
if (args.vestingIds.length === 0) {
|
|
2251
|
-
throw new
|
|
2210
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2252
2211
|
method: "adminBatchDiscloseToParty",
|
|
2253
2212
|
argument: "vestingIds",
|
|
2254
2213
|
reason: "must be non-empty"
|
|
2255
2214
|
});
|
|
2256
2215
|
}
|
|
2257
2216
|
if (args.vestingIds.length !== args.disclosureTypes.length) {
|
|
2258
|
-
throw new
|
|
2217
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2259
2218
|
method: "adminBatchDiscloseToParty",
|
|
2260
2219
|
argument: "disclosureTypes",
|
|
2261
2220
|
reason: `length mismatch: vestingIds=${args.vestingIds.length}, disclosureTypes=${args.disclosureTypes.length}`
|
|
@@ -2287,7 +2246,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2287
2246
|
*/
|
|
2288
2247
|
async batchDiscloseHandlesToParty(handles, party, account) {
|
|
2289
2248
|
if (handles.length === 0) {
|
|
2290
|
-
throw new
|
|
2249
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2291
2250
|
method: "batchDiscloseHandlesToParty",
|
|
2292
2251
|
argument: "handles",
|
|
2293
2252
|
reason: "must be non-empty"
|
|
@@ -2376,7 +2335,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2376
2335
|
*/
|
|
2377
2336
|
async withdrawTokenFee(args) {
|
|
2378
2337
|
if (args.to === ZERO_ADDRESS) {
|
|
2379
|
-
throw new
|
|
2338
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2380
2339
|
method: "withdrawTokenFee",
|
|
2381
2340
|
argument: "to",
|
|
2382
2341
|
reason: "must not be the zero address"
|
|
@@ -2541,33 +2500,33 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2541
2500
|
// ============================================================
|
|
2542
2501
|
#requireWallet(method) {
|
|
2543
2502
|
if (!this.walletClient) {
|
|
2544
|
-
throw new
|
|
2503
|
+
throw new chunk2RNW4MIJ_cjs.MissingWalletClientError(method);
|
|
2545
2504
|
}
|
|
2546
2505
|
return this.walletClient;
|
|
2547
2506
|
}
|
|
2548
2507
|
#resolveAccount(wallet, override, method) {
|
|
2549
2508
|
const acct = override ?? wallet.account;
|
|
2550
2509
|
if (!acct) {
|
|
2551
|
-
throw new
|
|
2510
|
+
throw new chunk2RNW4MIJ_cjs.MissingAccountError(method);
|
|
2552
2511
|
}
|
|
2553
2512
|
return acct;
|
|
2554
2513
|
}
|
|
2555
2514
|
async #encryptUint64(value, encryptor, account) {
|
|
2556
|
-
const enc = encryptor ?? resolveEncryptor(this.encryptor);
|
|
2515
|
+
const enc = encryptor ?? chunkBD4LZBVF_cjs.resolveEncryptor(this.encryptor);
|
|
2557
2516
|
if (!enc) {
|
|
2558
|
-
throw new
|
|
2517
|
+
throw new chunk2RNW4MIJ_cjs.MissingEncryptorError("encryptUint64", {
|
|
2559
2518
|
hint: "Pass `encryptor` to the call or the client config (eager or lazy factory)."
|
|
2560
2519
|
});
|
|
2561
2520
|
}
|
|
2562
2521
|
try {
|
|
2563
|
-
return await encryptUint64({
|
|
2522
|
+
return await chunkBD4LZBVF_cjs.encryptUint64({
|
|
2564
2523
|
encryptor: enc,
|
|
2565
2524
|
contractAddress: this.address,
|
|
2566
2525
|
userAddress: accountAddress(account),
|
|
2567
2526
|
value
|
|
2568
2527
|
});
|
|
2569
2528
|
} catch (err) {
|
|
2570
|
-
throw
|
|
2529
|
+
throw chunkUJS4N2XM_cjs.mapZamaError(err, { method: "encryptUint64", operation: "encrypt" });
|
|
2571
2530
|
}
|
|
2572
2531
|
}
|
|
2573
2532
|
/**
|
|
@@ -2581,14 +2540,14 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2581
2540
|
const hasAmount = args.amount !== void 0;
|
|
2582
2541
|
const hasInput = args.encryptedInput !== void 0;
|
|
2583
2542
|
if (hasAmount && hasInput) {
|
|
2584
|
-
throw new
|
|
2543
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2585
2544
|
method: args.method,
|
|
2586
2545
|
argument: "amount/encryptedInput",
|
|
2587
2546
|
reason: "exactly one of `amount` (plaintext, SDK encrypts) or `encryptedInput` (pre-encrypted) must be supplied \u2014 got both"
|
|
2588
2547
|
});
|
|
2589
2548
|
}
|
|
2590
2549
|
if (!hasAmount && !hasInput) {
|
|
2591
|
-
throw new
|
|
2550
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2592
2551
|
method: args.method,
|
|
2593
2552
|
argument: "amount/encryptedInput",
|
|
2594
2553
|
reason: "exactly one of `amount` (plaintext, SDK encrypts) or `encryptedInput` (pre-encrypted) must be supplied \u2014 got neither"
|
|
@@ -2604,7 +2563,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2604
2563
|
* the offending schedule id in its context.
|
|
2605
2564
|
*/
|
|
2606
2565
|
#mapRevert(method, err, productContext, account) {
|
|
2607
|
-
return
|
|
2566
|
+
return chunk43RFBQ73_cjs.mapContractRevert(err, {
|
|
2608
2567
|
method,
|
|
2609
2568
|
contractAddress: this.address,
|
|
2610
2569
|
abi: confidentialVestingManagerAbi,
|
|
@@ -2650,7 +2609,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2650
2609
|
...value !== void 0 ? { value } : {}
|
|
2651
2610
|
});
|
|
2652
2611
|
} catch (err) {
|
|
2653
|
-
if (
|
|
2612
|
+
if (chunk43RFBQ73_cjs.isContractRevert(err)) {
|
|
2654
2613
|
throw this.#mapRevert(method, err, productContext, accountAddress(account));
|
|
2655
2614
|
}
|
|
2656
2615
|
}
|
|
@@ -2663,7 +2622,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2663
2622
|
*/
|
|
2664
2623
|
async #discloseSingleWithReceipt(input) {
|
|
2665
2624
|
if (!viem.isAddress(input.party, { strict: true })) {
|
|
2666
|
-
throw new
|
|
2625
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2667
2626
|
method: input.functionName,
|
|
2668
2627
|
argument: "party",
|
|
2669
2628
|
reason: "must be a valid EIP-55 checksummed address",
|
|
@@ -2700,7 +2659,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2700
2659
|
(ev) => ev.args.vestingId.toLowerCase() === input.vestingId.toLowerCase() && ev.args.discloser.toLowerCase() === callerAddress && ev.args.party.toLowerCase() === input.party.toLowerCase()
|
|
2701
2660
|
);
|
|
2702
2661
|
if (matches.length === 0) {
|
|
2703
|
-
throw new
|
|
2662
|
+
throw new chunk2RNW4MIJ_cjs.ReceiptEventNotFoundError({
|
|
2704
2663
|
method: input.functionName,
|
|
2705
2664
|
eventName: "AmountDisclosed",
|
|
2706
2665
|
contractAddress: this.address,
|
|
@@ -2709,7 +2668,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2709
2668
|
});
|
|
2710
2669
|
}
|
|
2711
2670
|
if (matches.length > 1) {
|
|
2712
|
-
throw new
|
|
2671
|
+
throw new chunk2RNW4MIJ_cjs.ReceiptEventAmbiguousError({
|
|
2713
2672
|
method: input.functionName,
|
|
2714
2673
|
eventName: "AmountDisclosed",
|
|
2715
2674
|
contractAddress: this.address,
|
|
@@ -2726,7 +2685,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2726
2685
|
*/
|
|
2727
2686
|
async #discloseBatchWithReceipt(input) {
|
|
2728
2687
|
if (!viem.isAddress(input.party, { strict: true })) {
|
|
2729
|
-
throw new
|
|
2688
|
+
throw new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2730
2689
|
method: input.functionName,
|
|
2731
2690
|
argument: "party",
|
|
2732
2691
|
reason: "must be a valid EIP-55 checksummed address",
|
|
@@ -2765,7 +2724,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2765
2724
|
for (const id of input.vestingIds) {
|
|
2766
2725
|
const handle = byVestingId.get(id.toLowerCase());
|
|
2767
2726
|
if (handle === void 0) {
|
|
2768
|
-
throw new
|
|
2727
|
+
throw new chunk2RNW4MIJ_cjs.ReceiptEventNotFoundError({
|
|
2769
2728
|
method: input.functionName,
|
|
2770
2729
|
eventName: "AmountDisclosed",
|
|
2771
2730
|
contractAddress: this.address,
|
|
@@ -2831,12 +2790,12 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2831
2790
|
const aclLogs = receipt.logs.filter(
|
|
2832
2791
|
(log) => log.address.toLowerCase() === this.aclAddress.toLowerCase()
|
|
2833
2792
|
);
|
|
2834
|
-
const events = viem.parseEventLogs({ abi: [
|
|
2793
|
+
const events = viem.parseEventLogs({ abi: [chunkSYHNZSZZ_cjs.ACL_ALLOWED_EVENT], logs: aclLogs });
|
|
2835
2794
|
const granted = events.filter(
|
|
2836
2795
|
(ev) => ev.args.account.toLowerCase() === callerAddress && ev.args.caller.toLowerCase() === this.address.toLowerCase()
|
|
2837
2796
|
);
|
|
2838
2797
|
if (granted.length === 0) {
|
|
2839
|
-
throw new
|
|
2798
|
+
throw new chunk2RNW4MIJ_cjs.ReceiptEventNotFoundError({
|
|
2840
2799
|
method: functionName,
|
|
2841
2800
|
eventName: "Allowed",
|
|
2842
2801
|
contractAddress: this.aclAddress,
|
|
@@ -2845,7 +2804,7 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2845
2804
|
});
|
|
2846
2805
|
}
|
|
2847
2806
|
if (granted.length > 1) {
|
|
2848
|
-
throw new
|
|
2807
|
+
throw new chunk2RNW4MIJ_cjs.ReceiptEventAmbiguousError({
|
|
2849
2808
|
method: functionName,
|
|
2850
2809
|
eventName: "Allowed",
|
|
2851
2810
|
contractAddress: this.aclAddress,
|
|
@@ -2853,13 +2812,18 @@ var ConfidentialVestingManagerClient = class {
|
|
|
2853
2812
|
count: granted.length
|
|
2854
2813
|
});
|
|
2855
2814
|
}
|
|
2856
|
-
const handle =
|
|
2857
|
-
return { handle, hash:
|
|
2815
|
+
const handle = chunk2RNW4MIJ_cjs.asEncryptedHandle(granted[0].args.handle);
|
|
2816
|
+
return { handle, hash: chunk2RNW4MIJ_cjs.asTxHash(hash) };
|
|
2858
2817
|
}
|
|
2859
2818
|
};
|
|
2860
2819
|
function createConfidentialVestingManagerClient(config) {
|
|
2861
2820
|
return new ConfidentialVestingManagerClient(config);
|
|
2862
2821
|
}
|
|
2822
|
+
function isNotErc7984Failure(err) {
|
|
2823
|
+
if (chunk43RFBQ73_cjs.isContractRevert(err)) return true;
|
|
2824
|
+
if (!(err instanceof viem.BaseError)) return false;
|
|
2825
|
+
return err.walk((e) => e instanceof viem.ContractFunctionZeroDataError) instanceof viem.ContractFunctionZeroDataError;
|
|
2826
|
+
}
|
|
2863
2827
|
function accountAddress(account) {
|
|
2864
2828
|
return typeof account === "string" ? account : account.address;
|
|
2865
2829
|
}
|
|
@@ -2868,7 +2832,7 @@ function collectVestingParamsErrors(params, where) {
|
|
|
2868
2832
|
const errors = [];
|
|
2869
2833
|
if (!viem.isAddress(params.recipient, { strict: true })) {
|
|
2870
2834
|
errors.push(
|
|
2871
|
-
new
|
|
2835
|
+
new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2872
2836
|
method: where,
|
|
2873
2837
|
argument: "recipient",
|
|
2874
2838
|
reason: "must be a valid EIP-55 checksummed address",
|
|
@@ -2877,7 +2841,7 @@ function collectVestingParamsErrors(params, where) {
|
|
|
2877
2841
|
);
|
|
2878
2842
|
} else if (params.recipient === ZERO_ADDRESS) {
|
|
2879
2843
|
errors.push(
|
|
2880
|
-
new
|
|
2844
|
+
new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2881
2845
|
method: where,
|
|
2882
2846
|
argument: "recipient",
|
|
2883
2847
|
reason: "must not be the zero address"
|
|
@@ -2886,7 +2850,7 @@ function collectVestingParamsErrors(params, where) {
|
|
|
2886
2850
|
}
|
|
2887
2851
|
if (params.startTimestamp >= params.endTimestamp) {
|
|
2888
2852
|
errors.push(
|
|
2889
|
-
new
|
|
2853
|
+
new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2890
2854
|
method: where,
|
|
2891
2855
|
argument: "startTimestamp/endTimestamp",
|
|
2892
2856
|
reason: "startTimestamp must be strictly less than endTimestamp",
|
|
@@ -2896,7 +2860,7 @@ function collectVestingParamsErrors(params, where) {
|
|
|
2896
2860
|
}
|
|
2897
2861
|
if (params.startTimestamp < params.endTimestamp && params.startTimestamp + params.cliffSeconds > params.endTimestamp) {
|
|
2898
2862
|
errors.push(
|
|
2899
|
-
new
|
|
2863
|
+
new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2900
2864
|
method: where,
|
|
2901
2865
|
argument: "cliffSeconds",
|
|
2902
2866
|
reason: "cliff cannot extend past endTimestamp",
|
|
@@ -2906,7 +2870,7 @@ function collectVestingParamsErrors(params, where) {
|
|
|
2906
2870
|
}
|
|
2907
2871
|
if (params.initialUnlockBps + params.cliffAmountBps > 1e4) {
|
|
2908
2872
|
errors.push(
|
|
2909
|
-
new
|
|
2873
|
+
new chunk2RNW4MIJ_cjs.InvalidArgumentError({
|
|
2910
2874
|
method: where,
|
|
2911
2875
|
argument: "initialUnlockBps + cliffAmountBps",
|
|
2912
2876
|
reason: "must be \u2264 10000 (100%)",
|
|
@@ -2930,6 +2894,3 @@ exports.VestingNotRevocableError = VestingNotRevocableError;
|
|
|
2930
2894
|
exports.VestingRevokedError = VestingRevokedError;
|
|
2931
2895
|
exports.confidentialVestingManagerAbi = confidentialVestingManagerAbi;
|
|
2932
2896
|
exports.createConfidentialVestingManagerClient = createConfidentialVestingManagerClient;
|
|
2933
|
-
exports.encryptUint64 = encryptUint64;
|
|
2934
|
-
exports.encryptUint64Batch = encryptUint64Batch;
|
|
2935
|
-
exports.resolveEncryptor = resolveEncryptor;
|