togglePopups
How to call the API from an app
const snapId = `npm:@hashgraph/hedera-identify-snap`
const handleTogglePopupsAPI = async () => {
await window.ethereum.request({
method: 'wallet_invokeSnap',
params: {
snapId,
request: { method: 'togglePopups', params: { } }
}
})
}How the API is handled between the app and snap

What the API does
Retrieves the currently connected account and the blockchain network the user has selected on Metamask. If it's the first time, the account info is also saved in snap state.
Checks the current behavior for handling Metamask popups in snap state.
Enable/disable the Metamask popups.
Returns a value of type "boolean" for success/failure.

Live Demo on CodePen
Last updated
Was this helpful?

