Skip to content

Commit d74ce0b

Browse files
committed
taprpc: add pagination and sorting to AddrReceivesRequest
1 parent 3975b46 commit d74ce0b

File tree

8 files changed

+1603
-1534
lines changed

8 files changed

+1603
-1534
lines changed

taprpc/tapcommon.pb.go

Lines changed: 60 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

taprpc/tapcommon.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,9 @@ message AssetOutPoint {
3434
// asset is locked to.
3535
bytes script_key = 3;
3636
}
37+
38+
enum SortDirection {
39+
SORT_DIRECTION_ASC = 0;
40+
41+
SORT_DIRECTION_DESC = 1;
42+
}

taprpc/taprootassets.pb.go

Lines changed: 532 additions & 496 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

taprpc/taprootassets.proto

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,6 +1513,15 @@ message AddrReceivesRequest {
15131513

15141514
// Filter receives by a specific status. Leave empty to get all receives.
15151515
AddrEventStatus filter_status = 2;
1516+
1517+
// The number of events to skip.
1518+
int32 offset = 3;
1519+
1520+
// The max number of events returned.
1521+
int32 limit = 4;
1522+
1523+
// The direction of the page. Sorted by creation time.
1524+
SortDirection direction = 5;
15161525
}
15171526

15181527
message AddrReceivesResponse {

taprpc/taprootassets.swagger.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,20 @@
12881288
"filter_status": {
12891289
"$ref": "#/definitions/taprpcAddrEventStatus",
12901290
"description": "Filter receives by a specific status. Leave empty to get all receives."
1291+
},
1292+
"offset": {
1293+
"type": "integer",
1294+
"format": "int32",
1295+
"description": "The number of events to skip."
1296+
},
1297+
"limit": {
1298+
"type": "integer",
1299+
"format": "int32",
1300+
"description": "The max number of events returned."
1301+
},
1302+
"direction": {
1303+
"$ref": "#/definitions/taprpcSortDirection",
1304+
"description": "The direction of the page. Sorted by creation time."
12911305
}
12921306
}
12931307
},
@@ -2669,6 +2683,14 @@
26692683
}
26702684
}
26712685
},
2686+
"taprpcSortDirection": {
2687+
"type": "string",
2688+
"enum": [
2689+
"SORT_DIRECTION_ASC",
2690+
"SORT_DIRECTION_DESC"
2691+
],
2692+
"default": "SORT_DIRECTION_ASC"
2693+
},
26722694
"taprpcSplitCommitment": {
26732695
"type": "object",
26742696
"properties": {

0 commit comments

Comments
 (0)