HomePhabricator

[Cashtab] Add ecash-agora lib and helper methods

Description

[Cashtab] Add ecash-agora lib and helper methods

Summary:
Add (unimplemented) ecash-agora methods to support NFT trading in Cashtab. See D16328 for implementation.

It makes sense to split these helper methods off in their own diff.

  • Easier to review function and tests in isolation (can reference D16328 for intended implementation)
  • We can test that ecash-agora does not break Cashtab deployment before we launch the feature

Why we need the getTokenOfferMaps method

Whenever a user goes to the NFT listings page, we need to query chronik for the most recent listings. However, Cashtab does not necessarily support every agora listing. This process may be simplified in the future by a chronik plugin. However we can handle this process client-side.

Cashtab needs to take all indexed agora offers and

  • Throw out any that are already spent (i.e. sold or canceled), as we do not render these for now (going forward, mb we want to show things like "most valuable sale this week")
  • Throw out any that are not explicitly supported by Cashtab, i.e. SLP1 NFT sales with valid SLP 1 NFT outputs
  • Organize valid offers into two categories, myListings (which the user can cancel) and offeredListings (which the user can buy).

Test Plan:
npm test, CI tests pass (updated dep)

For CI deployment, docker build -f cashtab.Dockerfile -t cashtab_local . builds

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

Subscribers: emack

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

Details

Provenance
bytesofmanAuthored on Jul 17 2024, 22:26
bytesofmanPushed on Jul 20 2024, 23:14
Reviewer
Restricted Project
Differential Revision
D16496: [Cashtab] Add ecash-agora lib and helper methods
Parents
rABC361ae4913865: [Cashtab] Show option to claim token reward from Home page if wallet is new
Branches
Unknown
Tags
Unknown