Skip to content

Instantly share code, notes, and snippets.

Created May 21, 2020
What would you like to do?
const conseilServer = {
url: '',
apiKey: "INSERT KEY HERE", //Replace this with your own key from Nautilus Cloud
network: 'mainnet'
// Account Balance Query
let query = conseiljs.ConseilQueryBuilder.blankQuery(); //Initializes a blank query
query = conseiljs.ConseilQueryBuilder.addFields(query, 'balance'); // Adds balance as a field
query = conseiljs.ConseilQueryBuilder.addFields(query, 'account_id'); // Adds the account_id as a field
query = conseiljs.ConseilQueryBuilder.addOrdering(query, "balance", conseiljs.ConseilSortDirection.DESC); // Orders the results based off of balance in descending order
query = conseiljs.ConseilQueryBuilder.setLimit(query, 684); // Limits the results to 684 accounts
// Wrapper function for query execution
let execute = async function(query, entity) {
let result = await conseiljs.ConseilDataClient.executeEntityQuery(conseilServer, 'tezos',, entity, query); // ConseilJS call to execute query
return result
result = execute(query, "accounts")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment