Skip to content

RPC

Defined in: packages/iso-filecoin/src/rpc.js:125

RPC

new RPC(options, fetchOptions?): RPC

Defined in: packages/iso-filecoin/src/rpc.js:134

TODO: remove fetch from Options and use fetch from RequestOptions TODO: either remove token or merge this.headers with fetchOptions.headers

ParameterType
optionsOptions
fetchOptions?RequestOptions

RPC

balance(address, fetchOptions?): Promise<MaybeResult<string, RequestErrors | RpcError | JsonRpcError>>

Defined in: packages/iso-filecoin/src/rpc.js:231

WalletBalance returns the balance of the given address at the current head of the chain.

ParameterType
addressstring
fetchOptions?RequestOptions

Promise<MaybeResult<string, RequestErrors | RpcError | JsonRpcError>>

https://lotus.filecoin.io/reference/lotus/wallet/#walletbalance


call<R>(rpcOptions, fetchOptions?): Promise<MaybeResult<R, RequestErrors | JsonRpcError>>

Defined in: packages/iso-filecoin/src/rpc.js:590

Generic method to call any method on the lotus rpc api.

Type Parameter
R
ParameterType
rpcOptionsRpcOptions
fetchOptions?RequestOptions

Promise<MaybeResult<R, RequestErrors | JsonRpcError>>


chainHead(fetchOptions?): Promise<MaybeResult<TipSet, RequestErrors | JsonRpcError>>

Defined in: packages/iso-filecoin/src/rpc.js:471

The current head of the chain.

ParameterType
fetchOptions?RequestOptions

Promise<MaybeResult<TipSet, RequestErrors | JsonRpcError>>

https://github.com/filecoin-project/filecoin-docs/blob/main/reference/json-rpc/chain.md#chainhead


filecoinAddressToEthAddress(params, fetchOptions?): Promise<MaybeResult<string, RequestErrors | RpcError | JsonRpcError>>

Defined in: packages/iso-filecoin/src/rpc.js:340

Converts any Filecoin address to an EthAddress.

ParameterType
paramsFilecoinAddressToEthAddressParams
fetchOptions?RequestOptions

Promise<MaybeResult<string, RequestErrors | RpcError | JsonRpcError>>

https://github.com/filecoin-project/lotus/blob/471819bf1ef8a4d5c7c0476a38ce9f5e23c59bfc/api/api_full.go#L743-L768


gasEstimate(params, fetchOptions?): Promise<MaybeResult<LotusMessage, RequestErrors | RpcError | JsonRpcError | ValidationRpcError>>

Defined in: packages/iso-filecoin/src/rpc.js:186

GasEstimateMessageGas estimates gas values for unset message gas fields

ParameterType
paramsGasEstimateParams
fetchOptions?RequestOptions

Promise<MaybeResult<LotusMessage, RequestErrors | RpcError | JsonRpcError | ValidationRpcError>>

https://lotus.filecoin.io/reference/lotus/gas/#gasestimatemessagegas


getIDAddress(params, fetchOptions?): Promise<MaybeResult<string, RequestErrors | RpcError | JsonRpcError>>

Defined in: packages/iso-filecoin/src/rpc.js:552

Get the ID address for an address with different safety guarantees

ParameterType
params{ address: string; safety?: Safety; }
params.addressstring
params.safety?Safety
fetchOptions?RequestOptions

Promise<MaybeResult<string, RequestErrors | RpcError | JsonRpcError>>


getTipSetByHeight(params, fetchOptions?): Promise<MaybeResult<TipSet, RequestErrors | JsonRpcError>>

Defined in: packages/iso-filecoin/src/rpc.js:491

Get tipset at the specified epoch (height). If there are no blocks at the specified epoch, a tipset at an earlier epoch will be returned.

ParameterType
paramsChainGetTipSetByHeightParams
fetchOptions?RequestOptions

Promise<MaybeResult<TipSet, RequestErrors | JsonRpcError>>

https://github.com/filecoin-project/filecoin-docs/blob/main/reference/json-rpc/chain.md#chaingettipsetbyheight


lookBackTipSet(lookback, fetchOptions?): Promise<MaybeResult<TipSet, RequestErrors | RpcError | JsonRpcError>>

Defined in: packages/iso-filecoin/src/rpc.js:513

Looks back from latest height for a tipset

ParameterTypeDescription
lookbacknumberChain epoch to look back to
fetchOptions?RequestOptions-

Promise<MaybeResult<TipSet, RequestErrors | RpcError | JsonRpcError>>


networkName(fetchOptions?): Promise<MaybeResult<Network, RequestErrors | JsonRpcError>>

Defined in: packages/iso-filecoin/src/rpc.js:171

NetworkName returns the name of the network the node is synced to.

ParameterType
fetchOptions?RequestOptions

Promise<MaybeResult<Network, RequestErrors | JsonRpcError>>


nonce(address, fetchOptions?): Promise<MaybeResult<number, RequestErrors | RpcError | JsonRpcError>>

Defined in: packages/iso-filecoin/src/rpc.js:249

MpoolGetNonce gets next nonce for the specified sender. Note that this method may not be atomic. Use MpoolPushMessage instead.

ParameterType
addressstring
fetchOptions?RequestOptions

Promise<MaybeResult<number, RequestErrors | RpcError | JsonRpcError>>

https://lotus.filecoin.io/reference/lotus/mpool/#mpoolgetnonce


pushMessage(params, fetchOptions?): Promise<MaybeResult<CID, RequestErrors | RpcError | JsonRpcError | ValidationRpcError>>

Defined in: packages/iso-filecoin/src/rpc.js:268

MpoolPush pushes a signed message to mempool.

ParameterType
paramsPushMessageParams
fetchOptions?RequestOptions

Promise<MaybeResult<CID, RequestErrors | RpcError | JsonRpcError | ValidationRpcError>>

https://lotus.filecoin.io/reference/lotus/mpool/#mpoolpush


stateAccountKey(params, fetchOptions?): Promise<MaybeResult<string, RequestErrors | RpcError | JsonRpcError>>

Defined in: packages/iso-filecoin/src/rpc.js:365

Public key address of the given ID address.

ParameterType
paramsStateAccountKeyParams
fetchOptions?RequestOptions

Promise<MaybeResult<string, RequestErrors | RpcError | JsonRpcError>>

https://github.com/filecoin-project/lotus/blob/master/documentation/en/api-v0-methods.md#StateAccountKey


stateLookupID(params, fetchOptions?): Promise<MaybeResult<string, RequestErrors | JsonRpcError>>

Defined in: packages/iso-filecoin/src/rpc.js:440

Retrieves the ID address of the given address for a tipset. If you dont have a specific tipset in mind, better to use getIDAddress.

ParameterType
paramsStateAccountKeyParams
fetchOptions?RequestOptions

Promise<MaybeResult<string, RequestErrors | JsonRpcError>>

https://github.com/filecoin-project/lotus/blob/master/documentation/en/api-v0-methods.md#statelookupid


stateLookupRobustAddress(params, fetchOptions?): Promise<MaybeResult<string, RequestErrors | RpcError | JsonRpcError>>

Defined in: packages/iso-filecoin/src/rpc.js:402

Public key address of the given non-account ID address.

ParameterType
paramsStateAccountKeyParams
fetchOptions?RequestOptions

Promise<MaybeResult<string, RequestErrors | RpcError | JsonRpcError>>

https://github.com/filecoin-project/lotus/blob/master/documentation/en/api-v0-methods.md#StateLookupRobustAddress


version(fetchOptions?): Promise<MaybeResult<VersionResponse, RequestErrors | JsonRpcError>>

Defined in: packages/iso-filecoin/src/rpc.js:159

Version returns the version of the Filecoin node.

ParameterType
fetchOptions?RequestOptions

Promise<MaybeResult<VersionResponse, RequestErrors | JsonRpcError>>


waitMsg(params, fetchOptions?): Promise<MaybeResult<CID, RequestErrors | JsonRpcError>>

Defined in: packages/iso-filecoin/src/rpc.js:317

StateWaitMsg 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.

Timeout is increased to 60s instead of the default 5s.

ParameterType
paramswaitMsgParams
fetchOptions?RequestOptions

Promise<MaybeResult<CID, RequestErrors | JsonRpcError>>

https://lotus.filecoin.io/reference/lotus/state/#statewaitmsg

api: URL

Defined in: packages/iso-filecoin/src/rpc.js:144


fetch: {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Defined in: packages/iso-filecoin/src/rpc.js:143

(input, init?): Promise<Response>

MDN Reference

ParameterType
inputURL | RequestInfo
init?RequestInit

Promise<Response>

(input, init?): Promise<Response>

MDN Reference

ParameterType
inputstring | URL | Request
init?RequestInit

Promise<Response>


fetchOptions: RequestOptions

Defined in: packages/iso-filecoin/src/rpc.js:151


headers: object

Defined in: packages/iso-filecoin/src/rpc.js:146

optional Authorization: string

Content-Type: string = 'application/json'


network: Network

Defined in: packages/iso-filecoin/src/rpc.js:145