From 998be7fd0494e020f3ae8229ddfdd64738e74358 Mon Sep 17 00:00:00 2001 From: Ry Racherbaumer Date: Tue, 19 Nov 2024 17:46:58 -0600 Subject: [PATCH] Add signature methods --- sdks/node-sdk/src/Client.ts | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/sdks/node-sdk/src/Client.ts b/sdks/node-sdk/src/Client.ts index 0e5453769..de94e32c1 100644 --- a/sdks/node-sdk/src/Client.ts +++ b/sdks/node-sdk/src/Client.ts @@ -15,7 +15,7 @@ import { generateInboxId, getInboxIdForAddress, GroupMessageKind, - Level, + LogLevel, SignatureRequestType, type Consent, type ConsentEntityType, @@ -78,7 +78,7 @@ export type OtherOptions = { /** * Logging level */ - loggingLevel?: Level; + loggingLevel?: LogLevel; /** * Disable automatic registration when creating a client */ @@ -126,7 +126,7 @@ export class Client { const logOptions: LogOptions = { structured: options?.structuredLogging ?? false, - level: options?.loggingLevel ?? Level.off, + level: options?.loggingLevel ?? LogLevel.off, }; const client = new Client( @@ -409,4 +409,30 @@ export class Client { async getConsentState(entityType: ConsentEntityType, entity: string) { return this.#innerClient.getConsentState(entityType, entity); } + + signWithInstallationKey(signatureText: string) { + return this.#innerClient.signWithInstallationKey(signatureText); + } + + verifySignedWithInstallationKey( + signatureText: string, + signatureBytes: Uint8Array, + ) { + this.#innerClient.verifySignedWithInstallationKey( + signatureText, + signatureBytes, + ); + } + + verifySignedWithPublicKey( + signatureText: string, + signatureBytes: Uint8Array, + publicKey: Uint8Array, + ) { + this.#innerClient.verifySignedWithPublicKey( + signatureText, + signatureBytes, + publicKey, + ); + } }