@0xpolygonid/js-sdk 1.10.1 → 1.10.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 +14 -10
- package/dist/browser/esm/index.js.map +1 -1
- package/dist/browser/umd/index.js +14 -10
- 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 +10 -7
- 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 +10 -7
- 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());
|
|
@@ -86359,12 +86358,16 @@ var PolygonIdSdk = (function (exports) {
|
|
|
86359
86358
|
transitionTimestamp: contractState.replacedAtTimestamp.toString()
|
|
86360
86359
|
};
|
|
86361
86360
|
}
|
|
86362
|
-
return {
|
|
86361
|
+
return {
|
|
86362
|
+
latest: !contractState.replacedAtTimestamp ||
|
|
86363
|
+
contractState.replacedAtTimestamp.toString() === zeroInt.toString(),
|
|
86364
|
+
transitionTimestamp: contractState.replacedAtTimestamp?.toString() ?? 0
|
|
86365
|
+
};
|
|
86363
86366
|
}
|
|
86364
|
-
async rootResolve(state) {
|
|
86367
|
+
async rootResolve(state, id) {
|
|
86365
86368
|
let globalStateInfo;
|
|
86366
86369
|
try {
|
|
86367
|
-
globalStateInfo = await this._stateStorage.getGISTRootInfo(state);
|
|
86370
|
+
globalStateInfo = await this._stateStorage.getGISTRootInfo(state, id);
|
|
86368
86371
|
}
|
|
86369
86372
|
catch (e) {
|
|
86370
86373
|
if (e.errorArgs[0] === 'Root does not exist') {
|
|
@@ -86633,7 +86636,8 @@ var PolygonIdSdk = (function (exports) {
|
|
|
86633
86636
|
throw new Error(`CircuitId is not supported ${circuitId}`);
|
|
86634
86637
|
}
|
|
86635
86638
|
const gistRoot = V$1.fromString(pubSignals[2]).bigInt();
|
|
86636
|
-
const
|
|
86639
|
+
const userId = BigInt(pubSignals[0]);
|
|
86640
|
+
const globalStateInfo = await this._stateStorage.getGISTRootInfo(gistRoot, userId);
|
|
86637
86641
|
if (globalStateInfo.createdAtTimestamp === 0n) {
|
|
86638
86642
|
throw new Error(`gist state doesn't exists in contract`);
|
|
86639
86643
|
}
|