Skip to content

Commit

Permalink
enhancement: add reverse param to query method
Browse files Browse the repository at this point in the history
closes issue #46
  • Loading branch information
dafuga committed Jan 9, 2024
1 parent 2866c48 commit 9f5da32
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/contract/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface QueryParams {
to?: API.v1.TableIndexType | string | number
maxRows?: number
rowsPerAPIRequest?: number
reverse?: boolean
}

interface FieldToIndex {
Expand Down Expand Up @@ -123,6 +124,7 @@ export class Table<RowType = any> {
lower_bound: wrapIndexValue(params.from),
upper_bound: wrapIndexValue(params.to),
limit: params.rowsPerAPIRequest || this.defaultRowLimit,
reverse: params.reverse,
}

if (params.index) {
Expand Down

0 comments on commit 9f5da32

Please sign in to comment.