@secrecy/lib 1.39.0 → 1.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,6 +10,7 @@ import { SecrecyWalletClient } from './SecrecyWalletClient.js';
10
10
  import { SecrecyPayClient } from './SecrecyPayClient.js';
11
11
  import { SecrecyUserClient } from './SecrecyUserClient.js';
12
12
  import { SecrecyPseudonymClient } from './SecrecyPseudonymClient.js';
13
+ import { decryptAnonymous } from '../crypto/index.js';
13
14
  export const encryptName = async (name, nameKey) => {
14
15
  const { data } = await encryptSecretStream(sodium.from_hex(nameKey), sodium.from_string(name));
15
16
  const nameEncrypted = sodium.to_hex(data);
@@ -48,6 +49,9 @@ export class SecrecyClient extends BaseClient {
48
49
  get publicKey() {
49
50
  return this.#keys.publicKey;
50
51
  }
52
+ decryptAnonymous(data) {
53
+ return decryptAnonymous(data, this.#keys);
54
+ }
51
55
  async logout(sessionId) {
52
56
  nodesCache.clear();
53
57
  dataCache.clear();
@@ -25,5 +25,6 @@ export declare class SecrecyClient extends BaseClient {
25
25
  pseudonym: SecrecyPseudonymClient;
26
26
  constructor(uaSession: string, uaKeys: KeyPair, uaJwt: string);
27
27
  get publicKey(): string;
28
+ decryptAnonymous(data: Uint8Array): Uint8Array;
28
29
  logout(sessionId?: string | null | undefined): Promise<void>;
29
30
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@secrecy/lib",
3
3
  "author": "Anonymize <anonymize@gmail.com>",
4
4
  "description": "Anonymize Secrecy Library",
5
- "version": "1.39.0",
5
+ "version": "1.40.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/anonymize-org/lib.git"