Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.
mace edited this page Jul 30, 2020 · 14 revisions

Welcome to Filecoin snap wiki!

Contents

Architecture

Filecoin Metamask snap is installed using metamask-filecoin-adapter. Ussage flow is represented in the diagram below and described in more details inside integration steps.

Integration

Prerequisites

npm i @nodefactory/metamask-filecoin-adapter

npm i @nodefactory/metamask-filecoin-types


Integration steps

  1. Install snap by calling enableFilecoinSnap() from @nodefactory/metamask-filecoin-adapter package.

This will prompt user to:

  • accept the snap installation
  • accept all snap permissions

This function accepts the configuration object for defining network properties, same as configure method from Filecoin Snap API. After successful installation, it will return MetamaskFilecoinSnap object (see Architecture overview for details).

  1. Invoke Filecoin Snap API

MetamaskFilecoinSnap object has an exposed method for obtaining API getFilecoinSnapApi(): Promise<FilecoinSnapApi>. For more details about exposed API see API documentation.

Clone this wiki locally