Function
retrievePaginatedEntity
retrievePaginatedEntity< T, V extends RawGtv, R extends PagedResponse<V> = PagedResponse<V>, >( queryable: Queryable, query: QueryObject<R, DictPair>, dataMapper: (arg: V[]) => T[], ): Promise<PaginatedEntity<T>>Type Parameters
- T
type of entity that will be returned (note: Type of a single entity, not a list)
- V extends RawGtv
type of data returned from the blockchain
- R extends PagedResponse<V> = PagedResponse<V>
Parameters
- queryable: Queryable
to use to make queries to blockchain
- query: QueryObject<R, DictPair>
the query to perform
- dataMapper: (arg: V[]) => T[]
function that transforms data from the type returned by backend to the type returned to caller
Returns Promise<PaginatedEntity<T>>
an object that contains a method to fetch a page from a paginated endpoint
- T