Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions docs/other-topics.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# Other topics

## Using WebAssembly
# Using WebAssembly

React native doesn't support WebAssembly. Libraries that require WebAssembly need to run in a WebView. This includes some components of the wallet-sdk. Messages are exchanged with the React Native thread through a JSON RPC client / server layer. The Wallet SDK can be used to abstract all the complexity of the WebView communication with the react-native thread.

The WebView is similar to a REST API, and its entry point is in the wallet-sdk-wasm package. Each module in the package has a service-rpc client to interact with the service.js that is running in the main thread (React Native):

`@docknetwork/wallet-sdk-wasm/lib/services/[moduleName]/service-rpc`
interacts with
`@docknetwork/wallet-sdk-wasm/lib/services/[moduleName]/service.js`
`@docknetwork/wallet-sdk-wasm/lib/services/[moduleName]/service-rpc` interacts with `@docknetwork/wallet-sdk-wasm/lib/services/[moduleName]/service.js`

Notice that the `modules` folder is running in the main thread (React Native) and will be using the JSON RPC client (`@docknetwork/wallet-sdk-core/lib/client`) to interact with `@docknetwork/wallet-sdk-core/lib/service` methods.
Loading