Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
feat: update v2 cursor pagination to enable a sort order (#476)
Browse files Browse the repository at this point in the history
* feat: update v2 pagination to add a flag for retrieving newest data first

* fix: liniting error
  • Loading branch information
guoguojin committed Jun 29, 2022
1 parent fade3fd commit ecf2441
Show file tree
Hide file tree
Showing 26 changed files with 1,106 additions and 995 deletions.
2,003 changes: 1,008 additions & 995 deletions data-node/api/v2/trading_data.pb.go

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions generated/json/data-node/api/v2/GetAssetsRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
4 changes: 4 additions & 0 deletions generated/json/data-node/api/v2/GetCandleDataRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
4 changes: 4 additions & 0 deletions generated/json/data-node/api/v2/GetDepositsRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
4 changes: 4 additions & 0 deletions generated/json/data-node/api/v2/GetMarginLevelsRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
4 changes: 4 additions & 0 deletions generated/json/data-node/api/v2/GetMarketsRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
4 changes: 4 additions & 0 deletions generated/json/data-node/api/v2/GetPartiesRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
4 changes: 4 additions & 0 deletions generated/json/data-node/api/v2/GetRewardsRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
4 changes: 4 additions & 0 deletions generated/json/data-node/api/v2/GetTradesByMarketRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
4 changes: 4 additions & 0 deletions generated/json/data-node/api/v2/GetTradesByPartyRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
4 changes: 4 additions & 0 deletions generated/json/data-node/api/v2/GetTransfersRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
4 changes: 4 additions & 0 deletions generated/json/data-node/api/v2/GetVotesRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
4 changes: 4 additions & 0 deletions generated/json/data-node/api/v2/GetWithdrawalsRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
4 changes: 4 additions & 0 deletions generated/json/data-node/api/v2/ListOracleDataRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
4 changes: 4 additions & 0 deletions generated/json/data-node/api/v2/ListOracleSpecsRequest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
4 changes: 4 additions & 0 deletions generated/json/data-node/api/v2/Pagination.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
},
"before": {
"type": "string"
},
"newest_first": {
"type": "boolean",
"description": "Newest records first, older records last, default is true"
}
},
"additionalProperties": true,
Expand Down
2 changes: 2 additions & 0 deletions sources/data-node/api/v2/trading_data.proto
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ message Pagination {
optional string after = 2;
optional int32 last = 3;
optional string before = 4;
// Newest records first, older records last, default is true
optional bool newest_first = 5;
}

// Page information for cursor based pagination
Expand Down

0 comments on commit ecf2441

Please sign in to comment.