Introduction
The Lotus JS Client is a collection of small JavaScript libraries that you can use to communicate with the Lotus implementation of Filecoin via it's JSON-RPC API.
The Lotus daemons exposes JSON-RPC methods via HTTP and WebSockets that can be called from any language. Applications and websites written in JavaScript can make calls to the endpoints directly using the raw JSON-RPC API, or they can use these libraries to make accessing the APIs more convenient and ergonomic from common JavaScript environments.
For more information on other libraries and languages, and for basic information on how to build applications for Filecoin, check out the "Build" documentation on docs.filecoin.io.
Lotus JSON-RPC API
JSON-RPC is a standardized way to encode remote procedure calls in JSON. Projects such as Bitcoin and Ethereum have adopted it for use in their APIs.
Lotus uses JSON-RPC calls transported via HTTP or Websockets to communicate between different daemons and command line tools.
For example, when you run the Lotus node with lotus daemon
, it will listen for connections on TCP port 1234 (by default).
Applications may connect to this port and issue JSON-RPC calls. For example, using CURL, if we want to call the Filecoin.Version method, we might do this:
curl -X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"method": "Filecoin.Version",
"params": [],
"id": 1
}' \
http://127.0.0.1:1234/rpc/v0
The Lotus daemon will return a response that looks something like:
{"jsonrpc":"2.0","result":{"Version":"0.3.0+gite4b5f1df.dirty","APIVersion":512,"BlockDelay":6},"id":1}
Most of the time, when you run commands using the lotus
command line client, for example, lotus version
, it is actually connecting to the daemon using a WebSocket, and it is executing methods using JSON-RPC.
Different daemons that are part of Lotus support different sets of methods. When you execute lotus daemon
, it will listen on port 1234 (by default), exposes JSON-RPC methods for wallets, making deals, checking chain sync status, etc. When you run lotus-storage-miner run
, it will listen on port 2345 (by default), and it has a number of methods for doing things such as querying the status of sectors.
More details about the JSON-RPC API, including links to the lists of methods available, are at: docs.filecoin.io/reference/lotus-api
JSON-RPC and JavaScript
Calling the JSON-RPC using JavaScript from a web application is very simple, as HTTP and Websockets are part of almost every web browser, and JSON parsing is built into JavaScript. For example, the following code uses the Fetch API and async/await features found in any modern browser to query the Filecoin.Version
JSON-RPC method via HTTP:
async getVersion () {
const response = await fetch('http://127.0.0.1:1234/rpc/v0', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
method: `Filecoin.Version`,
params: [],
id: 1
}
})
const { result, error } = await response.json()
}
Caution: There is a big problem with the above code. Due to the web's Same-origin policy, the above code will not usually work unmodified in a web page as the API endpoint is likely on a different "origin" than the location the web page is hosted at. Read more about how to set up an endpoint in the endpoint deployment chapter.
Lotus JS Client
To make developing applications as easy as possible, the Lotus JS Client libraries are available. These libraries contain re-useable code to make the chore of interfacing with your Lotus Filecoin nodes and miners much more enjoyable.
Caution: These libraries are very new and currently under heavy development, as is Lotus and Filecoin. Expect many breaking changes. As the ecosystem matures, these libraries will evolve to become more stable and production ready.
These libraries are intended to be used in many different environments, including web pages, mobile apps, desktop apps, and server-side applications. Additionally, they will target different types of Lotus daemons, such as nodes or miners, and potentially other Filecoin implementations in the future. Also, it is expected that APIs will change over time, sometimes in incompatible ways, and it may be necessary to talk to multiple different versions in a heterogeneous environment.
For these reasons, and also with an eye towards encouraging a healthy ecosystem of community developed open-source modules, we have decided to develop many small modular JavaScript libraries that work well together.
We decided against developing a single monolithic library as it might get too large for lightweight use cases (eg. mobile web) and it would likely have a higher barrier for accepting individual contributions.
In the future, we may develop some convenience libraries that will bundle together multiple smaller libraries that are optimized for specific use cases. In the beginning, though, we will focus on modularity.
List of Libraries
Here is the list of libraries that make up the Lotus JS Client ecosystem.
All-in-one Libraries
At the moment, we are not shipping any JavaScript libraries that combine a schema, plus a provider, plus low-level or high-level API wrappers. We may prepare an opinionated bundle in the future in order to make it easier for apps to integrate the most common configurations with a single library import. In the meantime, feel free to combine the following libraries yourself, or contribute new libraries to the community.
Schema
Contains JSON data representing the available methods in the Lotus JSON-RPC API (and possibly others in the future). This data can be used by other libraries to make calls against the API, or to generate documentation, etc.
- @filecoin-shipyard/lotus-client-schema (GitHub) - contains schemas for the current master branch of Lotus + additional development branches
Provider Libraries
Pluggable "Providers" let you select a module with the code you need to connect to a Lotus node from a particular environment, such as a web page, from Node.js, or from a mobile app. Inspired by "providers" in the Ethereum ecosystem.
-
@filecoin-shipyard/lotus-client-provider-browser (GitHub) - lightweight provider for web browsers that communicates to Lotus using WebSockets or HTTP
-
@filecoin-shipyard/lotus-client-provider-nodejs (GitHub) - provider for Node.js that communicates to Lotus using WebSockets or HTTP - it wraps the browser provider and includes
ws
andnode-fetch
for WebSocket and browser-compatible Fetch API support
The interfaces that providers must implement are not yet defined, and will likely evolve over time.
Low-level Libraries
These libraries are used together with a schema for a particular API and a provider library to allow JavaScript programs to call JavaScript methods in the library which will get sent to the Lotus API as JSON-RPC requests.
- @filecoin-shipyard/lotus-client-rpc (GitHub) - a very simple library that simply passes parameters to JSON-RPC with no extra formatting, and results are returned as plain JavaScript objects
In the future, we will introduce additional low-level libraries that have more knowledge of how to marshall/unmarshall requests and responses to/from the JSON-RPC API into appropriate JavaScript classes with extra support for specific data types and Filecoin features.
High-level Libraries
We will be experimenting and collecting feedback on ideas for useful abstractions that build on top of the low level libraries to make it even easier to build applications with Lotus and Filecoin.
Helper Libraries
The following libraries provide support for handling specific data types or features and work well with the Lotus JS Client libraries:
- @openworklabs/filecoin-number (GitHub) - A wrapper around bignumber with AttoFil and currency conversions
- @openworklabs/filecoin-message (GitHub) - JS implementation of the Filecoin message type, used to transfer tokens and make state changes
- @zondax/filecoin-signer-wasm (GitHub) (Docs) - Filecoin Signing Library - Rust / WASM / JSONRPC Service
Quick Start
README on GitHub
Take a look at the README on the GitHub project for a basic Usage example and links to additional examples and tutorials.
Plnkr Example
Because the library is just JavaScript, it runs in any web browser. If you want to just quickly experiment with some API calls, here is a minimalist example that runs in the browser that you can modify to try different calls out:
It is connected to a development "local net" which is reset periodically.
Full Tutorial
A full tutorial is available on docs.filcoin.io which guides you through building an example React.js app that implements a Filecoin Network Inspector.
Endpoint Deployment
A typical deployment will use a reverse proxy server to serve the endpoint on the same origin as the web page, or to add CORS headers. TODO: Link to working NGINX and Caddy Server configurations. Unlike HTTP, using WebSockets shifts the security burden to the server side, so the same-origin policy does not apply. A secure deployment will still need to set up a reverse proxy to compare the header data against a whitelist of origins permitted to receive a reply. A typical production API gateway deployment will also implement TLS encryption (https/wss).
API
These API docs are generated from the lotus-client-schema
and the lotus-client-rpc
Typescript delcarations, which are themselves generated directly from the Lotus source code. The following APIs are available:
- Full Node API - Talk to a Lotus "Full Node" (
lotus
). - Storage Miner API - Talk to a Lotus Storage Miner (
lotus-storage-miner
). - Gateway API - Talk to a Lotus Gateway (
lotus-gateway
). - Wallet API - A subset of API methods for wallets.
- Worker API - Talk to
lotus-worker
(for mining).
JSON-RPC Postman Docs
- Postman (courtesy of Open Work Labs)
Full Node API
Enable the API by passing the fullNode
schema to LotusRPC
e.g.
import { LotusRPC } from '@filecoin-shipyard/lotus-client-rpc'
import { mainnet } from '@filecoin-shipyard/lotus-client-schema'
import { NodejsProvider } from '@filecoin-shipyard/lotus-client-provider-nodejs'
const provider = new NodejsProvider('<PROVIDER_URL>')
const client = new LotusRPC(provider, { schema: mainnet.fullNode })
Lotus source: github.com/filecoin-project/lotus/api/api_full.go
API Reference
- Auth
- Beacon
- Chain
- chainDeleteObj
- chainExport
- chainGetBlock
- chainGetBlockMessages
- chainGetGenesis
- chainGetMessage
- chainGetNode
- chainGetParentMessages
- chainGetParentReceipts
- chainGetPath
- chainGetRandomnessFromBeacon
- chainGetRandomnessFromTickets
- chainGetTipSet
- chainGetTipSetByHeight
- chainHasObj
- chainHead
- chainNotify
- chainReadObj
- chainSetHead
- chainStatObj
- chainTipSetWeight
- Client
- clientCalcCommP
- clientDataTransferUpdates
- clientDealSize
- clientFindData
- clientGenCar
- clientGetDealInfo
- clientGetDealStatus
- clientGetDealUpdates
- clientHasLocal
- clientImport
- clientListDataTransfers
- clientListDeals
- clientListImports
- clientMinerQueryOffer
- clientQueryAsk
- clientRemoveImport
- clientRestartDataTransfer
- clientRetrieve
- clientRetrieveTryRestartInsufficientFunds
- clientRetrieveWithEvents
- clientStartDeal
- Gas
- Log
- Market
- Miner
- Misc
- Mpool
- Msig
- Net
- Paych
- State
- stateAccountKey
- stateAllMinerFaults
- stateCall
- stateChangedActors
- stateCirculatingSupply
- stateCompute
- stateDealProviderCollateralBounds
- stateGetActor
- stateGetReceipt
- stateListActors
- stateListMessages
- stateListMiners
- stateLookupID
- stateMarketBalance
- stateMarketDeals
- stateMarketParticipants
- stateMarketStorageDeal
- stateMinerActiveSectors
- stateMinerAvailableBalance
- stateMinerDeadlines
- stateMinerFaults
- stateMinerInfo
- stateMinerInitialPledgeCollateral
- stateMinerPartitions
- stateMinerPower
- stateMinerPreCommitDepositForPower
- stateMinerProvingDeadline
- stateMinerRecoveries
- stateMinerSectorCount
- stateMinerSectors
- stateNetworkName
- stateNetworkVersion
- stateReadState
- stateReplay
- stateSearchMsg
- stateSectorExpiration
- stateSectorGetInfo
- stateSectorPartition
- stateSectorPreCommitInfo
- stateVMCirculatingSupplyInternal
- stateVerifiedClientStatus
- stateVerifiedRegistryRootKey
- stateVerifierStatus
- stateWaitMsg
- stateWaitMsgLimited
- Sync
- Wallet
Auth
authNew
authNew (permission: Array<string>): Promise<string>
Parameters:
permission
:Array<string>
Returns:
Promise<string>
Source: index.d.ts, line 128, character 9
authVerify
authVerify (str: string): Promise<Array<string>>
Parameters:
str
:string
Returns:
Promise<Array<string>>
Source: index.d.ts, line 129, character 12
Beacon
The Beacon method group contains methods for interacting with the random beacon (DRAND).
beaconGetEntry
beaconGetEntry (chainEpoch: number): Promise<BeaconEntry>
Returns the beacon entry for the given filecoin epoch. If the entry has not yet been produced, the call will block until the entry becomes available
Parameters:
chainEpoch
:number
Returns:
Promise<BeaconEntry>
Source: index.d.ts, line 156, character 16
Chain
The Chain method group contains methods for interacting with the blockchain, but that do not require any form of state computation.
- chainDeleteObj
- chainExport
- chainGetBlock
- chainGetBlockMessages
- chainGetGenesis
- chainGetMessage
- chainGetNode
- chainGetParentMessages
- chainGetParentReceipts
- chainGetPath
- chainGetRandomnessFromBeacon
- chainGetRandomnessFromTickets
- chainGetTipSet
- chainGetTipSetByHeight
- chainHasObj
- chainHead
- chainNotify
- chainReadObj
- chainSetHead
- chainStatObj
- chainTipSetWeight
chainDeleteObj
chainDeleteObj (cid: Cid): Promise<void>
Deletes node referenced by the given CID
Parameters:
cid
:Cid
Returns:
Promise<void>
Source: index.d.ts, line 160, character 16
chainExport
chainExport (handler: (data: string) => void, chainEpoch: number, bool: boolean, tipSetKey: Cid[]): [() => void, Promise<void>]
Returns a stream of bytes with CAR dump of chain data. The exported chain data includes the header chain from the given tipset back to genesis, the entire genesis state, and the most recent 'nroots' state trees. If oldmsgskip is set, messages from before the requested roots are also not included.
Parameters:
handler
:(data: string) => void
chainEpoch
:number
bool
:boolean
tipSetKey
:Cid[]
Returns:
[() => void, Promise<void>]
Source: index.d.ts, line 168, character 13
chainGetBlock
chainGetBlock (cid: Cid): Promise<BlockHeader>
Returns the block specified by the given CID.
Parameters:
cid
:Cid
Returns:
Promise<BlockHeader>
Source: index.d.ts, line 172, character 15
chainGetBlockMessages
chainGetBlockMessages (cid: Cid): Promise<BlockMessages>
Returns messages stored in the specified block.
Parameters:
cid
:Cid
Returns:
Promise<BlockMessages>
Source: index.d.ts, line 176, character 23
chainGetGenesis
chainGetGenesis (): Promise<TipSet>
Returns the genesis tipset.
Returns:
Promise<TipSet>
Source: index.d.ts, line 180, character 17
chainGetMessage
chainGetMessage (cid: Cid): Promise<Message>
Reads a message referenced by the specified CID from the chain blockstore.
Parameters:
cid
:Cid
Returns:
Promise<Message>
Source: index.d.ts, line 185, character 17
chainGetNode
chainGetNode (str: string): Promise<IpldObject>
Parameters:
str
:string
Returns:
Promise<IpldObject>
Source: index.d.ts, line 186, character 14
chainGetParentMessages
chainGetParentMessages (cid: Cid): Promise<Array<Message1>>
Returns messages stored in parent tipset of the specified block.
Parameters:
cid
:Cid
Returns:
Promise<Array<Message1>>
Source: index.d.ts, line 191, character 24
chainGetParentReceipts
chainGetParentReceipts (cid: Cid): Promise<Array<MessageReceipt>>
Returns receipts for messages in parent tipset of the specified block.
Parameters:
cid
:Cid
Returns:
Promise<Array<MessageReceipt>>
Source: index.d.ts, line 196, character 24
chainGetPath
chainGetPath (tipSetKey: Cid[], tipSetKey1: Cid[]): Promise<Array<HeadChange>>
Returns a set of revert/apply operations needed to get from one tipset to another, for example:
to
^
from tAA
^ ^
tBA tAB
^---*--^
^
tRR
Would return [revert(tBA), apply(tAB), apply(tAA)]
Parameters:
Returns:
Promise<Array<HeadChange>>
Source: index.d.ts, line 212, character 14
chainGetRandomnessFromBeacon
chainGetRandomnessFromBeacon (tipSetKey: Cid[], domainSeparationTag: number, chainEpoch: number, bytes: string): Promise<string>
Is used to sample the beacon for randomness.
Parameters:
tipSetKey
:Cid[]
domainSeparationTag
:number
chainEpoch
:number
bytes
:string
Returns:
Promise<string>
Source: index.d.ts, line 216, character 30
chainGetRandomnessFromTickets
chainGetRandomnessFromTickets (tipSetKey: Cid[], domainSeparationTag: number, chainEpoch: number, bytes: string): Promise<string>
Is used to sample the chain for randomness.
Parameters:
tipSetKey
:Cid[]
domainSeparationTag
:number
chainEpoch
:number
bytes
:string
Returns:
Promise<string>
Source: index.d.ts, line 220, character 31
chainGetTipSet
chainGetTipSet (tipSetKey: Cid[]): Promise<TipSet>
Returns the tipset specified by the given TipSetKey.
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<TipSet>
Source: index.d.ts, line 224, character 16
chainGetTipSetByHeight
chainGetTipSetByHeight (chainEpoch: number, tipSetKey: Cid[]): Promise<TipSet>
Looks back for a tipset at the specified epoch. If there are no blocks at the specified epoch, a tipset at an earlier epoch will be returned.
Parameters:
chainEpoch
:number
tipSetKey
:Cid[]
Returns:
Promise<TipSet>
Source: index.d.ts, line 230, character 24
chainHasObj
chainHasObj (cid: Cid): Promise<boolean>
Checks if a given CID exists in the chain blockstore.
Parameters:
cid
:Cid
Returns:
Promise<boolean>
Source: index.d.ts, line 234, character 13
chainHead
chainHead (): Promise<TipSet>
Returns the current head of the chain.
Returns:
Promise<TipSet>
Source: index.d.ts, line 238, character 11
chainNotify
chainNotify (handler: (data: Array<HeadChange>) => void): [() => void, Promise<void>]
Returns channel with chain head updates. First message is guaranteed to be of len == 1, and type == 'current'.
Parameters:
handler
:(data: Array<HeadChange>) => void
Returns:
[() => void, Promise<void>]
Source: index.d.ts, line 243, character 13
chainReadObj
chainReadObj (cid: Cid): Promise<string>
Reads ipld nodes referenced by the specified CID from chain blockstore and returns raw bytes.
Parameters:
cid
:Cid
Returns:
Promise<string>
Source: index.d.ts, line 248, character 14
chainSetHead
chainSetHead (tipSetKey: Cid[]): Promise<void>
Forcefully sets current chain head. Use with caution.
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<void>
Source: index.d.ts, line 252, character 14
chainStatObj
chainStatObj (cid: Cid, cid1: Cid): Promise<ObjStat>
Returns statistics about the graph referenced by 'obj'. If 'base' is also specified, then the returned stat will be a diff between the two objects.
Parameters:
Returns:
Promise<ObjStat>
Source: index.d.ts, line 258, character 14
chainTipSetWeight
chainTipSetWeight (tipSetKey: Cid[]): Promise<string>
Computes weight for the specified tipset.
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<string>
Source: index.d.ts, line 262, character 19
Client
The Client methods all have to do with interacting with the storage and retrieval markets as a client.
- clientCalcCommP
- clientDataTransferUpdates
- clientDealSize
- clientFindData
- clientGenCar
- clientGetDealInfo
- clientGetDealStatus
- clientGetDealUpdates
- clientHasLocal
- clientImport
- clientListDataTransfers
- clientListDeals
- clientListImports
- clientMinerQueryOffer
- clientQueryAsk
- clientRemoveImport
- clientRestartDataTransfer
- clientRetrieve
- clientRetrieveTryRestartInsufficientFunds
- clientRetrieveWithEvents
- clientStartDeal
clientCalcCommP
clientCalcCommP (str: string): Promise<CommPRet>
Calculates the CommP for a specified file
Parameters:
str
:string
Returns:
Promise<CommPRet>
Source: index.d.ts, line 266, character 17
clientDataTransferUpdates
clientDataTransferUpdates (handler: (data: DataTransferChannel) => void): [() => void, Promise<void>]
Parameters:
handler
:(data: DataTransferChannel) => void
Returns:
[() => void, Promise<void>]
Source: index.d.ts, line 267, character 27
clientDealSize
clientDealSize (cid: Cid): Promise<DataSize>
Calculates real deal data size
Parameters:
cid
:Cid
Returns:
Promise<DataSize>
Source: index.d.ts, line 271, character 16
clientFindData
clientFindData (cid: Cid, cid1: Cid): Promise<Array<QueryOffer>>
Identifies peers that have a certain file, and returns QueryOffers (one per peer).
Parameters:
Returns:
Promise<Array<QueryOffer>>
Source: index.d.ts, line 275, character 16
clientGenCar
clientGenCar (fileRef: FileRef, str: string): Promise<void>
Generates a CAR file for the specified file.
Parameters:
fileRef
:FileRef
str
:string
Returns:
Promise<void>
Source: index.d.ts, line 279, character 14
clientGetDealInfo
clientGetDealInfo (cid: Cid): Promise<DealInfo>
Returns the latest information about a given deal.
Parameters:
cid
:Cid
Returns:
Promise<DealInfo>
Source: index.d.ts, line 283, character 19
clientGetDealStatus
clientGetDealStatus (uint: number): Promise<string>
Returns status given a code
Parameters:
uint
:number
Returns:
Promise<string>
Source: index.d.ts, line 287, character 21
clientGetDealUpdates
clientGetDealUpdates (handler: (data: DealInfo) => void): [() => void, Promise<void>]
Returns the status of updated deals
Parameters:
handler
:(data: DealInfo) => void
Returns:
[() => void, Promise<void>]
Source: index.d.ts, line 291, character 22
clientHasLocal
clientHasLocal (cid: Cid): Promise<boolean>
Indicates whether a certain CID is locally stored.
Parameters:
cid
:Cid
Returns:
Promise<boolean>
Source: index.d.ts, line 295, character 16
clientImport
clientImport (fileRef: FileRef): Promise<ImportRes>
Imports file under the specified path into filestore.
Parameters:
fileRef
:FileRef
Returns:
Promise<ImportRes>
Source: index.d.ts, line 299, character 14
clientListDataTransfers
clientListDataTransfers (): Promise<Array<DataTransferChannel>>
clientListTransfers returns the status of all ongoing transfers of data
Returns:
Promise<Array<DataTransferChannel>>
Source: index.d.ts, line 303, character 25
clientListDeals
clientListDeals (): Promise<Array<DealInfo>>
Returns information about the deals made by the local client.
Returns:
Promise<Array<DealInfo>>
Source: index.d.ts, line 307, character 17
clientListImports
clientListImports (): Promise<Array<Import>>
Lists imported files and their root CIDs
Returns:
Promise<Array<Import>>
Source: index.d.ts, line 311, character 19
clientMinerQueryOffer
clientMinerQueryOffer (address: string, cid: Cid, cid1: Cid): Promise<QueryOffer>
Returns a QueryOffer for the specific miner and file.
Parameters:
Returns:
Promise<QueryOffer>
Source: index.d.ts, line 315, character 23
clientQueryAsk
clientQueryAsk (id: string, address: string): Promise<StorageAsk>
Returns a signed StorageAsk from the specified miner.
Parameters:
id
:string
address
:string
Returns:
Promise<StorageAsk>
Source: index.d.ts, line 319, character 16
clientRemoveImport
clientRemoveImport (storeID: number): Promise<void>
Removes file import
Parameters:
storeID
:number
Returns:
Promise<void>
Source: index.d.ts, line 323, character 20
clientRestartDataTransfer
clientRestartDataTransfer (transferID: number, id: string, bool: boolean): Promise<void>
Attempts to restart a data transfer with the given transfer ID and other peer
Parameters:
transferID
:number
id
:string
bool
:boolean
Returns:
Promise<void>
Source: index.d.ts, line 327, character 27
clientRetrieve
clientRetrieve (retrievalOrder: RetrievalOrder, fileRef: FileRef): Promise<void>
Initiates the retrieval of a file, as specified in the order.
Parameters:
retrievalOrder
:RetrievalOrder
fileRef
:FileRef
Returns:
Promise<void>
Source: index.d.ts, line 331, character 16
clientRetrieveTryRestartInsufficientFunds
clientRetrieveTryRestartInsufficientFunds (address: string): Promise<void>
Attempts to restart stalled retrievals on a given payment channel which are stuck due to insufficient funds
Parameters:
address
:string
Returns:
Promise<void>
Source: index.d.ts, line 336, character 43
clientRetrieveWithEvents
clientRetrieveWithEvents (handler: (data: RetrievalEvent) => void, retrievalOrder: RetrievalOrder, fileRef: FileRef): [() => void, Promise<void>]
Initiates the retrieval of a file, as specified in the order, and provides a channel of status updates.
Parameters:
handler
:(data: RetrievalEvent) => void
retrievalOrder
:RetrievalOrder
fileRef
:FileRef
Returns:
[() => void, Promise<void>]
Source: index.d.ts, line 341, character 26
clientStartDeal
clientStartDeal (startDealParams: StartDealParams): Promise<Cid>
Proposes a deal with a miner.
Parameters:
startDealParams
:StartDealParams
Returns:
Promise<Cid>
Source: index.d.ts, line 345, character 17
Gas
gasEstimateFeeCap
gasEstimateFeeCap (message: Message, int: number, tipSetKey: Cid[]): Promise<string>
Estimates gas fee cap
Parameters:
Returns:
Promise<string>
Source: index.d.ts, line 356, character 19
gasEstimateGasLimit
gasEstimateGasLimit (message: Message, tipSetKey: Cid[]): Promise<number>
Estimates gas used by the message and returns it. It fails if message fails to execute.
Parameters:
Returns:
Promise<number>
Source: index.d.ts, line 361, character 21
gasEstimateGasPremium
gasEstimateGasPremium (uint: number, address: string, int: number, tipSetKey: Cid[]): Promise<string>
Estimates what gas price should be used for a
message to have high likelihood of inclusion in nblocksincl
epochs.
Parameters:
uint
:number
address
:string
int
:number
tipSetKey
:Cid[]
Returns:
Promise<string>
Source: index.d.ts, line 366, character 23
gasEstimateMessageGas
gasEstimateMessageGas (message: Message, messageSendSpec: MessageSendSpec, tipSetKey: Cid[]): Promise<Message>
Estimates gas values for unset message gas fields
Parameters:
message
:Message
messageSendSpec
:MessageSendSpec
tipSetKey
:Cid[]
Returns:
Promise<Message>
Source: index.d.ts, line 370, character 23
Log
logList
logList (): Promise<Array<string>>
Returns:
Promise<Array<string>>
Source: index.d.ts, line 132, character 9
logSetLevel
logSetLevel (str: string, str1: string): Promise<void>
Parameters:
str
:string
str1
:string
Returns:
Promise<void>
Source: index.d.ts, line 133, character 13
Market
marketEnsureAvailable
marketEnsureAvailable (address: string, address1: string, bigInt: string): Promise<Cid>
marketFreeBalance
Parameters:
address
:string
address1
:string
bigInt
:string
Returns:
Promise<Cid>
Source: index.d.ts, line 374, character 23
Miner
minerCreateBlock
minerCreateBlock (blockTemplate: BlockTemplate): Promise<BlockMsg>
Parameters:
blockTemplate
:BlockTemplate
Returns:
Promise<BlockMsg>
Source: index.d.ts, line 375, character 18
minerGetBaseInfo
minerGetBaseInfo (address: string, chainEpoch: number, tipSetKey: Cid[]): Promise<MiningBaseInfo>
Parameters:
address
:string
chainEpoch
:number
tipSetKey
:Cid[]
Returns:
Promise<MiningBaseInfo>
Source: index.d.ts, line 376, character 18
Misc
closing
closing (handler: (data: {}) => void): [() => void, Promise<void>]
Parameters:
handler
:(data: {}) => void
Returns:
[() => void, Promise<void>]
Source: index.d.ts, line 130, character 9
createBackup
createBackup (str: string): Promise<void>
Creates node backup onder the specified file name. The method requires that the lotus daemon is running with the LOTUS_BACKUP_BASE_PATH environment variable set to some path, and that the path specified when calling CreateBackup is within the base path
Parameters:
str
:string
Returns:
Promise<void>
Source: index.d.ts, line 352, character 14
id
id (): Promise<string>
Returns:
Promise<string>
Source: index.d.ts, line 131, character 4
shutdown
shutdown (): Promise<void>
Returns:
Promise<void>
Source: index.d.ts, line 146, character 10
version
version (): Promise<Version>
tODO: Info() (name, ...) ?
Returns:
Promise<Version>
Source: index.d.ts, line 150, character 9
Mpool
The Mpool methods are for interacting with the message pool. The message pool manages all incoming and outgoing 'messages' going over the network.
- mpoolBatchPush
- mpoolBatchPushMessage
- mpoolBatchPushUntrusted
- mpoolClear
- mpoolGetConfig
- mpoolGetNonce
- mpoolPending
- mpoolPush
- mpoolPushMessage
- mpoolPushUntrusted
- mpoolSelect
- mpoolSetConfig
- mpoolSub
mpoolBatchPush
mpoolBatchPush (signedMessage: Array<SignedMessage>): Promise<Array<Cid>>
Batch pushes a signed message to mempool.
Parameters:
signedMessage
:Array<SignedMessage>
Returns:
Promise<Array<Cid>>
Source: index.d.ts, line 380, character 16
mpoolBatchPushMessage
mpoolBatchPushMessage (message: Array<Message>, messageSendSpec: MessageSendSpec): Promise<Array<SignedMessage>>
Batch pushes a unsigned message to mempool.
Parameters:
message
:Array<Message>
messageSendSpec
:MessageSendSpec
Returns:
Promise<Array<SignedMessage>>
Source: index.d.ts, line 384, character 23
mpoolBatchPushUntrusted
mpoolBatchPushUntrusted (signedMessage: Array<SignedMessage>): Promise<Array<Cid>>
Batch pushes a signed message to mempool from untrusted sources.
Parameters:
signedMessage
:Array<SignedMessage>
Returns:
Promise<Array<Cid>>
Source: index.d.ts, line 388, character 25
mpoolClear
mpoolClear (bool: boolean): Promise<void>
Clears pending messages from the mpool
Parameters:
bool
:boolean
Returns:
Promise<void>
Source: index.d.ts, line 392, character 12
mpoolGetConfig
mpoolGetConfig (): Promise<MpoolConfig>
Returns (a copy of) the current mpool config
Returns:
Promise<MpoolConfig>
Source: index.d.ts, line 396, character 16
mpoolGetNonce
mpoolGetNonce (address: string): Promise<number>
Gets next nonce for the specified sender. Note that this method may not be atomic. Use MpoolPushMessage instead.
Parameters:
address
:string
Returns:
Promise<number>
Source: index.d.ts, line 401, character 15
mpoolPending
mpoolPending (tipSetKey: Cid[]): Promise<Array<SignedMessage>>
Returns pending mempool messages.
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<Array<SignedMessage>>
Source: index.d.ts, line 405, character 14
mpoolPush
mpoolPush (signedMessage: SignedMessage): Promise<Cid>
Pushes a signed message to mempool.
Parameters:
signedMessage
:SignedMessage
Returns:
Promise<Cid>
Source: index.d.ts, line 409, character 11
mpoolPushMessage
mpoolPushMessage (message: Message, messageSendSpec: MessageSendSpec): Promise<SignedMessage>
Atomically assigns a nonce, signs, and pushes a message to mempool. maxFee is only used when GasFeeCap/GasPremium fields aren't specified
Parameters:
message
:Message
messageSendSpec
:MessageSendSpec
Returns:
Promise<SignedMessage>
Source: index.d.ts, line 418, character 18
mpoolPushUntrusted
mpoolPushUntrusted (signedMessage: SignedMessage): Promise<Cid>
Pushes a signed message to mempool from untrusted sources.
Parameters:
signedMessage
:SignedMessage
Returns:
Promise<Cid>
Source: index.d.ts, line 422, character 20
mpoolSelect
mpoolSelect (tipSetKey: Cid[], num: number): Promise<Array<SignedMessage>>
Returns a list of pending messages for inclusion in the next block
Parameters:
tipSetKey
:Cid[]
num
:number
Returns:
Promise<Array<SignedMessage>>
Source: index.d.ts, line 426, character 13
mpoolSetConfig
mpoolSetConfig (mpoolConfig: MpoolConfig): Promise<void>
Sets the mpool config to (a copy of) the supplied config
Parameters:
mpoolConfig
:MpoolConfig
Returns:
Promise<void>
Source: index.d.ts, line 430, character 16
mpoolSub
mpoolSub (handler: (data: MpoolUpdate) => void): [() => void, Promise<void>]
Parameters:
handler
:(data: MpoolUpdate) => void
Returns:
[() => void, Promise<void>]
Source: index.d.ts, line 431, character 10
Msig
The Msig methods are used to interact with multisig wallets on the filecoin network.
- msigAddApprove
- msigAddCancel
- msigAddPropose
- msigApprove
- msigApproveTxnHash
- msigCancel
- msigCreate
- msigGetAvailableBalance
- msigGetVested
- msigGetVestingSchedule
- msigPropose
- msigRemoveSigner
- msigSwapApprove
- msigSwapCancel
- msigSwapPropose
msigAddApprove
msigAddApprove (address: string, address1: string, uint: number, address2: string, address3: string, bool: boolean): Promise<Cid>
Approves a previously proposed AddSigner message
It takes the following params:
Parameters:
address
:string
address1
:string
uint
:number
address2
:string
address3
:string
bool
:boolean
Returns:
Promise<Cid>
Source: index.d.ts, line 437, character 16
msigAddCancel
msigAddCancel (address: string, address1: string, uint: number, address2: string, bool: boolean): Promise<Cid>
Cancels a previously proposed AddSigner message
It takes the following params:
Parameters:
address
:string
address1
:string
uint
:number
address2
:string
bool
:boolean
Returns:
Promise<Cid>
Source: index.d.ts, line 443, character 15
msigAddPropose
msigAddPropose (address: string, address1: string, address2: string, bool: boolean): Promise<Cid>
Proposes adding a signer in the multisig
It takes the following params:
Parameters:
address
:string
address1
:string
address2
:string
bool
:boolean
Returns:
Promise<Cid>
Source: index.d.ts, line 449, character 16
msigApprove
msigApprove (address: string, uint: number, address1: string): Promise<Cid>
Approves a previously-proposed multisig message by transaction ID
It takes the following params:
Parameters:
address
:string
uint
:number
address1
:string
Returns:
Promise<Cid>
Source: index.d.ts, line 454, character 13
msigApproveTxnHash
msigApproveTxnHash (address: string, uint: number, address1: string, address2: string, bigInt: string, address3: string, uint1: number, bytes: string): Promise<Cid>
Approves a previously-proposed multisig message, specified
using both transaction ID and a hash of the parameters used in the
proposal. This method of approval can be used to ensure you only approve
exactly the transaction you think you are.
It takes the following params:
Parameters:
address
:string
uint
:number
address1
:string
address2
:string
bigInt
:string
address3
:string
uint1
:number
bytes
:string
Returns:
Promise<Cid>
Source: index.d.ts, line 463, character 20
msigCancel
msigCancel (address: string, uint: number, address1: string, bigInt: string, address2: string, uint1: number, bytes: string): Promise<Cid>
Cancels a previously-proposed multisig message
It takes the following params:
Parameters:
address
:string
uint
:number
address1
:string
bigInt
:string
address2
:string
uint1
:number
bytes
:string
Returns:
Promise<Cid>
Source: index.d.ts, line 469, character 12
msigCreate
msigCreate (uint: number, address: Array<string>, chainEpoch: number, bigInt: string, address1: string, bigInt1: string): Promise<Cid>
Creates a multisig wallet
It takes the following params:
Parameters:
uint
:number
address
:Array<string>
chainEpoch
:number
bigInt
:string
address1
:string
bigInt1
:string
Returns:
Promise<Cid>
Source: index.d.ts, line 475, character 12
msigGetAvailableBalance
msigGetAvailableBalance (address: string, tipSetKey: Cid[]): Promise<string>
Returns the portion of a multisig's balance that can be withdrawn or spent
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<string>
Source: index.d.ts, line 479, character 25
msigGetVested
msigGetVested (address: string, tipSetKey: Cid[], tipSetKey1: Cid[]): Promise<string>
Returns the amount of FIL that vested in a multisig in a certain period.
It takes the following params:
Parameters:
Returns:
Promise<string>
Source: index.d.ts, line 484, character 15
msigGetVestingSchedule
msigGetVestingSchedule (address: string, tipSetKey: Cid[]): Promise<MsigVesting>
Returns the vesting details of a given multisig.
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<MsigVesting>
Source: index.d.ts, line 488, character 24
msigPropose
msigPropose (address: string, address1: string, bigInt: string, address2: string, uint: number, bytes: string): Promise<Cid>
Proposes a multisig message
It takes the following params:
Parameters:
address
:string
address1
:string
bigInt
:string
address2
:string
uint
:number
bytes
:string
Returns:
Promise<Cid>
Source: index.d.ts, line 494, character 13
msigRemoveSigner
msigRemoveSigner (address: string, address1: string, address2: string, bool: boolean): Promise<Cid>
Proposes the removal of a signer from the multisig. It accepts the multisig to make the change on, the proposer address to send the message from, the address to be removed, and a boolean indicating whether or not the signing threshold should be lowered by one along with the address removal.
Parameters:
address
:string
address1
:string
address2
:string
bool
:boolean
Returns:
Promise<Cid>
Source: index.d.ts, line 502, character 18
msigSwapApprove
msigSwapApprove (address: string, address1: string, uint: number, address2: string, address3: string, address4: string): Promise<Cid>
Approves a previously proposed SwapSigner
It takes the following params:
Parameters:
address
:string
address1
:string
uint
:number
address2
:string
address3
:string
address4
:string
Returns:
Promise<Cid>
Source: index.d.ts, line 508, character 17
msigSwapCancel
msigSwapCancel (address: string, address1: string, uint: number, address2: string, address3: string): Promise<Cid>
Cancels a previously proposed SwapSigner message
It takes the following params:
Parameters:
address
:string
address1
:string
uint
:number
address2
:string
address3
:string
Returns:
Promise<Cid>
Source: index.d.ts, line 514, character 16
msigSwapPropose
msigSwapPropose (address: string, address1: string, address2: string, address3: string): Promise<Cid>
Proposes swapping 2 signers in the multisig
It takes the following params:
Parameters:
address
:string
address1
:string
address2
:string
address3
:string
Returns:
Promise<Cid>
Source: index.d.ts, line 520, character 17
Net
- netAddrsListen
- netAgentVersion
- netAutoNatStatus
- netBandwidthStats
- netBandwidthStatsByPeer
- netBandwidthStatsByProtocol
- netConnect
- netConnectedness
- netDisconnect
- netFindPeer
- netPeers
- netPubsubScores
netAddrsListen
netAddrsListen (): Promise<AddrInfo>
Returns:
Promise<AddrInfo>
Source: index.d.ts, line 134, character 16
netAgentVersion
netAgentVersion (id: string): Promise<string>
Parameters:
id
:string
Returns:
Promise<string>
Source: index.d.ts, line 135, character 17
netAutoNatStatus
netAutoNatStatus (): Promise<NatInfo>
Returns:
Promise<NatInfo>
Source: index.d.ts, line 136, character 18
netBandwidthStats
netBandwidthStats (): Promise<Stats>
Returns:
Promise<Stats>
Source: index.d.ts, line 137, character 19
netBandwidthStatsByPeer
netBandwidthStatsByPeer (): Promise<{ [k: string]: Stats }>
Returns:
Promise<{ [k: string]: Stats }>
Source: index.d.ts, line 138, character 25
netBandwidthStatsByProtocol
netBandwidthStatsByProtocol (): Promise<{ [k: string]: Stats }>
Returns:
Promise<{ [k: string]: Stats }>
Source: index.d.ts, line 139, character 29
netConnect
netConnect (addrInfo: AddrInfo): Promise<void>
Parameters:
addrInfo
:AddrInfo
Returns:
Promise<void>
Source: index.d.ts, line 140, character 12
netConnectedness
netConnectedness (id: string): Promise<number>
Parameters:
id
:string
Returns:
Promise<number>
Source: index.d.ts, line 141, character 18
netDisconnect
netDisconnect (id: string): Promise<void>
Parameters:
id
:string
Returns:
Promise<void>
Source: index.d.ts, line 142, character 15
netFindPeer
netFindPeer (id: string): Promise<AddrInfo>
Parameters:
id
:string
Returns:
Promise<AddrInfo>
Source: index.d.ts, line 143, character 13
netPeers
netPeers (): Promise<Array<AddrInfo>>
Returns:
Promise<Array<AddrInfo>>
Source: index.d.ts, line 144, character 10
netPubsubScores
netPubsubScores (): Promise<Array<PubsubScore>>
Returns:
Promise<Array<PubsubScore>>
Source: index.d.ts, line 145, character 17
Paych
The Paych methods are for interacting with and managing payment channels,
- paychAllocateLane
- paychAvailableFunds
- paychAvailableFundsByFromTo
- paychCollect
- paychGet
- paychGetWaitReady
- paychList
- paychNewPayment
- paychSettle
- paychStatus
- paychVoucherAdd
- paychVoucherCheckSpendable
- paychVoucherCheckValid
- paychVoucherCreate
- paychVoucherList
- paychVoucherSubmit
paychAllocateLane
paychAllocateLane (address: string): Promise<number>
Parameters:
address
:string
Returns:
Promise<number>
Source: index.d.ts, line 521, character 19
paychAvailableFunds
paychAvailableFunds (address: string): Promise<ChannelAvailableFunds>
Parameters:
address
:string
Returns:
Promise<ChannelAvailableFunds>
Source: index.d.ts, line 522, character 21
paychAvailableFundsByFromTo
paychAvailableFundsByFromTo (address: string, address1: string): Promise<ChannelAvailableFunds>
Parameters:
address
:string
address1
:string
Returns:
Promise<ChannelAvailableFunds>
Source: index.d.ts, line 523, character 29
paychCollect
paychCollect (address: string): Promise<Cid>
Parameters:
address
:string
Returns:
Promise<Cid>
Source: index.d.ts, line 524, character 14
paychGet
paychGet (address: string, address1: string, bigInt: string): Promise<ChannelInfo>
Parameters:
address
:string
address1
:string
bigInt
:string
Returns:
Promise<ChannelInfo>
Source: index.d.ts, line 525, character 10
paychGetWaitReady
paychGetWaitReady (cid: Cid): Promise<string>
Parameters:
cid
:Cid
Returns:
Promise<string>
Source: index.d.ts, line 526, character 19
paychList
paychList (): Promise<Array<string>>
Returns:
Promise<Array<string>>
Source: index.d.ts, line 527, character 11
paychNewPayment
paychNewPayment (address: string, address1: string, voucherSpec: Array<VoucherSpec>): Promise<PaymentInfo>
Parameters:
address
:string
address1
:string
voucherSpec
:Array<VoucherSpec>
Returns:
Promise<PaymentInfo>
Source: index.d.ts, line 528, character 17
paychSettle
paychSettle (address: string): Promise<Cid>
Parameters:
address
:string
Returns:
Promise<Cid>
Source: index.d.ts, line 529, character 13
paychStatus
paychStatus (address: string): Promise<PaychStatus>
Parameters:
address
:string
Returns:
Promise<PaychStatus>
Source: index.d.ts, line 530, character 13
paychVoucherAdd
paychVoucherAdd (address: string, signedVoucher: SignedVoucher, bytes: string, bigInt: string): Promise<string>
Parameters:
address
:string
signedVoucher
:SignedVoucher
bytes
:string
bigInt
:string
Returns:
Promise<string>
Source: index.d.ts, line 531, character 17
paychVoucherCheckSpendable
paychVoucherCheckSpendable (address: string, signedVoucher: SignedVoucher, bytes: string, bytes1: string): Promise<boolean>
Parameters:
address
:string
signedVoucher
:SignedVoucher
bytes
:string
bytes1
:string
Returns:
Promise<boolean>
Source: index.d.ts, line 532, character 28
paychVoucherCheckValid
paychVoucherCheckValid (address: string, signedVoucher: SignedVoucher): Promise<void>
Parameters:
address
:string
signedVoucher
:SignedVoucher
Returns:
Promise<void>
Source: index.d.ts, line 533, character 24
paychVoucherCreate
paychVoucherCreate (address: string, bigInt: string, uint: number): Promise<VoucherCreateResult>
Parameters:
address
:string
bigInt
:string
uint
:number
Returns:
Promise<VoucherCreateResult>
Source: index.d.ts, line 534, character 20
paychVoucherList
paychVoucherList (address: string): Promise<Array<SignedVoucher>>
Parameters:
address
:string
Returns:
Promise<Array<SignedVoucher>>
Source: index.d.ts, line 535, character 18
paychVoucherSubmit
paychVoucherSubmit (address: string, signedVoucher: SignedVoucher, bytes: string, bytes1: string): Promise<Cid>
Parameters:
address
:string
signedVoucher
:SignedVoucher
bytes
:string
bytes1
:string
Returns:
Promise<Cid>
Source: index.d.ts, line 536, character 20
State
The State methods are used to query, inspect, and interact with chain state. Most methods take a TipSetKey as a parameter. The state looked up is the state at that tipset. A nil TipSetKey can be provided as a param, this will cause the heaviest tipset in the chain to be used.
- stateAccountKey
- stateAllMinerFaults
- stateCall
- stateChangedActors
- stateCirculatingSupply
- stateCompute
- stateDealProviderCollateralBounds
- stateGetActor
- stateGetReceipt
- stateListActors
- stateListMessages
- stateListMiners
- stateLookupID
- stateMarketBalance
- stateMarketDeals
- stateMarketParticipants
- stateMarketStorageDeal
- stateMinerActiveSectors
- stateMinerAvailableBalance
- stateMinerDeadlines
- stateMinerFaults
- stateMinerInfo
- stateMinerInitialPledgeCollateral
- stateMinerPartitions
- stateMinerPower
- stateMinerPreCommitDepositForPower
- stateMinerProvingDeadline
- stateMinerRecoveries
- stateMinerSectorCount
- stateMinerSectors
- stateNetworkName
- stateNetworkVersion
- stateReadState
- stateReplay
- stateSearchMsg
- stateSectorExpiration
- stateSectorGetInfo
- stateSectorPartition
- stateSectorPreCommitInfo
- stateVMCirculatingSupplyInternal
- stateVerifiedClientStatus
- stateVerifiedRegistryRootKey
- stateVerifierStatus
- stateWaitMsg
- stateWaitMsgLimited
stateAccountKey
stateAccountKey (address: string, tipSetKey: Cid[]): Promise<string>
Returns the public key address of the given ID address
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<string>
Source: index.d.ts, line 540, character 17
stateAllMinerFaults
stateAllMinerFaults (chainEpoch: number, tipSetKey: Cid[]): Promise<Array<Fault>>
Returns all non-expired Faults that occur within lookback epochs of the given tipset
Parameters:
chainEpoch
:number
tipSetKey
:Cid[]
Returns:
Promise<Array<Fault>>
Source: index.d.ts, line 544, character 21
stateCall
stateCall (message: Message, tipSetKey: Cid[]): Promise<InvocResult>
Runs the given message and returns its result without any persisted changes.
Parameters:
Returns:
Promise<InvocResult>
Source: index.d.ts, line 548, character 11
stateChangedActors
stateChangedActors (cid: Cid, cid1: Cid): Promise<{ [k: string]: Actor }>
Returns all the actors whose states change between the two given state CIDs TODO: Should this take tipset keys instead?
Parameters:
Returns:
Promise<{ [k: string]: Actor }>
Source: index.d.ts, line 553, character 20
stateCirculatingSupply
stateCirculatingSupply (tipSetKey: Cid[]): Promise<string>
Returns the exact circulating supply of Filecoin at the given tipset. This is not used anywhere in the protocol itself, and is only for external consumption.
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<string>
Source: index.d.ts, line 558, character 24
stateCompute
stateCompute (chainEpoch: number, message: Array<Message>, tipSetKey: Cid[]): Promise<ComputeStateOutput>
Is a flexible command that applies the given messages on the given tipset. The messages are run as though the VM were at the provided height.
Parameters:
Returns:
Promise<ComputeStateOutput>
Source: index.d.ts, line 563, character 14
stateDealProviderCollateralBounds
stateDealProviderCollateralBounds (paddedPieceSize: number, bool: boolean, tipSetKey: Cid[]): Promise<DealCollateralBounds>
Returns the min and max collateral a storage provider can issue. It takes the deal size and verified status as parameters.
Parameters:
paddedPieceSize
:number
bool
:boolean
tipSetKey
:Cid[]
Returns:
Promise<DealCollateralBounds>
Source: index.d.ts, line 568, character 35
stateGetActor
stateGetActor (address: string, tipSetKey: Cid[]): Promise<Actor>
Returns the indicated actor's nonce and balance.
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<Actor>
Source: index.d.ts, line 572, character 15
stateGetReceipt
stateGetReceipt (cid: Cid, tipSetKey: Cid[]): Promise<MessageReceipt>
Returns the message receipt for the given message
Parameters:
Returns:
Promise<MessageReceipt>
Source: index.d.ts, line 576, character 17
stateListActors
stateListActors (tipSetKey: Cid[]): Promise<Array<string>>
Returns the addresses of every actor in the state
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<Array<string>>
Source: index.d.ts, line 580, character 17
stateListMessages
stateListMessages (messageMatch: MessageMatch, tipSetKey: Cid[], chainEpoch: number): Promise<Array<Cid>>
Looks back and returns all messages with a matching to or from address, stopping at the given height.
Parameters:
messageMatch
:MessageMatch
tipSetKey
:Cid[]
chainEpoch
:number
Returns:
Promise<Array<Cid>>
Source: index.d.ts, line 584, character 19
stateListMiners
stateListMiners (tipSetKey: Cid[]): Promise<Array<string>>
Returns the addresses of every miner that has claimed power in the Power Actor
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<Array<string>>
Source: index.d.ts, line 588, character 17
stateLookupID
stateLookupID (address: string, tipSetKey: Cid[]): Promise<string>
Retrieves the ID address of the given address
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<string>
Source: index.d.ts, line 592, character 15
stateMarketBalance
stateMarketBalance (address: string, tipSetKey: Cid[]): Promise<MarketBalance>
Looks up the Escrow and Locked balances of the given address in the Storage Market
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<MarketBalance>
Source: index.d.ts, line 596, character 20
stateMarketDeals
stateMarketDeals (tipSetKey: Cid[]): Promise<{ [k: string]: MarketDeal }>
Returns information about every deal in the Storage Market
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<{ [k: string]: MarketDeal }>
Source: index.d.ts, line 600, character 18
stateMarketParticipants
stateMarketParticipants (tipSetKey: Cid[]): Promise<{ [k: string]: MarketBalance }>
Returns the Escrow and Locked balances of every participant in the Storage Market
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<{ [k: string]: MarketBalance }>
Source: index.d.ts, line 604, character 25
stateMarketStorageDeal
stateMarketStorageDeal (dealID: number, tipSetKey: Cid[]): Promise<MarketDeal>
Returns information about the indicated deal
Parameters:
dealID
:number
tipSetKey
:Cid[]
Returns:
Promise<MarketDeal>
Source: index.d.ts, line 608, character 24
stateMinerActiveSectors
stateMinerActiveSectors (address: string, tipSetKey: Cid[]): Promise<Array<SectorOnChainInfo>>
Returns info about sectors that a given miner is actively proving.
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<Array<SectorOnChainInfo>>
Source: index.d.ts, line 612, character 25
stateMinerAvailableBalance
stateMinerAvailableBalance (address: string, tipSetKey: Cid[]): Promise<string>
Returns the portion of a miner's balance that can be withdrawn or spent
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<string>
Source: index.d.ts, line 616, character 28
stateMinerDeadlines
stateMinerDeadlines (address: string, tipSetKey: Cid[]): Promise<Array<Deadline>>
Returns all the proving deadlines for the given miner
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<Array<Deadline>>
Source: index.d.ts, line 620, character 21
stateMinerFaults
stateMinerFaults (address: string, tipSetKey: Cid[]): Promise<BitField>
Returns a bitfield indicating the faulty sectors of the given miner
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<BitField>
Source: index.d.ts, line 624, character 18
stateMinerInfo
stateMinerInfo (address: string, tipSetKey: Cid[]): Promise<MinerInfo>
Returns info about the indicated miner
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<MinerInfo>
Source: index.d.ts, line 628, character 16
stateMinerInitialPledgeCollateral
stateMinerInitialPledgeCollateral (address: string, sectorPreCommitInfo: SectorPreCommitInfo, tipSetKey: Cid[]): Promise<string>
Returns the initial pledge collateral for the specified miner's sector
Parameters:
address
:string
sectorPreCommitInfo
:SectorPreCommitInfo
tipSetKey
:Cid[]
Returns:
Promise<string>
Source: index.d.ts, line 632, character 35
stateMinerPartitions
stateMinerPartitions (address: string, uint: number, tipSetKey: Cid[]): Promise<Array<Partition>>
Returns all partitions in the specified deadline
Parameters:
address
:string
uint
:number
tipSetKey
:Cid[]
Returns:
Promise<Array<Partition>>
Source: index.d.ts, line 636, character 22
stateMinerPower
stateMinerPower (address: string, tipSetKey: Cid[]): Promise<MinerPower>
Returns the power of the indicated miner
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<MinerPower>
Source: index.d.ts, line 640, character 17
stateMinerPreCommitDepositForPower
stateMinerPreCommitDepositForPower (address: string, sectorPreCommitInfo: SectorPreCommitInfo, tipSetKey: Cid[]): Promise<string>
stateMinerInitialPledgeCollateral returns the precommit deposit for the specified miner's sector
Parameters:
address
:string
sectorPreCommitInfo
:SectorPreCommitInfo
tipSetKey
:Cid[]
Returns:
Promise<string>
Source: index.d.ts, line 644, character 36
stateMinerProvingDeadline
stateMinerProvingDeadline (address: string, tipSetKey: Cid[]): Promise<Info>
Calculates the deadline at some epoch for a proving period and returns the deadline-related calculations.
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<Info>
Source: index.d.ts, line 649, character 27
stateMinerRecoveries
stateMinerRecoveries (address: string, tipSetKey: Cid[]): Promise<BitField>
Returns a bitfield indicating the recovering sectors of the given miner
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<BitField>
Source: index.d.ts, line 653, character 22
stateMinerSectorCount
stateMinerSectorCount (address: string, tipSetKey: Cid[]): Promise<MinerSectors>
Returns the number of sectors in a miner's sector set and proving set
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<MinerSectors>
Source: index.d.ts, line 657, character 23
stateMinerSectors
stateMinerSectors (address: string, bitField: BitField, tipSetKey: Cid[]): Promise<Array<SectorOnChainInfo>>
Returns info about the given miner's sectors. If the filter bitfield is nil, all sectors are included.
Parameters:
Returns:
Promise<Array<SectorOnChainInfo>>
Source: index.d.ts, line 661, character 19
stateNetworkName
stateNetworkName (): Promise<string>
Returns the name of the network the node is synced to
Returns:
Promise<string>
Source: index.d.ts, line 665, character 18
stateNetworkVersion
stateNetworkVersion (tipSetKey: Cid[]): Promise<number>
Returns the network version at the given tipset
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<number>
Source: index.d.ts, line 669, character 21
stateReadState
stateReadState (address: string, tipSetKey: Cid[]): Promise<ActorState>
Returns the indicated actor's state.
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<ActorState>
Source: index.d.ts, line 673, character 16
stateReplay
stateReplay (tipSetKey: Cid[], cid: Cid): Promise<InvocResult>
Replays a given message, assuming it was included in a block in the specified tipset. If no tipset key is provided, the appropriate tipset is looked up.
Parameters:
Returns:
Promise<InvocResult>
Source: index.d.ts, line 678, character 13
stateSearchMsg
stateSearchMsg (cid: Cid): Promise<MsgLookup>
Searches for a message in the chain, and returns its receipt and the tipset where it was executed
Parameters:
cid
:Cid
Returns:
Promise<MsgLookup>
Source: index.d.ts, line 682, character 16
stateSectorExpiration
stateSectorExpiration (address: string, sectorNumber: number, tipSetKey: Cid[]): Promise<SectorExpiration>
Returns epoch at which given sector will expire
Parameters:
address
:string
sectorNumber
:number
tipSetKey
:Cid[]
Returns:
Promise<SectorExpiration>
Source: index.d.ts, line 686, character 23
stateSectorGetInfo
stateSectorGetInfo (address: string, sectorNumber: number, tipSetKey: Cid[]): Promise<SectorOnChainInfo>
Returns the on-chain info for the specified miner's sector. Returns null in case the sector info isn't found NOTE: returned info.Expiration may not be accurate in some cases, use StateSectorExpiration to get accurate expiration epoch
Parameters:
address
:string
sectorNumber
:number
tipSetKey
:Cid[]
Returns:
Promise<SectorOnChainInfo>
Source: index.d.ts, line 692, character 20
stateSectorPartition
stateSectorPartition (address: string, sectorNumber: number, tipSetKey: Cid[]): Promise<SectorLocation>
Finds deadline/partition with the specified sector
Parameters:
address
:string
sectorNumber
:number
tipSetKey
:Cid[]
Returns:
Promise<SectorLocation>
Source: index.d.ts, line 696, character 22
stateSectorPreCommitInfo
stateSectorPreCommitInfo (address: string, sectorNumber: number, tipSetKey: Cid[]): Promise<SectorPreCommitOnChainInfo>
Returns the PreCommit info for the specified miner's sector
Parameters:
address
:string
sectorNumber
:number
tipSetKey
:Cid[]
Returns:
Promise<SectorPreCommitOnChainInfo>
Source: index.d.ts, line 700, character 26
stateVMCirculatingSupplyInternal
stateVMCirculatingSupplyInternal (tipSetKey: Cid[]): Promise<CirculatingSupply>
Returns an approximation of the circulating supply of Filecoin at the given tipset. This is the value reported by the runtime interface to actors code.
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<CirculatingSupply>
Source: index.d.ts, line 705, character 34
stateVerifiedClientStatus
stateVerifiedClientStatus (address: string, tipSetKey: Cid[]): Promise<string>
Returns the data cap for the given address. Returns nil if there is no entry in the data cap table for the address.
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<string>
Source: index.d.ts, line 711, character 27
stateVerifiedRegistryRootKey
stateVerifiedRegistryRootKey (tipSetKey: Cid[]): Promise<string>
stateVerifiedClientStatus returns the address of the Verified Registry's root key
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<string>
Source: index.d.ts, line 715, character 30
stateVerifierStatus
stateVerifierStatus (address: string, tipSetKey: Cid[]): Promise<string>
Returns the data cap for the given address. Returns nil if there is no entry in the data cap table for the address.
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<string>
Source: index.d.ts, line 721, character 21
stateWaitMsg
stateWaitMsg (cid: Cid, uint: number): Promise<MsgLookup>
Looks back in the chain for a message. If not found, it blocks until the message arrives on chain, and gets to the indicated confidence depth.
Parameters:
cid
:Cid
uint
:number
Returns:
Promise<MsgLookup>
Source: index.d.ts, line 726, character 14
stateWaitMsgLimited
stateWaitMsgLimited (cid: Cid, uint: number, chainEpoch: number): Promise<MsgLookup>
Looks back up to limit epochs in the chain for a message. If not found, it blocks until the message arrives on chain, and gets to the indicated confidence depth.
Parameters:
cid
:Cid
uint
:number
chainEpoch
:number
Returns:
Promise<MsgLookup>
Source: index.d.ts, line 732, character 21
Sync
The Sync method group contains methods for interacting with and observing the lotus sync service.
- syncCheckBad
- syncCheckpoint
- syncIncomingBlocks
- syncMarkBad
- syncState
- syncSubmitBlock
- syncUnmarkAllBad
- syncUnmarkBad
- syncValidateTipset
syncCheckBad
syncCheckBad (cid: Cid): Promise<string>
Checks if a block was marked as bad, and if it was, returns the reason.
Parameters:
cid
:Cid
Returns:
Promise<string>
Source: index.d.ts, line 737, character 14
syncCheckpoint
syncCheckpoint (tipSetKey: Cid[]): Promise<void>
Marks a blocks as checkpointed, meaning that it won't ever fork away from it.
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<void>
Source: index.d.ts, line 741, character 16
syncIncomingBlocks
syncIncomingBlocks (handler: (data: BlockHeader) => void): [() => void, Promise<void>]
Returns a channel streaming incoming, potentially not yet synced block headers.
Parameters:
handler
:(data: BlockHeader) => void
Returns:
[() => void, Promise<void>]
Source: index.d.ts, line 746, character 20
syncMarkBad
syncMarkBad (cid: Cid): Promise<void>
Marks a blocks as bad, meaning that it won't ever by synced. Use with extreme caution.
Parameters:
cid
:Cid
Returns:
Promise<void>
Source: index.d.ts, line 751, character 13
syncState
syncState (): Promise<SyncState>
Returns the current status of the lotus sync system.
Returns:
Promise<SyncState>
Source: index.d.ts, line 755, character 11
syncSubmitBlock
syncSubmitBlock (blockMsg: BlockMsg): Promise<void>
Can be used to submit a newly created block to the. network through this node
Parameters:
blockMsg
:BlockMsg
Returns:
Promise<void>
Source: index.d.ts, line 760, character 17
syncUnmarkAllBad
syncUnmarkAllBad (): Promise<void>
Purges bad block cache, making it possible to sync to chains previously marked as bad
Returns:
Promise<void>
Source: index.d.ts, line 764, character 18
syncUnmarkBad
syncUnmarkBad (cid: Cid): Promise<void>
Unmarks a blocks as bad, making it possible to be validated and synced again.
Parameters:
cid
:Cid
Returns:
Promise<void>
Source: index.d.ts, line 768, character 15
syncValidateTipset
syncValidateTipset (tipSetKey: Cid[]): Promise<boolean>
Indicates whether the provided tipset is valid or not
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<boolean>
Source: index.d.ts, line 772, character 20
Wallet
- walletBalance
- walletDefaultAddress
- walletDelete
- walletExport
- walletHas
- walletImport
- walletList
- walletNew
- walletSetDefault
- walletSign
- walletSignMessage
- walletValidateAddress
- walletVerify
walletBalance
walletBalance (address: string): Promise<string>
Returns the balance of the given address at the current head of the chain.
Parameters:
address
:string
Returns:
Promise<string>
Source: index.d.ts, line 776, character 15
walletDefaultAddress
walletDefaultAddress (): Promise<string>
Returns the address marked as default in the wallet.
Returns:
Promise<string>
Source: index.d.ts, line 780, character 22
walletDelete
walletDelete (address: string): Promise<void>
Deletes an address from the wallet.
Parameters:
address
:string
Returns:
Promise<void>
Source: index.d.ts, line 784, character 14
walletExport
walletExport (address: string): Promise<KeyInfo>
Returns the private key of an address in the wallet.
Parameters:
address
:string
Returns:
Promise<KeyInfo>
Source: index.d.ts, line 788, character 14
walletHas
walletHas (address: string): Promise<boolean>
Indicates whether the given address is in the wallet.
Parameters:
address
:string
Returns:
Promise<boolean>
Source: index.d.ts, line 792, character 11
walletImport
walletImport (keyInfo: KeyInfo): Promise<string>
Receives a KeyInfo, which includes a private key, and imports it into the wallet.
Parameters:
keyInfo
:KeyInfo
Returns:
Promise<string>
Source: index.d.ts, line 796, character 14
walletList
walletList (): Promise<Array<string>>
Lists all the addresses in the wallet.
Returns:
Promise<Array<string>>
Source: index.d.ts, line 800, character 12
walletNew
walletNew (keyType: string): Promise<string>
Creates a new address in the wallet with the given sigType. Available key types: bls, secp256k1, secp256k1-ledger Support for numerical types: 1 - secp256k1, 2 - BLS is deprecated
Parameters:
keyType
:string
Returns:
Promise<string>
Source: index.d.ts, line 806, character 11
walletSetDefault
walletSetDefault (address: string): Promise<void>
Marks the given address as as the default one.
Parameters:
address
:string
Returns:
Promise<void>
Source: index.d.ts, line 810, character 18
walletSign
walletSign (address: string, bytes: string): Promise<Signature>
Signs the given bytes using the given address.
Parameters:
address
:string
bytes
:string
Returns:
Promise<Signature>
Source: index.d.ts, line 814, character 12
walletSignMessage
walletSignMessage (address: string, message: Message): Promise<SignedMessage>
Signs the given message using the given address.
Parameters:
address
:string
message
:Message
Returns:
Promise<SignedMessage>
Source: index.d.ts, line 818, character 19
walletValidateAddress
walletValidateAddress (str: string): Promise<string>
Validates whether a given string can be decoded as a well-formed address
Parameters:
str
:string
Returns:
Promise<string>
Source: index.d.ts, line 822, character 23
walletVerify
walletVerify (address: string, bytes: string, signature: Signature): Promise<boolean>
Takes an address, a signature, and some bytes, and indicates whether the signature is valid. The address does not have to be in the wallet.
Parameters:
address
:string
bytes
:string
signature
:Signature
Returns:
Promise<boolean>
Source: index.d.ts, line 827, character 14
Storage Miner API
Enable the API by passing the storageMiner
schema to LotusRPC
e.g.
import { LotusRPC } from '@filecoin-shipyard/lotus-client-rpc'
import { mainnet } from '@filecoin-shipyard/lotus-client-schema'
import { NodejsProvider } from '@filecoin-shipyard/lotus-client-provider-nodejs'
const provider = new NodejsProvider('<PROVIDER_URL>')
const client = new LotusRPC(provider, { schema: mainnet.storageMiner })
Lotus source: github.com/filecoin-project/lotus/api/api_storage.go
API Reference
- Actor
- Auth
- Deals
- dealsConsiderOfflineRetrievalDeals
- dealsConsiderOfflineStorageDeals
- dealsConsiderOnlineRetrievalDeals
- dealsConsiderOnlineStorageDeals
- dealsImportData
- dealsList
- dealsPieceCidBlocklist
- dealsSetConsiderOfflineRetrievalDeals
- dealsSetConsiderOfflineStorageDeals
- dealsSetConsiderOnlineRetrievalDeals
- dealsSetConsiderOnlineStorageDeals
- dealsSetPieceCidBlocklist
- Log
- Market
- Mining
- Misc
- Net
- Pieces
- Pledge
- Sealing
- Sector
- Sectors
- Storage
- Worker
Actor
actorAddress
actorAddress (): Promise<string>
Returns:
Promise<string>
Source: index.d.ts, line 828, character 14
actorSectorSize
actorSectorSize (address: string): Promise<number>
Parameters:
address
:string
Returns:
Promise<number>
Source: index.d.ts, line 829, character 17
Auth
authNew
authNew (permission: Array<string>): Promise<string>
Parameters:
permission
:Array<string>
Returns:
Promise<string>
Source: index.d.ts, line 128, character 9
authVerify
authVerify (str: string): Promise<Array<string>>
Parameters:
str
:string
Returns:
Promise<Array<string>>
Source: index.d.ts, line 129, character 12
Deals
- dealsConsiderOfflineRetrievalDeals
- dealsConsiderOfflineStorageDeals
- dealsConsiderOnlineRetrievalDeals
- dealsConsiderOnlineStorageDeals
- dealsImportData
- dealsList
- dealsPieceCidBlocklist
- dealsSetConsiderOfflineRetrievalDeals
- dealsSetConsiderOfflineStorageDeals
- dealsSetConsiderOnlineRetrievalDeals
- dealsSetConsiderOnlineStorageDeals
- dealsSetPieceCidBlocklist
dealsConsiderOfflineRetrievalDeals
dealsConsiderOfflineRetrievalDeals (): Promise<boolean>
Returns:
Promise<boolean>
Source: index.d.ts, line 830, character 36
dealsConsiderOfflineStorageDeals
dealsConsiderOfflineStorageDeals (): Promise<boolean>
Returns:
Promise<boolean>
Source: index.d.ts, line 831, character 34
dealsConsiderOnlineRetrievalDeals
dealsConsiderOnlineRetrievalDeals (): Promise<boolean>
Returns:
Promise<boolean>
Source: index.d.ts, line 832, character 35
dealsConsiderOnlineStorageDeals
dealsConsiderOnlineStorageDeals (): Promise<boolean>
Returns:
Promise<boolean>
Source: index.d.ts, line 833, character 33
dealsImportData
dealsImportData (cid: Cid, str: string): Promise<void>
Parameters:
cid
:Cid
str
:string
Returns:
Promise<void>
Source: index.d.ts, line 834, character 17
dealsList
dealsList (): Promise<Array<MarketDeal>>
Returns:
Promise<Array<MarketDeal>>
Source: index.d.ts, line 835, character 11
dealsPieceCidBlocklist
dealsPieceCidBlocklist (): Promise<Array<Cid>>
Returns:
Promise<Array<Cid>>
Source: index.d.ts, line 836, character 24
dealsSetConsiderOfflineRetrievalDeals
dealsSetConsiderOfflineRetrievalDeals (bool: boolean): Promise<void>
Parameters:
bool
:boolean
Returns:
Promise<void>
Source: index.d.ts, line 837, character 39
dealsSetConsiderOfflineStorageDeals
dealsSetConsiderOfflineStorageDeals (bool: boolean): Promise<void>
Parameters:
bool
:boolean
Returns:
Promise<void>
Source: index.d.ts, line 838, character 37
dealsSetConsiderOnlineRetrievalDeals
dealsSetConsiderOnlineRetrievalDeals (bool: boolean): Promise<void>
Parameters:
bool
:boolean
Returns:
Promise<void>
Source: index.d.ts, line 839, character 38
dealsSetConsiderOnlineStorageDeals
dealsSetConsiderOnlineStorageDeals (bool: boolean): Promise<void>
Parameters:
bool
:boolean
Returns:
Promise<void>
Source: index.d.ts, line 840, character 36
dealsSetPieceCidBlocklist
dealsSetPieceCidBlocklist (cid: Array<Cid>): Promise<void>
Parameters:
cid
:Array<Cid>
Returns:
Promise<void>
Source: index.d.ts, line 841, character 27
Log
logList
logList (): Promise<Array<string>>
Returns:
Promise<Array<string>>
Source: index.d.ts, line 132, character 9
logSetLevel
logSetLevel (str: string, str1: string): Promise<void>
Parameters:
str
:string
str1
:string
Returns:
Promise<void>
Source: index.d.ts, line 133, character 13
Market
- marketDataTransferUpdates
- marketGetAsk
- marketGetDealUpdates
- marketGetRetrievalAsk
- marketImportDealData
- marketListDataTransfers
- marketListDeals
- marketListIncompleteDeals
- marketListRetrievalDeals
- marketSetAsk
- marketSetRetrievalAsk
marketDataTransferUpdates
marketDataTransferUpdates (handler: (data: DataTransferChannel) => void): [() => void, Promise<void>]
Parameters:
handler
:(data: DataTransferChannel) => void
Returns:
[() => void, Promise<void>]
Source: index.d.ts, line 842, character 27
marketGetAsk
marketGetAsk (): Promise<SignedStorageAsk>
Returns:
Promise<SignedStorageAsk>
Source: index.d.ts, line 843, character 14
marketGetDealUpdates
marketGetDealUpdates (handler: (data: MinerDeal) => void): [() => void, Promise<void>]
Parameters:
handler
:(data: MinerDeal) => void
Returns:
[() => void, Promise<void>]
Source: index.d.ts, line 844, character 22
marketGetRetrievalAsk
marketGetRetrievalAsk (): Promise<Ask>
Returns:
Promise<Ask>
Source: index.d.ts, line 845, character 23
marketImportDealData
marketImportDealData (cid: Cid, str: string): Promise<void>
Parameters:
cid
:Cid
str
:string
Returns:
Promise<void>
Source: index.d.ts, line 846, character 22
marketListDataTransfers
marketListDataTransfers (): Promise<Array<DataTransferChannel>>
Returns:
Promise<Array<DataTransferChannel>>
Source: index.d.ts, line 847, character 25
marketListDeals
marketListDeals (): Promise<Array<MarketDeal>>
Returns:
Promise<Array<MarketDeal>>
Source: index.d.ts, line 848, character 17
marketListIncompleteDeals
marketListIncompleteDeals (): Promise<Array<MinerDeal>>
Returns:
Promise<Array<MinerDeal>>
Source: index.d.ts, line 849, character 27
marketListRetrievalDeals
marketListRetrievalDeals (): Promise<Array<ProviderDealState>>
Returns:
Promise<Array<ProviderDealState>>
Source: index.d.ts, line 850, character 26
marketSetAsk
marketSetAsk (bigInt: string, bigInt1: string, chainEpoch: number, paddedPieceSize: number, paddedPieceSize1: number): Promise<void>
Parameters:
bigInt
:string
bigInt1
:string
chainEpoch
:number
paddedPieceSize
:number
paddedPieceSize1
:number
Returns:
Promise<void>
Source: index.d.ts, line 851, character 14
marketSetRetrievalAsk
marketSetRetrievalAsk (ask: Ask): Promise<void>
Parameters:
ask
:Ask
Returns:
Promise<void>
Source: index.d.ts, line 852, character 23
Mining
miningBase
miningBase (): Promise<TipSet>
Returns:
Promise<TipSet>
Source: index.d.ts, line 853, character 12
Misc
closing
closing (handler: (data: {}) => void): [() => void, Promise<void>]
Parameters:
handler
:(data: {}) => void
Returns:
[() => void, Promise<void>]
Source: index.d.ts, line 130, character 9
createBackup
createBackup (str: string): Promise<void>
Creates node backup onder the specified file name. The method requires that the lotus daemon is running with the LOTUS_BACKUP_BASE_PATH environment variable set to some path, and that the path specified when calling CreateBackup is within the base path
Parameters:
str
:string
Returns:
Promise<void>
Source: index.d.ts, line 352, character 14
id
id (): Promise<string>
Returns:
Promise<string>
Source: index.d.ts, line 131, character 4
shutdown
shutdown (): Promise<void>
Returns:
Promise<void>
Source: index.d.ts, line 146, character 10
version
version (): Promise<Version>
tODO: Info() (name, ...) ?
Returns:
Promise<Version>
Source: index.d.ts, line 150, character 9
Net
- netAddrsListen
- netAgentVersion
- netAutoNatStatus
- netBandwidthStats
- netBandwidthStatsByPeer
- netBandwidthStatsByProtocol
- netConnect
- netConnectedness
- netDisconnect
- netFindPeer
- netPeers
- netPubsubScores
netAddrsListen
netAddrsListen (): Promise<AddrInfo>
Returns:
Promise<AddrInfo>
Source: index.d.ts, line 134, character 16
netAgentVersion
netAgentVersion (id: string): Promise<string>
Parameters:
id
:string
Returns:
Promise<string>
Source: index.d.ts, line 135, character 17
netAutoNatStatus
netAutoNatStatus (): Promise<NatInfo>
Returns:
Promise<NatInfo>
Source: index.d.ts, line 136, character 18
netBandwidthStats
netBandwidthStats (): Promise<Stats>
Returns:
Promise<Stats>
Source: index.d.ts, line 137, character 19
netBandwidthStatsByPeer
netBandwidthStatsByPeer (): Promise<{ [k: string]: Stats }>
Returns:
Promise<{ [k: string]: Stats }>
Source: index.d.ts, line 138, character 25
netBandwidthStatsByProtocol
netBandwidthStatsByProtocol (): Promise<{ [k: string]: Stats }>
Returns:
Promise<{ [k: string]: Stats }>
Source: index.d.ts, line 139, character 29
netConnect
netConnect (addrInfo: AddrInfo): Promise<void>
Parameters:
addrInfo
:AddrInfo
Returns:
Promise<void>
Source: index.d.ts, line 140, character 12
netConnectedness
netConnectedness (id: string): Promise<number>
Parameters:
id
:string
Returns:
Promise<number>
Source: index.d.ts, line 141, character 18
netDisconnect
netDisconnect (id: string): Promise<void>
Parameters:
id
:string
Returns:
Promise<void>
Source: index.d.ts, line 142, character 15
netFindPeer
netFindPeer (id: string): Promise<AddrInfo>
Parameters:
id
:string
Returns:
Promise<AddrInfo>
Source: index.d.ts, line 143, character 13
netPeers
netPeers (): Promise<Array<AddrInfo>>
Returns:
Promise<Array<AddrInfo>>
Source: index.d.ts, line 144, character 10
netPubsubScores
netPubsubScores (): Promise<Array<PubsubScore>>
Returns:
Promise<Array<PubsubScore>>
Source: index.d.ts, line 145, character 17
Pieces
piecesGetCIDInfo
piecesGetCIDInfo (cid: Cid): Promise<CIDInfo>
Parameters:
cid
:Cid
Returns:
Promise<CIDInfo>
Source: index.d.ts, line 854, character 18
piecesGetPieceInfo
piecesGetPieceInfo (cid: Cid): Promise<PieceInfo>
Parameters:
cid
:Cid
Returns:
Promise<PieceInfo>
Source: index.d.ts, line 855, character 20
piecesListCidInfos
piecesListCidInfos (): Promise<Array<Cid>>
Returns:
Promise<Array<Cid>>
Source: index.d.ts, line 856, character 20
piecesListPieces
piecesListPieces (): Promise<Array<Cid>>
Returns:
Promise<Array<Cid>>
Source: index.d.ts, line 857, character 18
Pledge
pledgeSector
pledgeSector (): Promise<void>
temp api for testing
Returns:
Promise<void>
Source: index.d.ts, line 861, character 14
Sealing
sealingSchedDiag
sealingSchedDiag (): Promise<any>
Dumps internal sealing scheduler state
Returns:
Promise<any>
Source: index.d.ts, line 865, character 18
Sector
- sectorGetExpectedSealDuration
- sectorGetSealDelay
- sectorMarkForUpgrade
- sectorRemove
- sectorSetExpectedSealDuration
- sectorSetSealDelay
- sectorStartSealing
sectorGetExpectedSealDuration
sectorGetExpectedSealDuration (): Promise<number>
Gets the expected time for a sector to seal
Returns:
Promise<number>
Source: index.d.ts, line 869, character 31
sectorGetSealDelay
sectorGetSealDelay (): Promise<number>
Gets the time that a newly-created sector waits for more deals before it starts sealing
Returns:
Promise<number>
Source: index.d.ts, line 874, character 20
sectorMarkForUpgrade
sectorMarkForUpgrade (sectorNumber: number): Promise<void>
Parameters:
sectorNumber
:number
Returns:
Promise<void>
Source: index.d.ts, line 875, character 22
sectorRemove
sectorRemove (sectorNumber: number): Promise<void>
Parameters:
sectorNumber
:number
Returns:
Promise<void>
Source: index.d.ts, line 876, character 14
sectorSetExpectedSealDuration
sectorSetExpectedSealDuration (duration: number): Promise<void>
Sets the expected time for a sector to seal
Parameters:
duration
:number
Returns:
Promise<void>
Source: index.d.ts, line 880, character 31
sectorSetSealDelay
sectorSetSealDelay (duration: number): Promise<void>
Sets the time that a newly-created sector waits for more deals before it starts sealing
Parameters:
duration
:number
Returns:
Promise<void>
Source: index.d.ts, line 885, character 20
sectorStartSealing
sectorStartSealing (sectorNumber: number): Promise<void>
Can be called on sectors in Empty or WaitDeals states to trigger sealing early
Parameters:
sectorNumber
:number
Returns:
Promise<void>
Source: index.d.ts, line 890, character 20
Sectors
sectorsList
sectorsList (): Promise<Array<number>>
list all staged sectors
Returns:
Promise<Array<number>>
Source: index.d.ts, line 894, character 13
sectorsRefs
sectorsRefs (): Promise<{ [k: string]: Array<SealedRef> }>
Returns:
Promise<{ [k: string]: Array<SealedRef> }>
Source: index.d.ts, line 895, character 13
sectorsStatus
sectorsStatus (sectorNumber: number, bool: boolean): Promise<SectorInfo1>
get the status of a given sector by ID
Parameters:
sectorNumber
:number
bool
:boolean
Returns:
Promise<SectorInfo1>
Source: index.d.ts, line 899, character 15
sectorsUpdate
sectorsUpdate (sectorNumber: number, sectorState: string): Promise<void>
Parameters:
sectorNumber
:number
sectorState
:string
Returns:
Promise<void>
Source: index.d.ts, line 900, character 15
Storage
- storageAddLocal
- storageAttach
- storageBestAlloc
- storageDeclareSector
- storageDropSector
- storageFindSector
- storageInfo
- storageList
- storageLocal
- storageLock
- storageReportHealth
- storageStat
- storageTryLock
storageAddLocal
storageAddLocal (str: string): Promise<void>
Parameters:
str
:string
Returns:
Promise<void>
Source: index.d.ts, line 901, character 17
storageAttach
storageAttach (storageInfo: StorageInfo, fsStat: FsStat): Promise<void>
Parameters:
storageInfo
:StorageInfo
fsStat
:FsStat
Returns:
Promise<void>
Source: index.d.ts, line 902, character 15
storageBestAlloc
storageBestAlloc (sectorFileType: number, sectorSize: number, pathType: string): Promise<Array<StorageInfo>>
Parameters:
sectorFileType
:number
sectorSize
:number
pathType
:string
Returns:
Promise<Array<StorageInfo>>
Source: index.d.ts, line 903, character 18
storageDeclareSector
storageDeclareSector (id: string, sectorID: SectorID, sectorFileType: number, bool: boolean): Promise<void>
Parameters:
id
:string
sectorID
:SectorID
sectorFileType
:number
bool
:boolean
Returns:
Promise<void>
Source: index.d.ts, line 904, character 22
storageDropSector
storageDropSector (id: string, sectorID: SectorID, sectorFileType: number): Promise<void>
Parameters:
id
:string
sectorID
:SectorID
sectorFileType
:number
Returns:
Promise<void>
Source: index.d.ts, line 905, character 19
storageFindSector
storageFindSector (sectorID: SectorID, sectorFileType: number, sectorSize: number, bool: boolean): Promise<Array<SectorStorageInfo>>
Parameters:
sectorID
:SectorID
sectorFileType
:number
sectorSize
:number
bool
:boolean
Returns:
Promise<Array<SectorStorageInfo>>
Source: index.d.ts, line 906, character 19
storageInfo
storageInfo (id: string): Promise<StorageInfo>
Parameters:
id
:string
Returns:
Promise<StorageInfo>
Source: index.d.ts, line 907, character 13
storageList
storageList (): Promise<{ [k: string]: Array<Decl> }>
Returns:
Promise<{ [k: string]: Array<Decl> }>
Source: index.d.ts, line 908, character 13
storageLocal
storageLocal (): Promise<{ [k: string]: string }>
Returns:
Promise<{ [k: string]: string }>
Source: index.d.ts, line 909, character 14
storageLock
storageLock (sectorID: SectorID, sectorFileType: number, sectorFileType1: number): Promise<void>
Parameters:
sectorID
:SectorID
sectorFileType
:number
sectorFileType1
:number
Returns:
Promise<void>
Source: index.d.ts, line 910, character 13
storageReportHealth
storageReportHealth (id: string, healthReport: HealthReport): Promise<void>
Parameters:
id
:string
healthReport
:HealthReport
Returns:
Promise<void>
Source: index.d.ts, line 911, character 21
storageStat
storageStat (id: string): Promise<FsStat>
Parameters:
id
:string
Returns:
Promise<FsStat>
Source: index.d.ts, line 912, character 13
storageTryLock
storageTryLock (sectorID: SectorID, sectorFileType: number, sectorFileType1: number): Promise<boolean>
Parameters:
sectorID
:SectorID
sectorFileType
:number
sectorFileType1
:number
Returns:
Promise<boolean>
Source: index.d.ts, line 913, character 16
Worker
workerConnect
workerConnect (str: string): Promise<void>
Tells the node to connect to workers RPC
Parameters:
str
:string
Returns:
Promise<void>
Source: index.d.ts, line 917, character 15
workerJobs
workerJobs (): Promise<{ [k: string]: Array<WorkerJob> }>
Returns:
Promise<{ [k: string]: Array<WorkerJob> }>
Source: index.d.ts, line 918, character 12
workerStats
workerStats (): Promise<{ [k: string]: WorkerStats }>
Returns:
Promise<{ [k: string]: WorkerStats }>
Source: index.d.ts, line 919, character 13
Gateway API
Enable the API by passing the gatewayApi
schema to LotusRPC
e.g.
import { LotusRPC } from '@filecoin-shipyard/lotus-client-rpc'
import { mainnet } from '@filecoin-shipyard/lotus-client-schema'
import { NodejsProvider } from '@filecoin-shipyard/lotus-client-provider-nodejs'
const provider = new NodejsProvider('<PROVIDER_URL>')
const client = new LotusRPC(provider, { schema: mainnet.gatewayApi })
Lotus source: github.com/filecoin-project/lotus/api/api_gateway.go
API Reference
Chain
The Chain method group contains methods for interacting with the blockchain, but that do not require any form of state computation.
- chainGetBlockMessages
- chainGetMessage
- chainGetTipSet
- chainGetTipSetByHeight
- chainHasObj
- chainHead
- chainNotify
- chainReadObj
chainGetBlockMessages
chainGetBlockMessages (cid: Cid): Promise<BlockMessages>
Returns messages stored in the specified block.
Parameters:
cid
:Cid
Returns:
Promise<BlockMessages>
Source: index.d.ts, line 176, character 23
chainGetMessage
chainGetMessage (cid: Cid): Promise<Message>
Reads a message referenced by the specified CID from the chain blockstore.
Parameters:
cid
:Cid
Returns:
Promise<Message>
Source: index.d.ts, line 185, character 17
chainGetTipSet
chainGetTipSet (tipSetKey: Cid[]): Promise<TipSet>
Returns the tipset specified by the given TipSetKey.
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<TipSet>
Source: index.d.ts, line 224, character 16
chainGetTipSetByHeight
chainGetTipSetByHeight (chainEpoch: number, tipSetKey: Cid[]): Promise<TipSet>
Looks back for a tipset at the specified epoch. If there are no blocks at the specified epoch, a tipset at an earlier epoch will be returned.
Parameters:
chainEpoch
:number
tipSetKey
:Cid[]
Returns:
Promise<TipSet>
Source: index.d.ts, line 230, character 24
chainHasObj
chainHasObj (cid: Cid): Promise<boolean>
Checks if a given CID exists in the chain blockstore.
Parameters:
cid
:Cid
Returns:
Promise<boolean>
Source: index.d.ts, line 234, character 13
chainHead
chainHead (): Promise<TipSet>
Returns the current head of the chain.
Returns:
Promise<TipSet>
Source: index.d.ts, line 238, character 11
chainNotify
chainNotify (handler: (data: Array<HeadChange>) => void): [() => void, Promise<void>]
Returns channel with chain head updates. First message is guaranteed to be of len == 1, and type == 'current'.
Parameters:
handler
:(data: Array<HeadChange>) => void
Returns:
[() => void, Promise<void>]
Source: index.d.ts, line 243, character 13
chainReadObj
chainReadObj (cid: Cid): Promise<string>
Reads ipld nodes referenced by the specified CID from chain blockstore and returns raw bytes.
Parameters:
cid
:Cid
Returns:
Promise<string>
Source: index.d.ts, line 248, character 14
Gas
gasEstimateMessageGas
gasEstimateMessageGas (message: Message, messageSendSpec: MessageSendSpec, tipSetKey: Cid[]): Promise<Message>
Estimates gas values for unset message gas fields
Parameters:
message
:Message
messageSendSpec
:MessageSendSpec
tipSetKey
:Cid[]
Returns:
Promise<Message>
Source: index.d.ts, line 370, character 23
Mpool
The Mpool methods are for interacting with the message pool. The message pool manages all incoming and outgoing 'messages' going over the network.
mpoolPush
mpoolPush (signedMessage: SignedMessage): Promise<Cid>
Pushes a signed message to mempool.
Parameters:
signedMessage
:SignedMessage
Returns:
Promise<Cid>
Source: index.d.ts, line 409, character 11
Msig
The Msig methods are used to interact with multisig wallets on the filecoin network.
msigGetAvailableBalance
msigGetAvailableBalance (address: string, tipSetKey: Cid[]): Promise<string>
Returns the portion of a multisig's balance that can be withdrawn or spent
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<string>
Source: index.d.ts, line 479, character 25
msigGetVested
msigGetVested (address: string, tipSetKey: Cid[], tipSetKey1: Cid[]): Promise<string>
Returns the amount of FIL that vested in a multisig in a certain period.
It takes the following params:
Parameters:
Returns:
Promise<string>
Source: index.d.ts, line 484, character 15
State
The State methods are used to query, inspect, and interact with chain state. Most methods take a TipSetKey as a parameter. The state looked up is the state at that tipset. A nil TipSetKey can be provided as a param, this will cause the heaviest tipset in the chain to be used.
- stateAccountKey
- stateDealProviderCollateralBounds
- stateGetActor
- stateGetReceipt
- stateListMiners
- stateLookupID
- stateMarketBalance
- stateMarketStorageDeal
- stateMinerInfo
- stateMinerPower
- stateMinerProvingDeadline
- stateNetworkVersion
- stateVerifiedClientStatus
- stateWaitMsg
stateAccountKey
stateAccountKey (address: string, tipSetKey: Cid[]): Promise<string>
Returns the public key address of the given ID address
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<string>
Source: index.d.ts, line 540, character 17
stateDealProviderCollateralBounds
stateDealProviderCollateralBounds (paddedPieceSize: number, bool: boolean, tipSetKey: Cid[]): Promise<DealCollateralBounds>
Returns the min and max collateral a storage provider can issue. It takes the deal size and verified status as parameters.
Parameters:
paddedPieceSize
:number
bool
:boolean
tipSetKey
:Cid[]
Returns:
Promise<DealCollateralBounds>
Source: index.d.ts, line 568, character 35
stateGetActor
stateGetActor (address: string, tipSetKey: Cid[]): Promise<Actor>
Returns the indicated actor's nonce and balance.
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<Actor>
Source: index.d.ts, line 572, character 15
stateGetReceipt
stateGetReceipt (cid: Cid, tipSetKey: Cid[]): Promise<MessageReceipt>
Returns the message receipt for the given message
Parameters:
Returns:
Promise<MessageReceipt>
Source: index.d.ts, line 576, character 17
stateListMiners
stateListMiners (tipSetKey: Cid[]): Promise<Array<string>>
Returns the addresses of every miner that has claimed power in the Power Actor
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<Array<string>>
Source: index.d.ts, line 588, character 17
stateLookupID
stateLookupID (address: string, tipSetKey: Cid[]): Promise<string>
Retrieves the ID address of the given address
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<string>
Source: index.d.ts, line 592, character 15
stateMarketBalance
stateMarketBalance (address: string, tipSetKey: Cid[]): Promise<MarketBalance>
Looks up the Escrow and Locked balances of the given address in the Storage Market
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<MarketBalance>
Source: index.d.ts, line 596, character 20
stateMarketStorageDeal
stateMarketStorageDeal (dealID: number, tipSetKey: Cid[]): Promise<MarketDeal>
Returns information about the indicated deal
Parameters:
dealID
:number
tipSetKey
:Cid[]
Returns:
Promise<MarketDeal>
Source: index.d.ts, line 608, character 24
stateMinerInfo
stateMinerInfo (address: string, tipSetKey: Cid[]): Promise<MinerInfo>
Returns info about the indicated miner
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<MinerInfo>
Source: index.d.ts, line 628, character 16
stateMinerPower
stateMinerPower (address: string, tipSetKey: Cid[]): Promise<MinerPower>
Returns the power of the indicated miner
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<MinerPower>
Source: index.d.ts, line 640, character 17
stateMinerProvingDeadline
stateMinerProvingDeadline (address: string, tipSetKey: Cid[]): Promise<Info>
Calculates the deadline at some epoch for a proving period and returns the deadline-related calculations.
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<Info>
Source: index.d.ts, line 649, character 27
stateNetworkVersion
stateNetworkVersion (tipSetKey: Cid[]): Promise<number>
Returns the network version at the given tipset
Parameters:
tipSetKey
:Cid[]
Returns:
Promise<number>
Source: index.d.ts, line 669, character 21
stateVerifiedClientStatus
stateVerifiedClientStatus (address: string, tipSetKey: Cid[]): Promise<string>
Returns the data cap for the given address. Returns nil if there is no entry in the data cap table for the address.
Parameters:
address
:string
tipSetKey
:Cid[]
Returns:
Promise<string>
Source: index.d.ts, line 711, character 27
stateWaitMsg
stateWaitMsg (cid: Cid, uint: number): Promise<MsgLookup>
Looks back in the chain for a message. If not found, it blocks until the message arrives on chain, and gets to the indicated confidence depth.
Parameters:
cid
:Cid
uint
:number
Returns:
Promise<MsgLookup>
Source: index.d.ts, line 726, character 14
Wallet API
Enable the API by passing the walletApi
schema to LotusRPC
e.g.
import { LotusRPC } from '@filecoin-shipyard/lotus-client-rpc'
import { mainnet } from '@filecoin-shipyard/lotus-client-schema'
import { NodejsProvider } from '@filecoin-shipyard/lotus-client-provider-nodejs'
const provider = new NodejsProvider('<PROVIDER_URL>')
const client = new LotusRPC(provider, { schema: mainnet.walletApi })
Lotus source: github.com/filecoin-project/lotus/api/api_wallet.go
API Reference
Wallet
walletDelete
walletDelete (address: string): Promise<void>
Deletes an address from the wallet.
Parameters:
address
:string
Returns:
Promise<void>
Source: index.d.ts, line 784, character 14
walletExport
walletExport (address: string): Promise<KeyInfo>
Returns the private key of an address in the wallet.
Parameters:
address
:string
Returns:
Promise<KeyInfo>
Source: index.d.ts, line 788, character 14
walletHas
walletHas (address: string): Promise<boolean>
Indicates whether the given address is in the wallet.
Parameters:
address
:string
Returns:
Promise<boolean>
Source: index.d.ts, line 792, character 11
walletImport
walletImport (keyInfo: KeyInfo): Promise<string>
Receives a KeyInfo, which includes a private key, and imports it into the wallet.
Parameters:
keyInfo
:KeyInfo
Returns:
Promise<string>
Source: index.d.ts, line 796, character 14
walletList
walletList (): Promise<Array<string>>
Lists all the addresses in the wallet.
Returns:
Promise<Array<string>>
Source: index.d.ts, line 800, character 12
walletNew
walletNew (keyType: string): Promise<string>
Creates a new address in the wallet with the given sigType. Available key types: bls, secp256k1, secp256k1-ledger Support for numerical types: 1 - secp256k1, 2 - BLS is deprecated
Parameters:
keyType
:string
Returns:
Promise<string>
Source: index.d.ts, line 806, character 11
walletSign
walletSign (address: string, bytes: string): Promise<Signature>
Signs the given bytes using the given address.
Parameters:
address
:string
bytes
:string
Returns:
Promise<Signature>
Source: index.d.ts, line 814, character 12
Worker API
Enable the API by passing the workerApi
schema to LotusRPC
e.g.
import { LotusRPC } from '@filecoin-shipyard/lotus-client-rpc'
import { mainnet } from '@filecoin-shipyard/lotus-client-schema'
import { NodejsProvider } from '@filecoin-shipyard/lotus-client-provider-nodejs'
const provider = new NodejsProvider('<PROVIDER_URL>')
const client = new LotusRPC(provider, { schema: mainnet.workerApi })
Lotus source: github.com/filecoin-project/lotus/api/api_worker.go
API Reference
Misc
closing
closing (handler: (data: {}) => void): [() => void, Promise<void>]
Parameters:
handler
:(data: {}) => void
Returns:
[() => void, Promise<void>]
Source: index.d.ts, line 130, character 9
info
info (): Promise<WorkerInfo>
Returns:
Promise<WorkerInfo>
Source: index.d.ts, line 923, character 6
taskTypes
taskTypes (): Promise<{ [k: string]: {} }>
taskType -> Weight
Returns:
Promise<{ [k: string]: {} }>
Source: index.d.ts, line 936, character 11
version
version (): Promise<Version>
tODO: Info() (name, ...) ?
Returns:
Promise<Version>
Source: index.d.ts, line 150, character 9
Storage
- addPiece
- fetch
- finalizeSector
- moveStorage
- paths
- readPiece
- releaseUnsealed
- remove
- sealCommit1
- sealCommit2
- sealPreCommit1
- sealPreCommit2
- storageAddLocal
- unsealPiece
addPiece
addPiece (sectorID: SectorID, unpaddedPieceSize: Array<number>, unpaddedPieceSize1: number, reader: any): Promise<PieceInfo1>
Parameters:
sectorID
:SectorID
unpaddedPieceSize
:Array<number>
unpaddedPieceSize1
:number
reader
:any
Returns:
Promise<PieceInfo1>
Source: index.d.ts, line 920, character 10
fetch
fetch (sectorID: SectorID, sectorFileType: number, pathType: string, acquireMode: string): Promise<void>
Parameters:
sectorID
:SectorID
sectorFileType
:number
pathType
:string
acquireMode
:string
Returns:
Promise<void>
Source: index.d.ts, line 921, character 7
finalizeSector
finalizeSector (sectorID: SectorID, range: Array<Range>): Promise<void>
Parameters:
Returns:
Promise<void>
Source: index.d.ts, line 922, character 16
moveStorage
moveStorage (sectorID: SectorID, sectorFileType: number): Promise<void>
Parameters:
sectorID
:SectorID
sectorFileType
:number
Returns:
Promise<void>
Source: index.d.ts, line 924, character 13
paths
paths (): Promise<Array<StoragePath>>
Returns:
Promise<Array<StoragePath>>
Source: index.d.ts, line 925, character 7
readPiece
readPiece (writer: any, sectorID: SectorID, unpaddedByteIndex: number, unpaddedPieceSize: number): Promise<boolean>
Parameters:
writer
:any
sectorID
:SectorID
unpaddedByteIndex
:number
unpaddedPieceSize
:number
Returns:
Promise<boolean>
Source: index.d.ts, line 926, character 11
releaseUnsealed
releaseUnsealed (sectorID: SectorID, range: Array<Range>): Promise<void>
Parameters:
Returns:
Promise<void>
Source: index.d.ts, line 927, character 17
remove
remove (sectorID: SectorID): Promise<void>
Parameters:
sectorID
:SectorID
Returns:
Promise<void>
Source: index.d.ts, line 928, character 8
sealCommit1
sealCommit1 (sectorID: SectorID, uint: Array<number>, uint1: Array<number>, pieceInfo: Array<PieceInfo1>, sectorCids: SectorCids): Promise<Array<number>>
Parameters:
sectorID
:SectorID
uint
:Array<number>
uint1
:Array<number>
pieceInfo
:Array<PieceInfo1>
sectorCids
:SectorCids
Returns:
Promise<Array<number>>
Source: index.d.ts, line 929, character 13
sealCommit2
sealCommit2 (sectorID: SectorID, uint: Array<number>): Promise<Array<number>>
Parameters:
sectorID
:SectorID
uint
:Array<number>
Returns:
Promise<Array<number>>
Source: index.d.ts, line 930, character 13
sealPreCommit1
sealPreCommit1 (sectorID: SectorID, uint: Array<number>, pieceInfo: Array<PieceInfo1>): Promise<Array<number>>
Parameters:
sectorID
:SectorID
uint
:Array<number>
pieceInfo
:Array<PieceInfo1>
Returns:
Promise<Array<number>>
Source: index.d.ts, line 931, character 16
sealPreCommit2
sealPreCommit2 (sectorID: SectorID, uint: Array<number>): Promise<SectorCids>
Parameters:
sectorID
:SectorID
uint
:Array<number>
Returns:
Promise<SectorCids>
Source: index.d.ts, line 932, character 16
storageAddLocal
storageAddLocal (str: string): Promise<void>
Parameters:
str
:string
Returns:
Promise<void>
Source: index.d.ts, line 901, character 17
unsealPiece
unsealPiece (sectorID: SectorID, unpaddedByteIndex: number, unpaddedPieceSize: number, uint: Array<number>, cid: Cid): Promise<void>
Parameters:
Returns:
Promise<void>
Source: index.d.ts, line 937, character 13
Types
In Typescript, import types from the lotus-client-rpc
module e.g.
import { Cid, BlockHeader } from '@filecoin-shipyard/lotus-client-rpc'
Type Reference
- ActiveSync
- Actor
- ActorState
- AddrInfo
- Ask
- BeaconEntry
- BitField
- BlockHeader
- BlockLocation
- BlockMessages
- BlockMsg
- BlockTemplate
- CIDInfo
- CborTime
- ChannelAvailableFunds
- ChannelID
- ChannelInfo
- Cid
- CirculatingSupply
- Claim
- ClientDealProposal
- CommPRet
- ComputeStateOutput
- DataRef
- DataSize
- DataTransferChannel
- Deadline
- DealCollateralBounds
- DealInfo
- DealInfo1
- DealProposal
- DealProposal1
- DealProposal2
- DealState
- Decl
- Deferred
- ElectionProof
- ExecutionTrace
- ExpTipSet
- Fault
- FileRef
- FsStat
- GasTrace
- HeadChange
- HealthReport
- Import
- ImportRes
- Info
- InvocResult
- IpldObject
- KeyInfo
- Loc
- MarketBalance
- MarketDeal
- Merge
- Message
- Message1
- MessageMatch
- MessageReceipt
- MessageSendSpec
- MinerDeal
- MinerInfo
- MinerPower
- MinerSectors
- MiningBaseInfo
- ModVerifyParams
- MpoolConfig
- MpoolUpdate
- MsgGasCost
- MsgLookup
- MsigVesting
- NatInfo
- ObjStat
- Params
- Partition
- PaychStatus
- PaymentInfo
- PeerScoreSnapshot
- PieceBlockLocation
- PieceInfo
- PieceInfo1
- PoStProof
- ProviderDealState
- PubsubScore
- QueryOffer
- Range
- RetrievalEvent
- RetrievalOrder
- RetrievalPeer
- SealSeed
- SealTicket
- SealedRef
- SectorCids
- SectorExpiration
- SectorID
- SectorInfo
- SectorInfo1
- SectorLocation
- SectorLog
- SectorOnChainInfo
- SectorPreCommitInfo
- SectorPreCommitOnChainInfo
- SectorStorageInfo
- Signature
- SignedMessage
- SignedStorageAsk
- SignedVoucher
- StartDealParams
- Stats
- StorageAsk
- StorageInfo
- StoragePath
- SyncState
- Ticket
- Time
- TipSet
- TopicScoreSnapshot
- Version
- VoucherCreateResult
- VoucherSpec
- WorkerInfo
- WorkerJob
- WorkerResources
- WorkerStats
ActiveSync
type ActiveSync = { Base: TipSet, End: Time, Height: number, Message: string, Stage: number, Start: Time, Target: TipSet }
Properties:
Actor
type Actor = { Balance: string, Code: Cid, Head: Cid, Nonce: number }
Properties:
ActorState
type ActorState = { Balance: string, State: any }
Properties:
Balance
:string
State
:any
AddrInfo
type AddrInfo = { Addrs: Array<any>, ID: string }
Properties:
Addrs
:Array<any>
ID
:string
Ask
type Ask = { PaymentInterval: number, PaymentIntervalIncrease: number, PricePerByte: string, UnsealPrice: string }
Properties:
PaymentInterval
:number
PaymentIntervalIncrease
:number
PricePerByte
:string
UnsealPrice
:string
BeaconEntry
type BeaconEntry = { Data: string, Round: number }
Properties:
Data
:string
Round
:number
BitField
type BitField = {}
BlockHeader
type BlockHeader = { BLSAggregate: Signature, BeaconEntries: Array<BeaconEntry>, BlockSig: Signature, ElectionProof: ElectionProof, ForkSignaling: number, Height: number, Messages: Cid, Miner: string, ParentBaseFee: string, ParentMessageReceipts: Cid, ParentStateRoot: Cid, ParentWeight: string, Parents: Array<Cid>, Ticket: Ticket, Timestamp: number, WinPoStProof: Array<PoStProof> }
Properties:
BLSAggregate
:Signature
BeaconEntries
:Array<BeaconEntry>
BlockSig
:Signature
ElectionProof
:ElectionProof
ForkSignaling
:number
Height
:number
Messages
:Cid
Miner
:string
ParentBaseFee
:string
ParentMessageReceipts
:Cid
ParentStateRoot
:Cid
ParentWeight
:string
Parents
:Array<Cid>
Ticket
:Ticket
Timestamp
:number
WinPoStProof
:Array<PoStProof>
BlockLocation
type BlockLocation = { BlockSize: number, RelOffset: number }
Properties:
BlockSize
:number
RelOffset
:number
BlockMessages
type BlockMessages = { BlsMessages: Array<Message>, Cids: Array<Cid>, SecpkMessages: Array<SignedMessage> }
Properties:
BlsMessages
:Array<Message>
Cids
:Array<Cid>
SecpkMessages
:Array<SignedMessage>
BlockMsg
type BlockMsg = { BlsMessages: Array<Cid>, Header: BlockHeader, SecpkMessages: Array<Cid> }
Properties:
BlsMessages
:Array<Cid>
Header
:BlockHeader
SecpkMessages
:Array<Cid>
BlockTemplate
type BlockTemplate = { BeaconValues: Array<BeaconEntry>, Epoch: number, Eproof: ElectionProof, Messages: Array<SignedMessage>, Miner: string, Parents: Cid[], Ticket: Ticket, Timestamp: number, WinningPoStProof: Array<PoStProof> }
Properties:
BeaconValues
:Array<BeaconEntry>
Epoch
:number
Eproof
:ElectionProof
Messages
:Array<SignedMessage>
Miner
:string
Parents
:Cid[]
Ticket
:Ticket
Timestamp
:number
WinningPoStProof
:Array<PoStProof>
CIDInfo
type CIDInfo = { CID: Cid, PieceBlockLocations: Array<PieceBlockLocation> }
Properties:
CID
:Cid
PieceBlockLocations
:Array<PieceBlockLocation>
CborTime
type CborTime = {}
ChannelAvailableFunds
type ChannelAvailableFunds = { Channel: string, ConfirmedAmt: string, From: string, PendingAmt: string, PendingWaitSentinel: Cid, QueuedAmt: string, To: string, VoucherReedeemedAmt: string }
Properties:
Channel
:string
ConfirmedAmt
:string
From
:string
PendingAmt
:string
PendingWaitSentinel
:Cid
QueuedAmt
:string
To
:string
VoucherReedeemedAmt
:string
ChannelID
type ChannelID = { ID: number, Initiator: string, Responder: string }
Properties:
ID
:number
Initiator
:string
Responder
:string
ChannelInfo
type ChannelInfo = { Channel: string, WaitSentinel: Cid }
Properties:
Channel
:string
WaitSentinel
:Cid
Cid
type Cid = { /: string }
Properties:
/
:string
CirculatingSupply
type CirculatingSupply = { FilBurnt: string, FilCirculating: string, FilLocked: string, FilMined: string, FilVested: string }
Properties:
FilBurnt
:string
FilCirculating
:string
FilLocked
:string
FilMined
:string
FilVested
:string
Claim
type Claim = { QualityAdjPower: string, RawBytePower: string }
Properties:
QualityAdjPower
:string
RawBytePower
:string
ClientDealProposal
type ClientDealProposal = { ClientSignature: Signature, Proposal: DealProposal1 }
Properties:
ClientSignature
:Signature
Proposal
:DealProposal1
CommPRet
type CommPRet = { Root: Cid, Size: number }
Properties:
Root
:Cid
Size
:number
ComputeStateOutput
type ComputeStateOutput = { Root: Cid, Trace: Array<InvocResult> }
Properties:
Root
:Cid
Trace
:Array<InvocResult>
DataRef
type DataRef = { PieceCid: Cid, PieceSize: number, Root: Cid, TransferType: string }
Properties:
DataSize
type DataSize = { PayloadSize: number, PieceSize: number }
Properties:
PayloadSize
:number
PieceSize
:number
DataTransferChannel
type DataTransferChannel = { BaseCID: Cid, IsInitiator: boolean, IsSender: boolean, Message: string, OtherPeer: string, Status: number, TransferID: number, Transferred: number, Voucher: string }
Properties:
BaseCID
:Cid
IsInitiator
:boolean
IsSender
:boolean
Message
:string
OtherPeer
:string
Status
:number
TransferID
:number
Transferred
:number
Voucher
:string
Deadline
type Deadline = { PostSubmissions: BitField }
Properties:
PostSubmissions
:BitField
DealCollateralBounds
type DealCollateralBounds = { Max: string, Min: string }
Properties:
Max
:string
Min
:string
DealInfo
type DealInfo = { CreationTime: Time, DataRef: DataRef, DealID: number, Duration: number, Message: string, PieceCID: Cid, PricePerEpoch: string, ProposalCid: Cid, Provider: string, Size: number, State: number, Verified: boolean }
Properties:
CreationTime
:Time
DataRef
:DataRef
DealID
:number
Duration
:number
Message
:string
PieceCID
:Cid
PricePerEpoch
:string
ProposalCid
:Cid
Provider
:string
Size
:number
State
:number
Verified
:boolean
DealInfo1
type DealInfo1 = { DealID: number, Length: number, Offset: number, SectorID: number }
Properties:
DealID
:number
Length
:number
Offset
:number
SectorID
:number
DealProposal
type DealProposal = { Client: string, ClientCollateral: string, EndEpoch: number, Label: string, PieceCID: Cid, PieceSize: number, Provider: string, ProviderCollateral: string, StartEpoch: number, StoragePricePerEpoch: string, VerifiedDeal: boolean }
Properties:
Client
:string
ClientCollateral
:string
EndEpoch
:number
Label
:string
PieceCID
:Cid
PieceSize
:number
Provider
:string
ProviderCollateral
:string
StartEpoch
:number
StoragePricePerEpoch
:string
VerifiedDeal
:boolean
DealProposal1
type DealProposal1 = { Client: string, ClientCollateral: string, EndEpoch: number, Label: string, PieceCID: Cid, PieceSize: number, Provider: string, ProviderCollateral: string, StartEpoch: number, StoragePricePerEpoch: string, VerifiedDeal: boolean }
Properties:
Client
:string
ClientCollateral
:string
EndEpoch
:number
Label
:string
PieceCID
:Cid
PieceSize
:number
Provider
:string
ProviderCollateral
:string
StartEpoch
:number
StoragePricePerEpoch
:string
VerifiedDeal
:boolean
DealProposal2
type DealProposal2 = { ID: number, Params: Params, PayloadCID: Cid }
Properties:
DealState
type DealState = { LastUpdatedEpoch: number, SectorStartEpoch: number, SlashEpoch: number }
Properties:
LastUpdatedEpoch
:number
SectorStartEpoch
:number
SlashEpoch
:number
Decl
type Decl = { SectorFileType: number, SectorID: SectorID }
Properties:
SectorFileType
:number
SectorID
:SectorID
Deferred
type Deferred = { Raw: string }
Properties:
Raw
:string
ElectionProof
type ElectionProof = { VRFProof: string, WinCount: number }
Properties:
VRFProof
:string
WinCount
:number
ExecutionTrace
type ExecutionTrace = { Duration: number, Error: string, GasCharges: Array<GasTrace>, Msg: Message, MsgRct: MessageReceipt, Subcalls: ExecutionTrace[] }
Properties:
Duration
:number
Error
:string
GasCharges
:Array<GasTrace>
Msg
:Message
MsgRct
:MessageReceipt
Subcalls
:ExecutionTrace[]
ExpTipSet
type ExpTipSet = { Blocks: Array<BlockHeader>, Cids: Array<Cid>, Height: number }
Properties:
Blocks
:Array<BlockHeader>
Cids
:Array<Cid>
Height
:number
Fault
type Fault = { Epoch: number, Miner: string }
Properties:
Epoch
:number
Miner
:string
FileRef
type FileRef = { IsCAR: boolean, Path: string }
Properties:
IsCAR
:boolean
Path
:string
FsStat
type FsStat = { Available: number, Capacity: number, Reserved: number }
Properties:
Available
:number
Capacity
:number
Reserved
:number
GasTrace
type GasTrace = { Callers: Array<number>, ComputeGas: number, Extra: any, Location: Array<Loc>, Name: string, StorageGas: number, TimeTaken: number, TotalGas: number, TotalVirtualGas: number, VirtualComputeGas: number, VirtualStorageGas: number }
Properties:
Callers
:Array<number>
ComputeGas
:number
Extra
:any
Location
:Array<Loc>
Name
:string
StorageGas
:number
TimeTaken
:number
TotalGas
:number
TotalVirtualGas
:number
VirtualComputeGas
:number
VirtualStorageGas
:number
HeadChange
type HeadChange = { Type: string, Val: TipSet }
Properties:
Type
:string
Val
:TipSet
HealthReport
type HealthReport = { Err: any, Stat: FsStat }
Properties:
Err
:any
Stat
:FsStat
Import
type Import = { Err: string, FilePath: string, Key: number, Root: Cid, Source: string }
Properties:
Err
:string
FilePath
:string
Key
:number
Root
:Cid
Source
:string
ImportRes
type ImportRes = { ImportID: number, Root: Cid }
Properties:
ImportID
:number
Root
:Cid
Info
type Info = { Challenge: number, Close: number, CurrentEpoch: number, FaultCutoff: number, FaultDeclarationCutoff: number, Index: number, Open: number, PeriodStart: number, WPoStChallengeLookback: number, WPoStChallengeWindow: number, WPoStPeriodDeadlines: number, WPoStProvingPeriod: number }
Properties:
Challenge
:number
Close
:number
CurrentEpoch
:number
FaultCutoff
:number
FaultDeclarationCutoff
:number
Index
:number
Open
:number
PeriodStart
:number
WPoStChallengeLookback
:number
WPoStChallengeWindow
:number
WPoStPeriodDeadlines
:number
WPoStProvingPeriod
:number
InvocResult
type InvocResult = { Duration: number, Error: string, ExecutionTrace: ExecutionTrace, GasCost: MsgGasCost, Msg: Message, MsgCid: Cid, MsgRct: MessageReceipt }
Properties:
Duration
:number
Error
:string
ExecutionTrace
:ExecutionTrace
GasCost
:MsgGasCost
Msg
:Message
MsgCid
:Cid
MsgRct
:MessageReceipt
IpldObject
type IpldObject = { Cid: Cid, Obj: any }
Properties:
Cid
:Cid
Obj
:any
KeyInfo
type KeyInfo = { PrivateKey: string, Type: string }
Properties:
PrivateKey
:string
Type
:string
Loc
type Loc = { File: string, Function: string, Line: number }
Properties:
File
:string
Function
:string
Line
:number
MarketBalance
type MarketBalance = { Escrow: string, Locked: string }
Properties:
Escrow
:string
Locked
:string
MarketDeal
type MarketDeal = { Proposal: DealProposal, State: DealState }
Properties:
Proposal
:DealProposal
State
:DealState
Merge
type Merge = { Lane: number, Nonce: number }
Properties:
Lane
:number
Nonce
:number
Message
type Message = { From: string, GasFeeCap: string, GasLimit: number, GasPremium: string, Method: number, Nonce: number, Params: string, To: string, Value: string, Version: number }
Properties:
From
:string
GasFeeCap
:string
GasLimit
:number
GasPremium
:string
Method
:number
Nonce
:number
Params
:string
To
:string
Value
:string
Version
:number
Message1
type Message1 = { Cid: Cid, Message: Message }
Properties:
MessageMatch
type MessageMatch = { From: string, To: string }
Properties:
From
:string
To
:string
MessageReceipt
type MessageReceipt = { ExitCode: number, GasUsed: number, Return: string }
Properties:
ExitCode
:number
GasUsed
:number
Return
:string
MessageSendSpec
type MessageSendSpec = { MaxFee: string }
Properties:
MaxFee
:string
MinerDeal
type MinerDeal = { AddFundsCid: Cid, AvailableForRetrieval: boolean, Client: string, ClientDealProposal: ClientDealProposal, CreationTime: CborTime, DealID: number, FastRetrieval: boolean, FundsReserved: string, Message: string, MetadataPath: string, Miner: string, PiecePath: string, ProposalCid: Cid, PublishCid: Cid, Ref: DataRef, SlashEpoch: number, State: number, StoreID: number, TransferChannelId: ChannelID }
Properties:
AddFundsCid
:Cid
AvailableForRetrieval
:boolean
Client
:string
ClientDealProposal
:ClientDealProposal
CreationTime
:CborTime
DealID
:number
FastRetrieval
:boolean
FundsReserved
:string
Message
:string
MetadataPath
:string
Miner
:string
PiecePath
:string
ProposalCid
:Cid
PublishCid
:Cid
Ref
:DataRef
SlashEpoch
:number
State
:number
StoreID
:number
TransferChannelId
:ChannelID
MinerInfo
type MinerInfo = { ConsensusFaultElapsed: number, ControlAddresses: Array<string>, Multiaddrs: Array<string>, NewWorker: string, Owner: string, PeerId: string, SealProofType: number, SectorSize: number, WindowPoStPartitionSectors: number, Worker: string, WorkerChangeEpoch: number }
Properties:
ConsensusFaultElapsed
:number
ControlAddresses
:Array<string>
Multiaddrs
:Array<string>
NewWorker
:string
Owner
:string
PeerId
:string
SealProofType
:number
SectorSize
:number
WindowPoStPartitionSectors
:number
Worker
:string
WorkerChangeEpoch
:number
MinerPower
type MinerPower = { HasMinPower: boolean, MinerPower: Claim, TotalPower: Claim }
Properties:
MinerSectors
type MinerSectors = { Active: number, Faulty: number, Live: number }
Properties:
Active
:number
Faulty
:number
Live
:number
MiningBaseInfo
type MiningBaseInfo = { BeaconEntries: Array<BeaconEntry>, EligibleForMining: boolean, MinerPower: string, NetworkPower: string, PrevBeaconEntry: BeaconEntry, SectorSize: number, Sectors: Array<SectorInfo>, WorkerKey: string }
Properties:
BeaconEntries
:Array<BeaconEntry>
EligibleForMining
:boolean
MinerPower
:string
NetworkPower
:string
PrevBeaconEntry
:BeaconEntry
SectorSize
:number
Sectors
:Array<SectorInfo>
WorkerKey
:string
ModVerifyParams
type ModVerifyParams = { Actor: string, Data: string, Method: number }
Properties:
Actor
:string
Data
:string
Method
:number
MpoolConfig
type MpoolConfig = { GasLimitOverestimation: number, PriorityAddrs: Array<string>, PruneCooldown: number, ReplaceByFeeRatio: number, SizeLimitHigh: number, SizeLimitLow: number }
Properties:
GasLimitOverestimation
:number
PriorityAddrs
:Array<string>
PruneCooldown
:number
ReplaceByFeeRatio
:number
SizeLimitHigh
:number
SizeLimitLow
:number
MpoolUpdate
type MpoolUpdate = { Message: SignedMessage, Type: number }
Properties:
Message
:SignedMessage
Type
:number
MsgGasCost
type MsgGasCost = { BaseFeeBurn: string, GasUsed: string, Message: Cid, MinerPenalty: string, MinerTip: string, OverEstimationBurn: string, Refund: string, TotalCost: string }
Properties:
BaseFeeBurn
:string
GasUsed
:string
Message
:Cid
MinerPenalty
:string
MinerTip
:string
OverEstimationBurn
:string
Refund
:string
TotalCost
:string
MsgLookup
type MsgLookup = { Height: number, Message: Cid, Receipt: MessageReceipt, ReturnDec: any, TipSet: Cid[] }
Properties:
Height
:number
Message
:Cid
Receipt
:MessageReceipt
ReturnDec
:any
TipSet
:Cid[]
MsigVesting
type MsigVesting = { InitialBalance: string, StartEpoch: number, UnlockDuration: number }
Properties:
InitialBalance
:string
StartEpoch
:number
UnlockDuration
:number
NatInfo
type NatInfo = { PublicAddr: string, Reachability: number }
Properties:
PublicAddr
:string
Reachability
:number
ObjStat
type ObjStat = { Links: number, Size: number }
Properties:
Links
:number
Size
:number
Params
type Params = { PaymentInterval: number, PaymentIntervalIncrease: number, PieceCID: Cid, PricePerByte: string, Selector: Deferred, UnsealPrice: string }
Properties:
PaymentInterval
:number
PaymentIntervalIncrease
:number
PieceCID
:Cid
PricePerByte
:string
Selector
:Deferred
UnsealPrice
:string
Partition
type Partition = { ActiveSectors: BitField, AllSectors: BitField, FaultySectors: BitField, LiveSectors: BitField, RecoveringSectors: BitField }
Properties:
ActiveSectors
:BitField
AllSectors
:BitField
FaultySectors
:BitField
LiveSectors
:BitField
RecoveringSectors
:BitField
PaychStatus
type PaychStatus = { ControlAddr: string, Direction: number }
Properties:
ControlAddr
:string
Direction
:number
PaymentInfo
type PaymentInfo = { Channel: string, Vouchers: Array<SignedVoucher>, WaitSentinel: Cid }
Properties:
Channel
:string
Vouchers
:Array<SignedVoucher>
WaitSentinel
:Cid
PeerScoreSnapshot
type PeerScoreSnapshot = { AppSpecificScore: number, BehaviourPenalty: number, IPColocationFactor: number, Score: number, Topics: { [k: string]: TopicScoreSnapshot } }
Properties:
AppSpecificScore
:number
BehaviourPenalty
:number
IPColocationFactor
:number
Score
:number
Topics
:{ [k: string]: TopicScoreSnapshot }
PieceBlockLocation
type PieceBlockLocation = { BlockLocation: BlockLocation, PieceCID: Cid }
Properties:
BlockLocation
:BlockLocation
PieceCID
:Cid
PieceInfo
type PieceInfo = { Deals: Array<DealInfo1>, PieceCID: Cid }
Properties:
PieceInfo1
type PieceInfo1 = { PieceCID: Cid, Size: number }
Properties:
PieceCID
:Cid
Size
:number
PoStProof
type PoStProof = { PoStProof: number, ProofBytes: string }
Properties:
PoStProof
:number
ProofBytes
:string
ProviderDealState
type ProviderDealState = { ChannelID: ChannelID, CurrentInterval: number, DealProposal: DealProposal2, FundsReceived: string, LegacyProtocol: boolean, Message: string, PieceInfo: PieceInfo, Receiver: string, Status: number, StoreID: number, TotalSent: number }
Properties:
ChannelID
:ChannelID
CurrentInterval
:number
DealProposal
:DealProposal2
FundsReceived
:string
LegacyProtocol
:boolean
Message
:string
PieceInfo
:PieceInfo
Receiver
:string
Status
:number
StoreID
:number
TotalSent
:number
PubsubScore
type PubsubScore = { ID: string, Score: PeerScoreSnapshot }
Properties:
ID
:string
Score
:PeerScoreSnapshot
QueryOffer
type QueryOffer = { Err: string, MinPrice: string, Miner: string, MinerPeer: RetrievalPeer, PaymentInterval: number, PaymentIntervalIncrease: number, Piece: Cid, Root: Cid, Size: number, UnsealPrice: string }
Properties:
Err
:string
MinPrice
:string
Miner
:string
MinerPeer
:RetrievalPeer
PaymentInterval
:number
PaymentIntervalIncrease
:number
Piece
:Cid
Root
:Cid
Size
:number
UnsealPrice
:string
Range
type Range = { Offset: number, Size: number }
Properties:
Offset
:number
Size
:number
RetrievalEvent
type RetrievalEvent = { BytesReceived: number, Err: string, Event: number, FundsSpent: string, Status: number }
Properties:
BytesReceived
:number
Err
:string
Event
:number
FundsSpent
:string
Status
:number
RetrievalOrder
type RetrievalOrder = { Client: string, Miner: string, MinerPeer: RetrievalPeer, PaymentInterval: number, PaymentIntervalIncrease: number, Piece: Cid, Root: Cid, Size: number, Total: string, UnsealPrice: string }
Properties:
Client
:string
Miner
:string
MinerPeer
:RetrievalPeer
PaymentInterval
:number
PaymentIntervalIncrease
:number
Piece
:Cid
Root
:Cid
Size
:number
Total
:string
UnsealPrice
:string
RetrievalPeer
type RetrievalPeer = { Address: string, ID: string, PieceCID: Cid }
Properties:
Address
:string
ID
:string
PieceCID
:Cid
SealSeed
type SealSeed = { Epoch: number, Value: Array<number> }
Properties:
Epoch
:number
Value
:Array<number>
SealTicket
type SealTicket = { Epoch: number, Value: Array<number> }
Properties:
Epoch
:number
Value
:Array<number>
SealedRef
type SealedRef = { Offset: number, SectorID: number, Size: number }
Properties:
Offset
:number
SectorID
:number
Size
:number
SectorCids
type SectorCids = { Sealed: Cid, Unsealed: Cid }
Properties:
SectorExpiration
type SectorExpiration = { Early: number, OnTime: number }
Properties:
Early
:number
OnTime
:number
SectorID
type SectorID = { Miner: number, Number: number }
Properties:
Miner
:number
Number
:number
SectorInfo
type SectorInfo = { SealProof: number, SealedCID: Cid, SectorNumber: number }
Properties:
SealProof
:number
SealedCID
:Cid
SectorNumber
:number
SectorInfo1
type SectorInfo1 = { Activation: number, CommD: Cid, CommR: Cid, CommitMsg: Cid, DealWeight: string, Deals: Array<number>, Early: number, Expiration: number, InitialPledge: string, LastErr: string, Log: Array<SectorLog>, OnTime: number, PreCommitMsg: Cid, Proof: string, Retries: number, SealProof: number, SectorID: number, Seed: SealSeed, State: string, Ticket: SealTicket, ToUpgrade: boolean, VerifiedDealWeight: string }
Properties:
Activation
:number
CommD
:Cid
CommR
:Cid
CommitMsg
:Cid
DealWeight
:string
Deals
:Array<number>
Early
:number
Expiration
:number
InitialPledge
:string
LastErr
:string
Log
:Array<SectorLog>
OnTime
:number
PreCommitMsg
:Cid
Proof
:string
Retries
:number
SealProof
:number
SectorID
:number
Seed
:SealSeed
State
:string
Ticket
:SealTicket
ToUpgrade
:boolean
VerifiedDealWeight
:string
SectorLocation
type SectorLocation = { Deadline: number, Partition: number }
Properties:
Deadline
:number
Partition
:number
SectorLog
type SectorLog = { Kind: string, Message: string, Timestamp: number, Trace: string }
Properties:
Kind
:string
Message
:string
Timestamp
:number
Trace
:string
SectorOnChainInfo
type SectorOnChainInfo = { Activation: number, DealIDs: Array<number>, DealWeight: string, ExpectedDayReward: string, ExpectedStoragePledge: string, Expiration: number, InitialPledge: string, SealProof: number, SealedCID: Cid, SectorNumber: number, VerifiedDealWeight: string }
Properties:
Activation
:number
DealIDs
:Array<number>
DealWeight
:string
ExpectedDayReward
:string
ExpectedStoragePledge
:string
Expiration
:number
InitialPledge
:string
SealProof
:number
SealedCID
:Cid
SectorNumber
:number
VerifiedDealWeight
:string
SectorPreCommitInfo
type SectorPreCommitInfo = { DealIDs: Array<number>, Expiration: number, ReplaceCapacity: boolean, ReplaceSectorDeadline: number, ReplaceSectorNumber: number, ReplaceSectorPartition: number, SealProof: number, SealRandEpoch: number, SealedCID: Cid, SectorNumber: number }
Properties:
DealIDs
:Array<number>
Expiration
:number
ReplaceCapacity
:boolean
ReplaceSectorDeadline
:number
ReplaceSectorNumber
:number
ReplaceSectorPartition
:number
SealProof
:number
SealRandEpoch
:number
SealedCID
:Cid
SectorNumber
:number
SectorPreCommitOnChainInfo
type SectorPreCommitOnChainInfo = { DealWeight: string, Info: SectorPreCommitInfo, PreCommitDeposit: string, PreCommitEpoch: number, VerifiedDealWeight: string }
Properties:
DealWeight
:string
Info
:SectorPreCommitInfo
PreCommitDeposit
:string
PreCommitEpoch
:number
VerifiedDealWeight
:string
SectorStorageInfo
type SectorStorageInfo = { CanSeal: boolean, CanStore: boolean, ID: string, Primary: boolean, URLs: Array<string>, Weight: number }
Properties:
CanSeal
:boolean
CanStore
:boolean
ID
:string
Primary
:boolean
URLs
:Array<string>
Weight
:number
Signature
type Signature = { Data: string, Type: number }
Properties:
Data
:string
Type
:number
SignedMessage
type SignedMessage = { Message: Message, Signature: Signature }
Properties:
SignedStorageAsk
type SignedStorageAsk = { Ask: StorageAsk, Signature: Signature }
Properties:
Ask
:StorageAsk
Signature
:Signature
SignedVoucher
type SignedVoucher = { Amount: string, ChannelAddr: string, Extra: ModVerifyParams, Lane: number, Merges: Array<Merge>, MinSettleHeight: number, Nonce: number, SecretPreimage: string, Signature: Signature, TimeLockMax: number, TimeLockMin: number }
Properties:
Amount
:string
ChannelAddr
:string
Extra
:ModVerifyParams
Lane
:number
Merges
:Array<Merge>
MinSettleHeight
:number
Nonce
:number
SecretPreimage
:string
Signature
:Signature
TimeLockMax
:number
TimeLockMin
:number
StartDealParams
type StartDealParams = { Data: DataRef, DealStartEpoch: number, EpochPrice: string, FastRetrieval: boolean, MinBlocksDuration: number, Miner: string, ProviderCollateral: string, VerifiedDeal: boolean, Wallet: string }
Properties:
Data
:DataRef
DealStartEpoch
:number
EpochPrice
:string
FastRetrieval
:boolean
MinBlocksDuration
:number
Miner
:string
ProviderCollateral
:string
VerifiedDeal
:boolean
Wallet
:string
Stats
type Stats = { RateIn: number, RateOut: number, TotalIn: number, TotalOut: number }
Properties:
RateIn
:number
RateOut
:number
TotalIn
:number
TotalOut
:number
StorageAsk
type StorageAsk = { Expiry: number, MaxPieceSize: number, MinPieceSize: number, Miner: string, Price: string, SeqNo: number, Timestamp: number, VerifiedPrice: string }
Properties:
Expiry
:number
MaxPieceSize
:number
MinPieceSize
:number
Miner
:string
Price
:string
SeqNo
:number
Timestamp
:number
VerifiedPrice
:string
StorageInfo
type StorageInfo = { CanSeal: boolean, CanStore: boolean, ID: string, URLs: Array<string>, Weight: number }
Properties:
CanSeal
:boolean
CanStore
:boolean
ID
:string
URLs
:Array<string>
Weight
:number
StoragePath
type StoragePath = { CanSeal: boolean, CanStore: boolean, ID: string, LocalPath: string, Weight: number }
Properties:
CanSeal
:boolean
CanStore
:boolean
ID
:string
LocalPath
:string
Weight
:number
SyncState
type SyncState = { ActiveSyncs: Array<ActiveSync>, VMApplied: number }
Properties:
ActiveSyncs
:Array<ActiveSync>
VMApplied
:number
Ticket
type Ticket = { VRFProof: string }
Properties:
VRFProof
:string
Time
type Time = {}
TipSet
type TipSet = { Blocks: Array<BlockHeader>, Cids: Array<Cid>, Height: number }
Properties:
Blocks
:Array<BlockHeader>
Cids
:Array<Cid>
Height
:number
TopicScoreSnapshot
type TopicScoreSnapshot = { FirstMessageDeliveries: number, InvalidMessageDeliveries: number, MeshMessageDeliveries: number, TimeInMesh: number }
Properties:
FirstMessageDeliveries
:number
InvalidMessageDeliveries
:number
MeshMessageDeliveries
:number
TimeInMesh
:number
Version
type Version = { APIVersion: number, BlockDelay: number, Version: string }
Properties:
APIVersion
:number
BlockDelay
:number
Version
:string
VoucherCreateResult
type VoucherCreateResult = { Shortfall: string, Voucher: SignedVoucher }
Properties:
Shortfall
:string
Voucher
:SignedVoucher
VoucherSpec
type VoucherSpec = { Amount: string, Extra: ModVerifyParams, MinSettle: number, TimeLockMax: number, TimeLockMin: number }
Properties:
Amount
:string
Extra
:ModVerifyParams
MinSettle
:number
TimeLockMax
:number
TimeLockMin
:number
WorkerInfo
type WorkerInfo = { Hostname: string, Resources: WorkerResources }
Properties:
Hostname
:string
Resources
:WorkerResources
WorkerJob
type WorkerJob = { ID: number, RunWait: number, Sector: SectorID, Start: Time, Task: string }
Properties:
WorkerResources
type WorkerResources = { CPUs: number, GPUs: Array<string>, MemPhysical: number, MemReserved: number, MemSwap: number }
Properties:
CPUs
:number
GPUs
:Array<string>
MemPhysical
:number
MemReserved
:number
MemSwap
:number
WorkerStats
type WorkerStats = { CpuUse: number, GpuUsed: boolean, Info: WorkerInfo, MemUsedMax: number, MemUsedMin: number }
Properties:
CpuUse
:number
GpuUsed
:boolean
Info
:WorkerInfo
MemUsedMax
:number
MemUsedMin
:number