A JavaScript (and TypeScript) library for interacting with the Filecoin's Lotus node, with support for external signers.
⚠️ The library is currently in ALPHA: things will not work or work incorectly, will break and the API will change! ⚠️
Installing
Node:
npm install --save filecoin.js
Browser:
<!-- window.FilecoinJs object contains the library exports -->
Using
Node JavaScript/TypeScript:
; async { const connector = url: __LOTUS_RPC_ENDPOINT__ token: __LOTUS_AUTH_TOKEN__ ; const hdWalletMnemonic = 'equip ... young'; const hdWalletPassword = '...'; const hdDerivationPath = `m/44'/461'/0'/0/0`; const walletProvider = connector hdWalletMnemonic hdWalletPassword hdDerivationPath ; const myAddress = await walletProvider; console; // f1zx43cf6qb6rd... };
Browser:
Examples
Sending some FIL to someAddress
:
const message = await walletProvider; const msgCid = await walletProvider;
Check out the tests or examples folders for more usage examples.
Documentation
As with the rest of the library, the documentation is WIP. As it evolves the documentation site will be updated.
Contributing
Feel free to join in. All welcome. Open an issue!
License
Dual-licensed under MIT + Apache 2.0