diff --git a/packages/anoncreds-rs/src/services/AnonCredsRsHolderService.ts b/packages/anoncreds-rs/src/services/AnonCredsRsHolderService.ts index 5f6530c58a..4a34024851 100644 --- a/packages/anoncreds-rs/src/services/AnonCredsRsHolderService.ts +++ b/packages/anoncreds-rs/src/services/AnonCredsRsHolderService.ts @@ -24,7 +24,7 @@ import { AnonCredsLinkSecretRepository, AnonCredsCredentialRepository, } from '@aries-framework/anoncreds' -import { injectable } from '@aries-framework/core' +import { utils, injectable } from '@aries-framework/core' import { CredentialRequestMetadata, Credential, @@ -40,7 +40,6 @@ import { Schema, } from '@hyperledger/anoncreds-shared' -import { uuid } from '../../../core/src/utils/uuid' import { AnonCredsRsError } from '../errors/AnonCredsRsError' @injectable() @@ -51,7 +50,7 @@ export class AnonCredsRsHolderService implements AnonCredsHolderService { ): Promise { try { return { - linkSecretId: options?.linkSecretId ?? uuid(), + linkSecretId: options?.linkSecretId ?? utils.uuid(), linkSecretValue: JSON.parse(MasterSecret.create().toJson()).value.ms, } } catch (error) { @@ -230,7 +229,7 @@ export class AnonCredsRsHolderService implements AnonCredsHolderService { ? RevocationRegistryDefinition.load(JSON.stringify(revocationRegistry.definition)) : undefined - const credentialId = options.credentialId ?? uuid() + const credentialId = options.credentialId ?? utils.uuid() const processedCredential = Credential.load(JSON.stringify(credential)).process({ credentialDefinition: CredentialDefinition.load(JSON.stringify(credentialDefinition)), credentialRequestMetadata: CredentialRequestMetadata.load(JSON.stringify(credentialRequestMetadata)), diff --git a/packages/askar/src/AskarModuleConfig.ts b/packages/askar/src/AskarModuleConfig.ts deleted file mode 100644 index c2104eff8e..0000000000 --- a/packages/askar/src/AskarModuleConfig.ts +++ /dev/null @@ -1,44 +0,0 @@ -import type { AriesAskar } from './types' - -/** - * AskarModuleConfigOptions defines the interface for the options of the AskarModuleConfig class. - */ -export interface AskarModuleConfigOptions { - /** - * Implementation of the Askar interface according to aries-askar JavaScript wrapper. - * - * - * ## Node.JS - * - * ```ts - * import { NodeJSAriesAskar } from 'aries-askar-nodejs' - * - * const askarModule = new AskarModule({ - * askar: new NodeJSAriesAskar() - * }) - * ``` - * - * ## React Native - * - * ```ts - * import { ReactNativeAriesAskar } from 'aries-askar-react-native' - * - * const askarModule = new AskarModule({ - * askar: new ReactNativeAriesAskar() - * }) - * ``` - */ - askar: AriesAskar -} - -export class AskarModuleConfig { - private options: AskarModuleConfigOptions - - public constructor(options: AskarModuleConfigOptions) { - this.options = options - } - - public get askar() { - return this.options.askar - } -} diff --git a/packages/askar/src/index.ts b/packages/askar/src/index.ts index d7afa60eab..ed7baf9247 100644 --- a/packages/askar/src/index.ts +++ b/packages/askar/src/index.ts @@ -6,4 +6,3 @@ export { AskarStorageService } from './storage' // Module export { AskarModule } from './AskarModule' -export { AskarModuleConfig } from './AskarModuleConfig' diff --git a/packages/askar/src/wallet/AskarWallet.ts b/packages/askar/src/wallet/AskarWallet.ts index c84370cadf..baa17838a4 100644 --- a/packages/askar/src/wallet/AskarWallet.ts +++ b/packages/askar/src/wallet/AskarWallet.ts @@ -49,7 +49,6 @@ const isError = (error: unknown): error is Error => error instanceof Error import { inject, injectable } from 'tsyringe' -import { encodeToBase58, decodeFromBase58 } from '../../../core/src/utils/base58' import { askarErrors, isAskarError, @@ -364,7 +363,7 @@ export class AskarWallet implements Wallet { const key = seed ? AskarKey.fromSeed({ seed: Buffer.from(seed), algorithm }) : AskarKey.generate(algorithm) // Store key - await this.session.insertKey({ key, name: encodeToBase58(key.publicBytes) }) + await this.session.insertKey({ key, name: TypedArrayEncoder.toBase58(key.publicBytes) }) return Key.fromPublicKey(key.publicBytes, keyType) } else { // Check if there is a signing key provider for the specified key type. @@ -633,7 +632,7 @@ export class AskarWallet implements Wallet { ) const sender_x = AskarKey.fromPublicBytes({ algorithm: KeyAlgs.Ed25519, - publicKey: decodeFromBase58(senderKey), + publicKey: TypedArrayEncoder.fromBase58(senderKey), }).convertkey({ algorithm: KeyAlgs.X25519 }) payloadKey = CryptoBox.open({ diff --git a/packages/askar/src/wallet/AskarWalletPostgresStorageConfig.ts b/packages/askar/src/wallet/AskarWalletPostgresStorageConfig.ts index a9a9aab91f..2ca48f0c56 100644 --- a/packages/askar/src/wallet/AskarWalletPostgresStorageConfig.ts +++ b/packages/askar/src/wallet/AskarWalletPostgresStorageConfig.ts @@ -1,4 +1,4 @@ -import type { WalletStorageConfig } from '../../../core/src/types' +import type { WalletStorageConfig } from '@aries-framework/core' export interface AskarWalletPostgresConfig { host: string diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 42cf5984b1..38f4bc2fa8 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -26,6 +26,7 @@ export type { JsonValue, WalletConfigRekey, WalletExportImportConfig, + WalletStorageConfig, } from './types' export { DidCommMimeType, KeyDerivationMethod } from './types' export type { FileSystem, DownloadToFileOptions } from './storage/FileSystem'