Skip to content

Commit

Permalink
feat: add resolveDID RPC method (#78)
Browse files Browse the repository at this point in the history
* feat: add resolveDID
  • Loading branch information
andyv09 authored and martines3000 committed Feb 27, 2023
1 parent 2725865 commit c03c8e6
Show file tree
Hide file tree
Showing 16 changed files with 651 additions and 406 deletions.
16 changes: 15 additions & 1 deletion packages/connector/src/methods.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { VerifiablePresentation, W3CVerifiableCredential } from '@veramo/core';
import {
DIDResolutionResult,
VerifiablePresentation,
W3CVerifiableCredential,
} from '@veramo/core';
import {
AvailableMethods,
AvailableVCStores,
Expand Down Expand Up @@ -176,3 +180,13 @@ export async function getSnapSettings(
): Promise<SSISnapConfig> {
return await sendSnapMethod({ method: 'getSnapSettings' }, this.snapId);
}

export async function resolveDID(
this: MetaMaskSSISnap,
did: string
): Promise<DIDResolutionResult> {
return await sendSnapMethod(
{ method: 'resolveDID', params: { did } },
this.snapId
);
}
3 changes: 2 additions & 1 deletion packages/connector/src/snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
deleteVC,
getSnapSettings,
getAccountSettings,
resolveDID,
} from './methods';

export class MetaMaskSSISnap {
Expand Down Expand Up @@ -57,9 +58,9 @@ export class MetaMaskSSISnap {
setVCStore: setVCStore.bind(this),
getAvailableVCStores: getAvailableVCStores.bind(this),
deleteVC: deleteVC.bind(this),

getSnapSettings: getSnapSettings.bind(this),
getAccountSettings: getAccountSettings.bind(this),
resolveDID: resolveDID.bind(this),
};
};
}
Loading

0 comments on commit c03c8e6

Please sign in to comment.