duality-labs / hapi-indexer

A Node.js based indexer for the Duality Cosmos chain
1 stars 0 forks source link

fix indexer nextKey pagination #9

Closed dib542 closed 1 year ago

dib542 commented 1 year ago

the pagination options currently accepted are

interface PaginationRequest {
  key?: string;
  offset?: number;
  limit?: number;
  before?: number; // unix timestamp
  after?: number;  // unix timestamp
}

interface PaginationResponse {
  next-key: string | null;
}

which is meant to reflect the pagination options available in Cosmos (see any list endpoint in https://docs.cosmos.network/swagger)

interface CosmosPaginationRequest {
  key?: string;
  offset?: number;
  limit?: number;
  count_total?: boolean;
  reverse?: boolean;
}

interface CosmosPaginationResponse {
  next_key: string | null;
  total?: string;
}

but there are issues that: