From 0853ce8b9358bbddfe4af9d9d38f75855046784f Mon Sep 17 00:00:00 2001 From: michalsmiarowski Date: Thu, 27 Jul 2023 10:49:43 +0200 Subject: [PATCH] Pass project id through a constructor Pass wallet connect project id through ledger live constructor. --- src/web3/connectors/ledgerLive.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/web3/connectors/ledgerLive.ts b/src/web3/connectors/ledgerLive.ts index 7d465be97..9e0e5ece6 100644 --- a/src/web3/connectors/ledgerLive.ts +++ b/src/web3/connectors/ledgerLive.ts @@ -14,12 +14,14 @@ interface LedgerLiveConnectorArguments extends AbstractConnectorArguments { rpc: { [chainId: number]: string } + walletConnectProjectId: string } export class LedgerLiveConnector extends AbstractConnector { private rpc: LedgerLiveConnectorArguments["rpc"] private provider?: EthereumProvider private connectKitPromise: Promise + private walletConnectProjectId: string constructor(args: Required) { super({ @@ -29,6 +31,7 @@ export class LedgerLiveConnector extends AbstractConnector { }) this.rpc = args.rpc + this.walletConnectProjectId = args.walletConnectProjectId this.handleNetworkChanged = this.handleNetworkChanged.bind(this) this.handleChainChanged = this.handleChainChanged.bind(this) @@ -64,7 +67,7 @@ export class LedgerLiveConnector extends AbstractConnector { const checkSupportResult = connectKit.checkSupport({ chains: [chainId], walletConnectVersion: 2, - projectId: getEnvVariable(EnvVariable.WALLET_CONNECT_PROJECT_ID), + projectId: this.walletConnectProjectId, providerType: SupportedProviders.Ethereum, rpcMap: this.rpc, }) @@ -129,6 +132,7 @@ export const ledgerLive = new LedgerLiveConnector({ rpc: { [Number(supportedChainId)]: rpcUrl as string, }, + walletConnectProjectId: getEnvVariable(EnvVariable.WALLET_CONNECT_PROJECT_ID), }) class ConnectorNotAcivatedError extends Error {