bitshares / bitshares-core

BitShares Blockchain node and command-line wallet

Home Page:https://bitshares.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add API to get the next object ID

abitmore opened this issue · comments

commented

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:

  • pending transactions - results may be different with or without pending transactions
  • chain reorganization - results can jump up and down, but not always up

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.

  • API (the application programming interface)
  • Build (the build process or something prior to compiled code)
  • CLI (the command line wallet)
  • Deployment (the deployment process after building such as Docker, Travis, etc.)
  • DEX (the Decentralized EXchange, market engine, etc.)
  • P2P (the peer-to-peer network for transaction/block propagation)
  • Performance (system or user efficiency, etc.)
  • Protocol (the blockchain logic, consensus, validation, etc.)
  • Security (the security of system or user data, etc.)
  • UX (the User Experience)
  • Other (please add below)

CORE TEAM TASK LIST

  • Evaluate / Prioritize Feature Request
  • Refine User Stories / Requirements
  • Define Test Cases
  • Design / Develop Solution
  • Perform QA/Testing
  • Update Documentation
commented

Done via #2653.