@0xpolygonid/js-sdk 1.17.3 → 1.17.5
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 +14 -14
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/umd/index.js +14 -14
- package/dist/browser/umd/index.js.map +1 -1
- package/dist/node/cjs/iden3comm/handlers/common.js +1 -1
- package/dist/node/cjs/identity/identity-wallet.js +1 -0
- package/dist/node/cjs/storage/blockchain/state.js +5 -13
- package/dist/node/cjs/utils/object.js +7 -0
- package/dist/node/esm/iden3comm/handlers/common.js +1 -1
- package/dist/node/esm/identity/identity-wallet.js +1 -0
- package/dist/node/esm/storage/blockchain/state.js +5 -13
- package/dist/node/esm/utils/object.js +7 -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 +4 -4
- package/dist/types/iden3comm/types/protocol/messages.d.ts +1 -1
- package/dist/types/iden3comm/types/protocol/proof.d.ts +2 -2
- package/dist/types/iden3comm/types/protocol/proposal-request.d.ts +6 -6
- package/dist/types/iden3comm/types/protocol/revocation.d.ts +2 -2
- package/dist/types/proof/common.d.ts +3 -3
- package/dist/types/utils/object.d.ts +2 -5
- 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 +3 -2
|
@@ -592,6 +592,13 @@ var PolygonIdSdk = (function (exports) {
|
|
|
592
592
|
return b$5.encodeString(b);
|
|
593
593
|
}
|
|
594
594
|
|
|
595
|
+
/**
|
|
596
|
+
* Merges two objects together, prioritizing the properties of the second object.
|
|
597
|
+
* If a property exists in both objects, the value from the second object will be used.
|
|
598
|
+
* @param credSubject - The first object to merge.
|
|
599
|
+
* @param otherCredSubject - The second object to merge.
|
|
600
|
+
* @returns A new object with the merged properties.
|
|
601
|
+
*/
|
|
595
602
|
function mergeObjects(credSubject, otherCredSubject) {
|
|
596
603
|
let result = {};
|
|
597
604
|
const credSubjectKeys = Object.keys(credSubject);
|
|
@@ -52443,12 +52450,6 @@ var PolygonIdSdk = (function (exports) {
|
|
|
52443
52450
|
}
|
|
52444
52451
|
getStateContractAndProviderForId(id) {
|
|
52445
52452
|
const idTyped = H$2.fromBigInt(id);
|
|
52446
|
-
if (!Array.isArray(this.ethConfig)) {
|
|
52447
|
-
return {
|
|
52448
|
-
stateContract: this.stateContract,
|
|
52449
|
-
provider: this.provider
|
|
52450
|
-
};
|
|
52451
|
-
}
|
|
52452
52453
|
const chainId = et$2(Z$2.blockchainFromId(idTyped), Z$2.networkIdFromId(idTyped));
|
|
52453
52454
|
const config = this.networkByChainId(chainId);
|
|
52454
52455
|
const provider = new JsonRpcProvider(config.url);
|
|
@@ -52456,14 +52457,12 @@ var PolygonIdSdk = (function (exports) {
|
|
|
52456
52457
|
return { stateContract, provider };
|
|
52457
52458
|
}
|
|
52458
52459
|
networkByChainId(chainId) {
|
|
52459
|
-
|
|
52460
|
-
|
|
52461
|
-
|
|
52462
|
-
|
|
52463
|
-
}
|
|
52464
|
-
return network;
|
|
52460
|
+
const config = Array.isArray(this.ethConfig) ? this.ethConfig : [this.ethConfig];
|
|
52461
|
+
const network = config.find((c) => c.chainId === chainId);
|
|
52462
|
+
if (!network) {
|
|
52463
|
+
throw new Error(`chainId "${chainId}" not supported`);
|
|
52465
52464
|
}
|
|
52466
|
-
return
|
|
52465
|
+
return network;
|
|
52467
52466
|
}
|
|
52468
52467
|
}
|
|
52469
52468
|
|
|
@@ -77075,7 +77074,7 @@ var PolygonIdSdk = (function (exports) {
|
|
|
77075
77074
|
* Returns a Map where the key is the groupId and the value is an object containing the query and linkNonce.
|
|
77076
77075
|
*
|
|
77077
77076
|
* @param requestScope - An array of ZeroKnowledgeProofRequest objects.
|
|
77078
|
-
* @returns A Map<number, { query:
|
|
77077
|
+
* @returns A Map<number, { query: JsonDocumentObject; linkNonce: number }> representing the grouped queries.
|
|
77079
77078
|
*/
|
|
77080
77079
|
const getGroupedQueries = (requestScope) => requestScope.reduce((acc, proofReq) => {
|
|
77081
77080
|
const groupId = proofReq.query.groupId;
|
|
@@ -80350,6 +80349,7 @@ var PolygonIdSdk = (function (exports) {
|
|
|
80350
80349
|
break;
|
|
80351
80350
|
}
|
|
80352
80351
|
catch (err) {
|
|
80352
|
+
// eslint-disable-next-line no-console
|
|
80353
80353
|
console.warn(`Error while transiting state, retrying state transition, attempt: ${attempt}`, err);
|
|
80354
80354
|
}
|
|
80355
80355
|
} while (--attempt);
|