bitshares / bitshares-core

BitShares Blockchain node and command-line wallet
https://bitshares.github.io/
Other
1.17k stars 643 forks source link

Add API to get the next object ID #2649

Closed abitmore closed 1 year ago

abitmore commented 1 year ago

User Story

As a client application developer I want an API to get the next instance ID that will be assigned to an object space.

Things to consider:

Additional Context (optional)

Mentioned by @christophersanborn in the BitShares Development Telegram group:

How does one get the next instance ID in an object space? Like, if I wanted to predict what the account ID of the next account to be created will be, how could one get that information? Wondering about this generally, for any object space. (So in other words, not just wondering how to find out how many accounts are registered — it could be any object type where I want to find out in advance which one is "next".) Is there an API call that will return this? Or an object I could query that holds the object counter for various spaces?

... it's a generic question as it's come up a few time w.r.t different object types, but basically what I'm trying to do is to list the "most recent" objects of some such type to be created. So if I can get the "next" object ID, then I can request, say, the ten preceding objects to get the "ten most recent".

Impacts Describe which portion(s) of BitShares Core may be impacted by your request. Please tick at least one box.

CORE TEAM TASK LIST

abitmore commented 1 year ago

Done via #2653.