Skip to content

Commit

Permalink
chore: use new identity keys and expose prepareRegistrationViaRecaps
Browse files Browse the repository at this point in the history
  • Loading branch information
devceline committed Apr 18, 2024
1 parent d962314 commit 64f2233
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 16 deletions.
19 changes: 4 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/notify-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@walletconnect/cacao": "1.0.2",
"@walletconnect/core": "2.12.2",
"@walletconnect/did-jwt": "2.0.1",
"@walletconnect/identity-keys": "2.0.1",
"@walletconnect/identity-keys": "^2.1.0-3116e5d",
"@walletconnect/jsonrpc-utils": "1.0.7",
"@walletconnect/time": "1.0.2",
"@walletconnect/utils": "2.12.2",
Expand Down
11 changes: 11 additions & 0 deletions packages/notify-client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,17 @@ export class NotifyClient extends INotifyClient {
}
};

public prepareRegistrationViaRecaps: INotifyClient['prepareRegistrationViaRecaps'] = (
params
) => {
try {
return this.engine.prepareRegistrationViaRecaps(params);
} catch (error: any) {
this.logger.error(error.message);
throw error;
}
}

public prepareRegistration: INotifyClient["prepareRegistration"] = (
params
) => {
Expand Down
4 changes: 4 additions & 0 deletions packages/notify-client/src/controllers/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ export class NotifyEngine extends INotifyEngine {
return this.finishedInitialLoad;
};

public prepareRegistrationViaRecaps: INotifyEngine['prepareRegistrationViaRecaps'] = async (params) => {
return this.client.identityKeys.prepareRegistrationViaRecaps(params);
}

public prepareRegistration: INotifyEngine["prepareRegistration"] = async ({
account,
domain,
Expand Down
1 change: 1 addition & 0 deletions packages/notify-client/src/types/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ export abstract class INotifyClient {
// ---------- Public Methods ------------------------------------------------------- //

public abstract isRegistered: INotifyEngine["isRegistered"];
public abstract prepareRegistrationViaRecaps: INotifyEngine["prepareRegistrationViaRecaps"];
public abstract prepareRegistration: INotifyEngine["prepareRegistration"];
public abstract register: INotifyEngine["register"];
public abstract unregister: INotifyEngine["unregister"];
Expand Down
3 changes: 3 additions & 0 deletions packages/notify-client/src/types/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { INotifyClient, NotifyClientTypes } from "./client";
import { JsonRpcTypes } from "./jsonrpc";
import EventEmitter from "events";
import { CacaoSignature } from "@walletconnect/cacao";
import { IdentityKeys } from "@walletconnect/identity-keys";

export interface RpcOpts {
req: { ttl: number; tag: number };
Expand Down Expand Up @@ -55,6 +56,8 @@ export abstract class INotifyEngine {

public abstract hasFinishedInitialLoad(): boolean;

public abstract prepareRegistrationViaRecaps: IdentityKeys['prepareRegistrationViaRecaps']

public abstract prepareRegistration(params: {
account: string;
domain: string;
Expand Down

0 comments on commit 64f2233

Please sign in to comment.