What's Changed
New
- Added the
isPeraDiscoverBrowser
flag to enable auto-connection in the Pera Discover Browser. This flag checks if the app is opened in the Pera Discover Browser and returns a boolean
.
Before
<button onClick={handleClickConnectWallet}>Connect wallet</button>
function handleClickConnectWallet() {
openWalletOptions();
// Display wallet options
}
After
<button onClick={handleClickConnectWallet}>Connect wallet</button>
async function handleClickConnectWallet() {
if (peraWallet.isPeraDiscoverBrowser) {
const accounts = await peraWallet.connect();
// Handle connection success
} else {
openWalletOptions();
// Display wallet options
}
}