-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WASM #676
Comments
Not too much to do then! 😅 I would suggest splitting it up into two projects; sdk-common and nodeless core. The breez server has a grpc web proxy which should help. The great thing about having rt-sync now is we don't have to rely on file storage for rusqlite. We could start with in memory only and work from there. The rust-nostr repo is another good example of integrating wasm. In there they have configurable persistence modules depending on the integration. |
@hydra-yse before adding javascript wrappers code I think we should break down the compilation issue into several tasks. I am thinking of the following:
electrum client is tricky and not sure if possible as is. I think lwk_wasm uses esplora API instead but this is not a good solution as it doesn't have batching API. |
Here's the division in issues that I've thought of:
Note that these tasks do require to start working on the wrapper at the same time (not a JS wrapper, but a Rust wrapper). It's going to be a submodule of the repository, probably under
Not sure we'll need a JS wrapper later on, perhaps just a shim for type definitions. See |
Tracking issue for WASM integration on the Nodeless SDK.
Progress branch: wasm
Compilation Issues
Currently, these are the crates that prevent building for
wasm32-unknown-unknown
target:Creating an SDK WASM wrapper
Taking inspiration from lwk's lwk_wasm crate, we can create a wrapper for the primary SDK methods while also communicating with the browser API via the
web-sys
crate. This will allow us to instatiate WebSockets/gRPC connections and then forward the responses to the handlers (which will require to expose the interface methods to handle the message stream).This is especially useful in the case of the following dependencies:
electrum-client
,tokio-tungstenite
andtonic
, which affect the following parts of the SDK:References
wasm_bindgen
guideThe text was updated successfully, but these errors were encountered: