Author Topic: How to get the count of objects?  (Read 712 times)

0 Members and 1 Guest are viewing this topic.

Offline kinglaw0577

  • Full Member
  • ***
  • Posts: 95
    • View Profile
    • BitShares Richlist
How to get the count of objects?
« on: December 30, 2015, 07:47:35 am »
I know  "operation_history" object is 1.11.x,I can use get_objects to get it,
but how to get the count of this?
☆bitshares Richlist富豪榜 http://richlist.btsabc.org
☆BTSABC wallet online比特帝国在线钱包 https://bit.btsabc.org

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12897
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Re: How to get the count of objects?
« Reply #1 on: December 30, 2015, 09:21:12 am »
What "count"?
if you need an identifier for that particular operation, it is the number that comes after "1.11."
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline svk

Re: How to get the count of objects?
« Reply #2 on: December 30, 2015, 09:35:08 am »
He probably means the number of objects of that type.

As far as I know it's not possible, so you'll need to query objects in a loop until you find the first one that's undefined (or null or whatever the witness_node returns for objects that don't exist)
Worker: dev.bitsharesblocks

Offline kinglaw0577

  • Full Member
  • ***
  • Posts: 95
    • View Profile
    • BitShares Richlist
Re: How to get the count of objects?
« Reply #3 on: December 31, 2015, 05:00:54 am »
He probably means the number of objects of that type.

As far as I know it's not possible, so you'll need to query objects in a loop until you find the first one that's undefined (or null or whatever the witness_node returns for objects that don't exist)

Yes,I want to get the recent n transactions,so I hope get  the last identifier of objects of that type.
☆bitshares Richlist富豪榜 http://richlist.btsabc.org
☆BTSABC wallet online比特帝国在线钱包 https://bit.btsabc.org

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12897
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Re: How to get the count of objects?
« Reply #4 on: December 31, 2015, 12:13:44 pm »
Each account has a balance object that states the latest operation id that caused a change in your account .. i think it is 2.6.x with x being the id of your account 1.2.x
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH