HomePhabricator

[ecash-agora] Add `historicOffers` function to `Agora`

Description

[ecash-agora] Add historicOffers function to Agora

Summary:
Allows querying offers made in the past, which were either cancelled or accepted. Unspent offers are ignored.

This reflects what users would expect an "exchange" UX pretty closely: "activeOffers*" is the orderbook, "historicOffers" are the candlesticks (and also the cancelled offers, but those would have to be ignored).

They can also be queried by pubkey, giving users a history of their offers.

This is done by going through the tx history of the token ID/group token ID/pubkey group of the agora plugin, and looking at *inputs* that spend an agora output. We then reconstruct the Utxo, and then we just re-use the _parseOfferUtxo function, which we also gave a status.

Test Plan: npm run integration-tests

Reviewers: bytesofman, #bitcoin_abc

Reviewed By: bytesofman, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D16819

Details

Provenance
tobias_ruckAuthored on Sep 27 2024, 19:52
tobias_ruckPushed on Oct 2 2024, 09:50
Reviewer
Restricted Project
Differential Revision
D16819: [ecash-agora] Add `historicOffers` function to `Agora`
Parents
rABC5b92b0a94a62: Fix the type of the header receive time
Branches
Unknown
Tags
Unknown