getAvailableDIDMethods
How to call the API from an app
const snapId = `npm:@hashgraph/hedera-identify-snap`
const handleGetAvailableDIDMethodsAPI = async () => {
await window.ethereum.request({
method: 'wallet_invokeSnap',
params: {
snapId,
request: {
method: 'getAvailableMethods',
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.
Retrieves the available DID methods that Identify Snap supports. We currently only support
did:pkhbut there are plans to support more DID methods in the future. If you would like us to add a support for a DID method that you would like, feel free to let us know at [email protected]
Some example responses:
Live Demo on CodePen
Last updated
Was this helpful?

