Querying uploaded data

Installation

1
yarn add @kyve/query
Copied!
Note: The KYVE-Query class extends ArDB. For detailed information please refer to the documentation.

Basic Query

To query KYVE data, create a new Query and pass in the pool-ID. The default limit is 10 transactions. Call .next() to get to the next page. The default order is latest -> oldest transactions.
1
import { Query } from "@kyve/query";
2
3
const poolID = "my_pool_id";
4
const query = new Query(poolID);
5
6
// finding latest transactions
7
const txs = query.find();
8
9
// receiveing the next 10 results
10
const nextTxs = query.next();
Copied!

Setting custom limits

To set a custom limit you can add a .limit() statement.
1
// finding 50 latest transactions
2
const txs = query.limit(50).find();
Copied!

Other filters

For other filters please refer to the ArDB documentation.
Last modified 3mo ago