
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@filecoin-shipyard/lotus-client-schema
Advanced tools
This package contains some .js files that describe methods exported by the Lotus JSON-RPC API.
See filecoin-shipyard/js-lotus-client for examples that show how to use these schemas.
const { LotusRPC } = require('@filecoin-shipyard/lotus-client-rpc')
const { NodejsProvider } = require('@filecoin-shipyard/lotus-client-provider-nodejs')
const { mainnet } = require('@filecoin-shipyard/lotus-client-schema')
const url = 'ws://127.0.0.1:7777/rpc/v0'
const provider = new NodejsProvider(url)
const client = new LotusRPC(provider, { schema: mainnet.fullNode })
The following schema objects are exported:
mainnet.fullNode - used to talk to a Lotus "Full Node" (lotus)mainnet.storageMiner - used to talk to a Lotus storage miner (lotus-miner)mainnet.gatewayApi - used to talk to public Lotus API Gateway (lotus-gateway)mainnet.walletApi - a subset of methods for walletsmainnet.workerApi - used to talk to lotus-worker (for mining)mainnet.common - a subset of methods used by a number of different daemonsRight now, the schema is extremely simple, as the JS library only needs to know if a method supports subscriptions or not. The JS library is very light, so all method parameters are just passed through to the JSON-RPC request.
In the future, the schema could be extended to provide more parameter and type information to make it easier to validate and marshal/unmarshal requests and responses.
For example, the entry for the ChainHead method is currently just:
ChainHead: {}
The ChainNotify entry supports JSON-RPC subscriptions, so it looks like this:
ChainNotify: {
subscription: true
}
Each API is represented by an Object with a single methods property which
is an Object with all the methods supported.
If you are trying to use a JSON-RPC API method that isn't in the schema yet,
don't be afraid to "monkey-patch" the schemas distributed via this package
to add any missing methods ... eg. mainnet.fullNode.methods.MyMissingMethod = {}
Lotus is constantly being updated. There is a simple tool (written in go) in the go-schemagen directory that links against a Lotus source code tree (modify the replace directory in go.mod or make a symlink) and outputs the current set of method signatures as JSON. The generate-schema-for-api.sh script can be used to generate the JavaScript schemas. To simplify the process, there is an npm script to run the update:
npm run build:schema
The TypeScript definitions generated by go-tsgen are used by the @filecoin-shipyard/lotus-client-rpc package. See https://github.com/filecoin-shipyard/js-lotus-client-rpc#re-generating-typescript-definitions for details on how to update the definitions in that package using the tool located here.
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
FAQs
Lotus JS Client API Schema
The npm package @filecoin-shipyard/lotus-client-schema receives a total of 525 weekly downloads. As such, @filecoin-shipyard/lotus-client-schema popularity was classified as not popular.
We found that @filecoin-shipyard/lotus-client-schema demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.