Cardano-wallet: Add API endpoint for listing stake pools

Created on 15 Sep 2019  路  3Comments  路  Source: input-output-hk/cardano-wallet

Context

This will allow Daedalus (and other clients) to list stake pools, and see where they can delegate too.

Side-note: For this milestone we could only possibly show the id, stake and performance for each pool. In another U/S we will likely add more information once supported by j枚rmungandr.

The pool id should not be confused with the non-unique 3-4-letter ticker. The pool id is a public key.

In the future we could decide to show how many delegation certificates exist delegating to each pool.

Decision

Add an API endpoint that wraps the data from #711 and #713.

We should have a response format like this:

[
  {
    "id": "7d749ef424507fb80fed0d2289d535a94f6870add0cf8b374cfe6cae078320ec",
    "metrics": {
      "controlled_stake": {
        "quantity": 42000000,
        "unit": "lovelace"
      },
      "produced_blocks": {
        "quantity": 1337,
        "unit": "block"
      }
    }
  }
]

Acceptance Criteria

  • [ ] Wallet API clients _must_ be able to list stake-pools and get their id, approximate performance and stake.
  • [ ] If results are unavailable, this _must be_ presented appropriately to the user.
  • [ ] The response _should not_ be paginated
  • [ ] [Swagger.yaml](https://github.com/input-output-hk/cardano-wallet/blob/master/specifications/api/swagger.yaml) _must be_ updated

Development Plan

PR

| Number | Base |
| --- | --- |
| #748 | master |

QA

Most helpful comment

From @rvl

  • Can we get an exact schema of the value returned, and the endpoint name? (Maybe this needs to be sorted with Daedalus team).
  • Swagger.yaml should be updated as part of the AC.

All 3 comments

Would be nice to outline the swagger specification in the ticket as a requirement? This gives a really clear indicator of what needs to be implemented :)

From @rvl

  • Can we get an exact schema of the value returned, and the endpoint name? (Maybe this needs to be sorted with Daedalus team).
  • Swagger.yaml should be updated as part of the AC.

Closing this ticket. Remaining work and QA will be tracked in #713

Was this page helpful?
0 / 5 - 0 ratings