HomePhabricator

[Cashtab, cashtab-connect] Init an npm module to facilitate browser extension…

Description

[Cashtab, cashtab-connect] Init an npm module to facilitate browser extension interaction in react apps

Summary:
Cashtab and the extension support powerful web interaction methods through bip21 and address sharing. Unfortunately, due to long dev intervals between changes and lack of earlier attention, this feature is not documented anywhere and is difficult to use.

We should maintain a standardized library that organizes and facilitates available methods. Initialize cashtab-commit with a demo react app that shows how the methods work and provides an implementation template for devs.

cashtab-connect is tested and initialized in CI.

The react app is tested, but imo its tests do not belong in CI. The real test of the react app is that it works in practice with the extension, and its extensive use of mocks means that its tests confirm expected behavior of the demo (what buttons we see, how we interact with them) but not really that the extension interactions work. We would need to use browser-based testing for that, which we may add later if justified by extension complexity.

Test Plan:
npm test, npm start and try the demo with the extension, should see it as available and be able to open for address sharing and txs

docker build -f cashtab-connect.Dockerfile -t cashtab-connect_local . for docker instance that will automate publishing

I have also tested this by publishing an rc version and getting it to work by installing it through npm in a react app.

https://www.npmjs.com/package/cashtab-connect

Reviewers: #bitcoin_abc, emack, Fabien

Reviewed By: #bitcoin_abc, emack, Fabien

Subscribers: Fabien, emack

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

Details

Provenance
bytesofmanAuthored on Jul 4 2025, 18:38
bytesofmanPushed on Jul 9 2025, 03:57
Reviewer
Restricted Project
Differential Revision
D18328: [Cashtab, cashtab-connect] Init an npm module to facilitate browser extension interaction in react apps
Parents
rABCe5a073d4c827: [e.cash] Add card section
Branches
Unknown
Tags
Unknown