Skip to content

Commit

Permalink
chore: remove unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
martines3000 committed Oct 2, 2023
1 parent c507b2b commit 07aa091
Showing 1 changed file with 27 additions and 32 deletions.
59 changes: 27 additions & 32 deletions packages/connector/src/snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async function sendSnapMethod<T>(
*
* @return Result<QueryCredentialsRequestResult[]> - list of VCs
*/
export async function queryCredentials(
async function queryCredentials(
this: Masca,
params?: QueryCredentialsRequestParams
): Promise<Result<QueryCredentialsRequestResult[]>> {
Expand All @@ -76,7 +76,7 @@ export async function queryCredentials(
* @param params - parameters for creating a VP
* @return Result<VerifiablePresentation> - VP
*/
export async function createPresentation(
async function createPresentation(
this: Masca,
params: CreatePresentationRequestParams
): Promise<Result<VerifiablePresentation>> {
Expand Down Expand Up @@ -112,7 +112,7 @@ export async function createPresentation(
*
* @return Result<SaveCredentialRequestResult[]> - list of saved VCs
*/
export async function saveCredential(
async function saveCredential(
this: Masca,
vc: W3CVerifiableCredential,
options?: SaveCredentialOptions
Expand All @@ -137,7 +137,7 @@ export async function saveCredential(
* @param options - optional parameters for deleting a VC
* @return Result<boolean[]> - list of results for each VC
*/
export async function deleteCredential(
async function deleteCredential(
this: Masca,
id: string,
options?: DeleteCredentialsOptions
Expand All @@ -160,25 +160,23 @@ export async function deleteCredential(
* Get the DID of the currently selected MetaMask account
* @return Result<string> - DID
*/
export async function getDID(this: Masca): Promise<Result<string>> {
async function getDID(this: Masca): Promise<Result<string>> {
return sendSnapMethod({ method: 'getDID' }, this.snapId);
}

/**
* Get the currently selected DID method
* @return Result<string> - DID method
*/
export async function getSelectedMethod(this: Masca): Promise<Result<string>> {
async function getSelectedMethod(this: Masca): Promise<Result<string>> {
return sendSnapMethod({ method: 'getSelectedMethod' }, this.snapId);
}

/**
* Get a list of available DID methods
* @return Result<string[]> - list of available DID methods
*/
export async function getAvailableMethods(
this: Masca
): Promise<Result<string[]>> {
async function getAvailableMethods(this: Masca): Promise<Result<string[]>> {
return sendSnapMethod({ method: 'getAvailableMethods' }, this.snapId);
}

Expand All @@ -187,7 +185,7 @@ export async function getAvailableMethods(
* @param method - DID method to be switched to
* @return Result<boolean> - true if the switch was successful
*/
export async function switchDIDMethod(
async function switchDIDMethod(
this: Masca,
method: AvailableMethods
): Promise<Result<AvailableMethods>> {
Expand All @@ -204,7 +202,7 @@ export async function switchDIDMethod(
* Enables/disables confirmation popup windows when retrieving VCs, generating VPs,...
* @return Result<boolean> - true if the switch was successful
*/
export async function togglePopups(this: Masca): Promise<Result<boolean>> {
async function togglePopups(this: Masca): Promise<Result<boolean>> {
return sendSnapMethod({ method: 'togglePopups' }, this.snapId);
}

Expand All @@ -213,7 +211,7 @@ export async function togglePopups(this: Masca): Promise<Result<boolean>> {
*
* @return Result<boolean> - true if the addition was successful
*/
export async function addFriendlyDapp(this: Masca): Promise<Result<boolean>> {
async function addFriendlyDapp(this: Masca): Promise<Result<boolean>> {
return sendSnapMethod({ method: 'addFriendlyDapp' }, this.snapId);
}

Expand All @@ -222,7 +220,7 @@ export async function addFriendlyDapp(this: Masca): Promise<Result<boolean>> {
*
* @return Result<boolean> - true if the removal was successful
*/
export async function removeFriendlyDapp(
async function removeFriendlyDapp(
this: Masca,
id: string
): Promise<Result<boolean>> {
Expand All @@ -237,7 +235,7 @@ export async function removeFriendlyDapp(
*
* @return Result<Record<AvailableCredentialStores, boolean>> - status of available VC stores
*/
export async function getCredentialStore(
async function getCredentialStore(
this: Masca
): Promise<Result<Record<AvailableCredentialStores, boolean>>> {
return sendSnapMethod({ method: 'getCredentialStore' }, this.snapId);
Expand All @@ -247,7 +245,7 @@ export async function getCredentialStore(
* Get a list of available VC stores
* @return Result<string[]> - list of available VC stores
*/
export async function getAvailableCredentialStores(
async function getAvailableCredentialStores(
this: Masca
): Promise<Result<string[]>> {
return sendSnapMethod(
Expand All @@ -262,7 +260,7 @@ export async function getAvailableCredentialStores(
* @param value - true to enable, false to disable
* @return Result<boolean> - true if the switch was successful
*/
export async function setCredentialStore(
async function setCredentialStore(
this: Masca,
store: AvailableCredentialStores,
value: boolean
Expand All @@ -277,7 +275,7 @@ export async function setCredentialStore(
* Get account settings of currently selected account (i.e. DID method, VC stores,...)
* @return Result<MascaAccountConfig> - account settings
*/
export async function getAccountSettings(
async function getAccountSettings(
this: Masca
): Promise<Result<MascaAccountConfig>> {
return sendSnapMethod({ method: 'getAccountSettings' }, this.snapId);
Expand All @@ -287,9 +285,7 @@ export async function getAccountSettings(
* Get Masca settings
* @return Result<MascaConfig> - Masca settings
*/
export async function getSnapSettings(
this: Masca
): Promise<Result<MascaConfig>> {
async function getSnapSettings(this: Masca): Promise<Result<MascaConfig>> {
return sendSnapMethod({ method: 'getSnapSettings' }, this.snapId);
}

Expand All @@ -298,7 +294,7 @@ export async function getSnapSettings(
* @param did - DID to be resolved
* @return Result<DIDResolutionResult> - DID resolution result
*/
export async function resolveDID(
async function resolveDID(
this: Masca,
did: string
): Promise<Result<DIDResolutionResult>> {
Expand All @@ -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<Result<VerifiableCredential>> {
Expand Down Expand Up @@ -347,7 +343,7 @@ export async function createCredential(
* @param params.currentAccount - account address
* @returns Result<boolean> - true if successful
*/
export async function setCurrentAccount(
async function setCurrentAccount(
this: Masca,
params: SetCurrentAccountRequestParams
): Promise<Result<boolean>> {
Expand All @@ -366,7 +362,7 @@ export async function setCurrentAccount(
* @param params - a Credential or a Presentation with optional verbose flag
* @returns Result<boolean | IVerifyResult> - true if the Credential/Presentation is valid, false otherwise
*/
export async function verifyData(
async function verifyData(
this: Masca,
params: VerifyDataRequestParams
): Promise<Result<boolean | IVerifyResult>> {
Expand All @@ -385,7 +381,7 @@ export async function verifyData(
* @param params.credentialOffer - Credential Offer string
* @returns Result<VerifiableCredential[]> - list of VCs if successful
*/
export async function handleCredentialOffer(
async function handleCredentialOffer(
this: Masca,
params: HandleCredentialOfferRequestParams
): Promise<Result<VerifiableCredential[]>> {
Expand All @@ -404,7 +400,7 @@ export async function handleCredentialOffer(
* @param params.authorizationRequest - Authorization Request string
* @returns Result<void> - void if successful
*/
export async function handleAuthorizationRequest(
async function handleAuthorizationRequest(
this: Masca,
params: HandleAuthorizationRequestParams
): Promise<Result<void>> {
Expand All @@ -423,7 +419,7 @@ export async function handleAuthorizationRequest(
* @param serializedSession - serialized Ceramic session
* @returns Result<boolean> - true if successful
*/
export async function setCeramicSession(
async function setCeramicSession(
this: Masca,
serializedSession: string
): Promise<Result<boolean>> {
Expand All @@ -442,7 +438,7 @@ export async function setCeramicSession(
* @returns Result<boolean> - true if successful
* @throws Error - if the stored Ceramic session is invalid
*/
export async function validateStoredCeramicSession(
async function validateStoredCeramicSession(
this: Masca
): Promise<Result<boolean>> {
return sendSnapMethod(
Expand All @@ -458,7 +454,7 @@ export async function validateStoredCeramicSession(
* @param this - Masca instance
* @returns Result<string> - Encrypted Masca state
*/
export async function exportStateBackup(this: Masca): Promise<Result<string>> {
async function exportStateBackup(this: Masca): Promise<Result<string>> {
return sendSnapMethod(
{
method: 'exportStateBackup',
Expand All @@ -473,7 +469,7 @@ export async function exportStateBackup(this: Masca): Promise<Result<string>> {
* @param params - Encrypted Masca state
* @returns Result<boolean> - true if successful
*/
export async function importStateBackup(
async function importStateBackup(
this: Masca,
params: ImportStateBackupRequestParams
): Promise<Result<boolean>> {
Expand All @@ -492,8 +488,7 @@ export async function importStateBackup(
* @returns Result<string> - true if successful
* @throws Error - if id creation failed
*/
export async function getWalletId(this: Masca): Promise<Result<string>> {
console.log('getWalletId connector');
async function getWalletId(this: Masca): Promise<Result<string>> {
return sendSnapMethod(
{
method: 'getWalletId',
Expand Down

0 comments on commit 07aa091

Please sign in to comment.