#Requested account cannot be connected
4 messages · Page 1 of 1 (latest)
The "Requested account cannot be connected" error when connecting Pera Wallet to your Algorand dApp is related to an unauthorized signer issue. Based on the knowledge sources, here are the most likely causes and fixes:
Common Causes & Solutions
1. Wallet Not Properly Connected
Ensure the wallet is fully connected before attempting any account access. Use the useWallet() hook to check connection state:
import { useWallet } from '@txnlab/use-wallet-react'
function ConnectWallet() {
const { wallets, activeAddress } = useWallet()
if (activeAddress) {
return <p>Connected: {activeAddress}</p>
}
return (
<div>
{wallets.map((wallet) => (
<button key={wallet.id} onClick={() => wallet.connect()}>
Connect {wallet.metadata.name}
</button>
))}
</div>
)
}
2. Signer Not Registered with AlgorandClient
After connecting, you must register the wallet signer before making contract calls:
const algorand = AlgorandClient.testNet()
algorand.setSigner(activeAddress, transactionSigner)
If you skip this step, you'll get a signer not found for address error. [React Frontend Reference]
3. Guard Against Null/Undefined State
Always check that activeAddress and transactionSigner are available before proceeding:
if (!activeAddress || !transactionSigner) {
alert('Please connect your wallet first')
return
}
4. Network Mismatch
Ensure your WalletManager and AlgorandClient are configured for the same network. For example, both should target TestNet:
const walletManager = new WalletManager({
wallets: [WalletId.PERA],
defaultNetwork: NetworkId.TESTNET,
})
// and
const algorand = AlgorandClient.testNet()
5. ARC-0027 Unauthorized Signer (Error Code 4100)
Per the ARC-0027 standard, if the account has not been granted permission by the provider, an UnauthorizedSignerError (code 4100) is thrown. This means the wallet has not authorized the specific account for signing. In this case, you should prompt the user to reconnect and explicitly approve the account in their Pera Wallet. [ARC-0027 Errors]
Summary of quick checks:
- Is Pera Wallet installed and unlocked?
- Did the user approve the connection request in the wallet UI?
- Are your dApp and wallet on the same network (e.g., both TestNet)?
- Is
algorand.setSigner(activeAddress, transactionSigner)called after connecting?
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@dusty lance Kapa.ai is still learning and improving, please let me know how I did by reacting below.