diff --git a/packages/connector/src/snap.ts b/packages/connector/src/snap.ts index d6a6cc6ac..5cea6e334 100644 --- a/packages/connector/src/snap.ts +++ b/packages/connector/src/snap.ts @@ -59,7 +59,7 @@ async function sendSnapMethod( * * @return Result - list of VCs */ -export async function queryCredentials( +async function queryCredentials( this: Masca, params?: QueryCredentialsRequestParams ): Promise> { @@ -76,7 +76,7 @@ export async function queryCredentials( * @param params - parameters for creating a VP * @return Result - VP */ -export async function createPresentation( +async function createPresentation( this: Masca, params: CreatePresentationRequestParams ): Promise> { @@ -112,7 +112,7 @@ export async function createPresentation( * * @return Result - list of saved VCs */ -export async function saveCredential( +async function saveCredential( this: Masca, vc: W3CVerifiableCredential, options?: SaveCredentialOptions @@ -137,7 +137,7 @@ export async function saveCredential( * @param options - optional parameters for deleting a VC * @return Result - list of results for each VC */ -export async function deleteCredential( +async function deleteCredential( this: Masca, id: string, options?: DeleteCredentialsOptions @@ -160,7 +160,7 @@ export async function deleteCredential( * Get the DID of the currently selected MetaMask account * @return Result - DID */ -export async function getDID(this: Masca): Promise> { +async function getDID(this: Masca): Promise> { return sendSnapMethod({ method: 'getDID' }, this.snapId); } @@ -168,7 +168,7 @@ export async function getDID(this: Masca): Promise> { * Get the currently selected DID method * @return Result - DID method */ -export async function getSelectedMethod(this: Masca): Promise> { +async function getSelectedMethod(this: Masca): Promise> { return sendSnapMethod({ method: 'getSelectedMethod' }, this.snapId); } @@ -176,9 +176,7 @@ export async function getSelectedMethod(this: Masca): Promise> { * Get a list of available DID methods * @return Result - list of available DID methods */ -export async function getAvailableMethods( - this: Masca -): Promise> { +async function getAvailableMethods(this: Masca): Promise> { return sendSnapMethod({ method: 'getAvailableMethods' }, this.snapId); } @@ -187,7 +185,7 @@ export async function getAvailableMethods( * @param method - DID method to be switched to * @return Result - true if the switch was successful */ -export async function switchDIDMethod( +async function switchDIDMethod( this: Masca, method: AvailableMethods ): Promise> { @@ -204,7 +202,7 @@ export async function switchDIDMethod( * Enables/disables confirmation popup windows when retrieving VCs, generating VPs,... * @return Result - true if the switch was successful */ -export async function togglePopups(this: Masca): Promise> { +async function togglePopups(this: Masca): Promise> { return sendSnapMethod({ method: 'togglePopups' }, this.snapId); } @@ -213,7 +211,7 @@ export async function togglePopups(this: Masca): Promise> { * * @return Result - true if the addition was successful */ -export async function addFriendlyDapp(this: Masca): Promise> { +async function addFriendlyDapp(this: Masca): Promise> { return sendSnapMethod({ method: 'addFriendlyDapp' }, this.snapId); } @@ -222,7 +220,7 @@ export async function addFriendlyDapp(this: Masca): Promise> { * * @return Result - true if the removal was successful */ -export async function removeFriendlyDapp( +async function removeFriendlyDapp( this: Masca, id: string ): Promise> { @@ -237,7 +235,7 @@ export async function removeFriendlyDapp( * * @return Result> - status of available VC stores */ -export async function getCredentialStore( +async function getCredentialStore( this: Masca ): Promise>> { return sendSnapMethod({ method: 'getCredentialStore' }, this.snapId); @@ -247,7 +245,7 @@ export async function getCredentialStore( * Get a list of available VC stores * @return Result - list of available VC stores */ -export async function getAvailableCredentialStores( +async function getAvailableCredentialStores( this: Masca ): Promise> { return sendSnapMethod( @@ -262,7 +260,7 @@ export async function getAvailableCredentialStores( * @param value - true to enable, false to disable * @return Result - true if the switch was successful */ -export async function setCredentialStore( +async function setCredentialStore( this: Masca, store: AvailableCredentialStores, value: boolean @@ -277,7 +275,7 @@ export async function setCredentialStore( * Get account settings of currently selected account (i.e. DID method, VC stores,...) * @return Result - account settings */ -export async function getAccountSettings( +async function getAccountSettings( this: Masca ): Promise> { return sendSnapMethod({ method: 'getAccountSettings' }, this.snapId); @@ -287,9 +285,7 @@ export async function getAccountSettings( * Get Masca settings * @return Result - Masca settings */ -export async function getSnapSettings( - this: Masca -): Promise> { +async function getSnapSettings(this: Masca): Promise> { return sendSnapMethod({ method: 'getSnapSettings' }, this.snapId); } @@ -298,7 +294,7 @@ export async function getSnapSettings( * @param did - DID to be resolved * @return Result - DID resolution result */ -export async function resolveDID( +async function resolveDID( this: Masca, did: string ): Promise> { @@ -310,7 +306,7 @@ export async function resolveDID( * @param this - Masca instance * @param params - object with parameters for creating a Verifiable Credential */ -export async function createCredential( +async function createCredential( this: Masca, params: CreateCredentialRequestParams ): Promise> { @@ -347,7 +343,7 @@ export async function createCredential( * @param params.currentAccount - account address * @returns Result - true if successful */ -export async function setCurrentAccount( +async function setCurrentAccount( this: Masca, params: SetCurrentAccountRequestParams ): Promise> { @@ -366,7 +362,7 @@ export async function setCurrentAccount( * @param params - a Credential or a Presentation with optional verbose flag * @returns Result - true if the Credential/Presentation is valid, false otherwise */ -export async function verifyData( +async function verifyData( this: Masca, params: VerifyDataRequestParams ): Promise> { @@ -385,7 +381,7 @@ export async function verifyData( * @param params.credentialOffer - Credential Offer string * @returns Result - list of VCs if successful */ -export async function handleCredentialOffer( +async function handleCredentialOffer( this: Masca, params: HandleCredentialOfferRequestParams ): Promise> { @@ -404,7 +400,7 @@ export async function handleCredentialOffer( * @param params.authorizationRequest - Authorization Request string * @returns Result - void if successful */ -export async function handleAuthorizationRequest( +async function handleAuthorizationRequest( this: Masca, params: HandleAuthorizationRequestParams ): Promise> { @@ -423,7 +419,7 @@ export async function handleAuthorizationRequest( * @param serializedSession - serialized Ceramic session * @returns Result - true if successful */ -export async function setCeramicSession( +async function setCeramicSession( this: Masca, serializedSession: string ): Promise> { @@ -442,7 +438,7 @@ export async function setCeramicSession( * @returns Result - true if successful * @throws Error - if the stored Ceramic session is invalid */ -export async function validateStoredCeramicSession( +async function validateStoredCeramicSession( this: Masca ): Promise> { return sendSnapMethod( @@ -458,7 +454,7 @@ export async function validateStoredCeramicSession( * @param this - Masca instance * @returns Result - Encrypted Masca state */ -export async function exportStateBackup(this: Masca): Promise> { +async function exportStateBackup(this: Masca): Promise> { return sendSnapMethod( { method: 'exportStateBackup', @@ -473,7 +469,7 @@ export async function exportStateBackup(this: Masca): Promise> { * @param params - Encrypted Masca state * @returns Result - true if successful */ -export async function importStateBackup( +async function importStateBackup( this: Masca, params: ImportStateBackupRequestParams ): Promise> { @@ -492,8 +488,7 @@ export async function importStateBackup( * @returns Result - true if successful * @throws Error - if id creation failed */ -export async function getWalletId(this: Masca): Promise> { - console.log('getWalletId connector'); +async function getWalletId(this: Masca): Promise> { return sendSnapMethod( { method: 'getWalletId',