[Cashtab] Suppport a custom bip21 implementation in Cashtab to enable FIRMA-USDT redemptions
Summary:
Introduce new Cashtab-specific temporary spec allowing an additional empp push to be specified in bip21 token sends (ALP only). Implement and test in Cashtab.
The use case we are solving for here is including arbitrary message data in a token transaction. This is important in cryptocurrency for onchain annotation of payments, or allowing a token payment to interact with an app.
The Cashtab use case is quite niche, supporting only one data push. In the future, we will create a more generic spec. However in order to do this properly, we should first iron out the communication interface being worked on in D17822
This implementation covers an MVP use case: including a Solana address in a FIRMA payment to allow onchain redemption of Firma for USDT on the SOL network.
In this diff,
- We modify the Send screen in Cashtab to support empp_raw in bip21 codes, either by entering a bip21 string into the "Address" field or by including a bip21 query string in the URL
- We modify Cashtab-specific ALP output construction to optionally support a single additional user-specified output
- We modify tx parsing to parse for this in ALP txs
- We define a spec for encoding a SOL address in an EMPP push, and implement parsing this app action in Cashtab
Test Plan:
npm test
Can check it out at the test site: https://cashtab-local-dev.netlify.app/
e.g. go to https://cashtab-local-dev.netlify.app/#/send?bip21=ecash:qr8hdk8rxjc5nj6f450eth3nnslxa8k4gysrtyfxc5?token_id=0387947fd575db4fb19a3e322f635dec37fd192b5941625b66bc4b2c3008cbf0&token_decimalized_qty=1&empp_raw=534f4c304ebabba2b443691c1a9180426004d5fd3419e9f9c64e5839b853cecdaacbf745 and see this
Parsed tx in history:
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien, alitayin
Differential Revision: https://reviews.bitcoinabc.org/D18086

