⨎ Filecoin Wallet on Metamask

Jun 1, 2024 • 3 min read

Connect to Filecoin dapps using Metamask. Manage Filecoin accounts, send FIL to Native and FEVM accounts and enable FEVM transaction insights.

Filecoin Metamask Snap and related packages enable developers to add Filecoin integration to their dapps.

This Snap enables storage of native Filecoin private keys in Metamask’s local vault, to support native Filecoin addresses (e.g. f1 addresses or t1 testnet addresses).

For FEVM (Filecoin EVM) address support using Ethereum-style 0x addresses, you can also use regular Metamask directly without installing this Snap.

If you’re using FEVM, the Snap can also show your 0x address info and its equivalent Filecoin f410 address. (More info about 0x / f410 addresses can be found in the Filecoin Docs - Ethereum Address Manager.)

Resources

Packages

Examples

Usage

You can install and use filsnap using the Metamask provider.

import { getProvider } from 'filsnap-adapter'
const provider = await getProvider()
// Install filsnap
try {
const result = await provider.request({
method: 'wallet_requestSnaps',
params: {
'npm:filsnap': {
version: '^0.4.0', // Optional, defaults to latest
},
},
})
console.log(result)
/**
{
'npm:filsnap': {
version: '1.0.0',
id: 'npm:filsnap',
enabled: true,
blocked: false,
},
}
*/
// Get filsnap metadata
const snap = await provider.request({ method: 'wallet_getSnaps' })
// Get balance
const balance = await provider.request({
method: 'wallet_invokeSnap',
params: { snapId: 'npm:filsnap', method: 'fil_getBalance' },
})
/**
{
result: '100699819802794525019',
error: null
}
*/
} catch (error) {
console.log(error)
}

We recommend using filsnap-adapter to interact with filsnap for a simpler interface. Check the full API documentation here.

Architecture

Security Audits

Filsnap v1.0.1 - The FilSnap v0.5.0 was audited by ConsenSys Diligence in August 2023 with a follow-up assessment of fixes conducted in October 2023, leading to the release of filsnap-v1.0.1. The complete audit report is available here in the audits/ directory as well as on the ConsenSys Diligence website.

Back to projects