@ssv-labs/ssv-sdk 0.1.2 → 1.0.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.html +4 -7
- package/README.md +37 -26
- package/dist/{KeyShares-7biQfDev.js → KeyShares-Bk9uzOlK.js} +255 -75
- package/dist/{KeyShares-DEqBZits.mjs → KeyShares-Dlp4Pa3b.mjs} +259 -79
- package/dist/abi/mainnet/v4/getter.d.ts +699 -74
- package/dist/abi/mainnet/v4/setter.d.ts +939 -59
- package/dist/api/subgraph/index.d.ts +36 -1
- package/dist/config/create.d.ts +2 -2
- package/dist/config/globals.d.ts +3 -0
- package/dist/{globals-CDOcDUnk.mjs → config-BdEJjnYA.mjs} +107 -79
- package/dist/{globals-DsaKgq3v.js → config-ClGS9Tic.js} +73 -45
- package/dist/contract-interactions/create.d.ts +1 -1
- package/dist/contract-interactions/types.d.ts +9 -3
- package/dist/graphql/graphql.d.ts +4663 -922
- package/dist/keys.js +1 -1
- package/dist/keys.mjs +5 -5
- package/dist/libs/api/index.d.ts +2 -0
- package/dist/libs/cluster/index.d.ts +3 -1
- package/dist/libs/cluster/methods/deposit.d.ts +150 -5
- package/dist/libs/cluster/methods/exit-validators.d.ts +149 -0
- package/dist/libs/cluster/methods/index.d.ts +3 -1
- package/dist/libs/cluster/methods/liquidate-cluster.d.ts +149 -0
- package/dist/libs/cluster/methods/liquidate-ssv.d.ts +430 -0
- package/dist/libs/cluster/methods/migrate-cluster-to-eth.d.ts +431 -0
- package/dist/libs/cluster/methods/reactivate-cluster.d.ts +149 -0
- package/dist/libs/cluster/methods/register-validators.d.ts +2222 -309
- package/dist/libs/cluster/methods/remove-validators.d.ts +149 -0
- package/dist/libs/cluster/methods/set-fee-recipient.d.ts +149 -0
- package/dist/libs/cluster/methods/withdraw.d.ts +149 -0
- package/dist/libs/dao/index.d.ts +8 -0
- package/dist/libs/dao/methods/commit-root.d.ts +432 -0
- package/dist/libs/dao/methods/index.d.ts +3 -0
- package/dist/libs/dao/methods/update-network-fee-ssv.d.ts +430 -0
- package/dist/libs/dao/methods/withdraw-network-ssv-earnings.d.ts +430 -0
- package/dist/libs/operator/index.d.ts +1525 -32
- package/dist/libs/operator/methods.d.ts +1731 -2
- package/dist/libs/ssv-keys/Encryption/__test__/RsaKeys.d.ts +1 -1
- package/dist/libs/ssv-keys/KeyShares/KeySharesItem.d.ts +1 -1
- package/dist/libs/ssv-keys/SSVKeys.d.ts +1 -1
- package/dist/libs/ssv-keys/exceptions/index.d.ts +1 -1
- package/dist/libs/ssv-keys/index.d.ts +1 -1
- package/dist/libs/ssv-keys/interfaces/index.d.ts +2 -2
- package/dist/libs/utils/index.d.ts +6 -4
- package/dist/libs/utils/methods/calc-deposit-from-runway.d.ts +11 -0
- package/dist/libs/utils/methods/get-cluster-balance.d.ts +3 -1
- package/dist/libs/utils/methods/keyshares.d.ts +4 -2
- package/dist/libs/utils/methods/keystores.d.ts +4 -4
- package/dist/main.d.ts +1 -0
- package/dist/main.js +2714 -729
- package/dist/main.mjs +2746 -761
- package/dist/sdk.d.ts +8 -4
- package/dist/types/contract-interactions.d.ts +11 -0
- package/dist/types/methods.d.ts +4 -3
- package/dist/utils/cluster.d.ts +3 -3
- package/dist/utils/funding.d.ts +29 -0
- package/dist/utils/zod/config.d.ts +1 -1
- package/dist/utils.js +38 -38
- package/dist/utils.mjs +34 -34
- package/package.json +29 -17
|
@@ -2,10 +2,6 @@ import bls from "bls-eth-wasm";
|
|
|
2
2
|
import crypto$1 from "crypto";
|
|
3
3
|
import { keccak256, toHex, sha256 as sha256$1, toBytes, fromHex, getAddress } from "viem";
|
|
4
4
|
import { ValidatorConstraint, registerDecorator, IsNotEmpty, IsDefined, IsInt, IsString, validateSync, IsOptional, IsNumber, Length, ValidateNested } from "class-validator";
|
|
5
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
6
|
-
function getDefaultExportFromCjs(x) {
|
|
7
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
8
|
-
}
|
|
9
5
|
(async () => {
|
|
10
6
|
await bls.init(bls.BLS12_381);
|
|
11
7
|
})();
|
|
@@ -64,6 +60,10 @@ class OwnerNonceFormatError extends SSVKeysException {
|
|
|
64
60
|
this.data = data;
|
|
65
61
|
}
|
|
66
62
|
}
|
|
63
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
64
|
+
function getDefaultExportFromCjs(x) {
|
|
65
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
66
|
+
}
|
|
67
67
|
var forge$C = {
|
|
68
68
|
// default options
|
|
69
69
|
options: {
|
|
@@ -1326,6 +1326,9 @@ util$1.format = function(format) {
|
|
|
1326
1326
|
parts.push("<?>");
|
|
1327
1327
|
}
|
|
1328
1328
|
break;
|
|
1329
|
+
// FIXME: do proper formatting for numbers, etc
|
|
1330
|
+
//case 'f':
|
|
1331
|
+
//case 'd':
|
|
1329
1332
|
case "%":
|
|
1330
1333
|
parts.push("%");
|
|
1331
1334
|
break;
|
|
@@ -2736,6 +2739,7 @@ asn1$8.Type = {
|
|
|
2736
2739
|
GENERALIZEDTIME: 24,
|
|
2737
2740
|
BMPSTRING: 30
|
|
2738
2741
|
};
|
|
2742
|
+
asn1$8.maxDepth = 256;
|
|
2739
2743
|
asn1$8.create = function(tagClass, type, constructed, value, options) {
|
|
2740
2744
|
if (forge$w.util.isArray(value)) {
|
|
2741
2745
|
var tmp = [];
|
|
@@ -2877,6 +2881,9 @@ asn1$8.fromDer = function(bytes, options) {
|
|
|
2877
2881
|
if (!("decodeBitStrings" in options)) {
|
|
2878
2882
|
options.decodeBitStrings = true;
|
|
2879
2883
|
}
|
|
2884
|
+
if (!("maxDepth" in options)) {
|
|
2885
|
+
options.maxDepth = asn1$8.maxDepth;
|
|
2886
|
+
}
|
|
2880
2887
|
if (typeof bytes === "string") {
|
|
2881
2888
|
bytes = forge$w.util.createBuffer(bytes);
|
|
2882
2889
|
}
|
|
@@ -2891,6 +2898,9 @@ asn1$8.fromDer = function(bytes, options) {
|
|
|
2891
2898
|
return value;
|
|
2892
2899
|
};
|
|
2893
2900
|
function _fromDer(bytes, remaining, depth, options) {
|
|
2901
|
+
if (depth >= options.maxDepth) {
|
|
2902
|
+
throw new Error("ASN.1 parsing error: Max depth exceeded.");
|
|
2903
|
+
}
|
|
2894
2904
|
var start;
|
|
2895
2905
|
_checkBufferLength(bytes, remaining, 2);
|
|
2896
2906
|
var b1 = bytes.getByte();
|
|
@@ -3066,6 +3076,9 @@ asn1$8.oidToDer = function(oid) {
|
|
|
3066
3076
|
last = true;
|
|
3067
3077
|
valueBytes = [];
|
|
3068
3078
|
value = parseInt(values[i], 10);
|
|
3079
|
+
if (value > 4294967295) {
|
|
3080
|
+
throw new Error("OID value too large; max is 32-bits.");
|
|
3081
|
+
}
|
|
3069
3082
|
do {
|
|
3070
3083
|
b = value & 127;
|
|
3071
3084
|
value = value >>> 7;
|
|
@@ -3090,8 +3103,11 @@ asn1$8.derToOid = function(bytes) {
|
|
|
3090
3103
|
oid = Math.floor(b / 40) + "." + b % 40;
|
|
3091
3104
|
var value = 0;
|
|
3092
3105
|
while (bytes.length() > 0) {
|
|
3106
|
+
if (value > 70368744177663) {
|
|
3107
|
+
throw new Error("OID value too large; max is 53-bits.");
|
|
3108
|
+
}
|
|
3093
3109
|
b = bytes.getByte();
|
|
3094
|
-
value = value
|
|
3110
|
+
value = value * 128;
|
|
3095
3111
|
if (b & 128) {
|
|
3096
3112
|
value += b & 127;
|
|
3097
3113
|
} else {
|
|
@@ -3252,19 +3268,40 @@ asn1$8.validate = function(obj, v, capture, errors) {
|
|
|
3252
3268
|
if (v.value && forge$w.util.isArray(v.value)) {
|
|
3253
3269
|
var j = 0;
|
|
3254
3270
|
for (var i = 0; rval && i < v.value.length; ++i) {
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3271
|
+
var schemaItem = v.value[i];
|
|
3272
|
+
rval = !!schemaItem.optional;
|
|
3273
|
+
var objChild = obj.value[j];
|
|
3274
|
+
if (!objChild) {
|
|
3275
|
+
if (!schemaItem.optional) {
|
|
3276
|
+
rval = false;
|
|
3277
|
+
if (errors) {
|
|
3278
|
+
errors.push("[" + v.name + '] Missing required element. Expected tag class "' + schemaItem.tagClass + '", type "' + schemaItem.type + '"');
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
continue;
|
|
3282
|
+
}
|
|
3283
|
+
var schemaHasTag = typeof schemaItem.tagClass !== "undefined" && typeof schemaItem.type !== "undefined";
|
|
3284
|
+
if (schemaHasTag && (objChild.tagClass !== schemaItem.tagClass || objChild.type !== schemaItem.type)) {
|
|
3285
|
+
if (schemaItem.optional) {
|
|
3261
3286
|
rval = true;
|
|
3287
|
+
continue;
|
|
3288
|
+
} else {
|
|
3289
|
+
rval = false;
|
|
3290
|
+
if (errors) {
|
|
3291
|
+
errors.push("[" + v.name + "] Tag mismatch. Expected (" + schemaItem.tagClass + "," + schemaItem.type + "), got (" + objChild.tagClass + "," + objChild.type + ")");
|
|
3292
|
+
}
|
|
3293
|
+
break;
|
|
3262
3294
|
}
|
|
3263
3295
|
}
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3296
|
+
var childRval = asn1$8.validate(objChild, schemaItem, capture, errors);
|
|
3297
|
+
if (childRval) {
|
|
3298
|
+
++j;
|
|
3299
|
+
rval = true;
|
|
3300
|
+
} else if (schemaItem.optional) {
|
|
3301
|
+
rval = true;
|
|
3302
|
+
} else {
|
|
3303
|
+
rval = false;
|
|
3304
|
+
break;
|
|
3268
3305
|
}
|
|
3269
3306
|
}
|
|
3270
3307
|
}
|
|
@@ -7172,7 +7209,7 @@ var digestInfoValidator = {
|
|
|
7172
7209
|
constructed: false,
|
|
7173
7210
|
capture: "algorithmIdentifier"
|
|
7174
7211
|
}, {
|
|
7175
|
-
// NULL
|
|
7212
|
+
// NULL parameters
|
|
7176
7213
|
name: "DigestInfo.DigestAlgorithm.parameters",
|
|
7177
7214
|
tagClass: asn1$7.Class.UNIVERSAL,
|
|
7178
7215
|
type: asn1$7.Type.NULL,
|
|
@@ -7685,7 +7722,7 @@ pki$4.setRsaPublicKey = pki$4.rsa.setPublicKey = function(n, e) {
|
|
|
7685
7722
|
if (oid === forge$h.oids.md2 || oid === forge$h.oids.md5) {
|
|
7686
7723
|
if (!("parameters" in capture)) {
|
|
7687
7724
|
throw new Error(
|
|
7688
|
-
"ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm
|
|
7725
|
+
"ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifier NULL parameters."
|
|
7689
7726
|
);
|
|
7690
7727
|
}
|
|
7691
7728
|
}
|
|
@@ -9841,6 +9878,7 @@ var _readSignatureParameters = function(oid, obj, fillDefaults) {
|
|
|
9841
9878
|
var _createSignatureDigest = function(options) {
|
|
9842
9879
|
switch (oids[options.signatureOid]) {
|
|
9843
9880
|
case "sha1WithRSAEncryption":
|
|
9881
|
+
// deprecated alias
|
|
9844
9882
|
case "sha1WithRSASignature":
|
|
9845
9883
|
return forge$b.md.sha1.create();
|
|
9846
9884
|
case "md5WithRSAEncryption":
|
|
@@ -9866,6 +9904,7 @@ var _verifySignature = function(options) {
|
|
|
9866
9904
|
var scheme;
|
|
9867
9905
|
switch (cert.signatureOid) {
|
|
9868
9906
|
case oids.sha1WithRSAEncryption:
|
|
9907
|
+
// deprecated alias
|
|
9869
9908
|
case oids.sha1WithRSASignature:
|
|
9870
9909
|
break;
|
|
9871
9910
|
case oids["RSASSA-PSS"]:
|
|
@@ -10356,13 +10395,18 @@ pki$2.certificateExtensionFromAsn1 = function(ext) {
|
|
|
10356
10395
|
};
|
|
10357
10396
|
e.altNames.push(altName);
|
|
10358
10397
|
switch (gn.type) {
|
|
10398
|
+
// rfc822Name
|
|
10359
10399
|
case 1:
|
|
10400
|
+
// dNSName
|
|
10360
10401
|
case 2:
|
|
10402
|
+
// uniformResourceIdentifier (URI)
|
|
10361
10403
|
case 6:
|
|
10362
10404
|
break;
|
|
10405
|
+
// IPAddress
|
|
10363
10406
|
case 7:
|
|
10364
10407
|
altName.ip = forge$b.util.bytesToIP(gn.value);
|
|
10365
10408
|
break;
|
|
10409
|
+
// registeredID
|
|
10366
10410
|
case 8:
|
|
10367
10411
|
altName.oid = asn1$4.derToOid(gn.value);
|
|
10368
10412
|
break;
|
|
@@ -11516,6 +11560,7 @@ var pfxValidator = {
|
|
|
11516
11560
|
capture: "macAlgorithm"
|
|
11517
11561
|
}, {
|
|
11518
11562
|
name: "PFX.macData.mac.digestAlgorithm.parameters",
|
|
11563
|
+
optional: true,
|
|
11519
11564
|
tagClass: asn1$3.Class.UNIVERSAL,
|
|
11520
11565
|
captureAsn1: "macAlgorithmParameters"
|
|
11521
11566
|
}]
|
|
@@ -11794,6 +11839,8 @@ p12.pkcs12FromAsn1 = function(obj, strict, password) {
|
|
|
11794
11839
|
if (macValue.getBytes() !== capture.macDigest) {
|
|
11795
11840
|
throw new Error("PKCS#12 MAC could not be verified. Invalid password?");
|
|
11796
11841
|
}
|
|
11842
|
+
} else if (Array.isArray(obj.value) && obj.value.length > 2) {
|
|
11843
|
+
throw new Error("Invalid PKCS#12. macData field present but MAC was not validated.");
|
|
11797
11844
|
}
|
|
11798
11845
|
_decodeAuthenticatedSafe(pfx, data.value, strict, password);
|
|
11799
11846
|
return pfx;
|
|
@@ -11914,6 +11961,7 @@ function _decodeSafeContents(safeContents, strict, password) {
|
|
|
11914
11961
|
"Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?"
|
|
11915
11962
|
);
|
|
11916
11963
|
}
|
|
11964
|
+
/* fall through */
|
|
11917
11965
|
case pki$1.oids.keyBag:
|
|
11918
11966
|
try {
|
|
11919
11967
|
bag.key = pki$1.privateKeyFromAsn1(bagAsn1);
|
|
@@ -11922,6 +11970,7 @@ function _decodeSafeContents(safeContents, strict, password) {
|
|
|
11922
11970
|
bag.asn1 = bagAsn1;
|
|
11923
11971
|
}
|
|
11924
11972
|
continue;
|
|
11973
|
+
/* Nothing more to do. */
|
|
11925
11974
|
case pki$1.oids.certBag:
|
|
11926
11975
|
validator = certBagValidator;
|
|
11927
11976
|
decoder = function() {
|
|
@@ -17419,7 +17468,10 @@ class ForgeEncrypt {
|
|
|
17419
17468
|
}
|
|
17420
17469
|
try {
|
|
17421
17470
|
const encryptedBytes = lib.util.decode64(encryptedData);
|
|
17422
|
-
const decrypted = this.privateKey.decrypt(
|
|
17471
|
+
const decrypted = this.privateKey.decrypt(
|
|
17472
|
+
encryptedBytes,
|
|
17473
|
+
"RSAES-PKCS1-V1_5"
|
|
17474
|
+
);
|
|
17423
17475
|
return decrypted;
|
|
17424
17476
|
} catch (error) {
|
|
17425
17477
|
return false;
|
|
@@ -17484,12 +17536,16 @@ const OperatorPublicKeyValidator$1 = (publicKey) => {
|
|
|
17484
17536
|
let decodedPublicKey = "";
|
|
17485
17537
|
if (!publicKey.startsWith(begin)) {
|
|
17486
17538
|
if (publicKey.length < 98) {
|
|
17487
|
-
throw new Error(
|
|
17539
|
+
throw new Error(
|
|
17540
|
+
"The length of the operator public key must be at least 98 characters."
|
|
17541
|
+
);
|
|
17488
17542
|
}
|
|
17489
17543
|
try {
|
|
17490
17544
|
decodedPublicKey = lib.util.decode64(publicKey).trim();
|
|
17491
17545
|
} catch (error) {
|
|
17492
|
-
throw new Error(
|
|
17546
|
+
throw new Error(
|
|
17547
|
+
"Failed to decode the operator public key. Ensure it's correctly base64 encoded."
|
|
17548
|
+
);
|
|
17493
17549
|
}
|
|
17494
17550
|
if (!decodedPublicKey.startsWith(begin)) {
|
|
17495
17551
|
throw new Error(`Operator public key does not start with '${begin}'`);
|
|
@@ -17504,12 +17560,16 @@ const OperatorPublicKeyValidator$1 = (publicKey) => {
|
|
|
17504
17560
|
const content = decodedPublicKey.slice(begin.length, publicKey.length - end.length).trim();
|
|
17505
17561
|
decodedOperator = lib.util.decode64(content);
|
|
17506
17562
|
} catch {
|
|
17507
|
-
throw new Error(
|
|
17563
|
+
throw new Error(
|
|
17564
|
+
"Failed to decode the RSA public key. Ensure it's correctly base64 encoded."
|
|
17565
|
+
);
|
|
17508
17566
|
}
|
|
17509
17567
|
try {
|
|
17510
17568
|
encrypt.setPublicKey(decodedOperator);
|
|
17511
17569
|
} catch {
|
|
17512
|
-
throw new Error(
|
|
17570
|
+
throw new Error(
|
|
17571
|
+
"Invalid operator key format, make sure the operator exists in the network."
|
|
17572
|
+
);
|
|
17513
17573
|
}
|
|
17514
17574
|
} catch (error) {
|
|
17515
17575
|
throw new OperatorPublicKeyError(
|
|
@@ -17553,7 +17613,10 @@ class Threshold {
|
|
|
17553
17613
|
*/
|
|
17554
17614
|
async create(privateKeyString, operatorIds) {
|
|
17555
17615
|
if (!privateKeyString.startsWith("0x")) {
|
|
17556
|
-
throw new PrivateKeyFormatError(
|
|
17616
|
+
throw new PrivateKeyFormatError(
|
|
17617
|
+
privateKeyString,
|
|
17618
|
+
"The private key must be provided in the 0x format."
|
|
17619
|
+
);
|
|
17557
17620
|
}
|
|
17558
17621
|
operatorIds.map((operatorId) => {
|
|
17559
17622
|
if (!Number.isInteger(operatorId)) {
|
|
@@ -17574,7 +17637,9 @@ class Threshold {
|
|
|
17574
17637
|
if (!bls.deserializeHexStrToSecretKey) {
|
|
17575
17638
|
await bls.init(bls.BLS12_381);
|
|
17576
17639
|
}
|
|
17577
|
-
this.privateKey = bls.deserializeHexStrToSecretKey(
|
|
17640
|
+
this.privateKey = bls.deserializeHexStrToSecretKey(
|
|
17641
|
+
privateKeyString.replace("0x", "")
|
|
17642
|
+
);
|
|
17578
17643
|
this.publicKey = this.privateKey.getPublicKey();
|
|
17579
17644
|
msk.push(this.privateKey);
|
|
17580
17645
|
mpk.push(this.publicKey);
|
|
@@ -17608,7 +17673,7 @@ class Threshold {
|
|
|
17608
17673
|
}
|
|
17609
17674
|
}
|
|
17610
17675
|
var scrypt = { exports: {} };
|
|
17611
|
-
(function(module, exports) {
|
|
17676
|
+
(function(module, exports$1) {
|
|
17612
17677
|
(function(root) {
|
|
17613
17678
|
const MAX_VALUE = 2147483647;
|
|
17614
17679
|
function SHA256(m) {
|
|
@@ -17948,6 +18013,7 @@ var scrypt = { exports: {} };
|
|
|
17948
18013
|
arraycopy(B, Bi, XY, 0, Yi);
|
|
17949
18014
|
state = 1;
|
|
17950
18015
|
i1 = 0;
|
|
18016
|
+
// Fall through
|
|
17951
18017
|
case 1:
|
|
17952
18018
|
steps = N - i1;
|
|
17953
18019
|
if (steps > limit) {
|
|
@@ -17974,6 +18040,7 @@ var scrypt = { exports: {} };
|
|
|
17974
18040
|
}
|
|
17975
18041
|
i1 = 0;
|
|
17976
18042
|
state = 2;
|
|
18043
|
+
// Fall through
|
|
17977
18044
|
case 2:
|
|
17978
18045
|
steps = N - i1;
|
|
17979
18046
|
if (steps > limit) {
|
|
@@ -18070,11 +18137,17 @@ class EthereumKeyStore {
|
|
|
18070
18137
|
privateKey = "";
|
|
18071
18138
|
constructor(keyStoreData) {
|
|
18072
18139
|
if (!keyStoreData) {
|
|
18073
|
-
throw new KeyStoreDataFormatError(
|
|
18140
|
+
throw new KeyStoreDataFormatError(
|
|
18141
|
+
keyStoreData,
|
|
18142
|
+
"Key store data should be JSON or string"
|
|
18143
|
+
);
|
|
18074
18144
|
}
|
|
18075
18145
|
this.keyStoreData = typeof keyStoreData === "string" ? JSON.parse(keyStoreData) : keyStoreData;
|
|
18076
18146
|
if (!this.keyStoreData.version) {
|
|
18077
|
-
throw new KeyStoreInvalidError(
|
|
18147
|
+
throw new KeyStoreInvalidError(
|
|
18148
|
+
this.keyStoreData,
|
|
18149
|
+
"Invalid keystore file"
|
|
18150
|
+
);
|
|
18078
18151
|
}
|
|
18079
18152
|
}
|
|
18080
18153
|
// getPublicKey(): string {
|
|
@@ -18114,15 +18187,32 @@ class EthereumKeyStore {
|
|
|
18114
18187
|
const dklen = kdfparams.dklen;
|
|
18115
18188
|
let derivedKey;
|
|
18116
18189
|
if (json.crypto.kdf === "scrypt") {
|
|
18117
|
-
derivedKey = scryptExports.syncScrypt(
|
|
18190
|
+
derivedKey = scryptExports.syncScrypt(
|
|
18191
|
+
Buffer.from(password),
|
|
18192
|
+
salt,
|
|
18193
|
+
kdfparams.n,
|
|
18194
|
+
kdfparams.r,
|
|
18195
|
+
kdfparams.p,
|
|
18196
|
+
dklen
|
|
18197
|
+
);
|
|
18118
18198
|
} else if (json.crypto.kdf === "pbkdf2") {
|
|
18119
|
-
if (kdfparams.prf !== "hmac-sha256")
|
|
18120
|
-
|
|
18199
|
+
if (kdfparams.prf !== "hmac-sha256")
|
|
18200
|
+
throw new EthereumWalletError("Unsupported PBKDF2 params");
|
|
18201
|
+
derivedKey = crypto$1.pbkdf2Sync(
|
|
18202
|
+
Buffer.from(password),
|
|
18203
|
+
salt,
|
|
18204
|
+
kdfparams.c,
|
|
18205
|
+
dklen,
|
|
18206
|
+
"sha256"
|
|
18207
|
+
);
|
|
18121
18208
|
} else {
|
|
18122
18209
|
throw new EthereumWalletError("Unsupported kdf type");
|
|
18123
18210
|
}
|
|
18124
18211
|
const ciphertext = Buffer.from(json.crypto.ciphertext, "hex");
|
|
18125
|
-
const macCheck = Buffer.concat([
|
|
18212
|
+
const macCheck = Buffer.concat([
|
|
18213
|
+
Buffer.from(derivedKey.slice(16, 32)),
|
|
18214
|
+
ciphertext
|
|
18215
|
+
]);
|
|
18126
18216
|
const mac = keccak256(toHex(macCheck)).replace(/^0x/, "");
|
|
18127
18217
|
if (mac !== json.crypto.mac.toLowerCase()) {
|
|
18128
18218
|
throw new EthereumWalletError("Invalid password");
|
|
@@ -18151,12 +18241,21 @@ class EthereumKeyStore {
|
|
|
18151
18241
|
if (prf !== "hmac-sha256") {
|
|
18152
18242
|
throw new EthereumWalletError("Unsupported parameters to PBKDF2");
|
|
18153
18243
|
}
|
|
18154
|
-
derivedKey = crypto$1.pbkdf2Sync(
|
|
18244
|
+
derivedKey = crypto$1.pbkdf2Sync(
|
|
18245
|
+
Buffer.from(password),
|
|
18246
|
+
salt,
|
|
18247
|
+
c,
|
|
18248
|
+
dklen,
|
|
18249
|
+
"sha256"
|
|
18250
|
+
);
|
|
18155
18251
|
} else {
|
|
18156
18252
|
throw new EthereumWalletError("Unsupported key derivation scheme");
|
|
18157
18253
|
}
|
|
18158
18254
|
const ciphertext = Buffer.from(cipher.message, "hex");
|
|
18159
|
-
const checksumBuffer = Buffer.concat([
|
|
18255
|
+
const checksumBuffer = Buffer.concat([
|
|
18256
|
+
Buffer.from(derivedKey.slice(16, 32)),
|
|
18257
|
+
ciphertext
|
|
18258
|
+
]);
|
|
18160
18259
|
const hashFn = checksum.function === "sha256" ? sha256$1 : keccak256;
|
|
18161
18260
|
const calculatedMac = hashFn(toHex(checksumBuffer));
|
|
18162
18261
|
if (calculatedMac.replace(/^0x/, "") !== checksum.message.toLowerCase()) {
|
|
@@ -18191,7 +18290,9 @@ class Encryption {
|
|
|
18191
18290
|
OperatorPublicKeyValidator$1(operatorPublicKey);
|
|
18192
18291
|
const forgeEncrypt = new ForgeEncrypt();
|
|
18193
18292
|
forgeEncrypt.setPublicKey(operatorPublicKey);
|
|
18194
|
-
const encryptedPrivateKey = forgeEncrypt.encrypt(
|
|
18293
|
+
const encryptedPrivateKey = forgeEncrypt.encrypt(
|
|
18294
|
+
this.shares[idx].privateKey
|
|
18295
|
+
);
|
|
18195
18296
|
if (!encryptedPrivateKey) {
|
|
18196
18297
|
throw new OperatorPublicKeyError(
|
|
18197
18298
|
{
|
|
@@ -18282,10 +18383,18 @@ const operatorSortedList = (operators) => {
|
|
|
18282
18383
|
const validatedOperators = operators.map((operator) => {
|
|
18283
18384
|
const id = parseInt(`${operator.id}`, 10);
|
|
18284
18385
|
if (isNaN(id)) {
|
|
18285
|
-
throw new OperatorsCountsMismatchError(
|
|
18386
|
+
throw new OperatorsCountsMismatchError(
|
|
18387
|
+
ids,
|
|
18388
|
+
operatorKeys,
|
|
18389
|
+
`Invalid operator ID: ${operator.id}`
|
|
18390
|
+
);
|
|
18286
18391
|
}
|
|
18287
18392
|
if (!operator.operatorKey) {
|
|
18288
|
-
throw new OperatorsCountsMismatchError(
|
|
18393
|
+
throw new OperatorsCountsMismatchError(
|
|
18394
|
+
ids,
|
|
18395
|
+
operatorKeys,
|
|
18396
|
+
`Operator key is missing for operator ID: ${id}`
|
|
18397
|
+
);
|
|
18289
18398
|
}
|
|
18290
18399
|
return { ...operator, id };
|
|
18291
18400
|
});
|
|
@@ -18307,14 +18416,18 @@ class SingleSharesSignatureInvalid extends SSVKeysException {
|
|
|
18307
18416
|
}
|
|
18308
18417
|
}
|
|
18309
18418
|
const hexArrayToBytes = (hexArr) => {
|
|
18310
|
-
const uint8Array = new Uint8Array(
|
|
18419
|
+
const uint8Array = new Uint8Array(
|
|
18420
|
+
hexArr.flatMap((hex) => Array.from(toBytes(hex)))
|
|
18421
|
+
);
|
|
18311
18422
|
return Buffer.from(uint8Array);
|
|
18312
18423
|
};
|
|
18313
18424
|
const buildSignature = async (dataToSign, privateKeyHex) => {
|
|
18314
18425
|
if (!bls.deserializeHexStrToSecretKey) {
|
|
18315
18426
|
await bls.init(bls.BLS12_381);
|
|
18316
18427
|
}
|
|
18317
|
-
const privateKey = bls.deserializeHexStrToSecretKey(
|
|
18428
|
+
const privateKey = bls.deserializeHexStrToSecretKey(
|
|
18429
|
+
privateKeyHex.replace("0x", "")
|
|
18430
|
+
);
|
|
18318
18431
|
const messageHash = keccak256(toBytes(dataToSign));
|
|
18319
18432
|
const messageBytes = fromHex(messageHash, "bytes");
|
|
18320
18433
|
const signature = privateKey.sign(messageBytes);
|
|
@@ -18322,12 +18435,19 @@ const buildSignature = async (dataToSign, privateKeyHex) => {
|
|
|
18322
18435
|
return `0x${signatureHex}`;
|
|
18323
18436
|
};
|
|
18324
18437
|
const validateSignature = async (signedData, signatureHex, publicKey) => {
|
|
18325
|
-
const blsPublicKey = bls.deserializeHexStrToPublicKey(
|
|
18326
|
-
|
|
18438
|
+
const blsPublicKey = bls.deserializeHexStrToPublicKey(
|
|
18439
|
+
publicKey.replace("0x", "")
|
|
18440
|
+
);
|
|
18441
|
+
const signature = bls.deserializeHexStrToSignature(
|
|
18442
|
+
signatureHex.replace("0x", "")
|
|
18443
|
+
);
|
|
18327
18444
|
const messageHashHex = keccak256(toBytes(signedData));
|
|
18328
18445
|
const messageHashBytes = fromHex(messageHashHex, "bytes");
|
|
18329
18446
|
if (!blsPublicKey.verify(signature, messageHashBytes)) {
|
|
18330
|
-
throw new SingleSharesSignatureInvalid(
|
|
18447
|
+
throw new SingleSharesSignatureInvalid(
|
|
18448
|
+
signatureHex,
|
|
18449
|
+
"Single shares signature is invalid"
|
|
18450
|
+
);
|
|
18331
18451
|
}
|
|
18332
18452
|
};
|
|
18333
18453
|
const privateToPublicKey = async (privateKey) => {
|
|
@@ -18349,11 +18469,17 @@ let OpeatorsListValidatorConstraint = class {
|
|
|
18349
18469
|
const operatorIds = /* @__PURE__ */ new Set(), operatorPublicKeys = /* @__PURE__ */ new Set();
|
|
18350
18470
|
for (const operator of operatorsList || []) {
|
|
18351
18471
|
if (operatorIds.has(operator.id)) {
|
|
18352
|
-
throw new DuplicatedOperatorIdError(
|
|
18472
|
+
throw new DuplicatedOperatorIdError(
|
|
18473
|
+
operator,
|
|
18474
|
+
`The operator ID '${operator.id}' is duplicated in the list`
|
|
18475
|
+
);
|
|
18353
18476
|
}
|
|
18354
18477
|
operatorIds.add(operator.id);
|
|
18355
18478
|
if (operatorPublicKeys.has(operator.operatorKey)) {
|
|
18356
|
-
throw new DuplicatedOperatorPublicKeyError(
|
|
18479
|
+
throw new DuplicatedOperatorPublicKeyError(
|
|
18480
|
+
operator,
|
|
18481
|
+
`The public key for operator ID ${operator.id} is duplicated in the list`
|
|
18482
|
+
);
|
|
18357
18483
|
}
|
|
18358
18484
|
operatorPublicKeys.add(operator.operatorKey);
|
|
18359
18485
|
}
|
|
@@ -18391,10 +18517,15 @@ let PublicKeyValidatorConstraint = class {
|
|
|
18391
18517
|
if (typeof value === "string") {
|
|
18392
18518
|
bls.deserializeHexStrToPublicKey(value.replace("0x", ""));
|
|
18393
18519
|
} else {
|
|
18394
|
-
value.forEach(
|
|
18520
|
+
value.forEach(
|
|
18521
|
+
(item) => bls.deserializeHexStrToPublicKey(item.replace("0x", ""))
|
|
18522
|
+
);
|
|
18395
18523
|
}
|
|
18396
18524
|
} catch (e) {
|
|
18397
|
-
throw new BLSDeserializeError(
|
|
18525
|
+
throw new BLSDeserializeError(
|
|
18526
|
+
value,
|
|
18527
|
+
"Failed to BLS deserialize validator public key"
|
|
18528
|
+
);
|
|
18398
18529
|
}
|
|
18399
18530
|
return true;
|
|
18400
18531
|
}
|
|
@@ -18434,7 +18565,10 @@ let OwnerAddressValidatorConstraint = class {
|
|
|
18434
18565
|
try {
|
|
18435
18566
|
getAddress(value);
|
|
18436
18567
|
} catch {
|
|
18437
|
-
throw new OwnerAddressFormatError(
|
|
18568
|
+
throw new OwnerAddressFormatError(
|
|
18569
|
+
value,
|
|
18570
|
+
"Owner address is not a valid Ethereum address"
|
|
18571
|
+
);
|
|
18438
18572
|
}
|
|
18439
18573
|
return true;
|
|
18440
18574
|
}
|
|
@@ -18467,7 +18601,10 @@ var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
|
18467
18601
|
let OwnerNonceValidatorConstraint = class {
|
|
18468
18602
|
validate(value) {
|
|
18469
18603
|
if (!Number.isInteger(value) || value < 0) {
|
|
18470
|
-
throw new OwnerNonceFormatError(
|
|
18604
|
+
throw new OwnerNonceFormatError(
|
|
18605
|
+
value,
|
|
18606
|
+
"Owner nonce is not positive integer"
|
|
18607
|
+
);
|
|
18471
18608
|
}
|
|
18472
18609
|
return true;
|
|
18473
18610
|
}
|
|
@@ -18504,12 +18641,20 @@ let MatchLengthValidatorConstraint = class {
|
|
|
18504
18641
|
if (!Array.isArray(value)) {
|
|
18505
18642
|
Object.values(value).forEach((arr) => {
|
|
18506
18643
|
if (relatedLength !== arr.length) {
|
|
18507
|
-
throw new OperatorsCountsMismatchError(
|
|
18644
|
+
throw new OperatorsCountsMismatchError(
|
|
18645
|
+
args.object[relatedPropertyName],
|
|
18646
|
+
value,
|
|
18647
|
+
customError.message
|
|
18648
|
+
);
|
|
18508
18649
|
}
|
|
18509
18650
|
});
|
|
18510
18651
|
} else {
|
|
18511
18652
|
if (relatedLength !== value.length) {
|
|
18512
|
-
throw new OperatorsCountsMismatchError(
|
|
18653
|
+
throw new OperatorsCountsMismatchError(
|
|
18654
|
+
args.object[relatedPropertyName],
|
|
18655
|
+
value,
|
|
18656
|
+
customError.message
|
|
18657
|
+
);
|
|
18513
18658
|
}
|
|
18514
18659
|
}
|
|
18515
18660
|
return true;
|
|
@@ -18689,7 +18834,10 @@ const _KeySharesItem = class _KeySharesItem2 {
|
|
|
18689
18834
|
async buildPayload(metaData, toSignatureData) {
|
|
18690
18835
|
const { ownerAddress, ownerNonce, privateKey } = toSignatureData;
|
|
18691
18836
|
if (!Number.isInteger(ownerNonce) || ownerNonce < 0) {
|
|
18692
|
-
throw new OwnerNonceFormatError(
|
|
18837
|
+
throw new OwnerNonceFormatError(
|
|
18838
|
+
ownerNonce,
|
|
18839
|
+
"Owner nonce is not positive integer"
|
|
18840
|
+
);
|
|
18693
18841
|
}
|
|
18694
18842
|
let address;
|
|
18695
18843
|
try {
|
|
@@ -18702,10 +18850,15 @@ const _KeySharesItem = class _KeySharesItem2 {
|
|
|
18702
18850
|
}
|
|
18703
18851
|
const payload = this.payload.build({
|
|
18704
18852
|
publicKey: metaData.publicKey,
|
|
18705
|
-
operatorIds: operatorSortedList(metaData.operators).map(
|
|
18853
|
+
operatorIds: operatorSortedList(metaData.operators).map(
|
|
18854
|
+
(operator) => operator.id
|
|
18855
|
+
),
|
|
18706
18856
|
encryptedShares: metaData.encryptedShares
|
|
18707
18857
|
});
|
|
18708
|
-
const signature = await buildSignature(
|
|
18858
|
+
const signature = await buildSignature(
|
|
18859
|
+
`${address}:${ownerNonce}`,
|
|
18860
|
+
privateKey
|
|
18861
|
+
);
|
|
18709
18862
|
const signSharesBytes = hexArrayToBytes([signature, payload.sharesData]);
|
|
18710
18863
|
payload.sharesData = `0x${signSharesBytes.toString("hex")}`;
|
|
18711
18864
|
await this.validateSingleShares(payload.sharesData, {
|
|
@@ -18718,11 +18871,18 @@ const _KeySharesItem = class _KeySharesItem2 {
|
|
|
18718
18871
|
async validateSingleShares(shares, fromSignatureData) {
|
|
18719
18872
|
const { ownerAddress, ownerNonce, publicKey } = fromSignatureData;
|
|
18720
18873
|
if (!Number.isInteger(ownerNonce) || ownerNonce < 0) {
|
|
18721
|
-
throw new OwnerNonceFormatError(
|
|
18874
|
+
throw new OwnerNonceFormatError(
|
|
18875
|
+
ownerNonce,
|
|
18876
|
+
"Owner nonce is not positive integer"
|
|
18877
|
+
);
|
|
18722
18878
|
}
|
|
18723
18879
|
const address = getAddress(ownerAddress);
|
|
18724
18880
|
const signaturePt = shares.replace("0x", "").substring(0, SIGNATURE_LENGTH);
|
|
18725
|
-
await validateSignature(
|
|
18881
|
+
await validateSignature(
|
|
18882
|
+
`${address}:${ownerNonce}`,
|
|
18883
|
+
`0x${signaturePt}`,
|
|
18884
|
+
publicKey
|
|
18885
|
+
);
|
|
18726
18886
|
}
|
|
18727
18887
|
/**
|
|
18728
18888
|
* Build shares from bytes string and operators list length
|
|
@@ -18739,7 +18899,9 @@ const _KeySharesItem = class _KeySharesItem2 {
|
|
|
18739
18899
|
const sharesPt = bytes.slice(2 + SIGNATURE_LENGTH);
|
|
18740
18900
|
const pkSplit = sharesPt.substring(0, operatorCount * PUBLIC_KEY_LENGTH);
|
|
18741
18901
|
const pkBytes = toBytes("0x" + pkSplit);
|
|
18742
|
-
const sharesPublicKeys = this.splitArray(operatorCount, pkBytes).map(
|
|
18902
|
+
const sharesPublicKeys = this.splitArray(operatorCount, pkBytes).map(
|
|
18903
|
+
(item) => toHex(item)
|
|
18904
|
+
);
|
|
18743
18905
|
const eSplit = bytes.substring(operatorCount * PUBLIC_KEY_LENGTH);
|
|
18744
18906
|
const eBytes = toBytes("0x" + eSplit);
|
|
18745
18907
|
const encryptedKeys = this.splitArray(operatorCount, eBytes).map(
|
|
@@ -18841,7 +19003,10 @@ class SSVKeys {
|
|
|
18841
19003
|
*/
|
|
18842
19004
|
async createThreshold(privateKey, operators) {
|
|
18843
19005
|
const sortedOperators = operatorSortedList(operators);
|
|
18844
|
-
this.threshold = await new Threshold().create(
|
|
19006
|
+
this.threshold = await new Threshold().create(
|
|
19007
|
+
privateKey,
|
|
19008
|
+
sortedOperators.map((item) => item.id)
|
|
19009
|
+
);
|
|
18845
19010
|
return this.threshold;
|
|
18846
19011
|
}
|
|
18847
19012
|
/**
|
|
@@ -18851,7 +19016,9 @@ class SSVKeys {
|
|
|
18851
19016
|
*/
|
|
18852
19017
|
async encryptShares(operators, shares) {
|
|
18853
19018
|
const sortedOperators = operatorSortedList(operators);
|
|
18854
|
-
const decodedOperatorPublicKeys = sortedOperators.map(
|
|
19019
|
+
const decodedOperatorPublicKeys = sortedOperators.map(
|
|
19020
|
+
(item) => Buffer.from(item.operatorKey, "base64").toString()
|
|
19021
|
+
);
|
|
18855
19022
|
return new Encryption(decodedOperatorPublicKeys, shares).encrypt();
|
|
18856
19023
|
}
|
|
18857
19024
|
/**
|
|
@@ -18887,7 +19054,10 @@ class SSVKeys {
|
|
|
18887
19054
|
let signatureErrorMessage = "";
|
|
18888
19055
|
let errorMessage = "";
|
|
18889
19056
|
try {
|
|
18890
|
-
const restoredShares = keySharesItem.buildSharesFromBytes(
|
|
19057
|
+
const restoredShares = keySharesItem.buildSharesFromBytes(
|
|
19058
|
+
shares,
|
|
19059
|
+
operatorsCount
|
|
19060
|
+
);
|
|
18891
19061
|
const { sharesPublicKeys, encryptedKeys } = restoredShares;
|
|
18892
19062
|
restoredSharesPublicKeys = sharesPublicKeys;
|
|
18893
19063
|
restoredSharesEncryptedKeys = encryptedKeys;
|
|
@@ -18897,7 +19067,11 @@ class SSVKeys {
|
|
|
18897
19067
|
errorMessage = "Can not extract shares from bytes";
|
|
18898
19068
|
}
|
|
18899
19069
|
if (!sharesError && !errorMessage) {
|
|
18900
|
-
const signatureData = {
|
|
19070
|
+
const signatureData = {
|
|
19071
|
+
ownerNonce,
|
|
19072
|
+
publicKey: validatorPublicKey,
|
|
19073
|
+
ownerAddress
|
|
19074
|
+
};
|
|
18901
19075
|
try {
|
|
18902
19076
|
await keySharesItem.validateSingleShares(shares, signatureData);
|
|
18903
19077
|
} catch (e) {
|
|
@@ -18920,12 +19094,14 @@ class SSVKeys {
|
|
|
18920
19094
|
isSharesValid: !sharesError,
|
|
18921
19095
|
sharesPublicKeys: restoredSharesPublicKeys,
|
|
18922
19096
|
encryptedKeys: restoredSharesEncryptedKeys,
|
|
18923
|
-
memo: !!sharesError || !!signatureError ? [
|
|
18924
|
-
|
|
18925
|
-
|
|
18926
|
-
|
|
18927
|
-
|
|
18928
|
-
|
|
19097
|
+
memo: !!sharesError || !!signatureError ? [
|
|
19098
|
+
{
|
|
19099
|
+
message: errorMessage,
|
|
19100
|
+
error: sharesError || signatureError,
|
|
19101
|
+
data: `${sharesErrorMessage}${signatureErrorMessage ? ". " + signatureErrorMessage : ""}`,
|
|
19102
|
+
blockNumber
|
|
19103
|
+
}
|
|
19104
|
+
] : []
|
|
18929
19105
|
};
|
|
18930
19106
|
}
|
|
18931
19107
|
}
|
|
@@ -18944,19 +19120,19 @@ var constants = {
|
|
|
18944
19120
|
MAX_SAFE_INTEGER: MAX_SAFE_INTEGER$1
|
|
18945
19121
|
};
|
|
18946
19122
|
var re$1 = { exports: {} };
|
|
18947
|
-
(function(module, exports) {
|
|
19123
|
+
(function(module, exports$1) {
|
|
18948
19124
|
const {
|
|
18949
19125
|
MAX_SAFE_COMPONENT_LENGTH: MAX_SAFE_COMPONENT_LENGTH2,
|
|
18950
19126
|
MAX_SAFE_BUILD_LENGTH: MAX_SAFE_BUILD_LENGTH2,
|
|
18951
19127
|
MAX_LENGTH: MAX_LENGTH2
|
|
18952
19128
|
} = constants;
|
|
18953
19129
|
const debug2 = debug_1;
|
|
18954
|
-
exports = module.exports = {};
|
|
18955
|
-
const re2 = exports.re = [];
|
|
18956
|
-
const safeRe = exports.safeRe = [];
|
|
18957
|
-
const src = exports.src = [];
|
|
18958
|
-
const safeSrc = exports.safeSrc = [];
|
|
18959
|
-
const t2 = exports.t = {};
|
|
19130
|
+
exports$1 = module.exports = {};
|
|
19131
|
+
const re2 = exports$1.re = [];
|
|
19132
|
+
const safeRe = exports$1.safeRe = [];
|
|
19133
|
+
const src = exports$1.src = [];
|
|
19134
|
+
const safeSrc = exports$1.safeSrc = [];
|
|
19135
|
+
const t2 = exports$1.t = {};
|
|
18960
19136
|
let R = 0;
|
|
18961
19137
|
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
18962
19138
|
const safeRegexReplacements = [
|
|
@@ -19009,18 +19185,18 @@ var re$1 = { exports: {} };
|
|
|
19009
19185
|
createToken("COERCERTLFULL", src[t2.COERCEFULL], true);
|
|
19010
19186
|
createToken("LONETILDE", "(?:~>?)");
|
|
19011
19187
|
createToken("TILDETRIM", `(\\s*)${src[t2.LONETILDE]}\\s+`, true);
|
|
19012
|
-
exports.tildeTrimReplace = "$1~";
|
|
19188
|
+
exports$1.tildeTrimReplace = "$1~";
|
|
19013
19189
|
createToken("TILDE", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAIN]}$`);
|
|
19014
19190
|
createToken("TILDELOOSE", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAINLOOSE]}$`);
|
|
19015
19191
|
createToken("LONECARET", "(?:\\^)");
|
|
19016
19192
|
createToken("CARETTRIM", `(\\s*)${src[t2.LONECARET]}\\s+`, true);
|
|
19017
|
-
exports.caretTrimReplace = "$1^";
|
|
19193
|
+
exports$1.caretTrimReplace = "$1^";
|
|
19018
19194
|
createToken("CARET", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAIN]}$`);
|
|
19019
19195
|
createToken("CARETLOOSE", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAINLOOSE]}$`);
|
|
19020
19196
|
createToken("COMPARATORLOOSE", `^${src[t2.GTLT]}\\s*(${src[t2.LOOSEPLAIN]})$|^$`);
|
|
19021
19197
|
createToken("COMPARATOR", `^${src[t2.GTLT]}\\s*(${src[t2.FULLPLAIN]})$|^$`);
|
|
19022
19198
|
createToken("COMPARATORTRIM", `(\\s*)${src[t2.GTLT]}\\s*(${src[t2.LOOSEPLAIN]}|${src[t2.XRANGEPLAIN]})`, true);
|
|
19023
|
-
exports.comparatorTrimReplace = "$1$2$3";
|
|
19199
|
+
exports$1.comparatorTrimReplace = "$1$2$3";
|
|
19024
19200
|
createToken("HYPHENRANGE", `^\\s*(${src[t2.XRANGEPLAIN]})\\s+-\\s+(${src[t2.XRANGEPLAIN]})\\s*$`);
|
|
19025
19201
|
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t2.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t2.XRANGEPLAINLOOSE]})\\s*$`);
|
|
19026
19202
|
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
@@ -19225,6 +19401,8 @@ let SemVer$2 = class SemVer {
|
|
|
19225
19401
|
this.inc("patch", identifier, identifierBase);
|
|
19226
19402
|
this.inc("pre", identifier, identifierBase);
|
|
19227
19403
|
break;
|
|
19404
|
+
// If the input is a non-prerelease version, this acts the same as
|
|
19405
|
+
// prepatch.
|
|
19228
19406
|
case "prerelease":
|
|
19229
19407
|
if (this.prerelease.length === 0) {
|
|
19230
19408
|
this.inc("patch", identifier, identifierBase);
|
|
@@ -19258,6 +19436,8 @@ let SemVer$2 = class SemVer {
|
|
|
19258
19436
|
}
|
|
19259
19437
|
this.prerelease = [];
|
|
19260
19438
|
break;
|
|
19439
|
+
// This probably shouldn't be used publicly.
|
|
19440
|
+
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
19261
19441
|
case "pre": {
|
|
19262
19442
|
const base = Number(identifierBase) ? 1 : 0;
|
|
19263
19443
|
if (this.prerelease.length === 0) {
|
|
@@ -19414,10 +19594,10 @@ __decorateClass([
|
|
|
19414
19594
|
], _KeyShares.prototype, "shares");
|
|
19415
19595
|
let KeyShares = _KeyShares;
|
|
19416
19596
|
export {
|
|
19417
|
-
|
|
19597
|
+
KeyShares as K,
|
|
19418
19598
|
OperatorPublicKeyError as O,
|
|
19419
19599
|
SSVKeys as S,
|
|
19420
|
-
|
|
19421
|
-
|
|
19422
|
-
|
|
19600
|
+
KeySharesItem as a,
|
|
19601
|
+
OperatorsCountsMismatchError as b,
|
|
19602
|
+
SSVKeysException as c
|
|
19423
19603
|
};
|