diff --git a/package-lock.json b/package-lock.json index c4bf0a2d..a3eb782f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@0xpolygonid/js-sdk", - "version": "1.9.1", + "version": "1.9.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@0xpolygonid/js-sdk", - "version": "1.9.1", + "version": "1.9.2", "license": "AGPL-3.0", "dependencies": { "ajv": "8.12.0", diff --git a/package.json b/package.json index 933bb8c2..23c713aa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@0xpolygonid/js-sdk", - "version": "1.9.1", + "version": "1.9.2", "description": "SDK to work with Polygon ID", "main": "dist/node/cjs/index.js", "module": "dist/node/esm/index.js", diff --git a/src/proof/common.ts b/src/proof/common.ts index 658017dc..ced10957 100644 --- a/src/proof/common.ts +++ b/src/proof/common.ts @@ -214,8 +214,7 @@ export const parseQueryMetadata = async ( ); } - const datatype = propertyQuery.operator === Operators.EXISTS ? XSDNS.Boolean : query.datatype; - query.values = await transformQueryValueToBigInts(propertyQuery.operatorValue, datatype); + query.values = Operators.EXISTS ? transformExistsValue(propertyQuery.operatorValue): await transformQueryValueToBigInts(propertyQuery.operatorValue, query.datatype); } return query; }; @@ -247,3 +246,11 @@ export const transformQueryValueToBigInts = async ( } return values; }; + +const transformExistsValue = (value : unknown): bigint[] =>{ + + if (typeof value == "boolean") { + return [BigInt(value)]; + } + throw new Error("exists operator value must be true or false") +} \ No newline at end of file