ChainSafe / filsnap

MetaMask snap for interacting with Filecoin dapps.
https://filsnap.chainsafe.io
Apache License 2.0
107 stars 41 forks source link

[bug]: The filsnap adapter is breaking after MetaMask Flask update #243

Closed navFooh closed 1 year ago

navFooh commented 1 year ago

Describe the bug

Metamask Flask has had a recent update and replaced the wallet_enable RPC method. It seems like there has also been a change in the wallet_snap_* methods, but I'm not sure how much that affects the filsnap adapter. Currently it's not possible to install the Filecoin snap using the enableFilecoinSnap method.

To Reproduce

import { enableFilecoinSnap } from '@chainsafe/filsnap-adapter'

enableFilecoinSnap({
  network: 't',
  rpc: {
    token: '',
    url: 'https://api.node.glif.io/rpc/v1',
  },
}, 'npm:@chainsafe/filsnap')

Relevant log output

MetaMask - RPC Error: The method "wallet_enable" does not exist / is not available.
{
    "code": -32601,
    "message": "The method \"wallet_enable\" does not exist / is not available.",
    "data": {
        "origin": "http://localhost:3000"
    }
}

Expected behavior

The Filecoin snap should be installed.

Additional context