Page MenuHomePhabricator

[Cashtab] Parse agora ad prep txs in tx history
ClosedPublic

Authored by bytesofman on Oct 22 2024, 22:50.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABC275733139d7e: [Cashtab] Parse agora ad prep txs in tx history
Summary

Parse agora ad prep txs in Cashtab tx history

These are currently rendered as SLP SEND txs. They are SLP SEND txs, but a special case where we are sending to a p2sh script that is then immediately used to generate the offer.

We do not see the actual listing tx in Cashtab for SLP 1 agora listings, because we are not getting the tx history of the generated p2sh script. NBD, since in Cashtab we know this tx is always creating a listing.

Will see if can add offer details (price etc) in a reasonable way in a later diff. For now, at least parse correctly.

Note this also works for Agora Partials.

Test Plan

npm test, check screenshots

listing an nft:

image.png (159×453 px, 18 KB)

listing slp token:

image.png (179×466 px, 22 KB)

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

remove unrelated line break

emack requested changes to this revision.Oct 23 2024, 00:06
emack added a subscriber: emack.
emack added inline comments.
cashtab/src/components/Home/Tx/index.js
671 ↗(On Diff #50297)

ad setup txs will never have a change output recipient?

This revision now requires changes to proceed.Oct 23 2024, 00:06
bytesofman marked an inline comment as done.
bytesofman added inline comments.
cashtab/src/components/Home/Tx/index.js
671 ↗(On Diff #50297)

They can have change, yes -- but the way cashtab parses txs, recipients only includes recipients ... i.e. only addresses that are not the sender.

The way cashtab makes them, ad setup txs will only ever have one of these.

This means we can't necessarily parse agora ad setup txs made by some other developer. But it's very hard to guess at what those might look like without an example. We would have to wait for those and then see how to make our parsing more generic.

At the moment, though, can't really do this.

This revision is now accepted and ready to land.Oct 23 2024, 00:18
This revision was automatically updated to reflect the committed changes.
bytesofman marked an inline comment as done.