From 613db1e218834b2d7e6d4ddfc8daacd04865726a Mon Sep 17 00:00:00 2001 From: bluecco Date: Tue, 9 Apr 2024 14:39:40 +0200 Subject: [PATCH] fix: provider in account --- src/connectors/injected/index.ts | 7 +++++++ src/connectors/webwallet/helpers/openWebwallet.ts | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/connectors/injected/index.ts b/src/connectors/injected/index.ts index 4576080..c1509c7 100644 --- a/src/connectors/injected/index.ts +++ b/src/connectors/injected/index.ts @@ -121,6 +121,13 @@ export class InjectedConnector extends Connector { let accounts try { accounts = await this._wallet.enable({ starknetVersion: "v5" }) + + const { provider } = this._options + if (provider) { + Object.assign(this._wallet.account, { + provider, + }) + } } catch { // NOTE: Argent v3.0.0 swallows the `.enable` call on reject, so this won't get hit. throw new UserRejectedRequestError() diff --git a/src/connectors/webwallet/helpers/openWebwallet.ts b/src/connectors/webwallet/helpers/openWebwallet.ts index 8ede2f5..f5403e0 100644 --- a/src/connectors/webwallet/helpers/openWebwallet.ts +++ b/src/connectors/webwallet/helpers/openWebwallet.ts @@ -54,6 +54,7 @@ export const openWebwallet = async ( return await getWebWalletStarknetObject( origin, windowProxyClient, + provider, undefined, ) } @@ -91,6 +92,7 @@ export const openWebwallet = async ( return await getWebWalletStarknetObject( origin, windowProxyClient, + provider, undefined, ) }