From 6830a7ce374b87f82c9a40738285e18f86530516 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Tue, 3 Dec 2024 08:37:28 +0530 Subject: [PATCH] chore: remove unnecessary code from credentials API Signed-off-by: Krishna Waske --- .../src/modules/credentials/CredentialsApi.ts | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/packages/core/src/modules/credentials/CredentialsApi.ts b/packages/core/src/modules/credentials/CredentialsApi.ts index 64fde621ce..9df548985d 100644 --- a/packages/core/src/modules/credentials/CredentialsApi.ts +++ b/packages/core/src/modules/credentials/CredentialsApi.ts @@ -24,8 +24,6 @@ import type { CredentialExchangeRecord } from './repository/CredentialExchangeRe import type { AgentMessage } from '../../agent/AgentMessage' import type { Query, QueryOptions } from '../../storage/StorageService' -import * as pako from 'pako' - import { AgentContext } from '../../agent' import { MessageSender } from '../../agent/MessageSender' import { getOutboundMessageContext } from '../../agent/getOutboundMessageContext' @@ -34,7 +32,6 @@ import { CredoError } from '../../error' import { Logger } from '../../logger' import { inject, injectable } from '../../plugins' import { DidCommMessageRepository } from '../../storage/didcomm/DidCommMessageRepository' -import { Buffer } from '../../utils' import { ConnectionService } from '../connections/services' import { RoutingService } from '../routing/services/RoutingService' @@ -707,21 +704,4 @@ export class CredentialsApi implements Credent return this.getProtocol(credentialExchangeRecord.protocolVersion) } - - private async encodeBitString(bitString: string): Promise { - // Convert the bitString to a Uint8Array - const buffer = new TextEncoder().encode(bitString) - const compressedBuffer = pako.gzip(buffer) - // Convert the compressed buffer to a base64 string - return Buffer.from(compressedBuffer).toString('base64') - } - - private async decodeBitSting(bitString: string): Promise { - // Decode base64 string to Uint8Array - const compressedBuffer = Uint8Array.from(atob(bitString), (c) => c.charCodeAt(0)) - - // Decompress using pako - const decompressedBuffer = pako.ungzip(compressedBuffer, { to: 'string' }) - return decompressedBuffer - } }