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>