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

Add dedicated ticket pool value and sdiff endpoints. #35

Merged
merged 2 commits into from
Mar 22, 2017

Conversation

chappjc
Copy link
Member

@chappjc chappjc commented Mar 22, 2017

Separate /stake into /stake/pool and /stake/diff for ticket pool info and sdiff, resp. Each have ./b/:ind and ./r/:ind0/:ind endpoints for values at a given block and on a range, resp.

TODO: log warning when sql result is shorter (or longer) than expected for range queries.

Begins to address #34, items 1 - 3. The results need caching, but now there is are at least array returns for sdiff and ticket pool info.

Also continues to address #20, which is an open ended issue to add new endpoints for 0.1.0.

Separate /stake into /stake/pool and /stake/diff for ticket pool info and sdiff, resp.  Each have ./b/:ind and ./r/:ind0/:ind endpoints for values at a given block and on a range, resp.

TODO: log warning when sql result is shorter (or longer) than expected for range queries.
@chappjc chappjc mentioned this pull request Mar 22, 2017
For example, /api/stake/pool/r/117723/117724?arrays=true gives you this:

{
  "start_height": 117723,
  "end_height": 117724,
  "value": [
    1988282.95249548,
    1988073.46390894
  ],
  "size": [
    41007,
    41002
  ]
}

But without arrays=true, you get:

[
  {
    "size": 41007,
    "value": 1988282.95249548,
    "valavg": 48.48642798
  },
  {
    "size": 41002,
    "value": 1988073.46390894,
    "valavg": 48.48723144
  }
]
@chappjc chappjc merged commit 51607ca into master Mar 22, 2017
@chappjc chappjc deleted the block-data-arrays branch March 22, 2017 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant