dashpay/dash

`getaddressdeltas` and `getaddressmempool` are missing `script`

Opened this issue · 1 comments

Related to dashpay/docs-core#40

Since getaddressuxtos is not reliable for realtime information (because it is not instantsend-aware), 'getaddressdeltas' must be used in conjunction with 'getaddressmempool' in order to get the correct uxtos.

However, neither 'getaddressdeltas' nor 'getaddressmempool' include script, which means that in order to use as a utxo for creating a transaction, the pkh has to be reproduced, which requires more wallet machinery in place, which leads to code that's more cumbersome when building a wallet.

Likewise, the deltas mempool fail to specify outputIndex vs inputIndex. This is workable since a negative satoshis value indicates inputIndex, otherwise it's outputIndex, but it would be nice if it were consistent to the delta type.

Example getaddressuxtos

https://trpc.digitalcash.dev/#?method=getaddressutxos&params=[{"addresses":["yQzps4ubfPzVdPUXNYAG9B6BvED1Jttaa8"]}]&submit

[
  {
    "address": "yQzps4ubfPzVdPUXNYAG9B6BvED1Jttaa8",
    "txid": "f9bee2ba45242c2f3c73e471a19fae5e967907a3eddf55282033a4c5d3e764fb",
    "outputIndex": 1,
    "satoshis": 144390000,
    "height": 1083179,
    "script": "76a91433531a4f36615c1fd00084eb460dff8176f5c36b88ac"
  }
]

Example getaddressdeltas

[
  {
    "address": "yQzps4ubfPzVdPUXNYAG9B6BvED1Jttaa8",
    "txid": "f9bee2ba45242c2f3c73e471a19fae5e967907a3eddf55282033a4c5d3e764fb",
    "index": 1,
    "satoshis": 144390000,
    "height": 1083179,
    "blockindex": 5
  }
]

Example getaddressmempool

I can't link to it because it's ephemeral data, but I believe it's exactly the same object as getaddressdeltas.

Whoops, I meant to post this in https://github.com/dashpay/dash/issues. Perhaps someone with the power to do so can click on the Transfer button?