@0xpolygonid/js-sdk 1.8.0 → 1.8.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/dist/browser/esm/index.js +22 -14
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/umd/index.js +22 -14
- package/dist/browser/umd/index.js.map +1 -1
- package/dist/node/cjs/circuits/atomic-query-v3-on-chain.js +22 -14
- package/dist/node/esm/circuits/atomic-query-v3-on-chain.js +22 -14
- package/package.json +1 -1
|
@@ -119,7 +119,10 @@ class AtomicQueryV3OnChainInputs extends common_1.BaseConfig {
|
|
|
119
119
|
valueProof.value = 0n;
|
|
120
120
|
valueProof.mtp = new js_merkletree_1.Proof();
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
let treeState = this.claim.nonRevProof.treeState;
|
|
123
|
+
if (this.proofType === verifiable_1.ProofType.BJJSignature && this.skipClaimRevocationCheck) {
|
|
124
|
+
treeState = this.claim.signatureProof?.issuerAuthNonRevProof.treeState;
|
|
125
|
+
}
|
|
123
126
|
if (!treeState) {
|
|
124
127
|
throw new Error(models_1.CircuitError.EmptyTreeState);
|
|
125
128
|
}
|
|
@@ -175,27 +178,32 @@ class AtomicQueryV3OnChainInputs extends common_1.BaseConfig {
|
|
|
175
178
|
s.isRevocationChecked = 0;
|
|
176
179
|
}
|
|
177
180
|
if (this.proofType === verifiable_1.ProofType.BJJSignature) {
|
|
181
|
+
const sigProof = this.claim.signatureProof;
|
|
178
182
|
s.proofType = '1';
|
|
179
|
-
s.issuerClaimSignatureR8x =
|
|
180
|
-
s.issuerClaimSignatureR8y =
|
|
181
|
-
s.issuerClaimSignatureS =
|
|
182
|
-
s.issuerAuthClaim =
|
|
183
|
-
s.issuerAuthClaimMtp = (0, common_1.prepareSiblingsStr)(
|
|
183
|
+
s.issuerClaimSignatureR8x = sigProof.signature.R8[0].toString();
|
|
184
|
+
s.issuerClaimSignatureR8y = sigProof.signature.R8[1].toString();
|
|
185
|
+
s.issuerClaimSignatureS = sigProof.signature.S.toString();
|
|
186
|
+
s.issuerAuthClaim = sigProof.issuerAuthClaim?.marshalJson();
|
|
187
|
+
s.issuerAuthClaimMtp = (0, common_1.prepareSiblingsStr)(sigProof.issuerAuthIncProof.proof, this.getMTLevel());
|
|
184
188
|
const issuerAuthTreeState = this.claim.nonRevProof.treeState;
|
|
185
189
|
if (!issuerAuthTreeState) {
|
|
186
190
|
throw new Error(models_1.CircuitError.EmptyTreeState);
|
|
187
191
|
}
|
|
188
|
-
s.issuerAuthClaimsTreeRoot =
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
s.
|
|
192
|
-
|
|
192
|
+
s.issuerAuthClaimsTreeRoot = sigProof.issuerAuthIncProof.treeState?.claimsRoot
|
|
193
|
+
.bigInt()
|
|
194
|
+
.toString();
|
|
195
|
+
s.issuerAuthRevTreeRoot = sigProof.issuerAuthIncProof.treeState?.revocationRoot
|
|
196
|
+
.bigInt()
|
|
197
|
+
.toString();
|
|
198
|
+
s.issuerAuthRootsTreeRoot = sigProof.issuerAuthIncProof.treeState?.rootOfRoots
|
|
199
|
+
.bigInt()
|
|
200
|
+
.toString();
|
|
201
|
+
s.issuerAuthClaimNonRevMtp = (0, common_1.prepareSiblingsStr)(sigProof.issuerAuthNonRevProof.proof, this.getMTLevel());
|
|
202
|
+
const nodeAuxIssuerAuthNonRev = (0, common_1.getNodeAuxValue)(sigProof.issuerAuthNonRevProof.proof);
|
|
193
203
|
s.issuerAuthClaimNonRevMtpAuxHi = nodeAuxIssuerAuthNonRev.key.bigInt().toString();
|
|
194
204
|
s.issuerAuthClaimNonRevMtpAuxHv = nodeAuxIssuerAuthNonRev.value.bigInt().toString();
|
|
195
205
|
s.issuerAuthClaimNonRevMtpNoAux = nodeAuxIssuerAuthNonRev.noAux;
|
|
196
|
-
s.issuerAuthState =
|
|
197
|
-
.bigInt()
|
|
198
|
-
.toString();
|
|
206
|
+
s.issuerAuthState = sigProof.issuerAuthIncProof.treeState?.state.bigInt().toString();
|
|
199
207
|
this.fillMTPProofsWithZero(s);
|
|
200
208
|
}
|
|
201
209
|
else if (this.proofType === verifiable_1.ProofType.Iden3SparseMerkleTreeProof) {
|
|
@@ -116,7 +116,10 @@ export class AtomicQueryV3OnChainInputs extends BaseConfig {
|
|
|
116
116
|
valueProof.value = 0n;
|
|
117
117
|
valueProof.mtp = new Proof();
|
|
118
118
|
}
|
|
119
|
-
|
|
119
|
+
let treeState = this.claim.nonRevProof.treeState;
|
|
120
|
+
if (this.proofType === ProofType.BJJSignature && this.skipClaimRevocationCheck) {
|
|
121
|
+
treeState = this.claim.signatureProof?.issuerAuthNonRevProof.treeState;
|
|
122
|
+
}
|
|
120
123
|
if (!treeState) {
|
|
121
124
|
throw new Error(CircuitError.EmptyTreeState);
|
|
122
125
|
}
|
|
@@ -172,27 +175,32 @@ export class AtomicQueryV3OnChainInputs extends BaseConfig {
|
|
|
172
175
|
s.isRevocationChecked = 0;
|
|
173
176
|
}
|
|
174
177
|
if (this.proofType === ProofType.BJJSignature) {
|
|
178
|
+
const sigProof = this.claim.signatureProof;
|
|
175
179
|
s.proofType = '1';
|
|
176
|
-
s.issuerClaimSignatureR8x =
|
|
177
|
-
s.issuerClaimSignatureR8y =
|
|
178
|
-
s.issuerClaimSignatureS =
|
|
179
|
-
s.issuerAuthClaim =
|
|
180
|
-
s.issuerAuthClaimMtp = prepareSiblingsStr(
|
|
180
|
+
s.issuerClaimSignatureR8x = sigProof.signature.R8[0].toString();
|
|
181
|
+
s.issuerClaimSignatureR8y = sigProof.signature.R8[1].toString();
|
|
182
|
+
s.issuerClaimSignatureS = sigProof.signature.S.toString();
|
|
183
|
+
s.issuerAuthClaim = sigProof.issuerAuthClaim?.marshalJson();
|
|
184
|
+
s.issuerAuthClaimMtp = prepareSiblingsStr(sigProof.issuerAuthIncProof.proof, this.getMTLevel());
|
|
181
185
|
const issuerAuthTreeState = this.claim.nonRevProof.treeState;
|
|
182
186
|
if (!issuerAuthTreeState) {
|
|
183
187
|
throw new Error(CircuitError.EmptyTreeState);
|
|
184
188
|
}
|
|
185
|
-
s.issuerAuthClaimsTreeRoot =
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
s.
|
|
189
|
-
|
|
189
|
+
s.issuerAuthClaimsTreeRoot = sigProof.issuerAuthIncProof.treeState?.claimsRoot
|
|
190
|
+
.bigInt()
|
|
191
|
+
.toString();
|
|
192
|
+
s.issuerAuthRevTreeRoot = sigProof.issuerAuthIncProof.treeState?.revocationRoot
|
|
193
|
+
.bigInt()
|
|
194
|
+
.toString();
|
|
195
|
+
s.issuerAuthRootsTreeRoot = sigProof.issuerAuthIncProof.treeState?.rootOfRoots
|
|
196
|
+
.bigInt()
|
|
197
|
+
.toString();
|
|
198
|
+
s.issuerAuthClaimNonRevMtp = prepareSiblingsStr(sigProof.issuerAuthNonRevProof.proof, this.getMTLevel());
|
|
199
|
+
const nodeAuxIssuerAuthNonRev = getNodeAuxValue(sigProof.issuerAuthNonRevProof.proof);
|
|
190
200
|
s.issuerAuthClaimNonRevMtpAuxHi = nodeAuxIssuerAuthNonRev.key.bigInt().toString();
|
|
191
201
|
s.issuerAuthClaimNonRevMtpAuxHv = nodeAuxIssuerAuthNonRev.value.bigInt().toString();
|
|
192
202
|
s.issuerAuthClaimNonRevMtpNoAux = nodeAuxIssuerAuthNonRev.noAux;
|
|
193
|
-
s.issuerAuthState =
|
|
194
|
-
.bigInt()
|
|
195
|
-
.toString();
|
|
203
|
+
s.issuerAuthState = sigProof.issuerAuthIncProof.treeState?.state.bigInt().toString();
|
|
196
204
|
this.fillMTPProofsWithZero(s);
|
|
197
205
|
}
|
|
198
206
|
else if (this.proofType === ProofType.Iden3SparseMerkleTreeProof) {
|