lukechampine / walrus

A wallet server for Sia
https://lukechampine.com/docs/walrus
MIT License
12 stars 0 forks source link

Make /filecontracts and /blockrewards consistent with other endpoints #11

Open lukechampine opened 4 years ago

lukechampine commented 4 years ago

/blockrewards returns a []wallet.BlockReward directly, unlike other endpoints which return a list of IDs. I'm not sure why. This "correct" API should be:

GET /blockrewards?max=n -> []types.BlockID
GET /blockrewards/id -> wallet.BlockReward

along with a corresponding batch query:

POST /batchquery/blockrewards [id1, id2, id3] -> []wallet.BlockReward

Arguably, /limbo should be like this as well. I think in the case of limbo, I figured that a) the response is unlikely to ever grow super large, and b) the client rarely wants to examine just a single limbo transaction -- you almost always want to work with the full limbo set. So I'll probably leave /limbo as-is, unless someone can provide a compelling reason not to.

EDIT: just realized /filecontracts is also like this 😬