Add cdk-wasm crate with browser wallet support#1660
Add cdk-wasm crate with browser wallet support#1660crodas wants to merge 1 commit intocashubtc:mainfrom
Conversation
Introduce the cdk-wasm crate providing WebAssembly bindings for the CDK wallet. This enables running Cashu wallets directly in browsers and Node.js environments. Key components: - Wallet and WalletRepository wasm_bindgen bindings - LocalStorage-backed database with swappable storage backend - Token parsing, encoding, and inspection - Full WASM type system mirroring cdk-common types - HTTP client implementation for wasm32 (fetch API) - Demo pages (www/) for browser testing - CI workflow for wasm32 build checks Also adapts cdk-http-client to compile for wasm32 by gating native dependencies and adding a fetch-based transport behind the wasm32 target.
07d6328 to
62e721f
Compare
thesimplekid
left a comment
There was a problem hiding this comment.
We need to split of this PR into multiple smaller PRs so it can be reviewed. It seems to do multiple things; change deps in signatory, modify the http client as well as introduce js bindings. The changes to the http client should be its own pr as they do not depend on the bindings.
On the bindings I have a strong preference for not redefining all these wasm types that we already have defined in cdk-ffi, it creates much more code to maintain. I know other projects have had recent success reusing their uniffi bindings with wasm using this project. I think this would be better for us since we already support uniffi. Did you look into wasm support via uniffi and there is a specefic reason we cannot use it?
|
Closed in flavour of #1665 |
Introduce the cdk-wasm crate providing WebAssembly bindings for the CDK wallet. This enables running Cashu wallets directly in browsers and Node.js environments.
Key components:
Also adapts cdk-http-client to compile for wasm32 by gating native dependencies and adding a fetch-based transport behind the wasm32 target.
Description
Notes to the reviewers
Suggested CHANGELOG Updates
CHANGED
ADDED
REMOVED
FIXED
Checklist
just final-checkbefore committing