Skip to content
Merged
Show file tree
Hide file tree
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
35 changes: 16 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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.
8 changes: 4 additions & 4 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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';
Expand All @@ -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

Expand Down
15 changes: 15 additions & 0 deletions docs/other-topics.md
Original file line number Diff line number Diff line change
@@ -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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the files @docknetwork/wallet-sdk-core/lib/client and @docknetwork/wallet-sdk-core/lib/service doesn't exist.

The proper path should be:

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the guidance. Please check to see if I understood correctly.



4 changes: 2 additions & 2 deletions examples/readme.md → examples/README.md
Original file line number Diff line number Diff line change
@@ -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
20 changes: 0 additions & 20 deletions readme/development.md

This file was deleted.