Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[indexer] Add total_count field #70

Merged
merged 2 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions api.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"openapi":"3.0.2",
"info": {
"version":"1.4.8",
"version":"1.4.9",
"title":"Rosetta",
"description":"Build Once. Integrate Your Blockchain Everywhere.",
"license": {
Expand Down Expand Up @@ -2345,22 +2345,30 @@
"description":"SearchTransactionsResponse contains an ordered collection of BlockTransactions that match the query in SearchTransactionsRequest. These BlockTransactions are sorted from most recent block to oldest block.",
"type":"object",
"required": [
"transactions"
"transactions",
"total_count"
],
"properties": {
"next_offset": {
"description":"next_offset is the next offset to use when paginating through transaction results. If this field is not populated, there are no more transactions to query.",
"type":"integer",
"format":"int64",
"minimum": 0,
"example": 5
},
"transactions": {
"type":"array",
"description":"transactions is an array of BlockTransactions sorted by most recent BlockIdentifier (meaning that transactions in recent blocks appear first). If there are many transactions for a particular search, transactions may not contain all matching transactions. It is up to the caller to paginate these transactions using the max_block field.",
"items": {
"$ref":"#/components/schemas/BlockTransaction"
}
},
"total_count": {
"description":"total_count is the number of results for a given search. Callers typically use this value to concurrently fetch results by offset or to display a virtual page number associated with results.",
"type":"integer",
"format":"int64",
"minimum": 0,
"example": 5
},
"next_offset": {
"description":"next_offset is the next offset to use when paginating through transaction results. If this field is not populated, there are no more transactions to query.",
"type":"integer",
"format":"int64",
"minimum": 0,
"example": 5
}
}
},
Expand Down
30 changes: 20 additions & 10 deletions api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

openapi: 3.0.2
info:
version: 1.4.8
version: 1.4.9
title: Rosetta
description: |
Build Once. Integrate Your Blockchain Everywhere.
Expand Down Expand Up @@ -1620,16 +1620,8 @@ components:
type: object
required:
- transactions
- total_count
properties:
next_offset:
description: |
next_offset is the next offset to use when paginating through
transaction results. If this field is not populated, there are
no more transactions to query.
type: integer
format: int64
minimum: 0
example: 5
transactions:
type: array
description: |
Expand All @@ -1642,6 +1634,24 @@ components:
paginate these transactions using the max_block field.
items:
$ref: '#/components/schemas/BlockTransaction'
total_count:
description: |
total_count is the number of results for a given search. Callers
typically use this value to concurrently fetch results by offset
or to display a virtual page number associated with results.
type: integer
format: int64
minimum: 0
example: 5
next_offset:
description: |
next_offset is the next offset to use when paginating through
transaction results. If this field is not populated, there are
no more transactions to query.
type: integer
format: int64
minimum: 0
example: 5

# Miscellaneous
Error:
Expand Down