Isomorphic filecoin abstractions for RPC, signatures, address, token and wallet.
Used by the Metamask Filecoin Wallet.
pnpm install iso-filecoin
import { Token } from 'iso-filecoin/token'
import * as Wallet from 'iso-filecoin/wallet'
Token.fromFIL(1).toPicoFIL().toString() // '1000000000000'
const mnemonic = Wallet.generateMnemonic()
const seed = Wallet.mnemonicToSeed(mnemonic)
const account = Wallet.accountFromSeed(
seed,
'SECP256K1',
"m/44'/461'/0'/0/0"
)
const account = Wallet.accountFromMnemonic(
mnemonic,
'SECP256K1',
"m/44'/461'/0'/0/0"
)
const address = account.address.toString() // 'f17levgrkmq7jeloew44ixqokvl4qdozvmacidp7i'
Check https://hugomrdias.github.io/filecoin
Read contributing guidelines here.