0.0.2 • Published 3 months ago

iso-filecoin-wallets v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

iso-filecoin

npm (scoped) GitHub Workflow Status (with event)

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

Used by the Metamask Filecoin Wallet.

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 here.

Open in GitHub Codespaces

License

MIT © Hugo Dias