From 4b46d40a5f72b22061753b930a0729a16439cff1 Mon Sep 17 00:00:00 2001 From: lukachi Date: Thu, 8 Feb 2024 12:48:06 +0200 Subject: [PATCH] update rm vc msg --- packages/snap/snap.manifest.json | 2 +- packages/snap/src/index.ts | 24 +++++++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/packages/snap/snap.manifest.json b/packages/snap/snap.manifest.json index 216d1a34..ad792866 100644 --- a/packages/snap/snap.manifest.json +++ b/packages/snap/snap.manifest.json @@ -7,7 +7,7 @@ "url": "https://github.com/rarimo/rarime.git" }, "source": { - "shasum": "GXjkIUlw10uOTKYgvXjwAgAfyxq3NCnwNlQN/ITO7mU=", + "shasum": "gyaXRe+EzX9rFKfg0ApqQCMROn3lowG5zVyBMkvUuwc=", "location": { "npm": { "filePath": "dist/bundle.js", diff --git a/packages/snap/src/index.ts b/packages/snap/src/index.ts index c01370a9..3e3453f6 100644 --- a/packages/snap/src/index.ts +++ b/packages/snap/src/index.ts @@ -1,6 +1,13 @@ // eslint-disable-next-line import/no-unassigned-import import './polyfill'; -import { copyable, divider, heading, panel, text } from '@metamask/snaps-sdk'; +import { + copyable, + divider, + heading, + panel, + text, + Component, +} from '@metamask/snaps-sdk'; import { CheckCredentialExistenceRequestParams, RemoveCredentialsRequestParams, @@ -122,11 +129,18 @@ export const onRpcRequest = async ({ content: panel([ heading('Remove Credentials'), divider(), - ...vcs.map((el) => { - const vcTargetType = el.type[1]; - return text(`${vcTargetType}\n`); - }), + ...vcs.reduce((acc, el, idx) => { + const vcTargetType = el.type[1]; + const vcID = el.id; + + return acc.concat([ + text(`**Credential #${idx + 1}**`), + text(`Type: ${vcTargetType}`), + text(`ID: ${vcID}`), + divider(), + ]); + }, [] as Component[]), ]), }, });