From c46c80a692b277803e1c44ceba6b9b62ea27688b Mon Sep 17 00:00:00 2001 From: edis Date: Thu, 16 Jan 2025 16:19:17 +0100 Subject: [PATCH] chore: refactor decode presentation sd-jwt method --- packages/snap/snap.manifest.json | 2 +- packages/snap/src/veramo/Veramo.service.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/snap/snap.manifest.json b/packages/snap/snap.manifest.json index 518f379c..c13b4950 100644 --- a/packages/snap/snap.manifest.json +++ b/packages/snap/snap.manifest.json @@ -26,7 +26,7 @@ "./files/circuits/credentialAtomicQuerySigV2/circuit_final.zkey", "./files/circuits/credentialAtomicQuerySigV2/verification_key.json" ], - "shasum": "fTs/nRwh2XGR1RuhJnmiNl09h8ZS3+7RREx+lGLu51A=" + "shasum": "HBrQ7mqPrxS1uCjOQUs8GK0rHNRmDVbRUGG6dmMXz0w=" }, "initialPermissions": { "endowment:ethereum-provider": {}, diff --git a/packages/snap/src/veramo/Veramo.service.ts b/packages/snap/src/veramo/Veramo.service.ts index 582e5f0f..9006fad9 100644 --- a/packages/snap/src/veramo/Veramo.service.ts +++ b/packages/snap/src/veramo/Veramo.service.ts @@ -619,6 +619,7 @@ class VeramoService { static async decodeSdJwtPresentation( params: DecodeSdJwtPresentationRequestParams ): Promise { + const sdjwt = SDJwtService.get(); const credentials: SdJwtCredential[] = []; const mapDisclosures = (disclosures: any[] = []) => @@ -631,7 +632,7 @@ class VeramoService { })); params.presentation.map(async (vp) => { - const res = await VeramoService.instance.decodeSdJwt(vp); + const res = await sdjwt.decode(vp); const payload = res.jwt?.payload; const signature = res.jwt?.signature ?? '';