Skip to content

Commit

Permalink
chore: refactor decode presentation sd-jwt method
Browse files Browse the repository at this point in the history
  • Loading branch information
SinanovicEdis committed Jan 16, 2025
1 parent c5dedad commit c46c80a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down
3 changes: 2 additions & 1 deletion packages/snap/src/veramo/Veramo.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ class VeramoService {
static async decodeSdJwtPresentation(
params: DecodeSdJwtPresentationRequestParams
): Promise<SdJwtCredential[]> {
const sdjwt = SDJwtService.get();
const credentials: SdJwtCredential[] = [];

const mapDisclosures = (disclosures: any[] = []) =>
Expand All @@ -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 ?? '';
Expand Down

0 comments on commit c46c80a

Please sign in to comment.