Formerly NeoVier/elm-eos. Search finds this package by either name.
Perform queries to get data from tables. The CLI gives you functions to perform type-safe queries, and this module helps you actually turn them into Cmds.
Send a Query to EOSIO.
You shouldn't need to construct a Query by hand. Instead, use functions generated by the CLI. They live in the Table.Query module.
Some parameters of the query are defined when running the CLI (like baseUrl).
Others can be modified with functions like withLimit and
withBaseUrl (in case you need to override it).
This returns a Response, since there may be pagination in the result. If you want to paginate, keep the Cursor returned in the Response and use withLowerBound or withUpperBound in the next query.
import Eos.Query
import Http
import Table
import Table.Query
type Msg
= GotAccountData (Result Http.Error (Eos.Query.Response Table.Accounts))
queryAccounts : Cmd Msg
queryAccounts =
Table.Query.accounts { scope = "henriquebuss" }
|> Eos.Query.withLimit 20
|> Eos.Query.send GotAccountDataA response from a Query. It contains the results, and also
pagination data. You can check if there is more data to be fetched with the
hasMore field. If there is, you can use the nextCursor field to fetch the
next page of data with withLowerBound or
withUpperBound.
Define if the Query results should be reversed.
Used to set the lower bound or upper bound with withLowerBound or withUpperBound. You can get one of these from send.
The
Querytype. It's only exposed so that the CLI can have access to it. You shouldn't construct it by hand.