diff --git a/README.md b/README.md index ca3022e0..13344f3e 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,25 @@ # Truvera Wallet SDK -The [Wallet SDK](https://github.com/docknetwork/wallet-sdk) enables you to build a Verifiable Credentials wallet inside your app and allows your users to receive, store, and manage their DOCK tokens too. This was built for mobile applications with added support for Polkadot-JS. +The [Wallet SDK](https://github.com/docknetwork/wallet-sdk) enables you to build an identity wallet inside your app and allows your users to receive, store, and manage verifiable credentials. To use the wallet-sdk, all you need to do is wrap your app in a `WalletSDKProvider` and start building your wallet. -Using [polkadot-js](https://polkadot.js.org/) libraries in React Native is a challenge, due to the lack of WebAssembly support. -The Truvera Wallet SDK handles all the Polkadot Web Assembly in a WebView, sending messages to the React Native thread through a JSON RPC layer. - -Truvera Mobile SDK supports: +The Truvera Mobile SDK supports: - Devices that have Android 8.1 or higher and iOS 11 or higher. - Minimum supported version of Node.js is 20.2.0 ## Installation ```js -yarn add @docknetwork/wallet-sdk-core -yarn add @docknetwork/wallet-sdk-react-native +npm install @docknetwork/wallet-sdk-core +npm install @docknetwork/wallet-sdk-react-native ``` **There are some scripts and additional dependencies required.** -Please check our [examples](/examples) folder for detailed steps. +Please check our [examples](https://github.com/docknetwork/wallet-sdk/tree/master/examples) folder for detailed steps. ## React Native Example -The following example will create a wallet and allow the user to add credentials to it. Displaying the count of documents added to the wallet. -Notice that the all documents are accessible through the `documents` object. +The following example will create a wallet and allow the user to add credentials to it, displaying the count of documents added to the wallet. +Notice that all documents are accessible through the `documents` object. ```js import {Box, Button, NativeBaseProvider, Text} from 'native-base'; @@ -67,20 +64,20 @@ export default App; ``` -## Running on other platforms - -Check the following repository for detailed examples for running the Truvera Wallet SDK on NodeJS, Web, and Flutter. - -[See the examples](https://github.com/docknetwork/wallet-sdk/tree/master/examples) +## Documentation -## Docs +The [Truvera Documentation Portal](https://docs.truvera.io) aggregates documentation for all components of the Truvera Platform. Documentation specific to the Wallet SDK is mirrored from [the GitHub repository](https://github.com/docknetwork/wallet-sdk). Node package reference documentation is also published on [GitHub.io](https://docknetwork.github.io/wallet-sdk/). -For more details you can check the [getting started guide](https://github.com/docknetwork/wallet-sdk/blob/master/docs/getting-started.md) +For more details you should read [the getting started guide](https://github.com/docknetwork/wallet-sdk/blob/master/docs/getting-started.md). -[See the Github repository](https://docknetwork.github.io/wallet-sdk/) -## Features +### Key Features - [Biometric Plugin](https://github.com/docknetwork/wallet-sdk/blob/master/docs/biometric-plugin.md) - [Ecosystem Tools](https://github.com/docknetwork/wallet-sdk/blob/master/docs/ecosystem-tools.md) - [Cloud Wallet](https://github.com/docknetwork/wallet-sdk/blob/master/docs/cloud-wallet.md) + + +### Running on other platforms + +[The examples directory](https://github.com/docknetwork/wallet-sdk/tree/master/examples) contains detailed examples for running the Truvera Wallet SDK on NodeJS, Web, and Flutter. diff --git a/docs/getting-started.md b/docs/getting-started.md index 6ec6dcc0..fa595fd6 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -7,7 +7,7 @@ This guide walks you through the process of setting up the Truvera Wallet SDK, c To start, you need to install the necessary packages for the wallet SDK and the data store. Open your terminal and run the following command: ```bash -yarn add @docknetwork/wallet-sdk-core @docknetwork/wallet-sdk-data-store-typeorm +npm install @docknetwork/wallet-sdk-core @docknetwork/wallet-sdk-data-store-typeorm ``` The `@docknetwork/wallet-sdk-core` provides the core wallet functionality, while `@docknetwork/wallet-sdk-data-store-typeorm` handles data persistence using a local SQLite database. @@ -16,7 +16,7 @@ The `@docknetwork/wallet-sdk-core` provides the core wallet functionality, while ### 1. Initialize the Data Store -Before creating a wallet, you need to set up a data store to manage the persistence of wallet data such as DIDs and credentials. Here’s how to create a data store: +Before creating a wallet, you need to set up a data store to manage the persistence of wallet data such as DIDs and credentials. Here’s how to create a local data store: ```ts import {createDataStore} from '@docknetwork/wallet-sdk-data-store-typeorm/lib'; @@ -28,9 +28,9 @@ const dataStore = await createDataStore({ }); ``` -This code initializes a SQLite database to store wallet data. You can adjust the `databasePath` and `defaultNetwork` based on your needs. +This code initializes an SQLite database to store wallet data locally on the device. You can adjust the `databasePath` and `defaultNetwork` based on your needs. -If you want to use the cloud wallet solution, please refer to the [Cloud Wallet Documentation](cloud-wallet.md) for detailed instructions and configuration options. +If you want to store data in the Truvera Cloud Wallet, please refer to the [Cloud Wallet Documentation](cloud-wallet.md) for detailed instructions and configuration options. ### 2. Create a New Wallet diff --git a/docs/other-topics.md b/docs/other-topics.md new file mode 100644 index 00000000..54bcd3b9 --- /dev/null +++ b/docs/other-topics.md @@ -0,0 +1,15 @@ +# Other Topics + +## 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` + +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 + + diff --git a/examples/readme.md b/examples/README.md similarity index 84% rename from examples/readme.md rename to examples/README.md index 09b11e82..5a528194 100644 --- a/examples/readme.md +++ b/examples/README.md @@ -1,5 +1,5 @@ -# Wallet sdk examples +# Wallet SDK Examples This repository contains examples for working with the Truvera Wallet SDK. -https://github.com/docknetwork/wallet-sdk +https://github.com/docknetwork/wallet-sdk diff --git a/readme/development.md b/readme/development.md deleted file mode 100644 index 38a8bcc9..00000000 --- a/readme/development.md +++ /dev/null @@ -1,20 +0,0 @@ - - -## - -React native doesn't support webassembly, which is heavly used by polkadit-js. All the polkadot-js implemenation needs to run in a webview, and it include some components of the wallet-sdk as well. - -The wallet sdk abstracts all the complexity of the webivew commnuication with the react-native thread. - -In case you want to have a better understanding on the webview implemenation, it's using a json-rpc client/server to exchange messages between react-native and the webview. - - -The webview is similar to a rest api, ans its entry point is -@docknetwork/wallet-sdk-core/lib/index.js - -The main thread will interact with the services by using the client -@docknetwork/wallet-sdk-core/lib/client - -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 - -