Package detail

iso-filecoin

hugomrdias49.9kMIT7.4.7

Isomorphic filecoin abstractions for RPC, signatures, address, token and wallet

token, filecoin, crypto, wallet

readme

iso-filecoin

npm (scoped) GitHub Workflow Status (with event)

Filecoin Javascript Standard Library. Used by the Metamask Filecoin Wallet and Ledger Live Filecoin app.

Install

pnpm install iso-filecoin

Usage

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'

Docs

Check docs website

Contributing

Read contributing guidelines.

Open in GitHub Codespaces

License

MIT © Hugo Dias