Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Update protocol to v2.2.0 #103

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ pnpm-debug.log*
*.njsproj
*.sln
*.sw?
.env
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
"acorn": "8.0.1"
},
"dependencies": {
"@verida/account-web-vault": "^2.0.1",
"@verida/client-ts": "^2.0.1",
"@verida/verifiable-credentials": "^2.0.1",
"@verida/account-web-vault": "^2.2.0",
"@verida/client-ts": "^2.2.0",
"@verida/types": "^2.2.0",
"@verida/verifiable-credentials": "^2.2.0",
"@verida/vue-account": "^0.1.38",
"comlink": "^4.3.1",
"core-js": "^3.6.5",
Expand Down
13 changes: 7 additions & 6 deletions src/helpers/VeridaClient.helpers.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import { config } from "@/config";
import { Context, Messaging } from "@verida/client-ts";
import { IContext, IMessaging } from "@verida/types"
import { Credentials } from "@verida/verifiable-credentials";
import store from "store";

class VeridaClient {
private context: Context | undefined;
private context: IContext | undefined;
public did: string | undefined;
public connected?: boolean;
public errors?: any;
public credentials?: Credentials;
public messagingInstance: Messaging | undefined;
public messagingInstance: IMessaging | undefined;

public async connectVault(context: Context): Promise<void> {
public async connectVault(context: IContext): Promise<void> {
this.context = context;
this.connected = true;
store.set(config.veridaContextName, true);
this.credentials = new Credentials();
this.did = await context.getAccount().did();
}

public async initialiseMessagingInstance(): Promise<Messaging> {
public async initialiseMessagingInstance(): Promise<IMessaging> {
if (this.messagingInstance) {
return this.messagingInstance;
}
if (!this.context) {
throw new Error("Context not available");
}
this.messagingInstance = await this.context.getMessaging();
this.messagingInstance = await this.context.getMessaging({});
return this.messagingInstance;
}

Expand All @@ -36,6 +36,7 @@ class VeridaClient {
subjectId: subjectDid,
data: data,
context: this.context,
schema: config.veridaCredentialSchema!
});
return credentialData;
}
Expand Down
Loading