From d5289cf8d7a2f28ec25285cc1293af2183ae250d Mon Sep 17 00:00:00 2001 From: Ansonhkg Date: Fri, 12 Apr 2024 19:26:44 +0100 Subject: [PATCH] chore: prettier --- .../src/lib/providers/EthWalletProvider.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/packages/lit-auth-client/src/lib/providers/EthWalletProvider.ts b/packages/lit-auth-client/src/lib/providers/EthWalletProvider.ts index 541c4c12b0..d3502d2ff5 100644 --- a/packages/lit-auth-client/src/lib/providers/EthWalletProvider.ts +++ b/packages/lit-auth-client/src/lib/providers/EthWalletProvider.ts @@ -54,9 +54,10 @@ export default class EthWalletProvider extends BaseProvider { public async authenticate( options?: EthWalletAuthenticateOptions ): Promise { - if (!options) { - throw new Error("Options are required to authenticate with EthWalletProvider."); + throw new Error( + 'Options are required to authenticate with EthWalletProvider.' + ); } return EthWalletProvider.authenticate({ @@ -72,7 +73,7 @@ export default class EthWalletProvider extends BaseProvider { /** * Generate a wallet signature to use as an auth method - * + * * @param {EthWalletAuthenticateOptions} options * @param {string} [options.address] - Address to sign with * @param {function} [options.signMessage] - Function to sign message with @@ -81,7 +82,7 @@ export default class EthWalletProvider extends BaseProvider { * @returns {Promise} - Auth method object containing the auth signature * @static * @memberof EthWalletProvider - * + * * @example * ```typescript * const authMethod = await EthWalletProvider.authenticate({ @@ -107,7 +108,6 @@ export default class EthWalletProvider extends BaseProvider { domain?: string; origin?: string; }): Promise { - if (!litNodeClient.latestBlockhash) { throwError({ message: @@ -122,10 +122,15 @@ export default class EthWalletProvider extends BaseProvider { let authSig: AuthSig; // convert to EIP-55 format or else SIWE complains - address = address || await signer?.getAddress!() || (signer as ethers.Wallet)?.address; + address = + address || + (await signer?.getAddress!()) || + (signer as ethers.Wallet)?.address; if (!address) { - throw new Error(`Address is required to authenticate with EthWalletProvider. Cannot find it in signer or options.`); + throw new Error( + `Address is required to authenticate with EthWalletProvider. Cannot find it in signer or options.` + ); } address = ethers.utils.getAddress(address);