@0xpolygonid/js-sdk 1.20.1 → 1.20.3
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 +348 -328
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/umd/index.js +8 -11
- package/dist/browser/umd/index.js.map +1 -1
- package/dist/node/cjs/circuits/atomic-query-sig-v2-on-chain.js +7 -10
- package/dist/node/cjs/iden3comm/handlers/common.js +1 -1
- package/dist/node/esm/circuits/atomic-query-sig-v2-on-chain.js +7 -10
- package/dist/node/esm/iden3comm/handlers/common.js +1 -1
- package/dist/types/iden3comm/handlers/credential-proposal.d.ts +2 -2
- package/dist/types/iden3comm/types/protocol/auth.d.ts +28 -4
- package/dist/types/iden3comm/types/protocol/proposal-request.d.ts +2 -2
- package/package.json +1 -1
|
@@ -66,6 +66,9 @@ class AtomicQuerySigV2OnChainInputs extends common_1.BaseConfig {
|
|
|
66
66
|
this.query.valueProof.validate();
|
|
67
67
|
}
|
|
68
68
|
const valueProof = this.query?.valueProof ?? new models_1.ValueProof();
|
|
69
|
+
const treeState = this.skipClaimRevocationCheck
|
|
70
|
+
? this.claim.signatureProof?.issuerAuthNonRevProof.treeState
|
|
71
|
+
: this.claim.nonRevProof?.treeState;
|
|
69
72
|
const s = {
|
|
70
73
|
requestID: this.requestID.toString(),
|
|
71
74
|
userGenesisID: this.id.bigInt().toString(),
|
|
@@ -73,16 +76,10 @@ class AtomicQuerySigV2OnChainInputs extends common_1.BaseConfig {
|
|
|
73
76
|
claimSubjectProfileNonce: this.claimSubjectProfileNonce?.toString(),
|
|
74
77
|
issuerID: this.claim.issuerID?.bigInt().toString(),
|
|
75
78
|
issuerClaim: this.claim.claim?.marshalJson(),
|
|
76
|
-
issuerClaimNonRevClaimsTreeRoot:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
?.bigInt()
|
|
81
|
-
.toString(),
|
|
82
|
-
issuerClaimNonRevRootsTreeRoot: this.claim.nonRevProof?.treeState?.rootOfRoots
|
|
83
|
-
?.bigInt()
|
|
84
|
-
.toString(),
|
|
85
|
-
issuerClaimNonRevState: this.claim.nonRevProof?.treeState?.state?.bigInt().toString(),
|
|
79
|
+
issuerClaimNonRevClaimsTreeRoot: treeState?.claimsRoot?.bigInt().toString(),
|
|
80
|
+
issuerClaimNonRevRevTreeRoot: treeState?.revocationRoot?.bigInt().toString(),
|
|
81
|
+
issuerClaimNonRevRootsTreeRoot: treeState?.rootOfRoots?.bigInt().toString(),
|
|
82
|
+
issuerClaimNonRevState: treeState?.state?.bigInt().toString(),
|
|
86
83
|
issuerClaimNonRevMtp: this.claim.nonRevProof?.proof &&
|
|
87
84
|
(0, common_1.prepareSiblingsStr)(this.claim.nonRevProof.proof, this.getMTLevel()),
|
|
88
85
|
issuerClaimSignatureR8x: this.claim.signatureProof && this.claim.signatureProof.signature.R8[0].toString(),
|
|
@@ -8,7 +8,7 @@ const utils_1 = require("../../utils");
|
|
|
8
8
|
* Returns a Map where the key is the groupId and the value is an object containing the query and linkNonce.
|
|
9
9
|
*
|
|
10
10
|
* @param requestScope - An array of ZeroKnowledgeProofRequest objects.
|
|
11
|
-
* @returns A Map<number, { query:
|
|
11
|
+
* @returns A Map<number, { query: ZeroKnowledgeProofQuery; linkNonce: number }> representing the grouped queries.
|
|
12
12
|
*/
|
|
13
13
|
const getGroupedQueries = (requestScope) => requestScope.reduce((acc, proofReq) => {
|
|
14
14
|
const groupId = proofReq.query.groupId;
|
|
@@ -63,6 +63,9 @@ export class AtomicQuerySigV2OnChainInputs extends BaseConfig {
|
|
|
63
63
|
this.query.valueProof.validate();
|
|
64
64
|
}
|
|
65
65
|
const valueProof = this.query?.valueProof ?? new ValueProof();
|
|
66
|
+
const treeState = this.skipClaimRevocationCheck
|
|
67
|
+
? this.claim.signatureProof?.issuerAuthNonRevProof.treeState
|
|
68
|
+
: this.claim.nonRevProof?.treeState;
|
|
66
69
|
const s = {
|
|
67
70
|
requestID: this.requestID.toString(),
|
|
68
71
|
userGenesisID: this.id.bigInt().toString(),
|
|
@@ -70,16 +73,10 @@ export class AtomicQuerySigV2OnChainInputs extends BaseConfig {
|
|
|
70
73
|
claimSubjectProfileNonce: this.claimSubjectProfileNonce?.toString(),
|
|
71
74
|
issuerID: this.claim.issuerID?.bigInt().toString(),
|
|
72
75
|
issuerClaim: this.claim.claim?.marshalJson(),
|
|
73
|
-
issuerClaimNonRevClaimsTreeRoot:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
?.bigInt()
|
|
78
|
-
.toString(),
|
|
79
|
-
issuerClaimNonRevRootsTreeRoot: this.claim.nonRevProof?.treeState?.rootOfRoots
|
|
80
|
-
?.bigInt()
|
|
81
|
-
.toString(),
|
|
82
|
-
issuerClaimNonRevState: this.claim.nonRevProof?.treeState?.state?.bigInt().toString(),
|
|
76
|
+
issuerClaimNonRevClaimsTreeRoot: treeState?.claimsRoot?.bigInt().toString(),
|
|
77
|
+
issuerClaimNonRevRevTreeRoot: treeState?.revocationRoot?.bigInt().toString(),
|
|
78
|
+
issuerClaimNonRevRootsTreeRoot: treeState?.rootOfRoots?.bigInt().toString(),
|
|
79
|
+
issuerClaimNonRevState: treeState?.state?.bigInt().toString(),
|
|
83
80
|
issuerClaimNonRevMtp: this.claim.nonRevProof?.proof &&
|
|
84
81
|
prepareSiblingsStr(this.claim.nonRevProof.proof, this.getMTLevel()),
|
|
85
82
|
issuerClaimSignatureR8x: this.claim.signatureProof && this.claim.signatureProof.signature.R8[0].toString(),
|
|
@@ -5,7 +5,7 @@ import { mergeObjects } from '../../utils';
|
|
|
5
5
|
* Returns a Map where the key is the groupId and the value is an object containing the query and linkNonce.
|
|
6
6
|
*
|
|
7
7
|
* @param requestScope - An array of ZeroKnowledgeProofRequest objects.
|
|
8
|
-
* @returns A Map<number, { query:
|
|
8
|
+
* @returns A Map<number, { query: ZeroKnowledgeProofQuery; linkNonce: number }> representing the grouped queries.
|
|
9
9
|
*/
|
|
10
10
|
const getGroupedQueries = (requestScope) => requestScope.reduce((acc, proofReq) => {
|
|
11
11
|
const groupId = proofReq.query.groupId;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BasicMessage, IPackageManager, JsonDocumentObject, PackerParams } from '../types';
|
|
1
|
+
import { BasicMessage, DIDDocument, IPackageManager, JsonDocumentObject, PackerParams } from '../types';
|
|
2
2
|
import { DID } from '@iden3/js-iden3-core';
|
|
3
3
|
import { Proposal, ProposalRequestCredential, ProposalRequestMessage, ProposalMessage } from '../types/protocol/proposal-request';
|
|
4
4
|
import { IIdentityWallet } from '../../identity';
|
|
@@ -10,7 +10,7 @@ export type ProposalRequestCreationOptions = {
|
|
|
10
10
|
type: string;
|
|
11
11
|
data?: JsonDocumentObject;
|
|
12
12
|
};
|
|
13
|
-
did_doc?:
|
|
13
|
+
did_doc?: DIDDocument;
|
|
14
14
|
};
|
|
15
15
|
/**
|
|
16
16
|
* @beta
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { ZKProof } from '@iden3/js-jwz';
|
|
2
2
|
import { BasicMessage, JsonDocumentObject } from '../packer';
|
|
3
3
|
import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
|
|
4
|
+
import { ProofType } from '../../../verifiable';
|
|
5
|
+
import { CircuitId } from '../../../circuits';
|
|
6
|
+
import { DIDDocument as DidResolverDidDocument, VerificationMethod as DidResolverVerificationMethod } from 'did-resolver';
|
|
7
|
+
import { RootInfo, StateInfo } from '../../../storage';
|
|
4
8
|
/** AuthorizationResponseMessage is struct the represents iden3message authorization response */
|
|
5
9
|
export type AuthorizationResponseMessage = BasicMessage & {
|
|
6
10
|
body: AuthorizationMessageResponseBody;
|
|
@@ -10,7 +14,7 @@ export type AuthorizationResponseMessage = BasicMessage & {
|
|
|
10
14
|
};
|
|
11
15
|
/** AuthorizationMessageResponseBody is struct the represents authorization response data */
|
|
12
16
|
export type AuthorizationMessageResponseBody = {
|
|
13
|
-
did_doc?:
|
|
17
|
+
did_doc?: DIDDocument;
|
|
14
18
|
message?: string;
|
|
15
19
|
scope: Array<ZeroKnowledgeProofResponse>;
|
|
16
20
|
};
|
|
@@ -25,19 +29,29 @@ export type AuthorizationRequestMessageBody = {
|
|
|
25
29
|
callbackUrl: string;
|
|
26
30
|
reason?: string;
|
|
27
31
|
message?: string;
|
|
28
|
-
did_doc?:
|
|
32
|
+
did_doc?: DIDDocument;
|
|
29
33
|
scope: Array<ZeroKnowledgeProofRequest>;
|
|
30
34
|
};
|
|
31
35
|
/** ZeroKnowledgeProofRequest represents structure of zkp request object */
|
|
32
36
|
export type ZeroKnowledgeProofRequest = {
|
|
33
37
|
id: number;
|
|
34
|
-
circuitId:
|
|
38
|
+
circuitId: CircuitId;
|
|
35
39
|
optional?: boolean;
|
|
36
|
-
query:
|
|
40
|
+
query: ZeroKnowledgeProofQuery;
|
|
37
41
|
params?: {
|
|
38
42
|
nullifierSessionId?: string | number;
|
|
39
43
|
};
|
|
40
44
|
};
|
|
45
|
+
/** ZeroKnowledgeProofQuery represents structure of zkp request query object */
|
|
46
|
+
export type ZeroKnowledgeProofQuery = {
|
|
47
|
+
allowedIssuers: string[];
|
|
48
|
+
context: string;
|
|
49
|
+
credentialSubject?: JsonDocumentObject;
|
|
50
|
+
proofType?: ProofType;
|
|
51
|
+
skipClaimRevocationCheck?: boolean;
|
|
52
|
+
groupId?: number;
|
|
53
|
+
type: string;
|
|
54
|
+
};
|
|
41
55
|
/** ZeroKnowledgeProofResponse represents structure of zkp response */
|
|
42
56
|
export type ZeroKnowledgeProofResponse = {
|
|
43
57
|
id: number;
|
|
@@ -54,3 +68,13 @@ export type VerifiablePresentation = {
|
|
|
54
68
|
credentialSubject: JsonDocumentObject;
|
|
55
69
|
};
|
|
56
70
|
};
|
|
71
|
+
/** DIDDocument represents structure of DID Document */
|
|
72
|
+
export type DIDDocument = DidResolverDidDocument & {
|
|
73
|
+
verificationMethod?: VerificationMethod[];
|
|
74
|
+
};
|
|
75
|
+
/** VerificationMethod represents structure of Verification Method */
|
|
76
|
+
export type VerificationMethod = DidResolverVerificationMethod & {
|
|
77
|
+
published?: boolean;
|
|
78
|
+
info?: StateInfo;
|
|
79
|
+
global?: RootInfo;
|
|
80
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BasicMessage, JsonDocumentObject } from '../';
|
|
1
|
+
import { BasicMessage, DIDDocument, JsonDocumentObject } from '../';
|
|
2
2
|
import { PROTOCOL_MESSAGE_TYPE } from '../../constants';
|
|
3
3
|
/** @beta ProposalRequestMessage is struct the represents proposal-request message */
|
|
4
4
|
export type ProposalRequestMessage = BasicMessage & {
|
|
@@ -12,7 +12,7 @@ export type ProposalRequestMessageBody = {
|
|
|
12
12
|
type: string;
|
|
13
13
|
data?: JsonDocumentObject;
|
|
14
14
|
};
|
|
15
|
-
did_doc?:
|
|
15
|
+
did_doc?: DIDDocument;
|
|
16
16
|
};
|
|
17
17
|
/** @beta ProposalMessage is struct the represents proposal message */
|
|
18
18
|
export type ProposalMessage = BasicMessage & {
|