Skip to content

Queries

Iroha queries read ledger state without mutating it. The current data model exposes two broad query shapes:

  • singular queries, which return one object or one value
  • iterable queries, which return a stream or collection and can be combined with filtering, sorting, projection, and pagination where the query type supports it

Use SDK typed builders or the CLI instead of constructing query envelopes by hand. The names below are the current query types exposed by iroha_data_model::query.

Runtime and Configuration

QueryPurpose
FindAbiVersionReturn the executor ABI version.
FindExecutorDataModelReturn the executor data-model description.
FindParametersReturn on-chain executor configuration parameters.

Accounts and Permissions

QueryPurpose
FindAccountByIdFind one account by canonical account ID.
FindAccountByAliasResolve an account alias to an account.
FindAccountsList registered accounts.
FindAccountIdsList registered account IDs.
FindAccountsWithAssetList accounts that hold a given asset definition.
FindAliasesByAccountIdList aliases bound to an account.
FindAccountRecoveryPolicyByAliasFind the recovery policy for an alias.
FindAccountRecoveryRequestByAliasFind the recovery request for an alias.
FindRolesList roles.
FindRoleIdsList role IDs.
FindRolesByAccountIdList roles granted to an account.
FindPermissionsByAccountIdList permissions granted to an account.

Domains and Peers

QueryPurpose
FindDomainByIdFind one domain by DomainId.
FindDomainsList registered domains.
FindDomainsByAccountIdList domains owned by an account.
FindDomainEndorsementsList domain endorsement records.
FindDomainEndorsementPolicyReturn the domain endorsement policy.
FindDomainCommitteeReturn the domain committee.
FindPeersList trusted peers known to the ledger.

Assets, NFTs, and RWAs

QueryPurpose
FindAssetsList asset balances.
FindAssetsDefinitionsList asset definitions.
FindAssetsByAccountIdList assets held by an account.
FindAssetByIdFind one asset balance by AssetId.
FindAssetDefinitionByIdFind one asset definition by ID.
FindNftsList NFTs.
FindNftsByAccountIdList NFTs owned by an account.
FindRwasList registered real-world-asset lots.

Escrow and Proof Records

QueryPurpose
FindAssetEscrowsList asset escrow records.
FindAssetEscrowByIdFind one asset escrow by ID.
FindAssetEscrowsBySellerList asset escrows by seller.
FindAssetEscrowsByBuyerList asset escrows by buyer.
FindAssetEscrowsByStatusList asset escrows by status.
FindAnonymousAssetEscrowsList anonymous asset escrow records.
FindAnonymousAssetEscrowByIdFind one anonymous asset escrow by ID.
FindAnonymousAssetEscrowsBySellerList anonymous escrows by seller.
FindAnonymousAssetEscrowsByBuyerList anonymous escrows by buyer.
FindAnonymousAssetEscrowsByStatusList anonymous escrows by status.
FindProofRecordByIdFind one proof record by ID.
FindProofRecordsList proof records.
FindProofRecordsByBackendList proof records for a proof backend.
FindProofRecordsByStatusList proof records by status.

Nexus, Data Availability, and Packages

QueryPurpose
FindRepoAgreementsList repository agreements stored on-chain.
FindTwitterBindingByHashResolve a Twitter binding by hash.
FindDaPinIntentByTicketFind a data-availability pin intent by ticket.
FindDaPinIntentByManifestFind a pin intent by manifest reference.
FindDaPinIntentByAliasFind a pin intent by alias.
FindDaPinIntentByLaneEpochSequenceFind a pin intent by lane, epoch, and sequence.
FindLaneRelayEnvelopeByRefFind a verified lane-relay envelope.
FindSorafsProviderOwnerResolve the owner of a SoraFS provider.
FindDataspaceNameOwnerByIdResolve a dataspace-name owner.
FindMusubiReleaseByRefFind a Musubi release by reference.
FindMusubiPackageVersionsList versions for a Musubi package.
FindMusubiPackageReleasesList releases for a Musubi package.
FindMusubiShortAliasByNameResolve a Musubi short alias.

Triggers, Contracts, Transactions, and Blocks

QueryPurpose
FindActiveTriggerIdsList active trigger IDs.
FindTriggersList triggers.
FindTriggerByIdFind one trigger by ID.
FindContractManifestByCodeHashFind a smart-contract manifest by code hash.
FindTransactionsList committed transactions.
FindBlocksList blocks.
FindBlockHeadersList block headers.

Filtering and Pagination

Iterable queries can expose predicate and selector support. Use query-specific typed filters from the SDK so the filter input matches the query output type. For large result sets, use query parameters such as cursor and limit instead of fetching every row at once.