From 0c7bd6cac1924d252931a2287901220c299fa584 Mon Sep 17 00:00:00 2001 From: Calvin Chang Date: Thu, 11 Jan 2024 13:21:15 +0800 Subject: [PATCH] refactor: walletServer replace duplicate expression --- packages/blocto-sdk/src/providers/ethereum.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/blocto-sdk/src/providers/ethereum.ts b/packages/blocto-sdk/src/providers/ethereum.ts index ea05442b..2ab78b76 100644 --- a/packages/blocto-sdk/src/providers/ethereum.ts +++ b/packages/blocto-sdk/src/providers/ethereum.ts @@ -149,12 +149,13 @@ export default class EthereumProvider `Get support chain failed: ${this.networkVersion} might not be supported yet.` ); } + const walletServer = + this.injectedWalletServer || + ETH_ENV_WALLET_SERVER_MAPPING[blocto_service_environment]; this._blocto = { ...this._blocto, sessionKeyEnv: ETH_SESSION_KEY_MAPPING[blocto_service_environment], - walletServer: - this.injectedWalletServer || - ETH_ENV_WALLET_SERVER_MAPPING[blocto_service_environment], + walletServer, blockchainName: name, networkType: network_type, switchableNetwork: { @@ -163,8 +164,7 @@ export default class EthereumProvider name, display_name, network_type, - wallet_web_url: this.injectedWalletServer || - ETH_ENV_WALLET_SERVER_MAPPING[blocto_service_environment], + wallet_web_url: walletServer, rpc_url: this.rpc, }, },