Skip to content
An API client for Filecoin
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
src
test
.gitignore
.npmignore
API.md
COPYRIGHT
LICENSE-APACHE
LICENSE-MIT
README.md
package-lock.json
package.json
webpack.config.js
webpack.dev.config.js

README.md

filecoin-api-client

CircleCI branch dependencies Status JavaScript Style Guide

An API client for Filecoin

⚠️ WARNING: Filecoin is under heavy development and breaking changes are highly likely between versions. This library is experimental, incomplete and unsupported by the Filecoin team. It may be broken in part or in entirety.

🧩 Currently compatible with Filecoin 0.3.2

Install

npm i filecoin-api-client

Usage

Node.js

const Filecoin = require('filecoin-api-client')

const fc = Filecoin({
  apiAddr: '/ip4/127.0.0.1/tcp/3453/http' // (optional, default)
})

// see API below for usage

Browser

<script src="https://unpkg.com/filecoin-api-client/dist/Filecoin.js"></script>
<script>
  const fc = Filecoin({
    apiAddr: '/ip4/127.0.0.1/tcp/3453/http' // (optional, default)
  })

  // see API below for usage
</script>

CORS

In a web browser, the Filecoin API client might encounter an error saying that the origin is not allowed. This is a CORS ("Cross Origin Resource Sharing") failure: Filecoin servers send HTTP headers allowing access to only certain origins by default. You can whitelist the origins that you are calling from by changing your Filecoin config like this:

$ filecoin config api.accessControlAllowOrigin '["http://example.com"]'

API

Status: 35/57 61%

Contribute

Feel free to dive in! Open an issue or submit PRs.

License

The Filecoin Project is dual-licensed under Apache 2.0 and MIT terms:

You can’t perform that action at this time.