iso-filecoin-wallets
Version:
Filecoin Wallet Adapters.
49 lines (29 loc) • 1.48 kB
Markdown
[](https://www.npmjs.com/package/iso-filecoin-wallets)
[](https://github.com/fission-codes/filecoin/actions/workflows/iso-filecoin-wallets.yml)
Unified wallet interface for filsnap, ledger, HD, Raw and more.
## Install
```bash
pnpm install iso-filecoin-wallets iso-filecoin filsnap-adapter
```
## Usage
```js
import { WalletAdapterHd } from 'iso-filecoin-wallets/hd'
const adapter = new WalletAdapterHd({
mnemonic: 'raw include ecology social turtle still perfect trip dance food welcome aunt patient very toss very program estate diet portion city camera loop guess'
})
adapter.connect({network: 'mainnet'})
const address = adapter.account.address.toString()
// 'f17levgrkmq7jeloew44ixqokvl4qdozvmacidp7i'
const {network, account} = adapter.changeNetwork({network: 'testnet'})
console.log(account.address.toString())
// t1xciji452owqgqmyuphjbv3ubfkhpsvvxrcnfgpq
await wallet.disconnect()
```
Check [docs website](https://filecoin.hugomrdias.dev)
Read contributing guidelines [here](../../.github/CONTRIBUTING.md).
[](https://codespaces.new/hugomrdias/filecoin)
[](../../license) © [Hugo Dias](http://hugodias.me)