hello
How to call the API from an app
const snapId = `npm:@hashgraph/hedera-identify-snap`
const handleHelloAPI = async () => {
await window.ethereum.request({
method: 'wallet_invokeSnap',
params: {
snapId,
request: { method: 'hello', 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.
Displays an alert dialog blox on Metamask with some content.

Live Demo on CodePen
Last updated
Was this helpful?