@0xpolygonid/js-sdk 1.17.4 → 1.17.6
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/dist/browser/esm/index.js +33 -40
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/umd/index.js +33 -40
- package/dist/browser/umd/index.js.map +1 -1
- package/dist/node/cjs/circuits/models.js +23 -39
- package/dist/node/cjs/iden3comm/handlers/common.js +1 -1
- package/dist/node/cjs/identity/identity-wallet.js +1 -0
- package/dist/node/cjs/utils/object.js +7 -0
- package/dist/node/cjs/verifiable/constants.js +1 -0
- package/dist/node/esm/circuits/models.js +23 -39
- package/dist/node/esm/iden3comm/handlers/common.js +1 -1
- package/dist/node/esm/identity/identity-wallet.js +1 -0
- package/dist/node/esm/utils/object.js +7 -0
- package/dist/node/esm/verifiable/constants.js +1 -0
- package/dist/types/credentials/models.d.ts +2 -3
- package/dist/types/iden3comm/handlers/credential-proposal.d.ts +3 -3
- package/dist/types/iden3comm/types/packer.d.ts +10 -0
- package/dist/types/iden3comm/types/protocol/auth.d.ts +4 -4
- package/dist/types/iden3comm/types/protocol/credentials.d.ts +2 -2
- package/dist/types/iden3comm/types/protocol/payment.d.ts +2 -2
- package/dist/types/iden3comm/types/protocol/proposal-request.d.ts +3 -3
- package/dist/types/proof/common.d.ts +3 -3
- package/dist/types/utils/object.d.ts +2 -5
- package/dist/types/verifiable/constants.d.ts +2 -1
- package/dist/types/verifiable/credential.d.ts +2 -3
- package/dist/types/verifiable/presentation.d.ts +2 -2
- package/dist/types/verifiable/proof.d.ts +2 -4
- package/package.json +1 -1
|
@@ -541,6 +541,13 @@ function bytesToHex$3(b) {
|
|
|
541
541
|
return Hex.encodeString(b);
|
|
542
542
|
}
|
|
543
543
|
|
|
544
|
+
/**
|
|
545
|
+
* Merges two objects together, prioritizing the properties of the second object.
|
|
546
|
+
* If a property exists in both objects, the value from the second object will be used.
|
|
547
|
+
* @param credSubject - The first object to merge.
|
|
548
|
+
* @param otherCredSubject - The second object to merge.
|
|
549
|
+
* @returns A new object with the merged properties.
|
|
550
|
+
*/
|
|
544
551
|
function mergeObjects(credSubject, otherCredSubject) {
|
|
545
552
|
let result = {};
|
|
546
553
|
const credSubjectKeys = Object.keys(credSubject);
|
|
@@ -7561,6 +7568,7 @@ var PaymentType;
|
|
|
7561
7568
|
var SupportedCurrencies;
|
|
7562
7569
|
(function (SupportedCurrencies) {
|
|
7563
7570
|
SupportedCurrencies["ETH"] = "ETH";
|
|
7571
|
+
SupportedCurrencies["MATIC"] = "MATIC";
|
|
7564
7572
|
})(SupportedCurrencies || (SupportedCurrencies = {}));
|
|
7565
7573
|
/**
|
|
7566
7574
|
* DisplayMethodType type for display method
|
|
@@ -49263,45 +49271,29 @@ class Query {
|
|
|
49263
49271
|
throw new Error(CircuitError.EmptyQueryValue);
|
|
49264
49272
|
}
|
|
49265
49273
|
validateValueArraySize(maxArrSize) {
|
|
49266
|
-
|
|
49267
|
-
|
|
49268
|
-
|
|
49269
|
-
|
|
49270
|
-
|
|
49271
|
-
|
|
49272
|
-
|
|
49273
|
-
|
|
49274
|
-
|
|
49275
|
-
|
|
49276
|
-
|
|
49277
|
-
|
|
49278
|
-
|
|
49279
|
-
|
|
49280
|
-
|
|
49281
|
-
|
|
49282
|
-
|
|
49283
|
-
|
|
49284
|
-
|
|
49285
|
-
|
|
49286
|
-
|
|
49287
|
-
|
|
49288
|
-
|
|
49289
|
-
case 2: {
|
|
49290
|
-
const twoArrSizeOps = [Operators.BETWEEN, Operators.NONBETWEEN];
|
|
49291
|
-
if (!twoArrSizeOps.includes(this.operator)) {
|
|
49292
|
-
throw new Error(CircuitError.InvalidValuesArrSize);
|
|
49293
|
-
}
|
|
49294
|
-
return;
|
|
49295
|
-
}
|
|
49296
|
-
default: {
|
|
49297
|
-
const maxArrSizeOps = [Operators.IN, Operators.NIN];
|
|
49298
|
-
if (!maxArrSizeOps.includes(this.operator)) {
|
|
49299
|
-
throw new Error(CircuitError.InvalidOperationType);
|
|
49300
|
-
}
|
|
49301
|
-
if (!this.values.length || this.values.length > maxArrSize) {
|
|
49302
|
-
throw new Error(CircuitError.InvalidValuesArrSize);
|
|
49303
|
-
}
|
|
49304
|
-
}
|
|
49274
|
+
if ([Operators.NOOP, Operators.SD, Operators.NULLIFY].includes(this.operator) &&
|
|
49275
|
+
this.values.length !== 0) {
|
|
49276
|
+
throw new Error(CircuitError.InvalidValuesArrSize);
|
|
49277
|
+
}
|
|
49278
|
+
else if ([
|
|
49279
|
+
Operators.EQ,
|
|
49280
|
+
Operators.LT,
|
|
49281
|
+
Operators.GT,
|
|
49282
|
+
Operators.NE,
|
|
49283
|
+
Operators.LTE,
|
|
49284
|
+
Operators.GTE,
|
|
49285
|
+
Operators.EXISTS
|
|
49286
|
+
].includes(this.operator) &&
|
|
49287
|
+
this.values.length !== 1) {
|
|
49288
|
+
throw new Error(CircuitError.InvalidValuesArrSize);
|
|
49289
|
+
}
|
|
49290
|
+
else if ([Operators.BETWEEN, Operators.NONBETWEEN].includes(this.operator) &&
|
|
49291
|
+
this.values.length !== 2) {
|
|
49292
|
+
throw new Error(CircuitError.InvalidValuesArrSize);
|
|
49293
|
+
}
|
|
49294
|
+
else if ([Operators.IN, Operators.NIN].includes(this.operator) &&
|
|
49295
|
+
this.values.length > maxArrSize) {
|
|
49296
|
+
throw new Error(CircuitError.InvalidValuesArrSize);
|
|
49305
49297
|
}
|
|
49306
49298
|
}
|
|
49307
49299
|
}
|
|
@@ -56159,7 +56151,7 @@ var CredentialOfferStatus;
|
|
|
56159
56151
|
* Returns a Map where the key is the groupId and the value is an object containing the query and linkNonce.
|
|
56160
56152
|
*
|
|
56161
56153
|
* @param requestScope - An array of ZeroKnowledgeProofRequest objects.
|
|
56162
|
-
* @returns A Map<number, { query:
|
|
56154
|
+
* @returns A Map<number, { query: JsonDocumentObject; linkNonce: number }> representing the grouped queries.
|
|
56163
56155
|
*/
|
|
56164
56156
|
const getGroupedQueries = (requestScope) => requestScope.reduce((acc, proofReq) => {
|
|
56165
56157
|
const groupId = proofReq.query.groupId;
|
|
@@ -59434,6 +59426,7 @@ class IdentityWallet {
|
|
|
59434
59426
|
break;
|
|
59435
59427
|
}
|
|
59436
59428
|
catch (err) {
|
|
59429
|
+
// eslint-disable-next-line no-console
|
|
59437
59430
|
console.warn(`Error while transiting state, retrying state transition, attempt: ${attempt}`, err);
|
|
59438
59431
|
}
|
|
59439
59432
|
} while (--attempt);
|