bigchaindb icon indicating copy to clipboard operation
bigchaindb copied to clipboard

Get all assets created by public key(s) (NOT necessarily currently owned)

Open TimDaub opened this issue 8 years ago • 0 comments

WARNING: Don't confuse with #790

@r-marques brought this up.

We have a ticket for 'get me all assets and their amounts I currently own with a public key'.

There could however be another use case which is:

As a BigchainDB HTTP consumer I want to get all assets created/transferred by a specific public key

Option 1:

As far as I understand, we could add this functionality by allowing one or many public_key values as query params here: https://docs.bigchaindb.com/projects/server/en/latest/http-client-server-api.html#get--api-v1-transactions?asset_id=asset_id&operation=CREATE|TRANSFER

Option 1.1:

A public_keyand a unspents=true | false flag could be added to https://docs.bigchaindb.com/projects/server/en/latest/http-client-server-api.html#get--api-v1-transactions?asset_id=asset_id&operation=CREATE|TRANSFER

You'd be able to retrieve:

  • all assets a public key has created. Don't specify unspents, but operation=CREATE
  • all assets a public key can spend. Don't specify operation, unspents=true
  • all assets a public key has spend. Don't specify operation, unspents=false
  • all assets a public key has transferred operation=TRANSFER&unspents=false
  • all assets that have been created and can be spend operation=CREATE&unspents=true
  • all assets that have been created and have been spent operation=CREATE&unspents=false

Edit: As @diminator pointed out. This might be better suited for the /outputs endpoint

TimDaub avatar May 11 '17 12:05 TimDaub