Skip to main content

LEZ indexer RPC reference

Look up every JSON-RPC method and subscription a LEZ indexer serves.​

Mirrored page

This page mirrors lez/indexer/service/rpc/src/lib.rs from logos-execution-zone v0.3.2, and is regenerated automatically after each release. To change it, edit the source in logos-blockchain/logos-execution-zone, not this page.

The server speaks JSON-RPC 2.0. Parameter and return types are the Rust types the server is written against; most come from the indexer_service_protocol crate, and their JSON shape is their serde serialisation. A failed call returns a JSON-RPC error object.

Methods​

NameParametersReturns
getSchemaNoneserde_json::Value
getLastFinalizedBlockIdNoneOption<BlockId>
getBlockByIdblock_idOption<Block>
getBlockByHashblock_hashOption<Block>
getAccountaccount_idAccount
getAccountAtBlockaccount_id, block_idAccount
getAccountSummaryaccount_idAccountSummary
getAccountViewselectorAccount
getAccountViewAtBlockselector, block_idAccount
getTransactiontx_hashOption<Transaction>
getBlocksbefore, limitVec<Block>
getTransactionsByAccountaccount_id, offset, limitVec<Transaction>
getEventsfilterVec<EventRecord>
getStatusNoneIndexerStatus
checkHealthNoneNone

getSchema​

Takes no parameters.

Returns serde_json::Value.

getLastFinalizedBlockId​

Takes no parameters.

Returns Option<BlockId>.

getBlockById​

Parameters, in order:

NameType
block_idBlockId

Returns Option<Block>.

getBlockByHash​

Parameters, in order:

NameType
block_hashHashType

Returns Option<Block>.

getAccount​

Parameters, in order:

NameType
account_idAccountId

Returns Account.

getAccountAtBlock​

Parameters, in order:

NameType
account_idAccountId
block_idBlockId

Returns Account.

getAccountSummary​

The account's balance, nonce, and one entry per shard carrying its size only. Safe to call on any account: unlike getAccount, the response does not grow with shard contents.

Parameters, in order:

NameType
account_idAccountId

Returns AccountSummary.

getAccountView​

Parameters, in order:

NameType
selectorProgramShardSelector

Returns Account.

getAccountViewAtBlock​

Parameters, in order:

NameType
selectorProgramShardSelector
block_idBlockId

Returns Account.

getTransaction​

Parameters, in order:

NameType
tx_hashHashType

Returns Option<Transaction>.

getBlocks​

Parameters, in order:

NameType
beforeOption<BlockId>
limitu64

Returns Vec<Block>.

getTransactionsByAccount​

Parameters, in order:

NameType
account_idAccountId
offsetu64
limitu64

Returns Vec<Transaction>.

getEvents​

Parameters, in order:

NameType
filterGetEventsFilter

Returns Vec<EventRecord>.

getStatus​

Takes no parameters.

Returns IndexerStatus.

checkHealth​

Takes no parameters.

Returns no value: the result is null.

Subscriptions​

NameParametersItem
subscribeToFinalizedBlocksNoneBlockId
subscribeToEventsfilterEventRecord

subscribeToFinalizedBlocks​

Takes no parameters.

Each notification carries BlockId.

subscribeToEvents​

Parameters, in order:

NameType
filterEventSubscriptionFilter

Each notification carries EventRecord.