Filecoin.js

Filecoin.js

  • Documentation
  • API Reference
  • GitHub

›Getting started

Getting started

  • Introduction
  • Adding Filecoin.js
  • Guides example
  • WS vs HTTP

Setup Wallet Providers

  • Setup lotus provider
  • Setup mnemonic provider
  • Setup metamask provider

Using a provider

  • Send message
  • Sign message
  • Verify message
  • Check if message is mined

Extra

  • Payment channels
  • State methods
  • Multisig Wallets

Contributing

  • How to contribute
  • Development workflow

Guides example

Node JavaScript/TypeScript:

import { HttpJsonRpcConnector, LotusClient } from 'filecoin.js';

(async () => {

  const httpConnector = new HttpJsonRpcConnector({ url: __LOTUS_HTTP_RPC_ENDPOINT__, token: __LOTUS_AUTH_TOKEN__ });

  const lotusClient = new LotusClient(httpConnector);
  const version = await lotusClient.common.version();
  console.log(version);

})().then().catch();

Browser:

<script type="text/javascript" src="https://unpkg.com/filecoin.js"></script>
<script type="text/javascript">
(async () => {

  const httpConnector = new FilecoinJs.HttpJsonRpcConnector({ url: __LOTUS_HTTP_RPC_ENDPOINT__, token: __LOTUS_AUTH_TOKEN__ });

  const lotusClient = new FilecoinJs.LotusClient(httpConnector);
  const version = await lotusClient.common.version();
  console.log(version);

})().then().catch();
</script>
← Adding Filecoin.jsWS vs HTTP →
Docs
Getting StartedAPI Reference
Community
Slack
More
BlogGitHubStar
Copyright © 2022 Filecoin