@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
|
@@ -60795,9 +60795,9 @@ var PolygonIdSdk = (function (exports) {
|
|
|
60795
60795
|
};
|
|
60796
60796
|
}
|
|
60797
60797
|
/** {@inheritdoc IStateStorage.getGISTRootInfo} */
|
|
60798
|
-
async getGISTRootInfo(id) {
|
|
60798
|
+
async getGISTRootInfo(root, id) {
|
|
60799
60799
|
const { stateContract } = this.getStateContractAndProviderForId(id);
|
|
60800
|
-
const data = await stateContract.getGISTRootInfo(
|
|
60800
|
+
const data = await stateContract.getGISTRootInfo(root);
|
|
60801
60801
|
return {
|
|
60802
60802
|
root: BigInt(data.root.toString()),
|
|
60803
60803
|
replacedByRoot: BigInt(data.replacedByRoot.toString()),
|
|
@@ -86161,7 +86161,7 @@ var PolygonIdSdk = (function (exports) {
|
|
|
86161
86161
|
this.challenge = authV2PubSignals.challenge;
|
|
86162
86162
|
// no query verification
|
|
86163
86163
|
// verify state
|
|
86164
|
-
const gist = await this.checkGlobalState(authV2PubSignals.GISTRoot);
|
|
86164
|
+
const gist = await this.checkGlobalState(authV2PubSignals.GISTRoot, this.userId);
|
|
86165
86165
|
let acceptedStateTransitionDelay = defaultAuthVerifyOpts;
|
|
86166
86166
|
if (opts?.acceptedStateTransitionDelay) {
|
|
86167
86167
|
acceptedStateTransitionDelay = opts.acceptedStateTransitionDelay;
|
|
@@ -86243,9 +86243,8 @@ var PolygonIdSdk = (function (exports) {
|
|
|
86243
86243
|
throw userStateError;
|
|
86244
86244
|
}
|
|
86245
86245
|
};
|
|
86246
|
-
this.checkGlobalState = async (state) => {
|
|
86247
|
-
|
|
86248
|
-
return gistStateResolved;
|
|
86246
|
+
this.checkGlobalState = async (state, id) => {
|
|
86247
|
+
return this.rootResolve(state.bigInt(), id.bigInt());
|
|
86249
86248
|
};
|
|
86250
86249
|
this.checkRevocationStateForId = async (issuerId, issuerClaimNonRevState) => {
|
|
86251
86250
|
const issuerNonRevStateResolved = await this.resolve(issuerId, issuerClaimNonRevState.bigInt());
|
|
@@ -86361,10 +86360,10 @@ var PolygonIdSdk = (function (exports) {
|
|
|
86361
86360
|
}
|
|
86362
86361
|
return { latest: true, transitionTimestamp: 0 };
|
|
86363
86362
|
}
|
|
86364
|
-
async rootResolve(state) {
|
|
86363
|
+
async rootResolve(state, id) {
|
|
86365
86364
|
let globalStateInfo;
|
|
86366
86365
|
try {
|
|
86367
|
-
globalStateInfo = await this._stateStorage.getGISTRootInfo(state);
|
|
86366
|
+
globalStateInfo = await this._stateStorage.getGISTRootInfo(state, id);
|
|
86368
86367
|
}
|
|
86369
86368
|
catch (e) {
|
|
86370
86369
|
if (e.errorArgs[0] === 'Root does not exist') {
|
|
@@ -86633,7 +86632,8 @@ var PolygonIdSdk = (function (exports) {
|
|
|
86633
86632
|
throw new Error(`CircuitId is not supported ${circuitId}`);
|
|
86634
86633
|
}
|
|
86635
86634
|
const gistRoot = V$1.fromString(pubSignals[2]).bigInt();
|
|
86636
|
-
const
|
|
86635
|
+
const userId = BigInt(pubSignals[0]);
|
|
86636
|
+
const globalStateInfo = await this._stateStorage.getGISTRootInfo(gistRoot, userId);
|
|
86637
86637
|
if (globalStateInfo.createdAtTimestamp === 0n) {
|
|
86638
86638
|
throw new Error(`gist state doesn't exists in contract`);
|
|
86639
86639
|
}
|