Skip to content
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

Update cloud-wallet.md #306

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
13 changes: 7 additions & 6 deletions docs/cloud-wallet.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ The Cloud Wallet integrates with an [Encrypted Data Vault (EDV)](https://digital

The example below demonstrates how to initialize and use the Cloud Wallet for managing documents.


### Step 1: Initialize the Data Store

First, you need to create local data storage to connect to the credential wallet.

#### For Mobile and Node.js

```ts
Expand All @@ -40,7 +41,7 @@ const dataStore = await createDataStore({

### Step 2: Generate Wallet Keys

Use the same Cloud Wallet keys across multiple devices to access the same documents. These keys are used to encrypt, decrypt, and locate documents in the EDV.
Next, we generate keys for interacting with the cloud wallet. Use the same Cloud Wallet keys across multiple devices to access the same documents. These keys are used to encrypt, decrypt, and locate documents in the EDV.

```ts
const {verificationKey, agreementKey, hmacKey} = await edvService.generateKeys();
Expand All @@ -52,7 +53,7 @@ The key generation returns an object with `agreementKey`, `verificationKey`, and

### Step 3: Initialize the Cloud Wallet

After setting up the data store and generating keys, initialize the Cloud Wallet. This ensures continuous synchronization between the EDV and the wallet.
After setting up the data store and generating keys, initialize the Cloud Wallet and connect it to the local data storage. This ensures continuous synchronization between the EDV and the wallet.

```ts
import {initializeCloudWallet} from '@docknetwork/wallet-sdk-core/lib/cloud-wallet';
Expand All @@ -70,11 +71,11 @@ const {pullDocuments} = await initializeCloudWallet({
await pullDocuments();
```

The `pullDocuments` function synchronizes the EDV and the wallet by comparing documents and updating the data store accordingly.
The `pullDocuments` function synchronizes the EDV and the wallet by comparing documents and updating the data store accordingly.Documents can be credentials or messages.

### Step 4: Create a New Wallet

Now, create a wallet to manage your documents. This will allow you to add, update, and remove documents.
Now, create a credential wallet inside of the data storage. This will allow you to add, update, and remove documents.

```ts
import {createWallet} from '@docknetwork/wallet-sdk-core/lib/wallet';
Expand Down Expand Up @@ -142,4 +143,4 @@ async function example() {

example();

```
```
Loading