diff --git a/src/connectors/argentMobile/index.ts b/src/connectors/argentMobile/index.ts index 7c0b328..cd28c37 100644 --- a/src/connectors/argentMobile/index.ts +++ b/src/connectors/argentMobile/index.ts @@ -9,6 +9,7 @@ import { ConnectorNotConnectedError, ConnectorNotFoundError, UserNotConnectedError, + UserRejectedRequestError, } from "../../errors" import { resetWalletConnect } from "../../helpers/resetWalletConnect" import { @@ -195,6 +196,11 @@ export class ArgentMobileConnector extends Connector { const _wallet = await getStarknetWindowObject(options) + // getStarknetWindowObject returns null when the user rejects the connection + if (!_wallet) { + throw new UserRejectedRequestError() + } + this._wallet = _wallet // wallet connect rpc enable