Issues connecting with snap
Before holidays, the snap integration demo used to fully work for me: https://docs.aeternity.com/aepp-sdk-js/v14.0.0/examples/browser/aepp/#
Now I get this when clicking 'basic functionality' :
Balance
Error: Address not available
Height
1063523
Node info
{
"name": "testnet",
"url": "https://testnet.aeternity.io",
"nodeNetworkId": "ae_uat",
"version": "7.1.0",
"consensusProtocolVersion": 6
}
Compiler version
8.0.0
and as status when I click the 'Install Snap' button:
Status
{
"blocked": false,
"enabled": true,
"id": "npm:@aeternity-snap/plugin",
"initialPermissions": {
"endowment:network-access": {},
"endowment:rpc": {
"dapps": true,
"snaps": false
},
"snap_dialog": {},
"snap_getBip32Entropy": [
{
"curve": "ed25519",
"path": [
"m",
"44'",
"457'"
]
}
],
"snap_manageState": {}
},
"version": "0.0.9"
}
´´´
It feels like it's missing some sort of permissions now ? Can you reproduce ?
Here is a tiny repro - I tried using the ethereum connector to connect the page to metamask first, but no result, could be an issue inside stackblitz though, I don't know: https://stackblitz.com/edit/stackblitz-starters-wzjs8jwy?file=src%2Fapp%2Fapp.component.ts,src%2Findex.html (check app.component.ts )
The error you have in stackblitz is "UnsupportedPlatformError: Aeternity snap is not installed to MetaMask".
You missed calling await accountFactory.installSnap(); before await accountFactory.initialize(0). I've added this and it looks to be working:
The aepp example still works for me, but it requires extra interactions for debugging purposes. Don't you forget to press "Add account" before switching to "Basic functionality"?
Hey, adding that one line indeed seems to help - but the function naming seems to be misleading then ? installSnap() sounds like it would literally ask me to install the snap or whatever, which is already present in my metamask. what is installSnap exactly doing then ?
Same goes for 'add account' - I get the idea now, it requests permission from metamask to interact with the account i added there.
what is installSnap exactly doing then?
If Snap is not installed, it will ask you to install it; otherwise, it will just return its version.
I am having a problem connecting with MM snap.
When the Superhero wallet is present, new AccountMetamaskFactory() does not return the MetaMask provider. Therefore, the .installSnap() method does nothing, and the app hangs.
I previously reported to the SH wallet team about SH conflicting with MM. They made some changes to resolve the issue, but now Snap is not working. I think they are overriding MM provider.. Is it possible to make sure AccountMetamaskFactory returns MM provider?