@0xpolygonid/js-sdk 1.10.1 → 1.10.2
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 +9 -9
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/umd/index.js +9 -9
- package/dist/browser/umd/index.js.map +1 -1
- package/dist/node/cjs/proof/proof-service.js +2 -1
- package/dist/node/cjs/proof/verifiers/pub-signals-verifier.js +5 -6
- package/dist/node/cjs/storage/blockchain/state.js +2 -2
- package/dist/node/esm/proof/proof-service.js +2 -1
- package/dist/node/esm/proof/verifiers/pub-signals-verifier.js +5 -6
- package/dist/node/esm/storage/blockchain/state.js +2 -2
- package/dist/types/proof/proof-service.d.ts +1 -1
- package/dist/types/storage/blockchain/state.d.ts +1 -1
- package/dist/types/storage/interfaces/state.d.ts +5 -4
- package/package.json +1 -1
|
@@ -60656,9 +60656,9 @@ class EthStateStorage {
|
|
|
60656
60656
|
};
|
|
60657
60657
|
}
|
|
60658
60658
|
/** {@inheritdoc IStateStorage.getGISTRootInfo} */
|
|
60659
|
-
async getGISTRootInfo(id) {
|
|
60659
|
+
async getGISTRootInfo(root, id) {
|
|
60660
60660
|
const { stateContract } = this.getStateContractAndProviderForId(id);
|
|
60661
|
-
const data = await stateContract.getGISTRootInfo(
|
|
60661
|
+
const data = await stateContract.getGISTRootInfo(root);
|
|
60662
60662
|
return {
|
|
60663
60663
|
root: BigInt(data.root.toString()),
|
|
60664
60664
|
replacedByRoot: BigInt(data.replacedByRoot.toString()),
|
|
@@ -65259,7 +65259,7 @@ class PubSignalsVerifier {
|
|
|
65259
65259
|
this.challenge = authV2PubSignals.challenge;
|
|
65260
65260
|
// no query verification
|
|
65261
65261
|
// verify state
|
|
65262
|
-
const gist = await this.checkGlobalState(authV2PubSignals.GISTRoot);
|
|
65262
|
+
const gist = await this.checkGlobalState(authV2PubSignals.GISTRoot, this.userId);
|
|
65263
65263
|
let acceptedStateTransitionDelay = defaultAuthVerifyOpts;
|
|
65264
65264
|
if (opts?.acceptedStateTransitionDelay) {
|
|
65265
65265
|
acceptedStateTransitionDelay = opts.acceptedStateTransitionDelay;
|
|
@@ -65341,9 +65341,8 @@ class PubSignalsVerifier {
|
|
|
65341
65341
|
throw userStateError;
|
|
65342
65342
|
}
|
|
65343
65343
|
};
|
|
65344
|
-
this.checkGlobalState = async (state) => {
|
|
65345
|
-
|
|
65346
|
-
return gistStateResolved;
|
|
65344
|
+
this.checkGlobalState = async (state, id) => {
|
|
65345
|
+
return this.rootResolve(state.bigInt(), id.bigInt());
|
|
65347
65346
|
};
|
|
65348
65347
|
this.checkRevocationStateForId = async (issuerId, issuerClaimNonRevState) => {
|
|
65349
65348
|
const issuerNonRevStateResolved = await this.resolve(issuerId, issuerClaimNonRevState.bigInt());
|
|
@@ -65459,10 +65458,10 @@ class PubSignalsVerifier {
|
|
|
65459
65458
|
}
|
|
65460
65459
|
return { latest: true, transitionTimestamp: 0 };
|
|
65461
65460
|
}
|
|
65462
|
-
async rootResolve(state) {
|
|
65461
|
+
async rootResolve(state, id) {
|
|
65463
65462
|
let globalStateInfo;
|
|
65464
65463
|
try {
|
|
65465
|
-
globalStateInfo = await this._stateStorage.getGISTRootInfo(state);
|
|
65464
|
+
globalStateInfo = await this._stateStorage.getGISTRootInfo(state, id);
|
|
65466
65465
|
}
|
|
65467
65466
|
catch (e) {
|
|
65468
65467
|
if (e.errorArgs[0] === 'Root does not exist') {
|
|
@@ -65731,7 +65730,8 @@ class ProofService {
|
|
|
65731
65730
|
throw new Error(`CircuitId is not supported ${circuitId}`);
|
|
65732
65731
|
}
|
|
65733
65732
|
const gistRoot = Hash$2.fromString(pubSignals[2]).bigInt();
|
|
65734
|
-
const
|
|
65733
|
+
const userId = BigInt(pubSignals[0]);
|
|
65734
|
+
const globalStateInfo = await this._stateStorage.getGISTRootInfo(gistRoot, userId);
|
|
65735
65735
|
if (globalStateInfo.createdAtTimestamp === 0n) {
|
|
65736
65736
|
throw new Error(`gist state doesn't exists in contract`);
|
|
65737
65737
|
}
|