Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting the transaction list by the block height (Owner API) #595

Open
davidtavarez opened this issue Mar 13, 2021 · 3 comments
Open

Getting the transaction list by the block height (Owner API) #595

davidtavarez opened this issue Mar 13, 2021 · 3 comments

Comments

@davidtavarez
Copy link
Contributor

I would like to filter the transaction list by block height. Right now, for retrieve_txs we have this:

{
  "jsonrpc": "2.0",
  "method": "retrieve_txs",
  "params": {
   "token": "token",
   "refresh_from_node": true,
   "tx_id": null,
   "tx_slate_id": null,
  },
  "id": 1
 }

I would like to also send confirm_height as a parameter, like this for example:

{
  "jsonrpc": "2.0",
  "method": "retrieve_txs",
  "params": {
   "token": "token",
   "refresh_from_node": true,
   "tx_id": null,
   "tx_slate_id": null,
   "confirm_height":  1127853,
  },
  "id": 1
 }
@davidtavarez
Copy link
Contributor Author

@pkariz
Copy link

pkariz commented Mar 22, 2021

I think i know why exchanges might need this for the deposit flow (if they use SRS flow - afaik they all do that currently). The problem is that after the exchange does R part of SRS, there exists the final kernel excess (X), but from the slates (which you get from wallet-api calls) you can only get Xs and Xr (in hex compressed). Now you have 2 options:

  1. you get Xs and Xr, calculate X = Xs + Xr and hex compress it (that seems painful to me and prone to errors in implementations)
  2. you call retrieve_txs(tx_slate_id=<...>)[0]['kernel_excess'] to get the excess (easy way)
    The problem is that exchanges have many transactions and it would be good to limit the returned transactions by block height (it's easy to know for exchanges by which height to filter) - ignore if it's already done in O(1) when tx_slate_id is passed

The current TxLogEntry doesn't seem to have the "confirmed" block stored

@trevyn
Copy link
Contributor

trevyn commented Apr 5, 2021

@davidtavarez If you're interested in digging a bit deeper on this one, I can personally offer a bounty of US$1,000 paid in BTC if you can figure out a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants