MetaLinkFilecoin snap (plugin) enables Filecoin network inside Metamask and by doing this provides DAPPs easy integration.
MetaLinkFilecoin snap is installed using metalink-filecoin-adapter. Usage flow is represented in the diagram below.
Add metalink-filecoin-adapter and metalink-filecoin-types package to your project
npm i @stfil/metalink-filecoin-adapter
npm i @stfil/metalink-filecoin-types
Install snap by calling enableMetaLinkFilecoinSnap
from @stfil/metalink-filecoin-adapter
package.
This will prompt the user to:
- accept the snap installation
- accept all snap permissions
This function accepts the configuration object for defining network properties, the same as configure method from MetaLinkFilecoin Snap API
. After successful installation, it will return MetaLinkFilecoinSnap
object.
MetaLinkFilecoinSnap
object has an exposed method for obtaining API getApi
.
For more details about exposed API see API documentation.