@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
|
@@ -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);
|
|
@@ -52304,12 +52311,6 @@ class EthStateStorage {
|
|
|
52304
52311
|
}
|
|
52305
52312
|
getStateContractAndProviderForId(id) {
|
|
52306
52313
|
const idTyped = Id$1.fromBigInt(id);
|
|
52307
|
-
if (!Array.isArray(this.ethConfig)) {
|
|
52308
|
-
return {
|
|
52309
|
-
stateContract: this.stateContract,
|
|
52310
|
-
provider: this.provider
|
|
52311
|
-
};
|
|
52312
|
-
}
|
|
52313
52314
|
const chainId = getChainId(DID.blockchainFromId(idTyped), DID.networkIdFromId(idTyped));
|
|
52314
52315
|
const config = this.networkByChainId(chainId);
|
|
52315
52316
|
const provider = new JsonRpcProvider(config.url);
|
|
@@ -52317,14 +52318,12 @@ class EthStateStorage {
|
|
|
52317
52318
|
return { stateContract, provider };
|
|
52318
52319
|
}
|
|
52319
52320
|
networkByChainId(chainId) {
|
|
52320
|
-
|
|
52321
|
-
|
|
52322
|
-
|
|
52323
|
-
|
|
52324
|
-
}
|
|
52325
|
-
return network;
|
|
52321
|
+
const config = Array.isArray(this.ethConfig) ? this.ethConfig : [this.ethConfig];
|
|
52322
|
+
const network = config.find((c) => c.chainId === chainId);
|
|
52323
|
+
if (!network) {
|
|
52324
|
+
throw new Error(`chainId "${chainId}" not supported`);
|
|
52326
52325
|
}
|
|
52327
|
-
return
|
|
52326
|
+
return network;
|
|
52328
52327
|
}
|
|
52329
52328
|
}
|
|
52330
52329
|
|
|
@@ -56167,7 +56166,7 @@ var CredentialOfferStatus;
|
|
|
56167
56166
|
* Returns a Map where the key is the groupId and the value is an object containing the query and linkNonce.
|
|
56168
56167
|
*
|
|
56169
56168
|
* @param requestScope - An array of ZeroKnowledgeProofRequest objects.
|
|
56170
|
-
* @returns A Map<number, { query:
|
|
56169
|
+
* @returns A Map<number, { query: JsonDocumentObject; linkNonce: number }> representing the grouped queries.
|
|
56171
56170
|
*/
|
|
56172
56171
|
const getGroupedQueries = (requestScope) => requestScope.reduce((acc, proofReq) => {
|
|
56173
56172
|
const groupId = proofReq.query.groupId;
|
|
@@ -59442,6 +59441,7 @@ class IdentityWallet {
|
|
|
59442
59441
|
break;
|
|
59443
59442
|
}
|
|
59444
59443
|
catch (err) {
|
|
59444
|
+
// eslint-disable-next-line no-console
|
|
59445
59445
|
console.warn(`Error while transiting state, retrying state transition, attempt: ${attempt}`, err);
|
|
59446
59446
|
}
|
|
59447
59447
|
} while (--attempt);
|