@cmts-dev/carmentis-sdk-core 1.1.3 → 1.1.5

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.
@@ -7414,7 +7414,7 @@ export declare abstract class KeyDerivationFunction {
7414
7414
  deriveKeyNoSalt(inputKeyingMaterial: Uint8Array, info: Uint8Array, keyLength: number): Uint8Array;
7415
7415
  }
7416
7416
 
7417
- declare enum KeyDerivationFunctionSchemeId {
7417
+ export declare enum KeyDerivationFunctionSchemeId {
7418
7418
  HKDF = 0
7419
7419
  }
7420
7420
 
@@ -7851,6 +7851,25 @@ export declare enum MerkleLeafTypeEnum {
7851
7851
  Maskable = 6
7852
7852
  }
7853
7853
 
7854
+ export declare class MerkleRecord {
7855
+ private channelMap;
7856
+ private recordByChannels;
7857
+ private publicChannels;
7858
+ constructor();
7859
+ static fromRecordByChannels(recordByChannels: RecordByChannels, peppers?: Map<number, Uint8Array> | undefined): MerkleRecord;
7860
+ private setChannelsFromRecordByChannels;
7861
+ private storeChannel;
7862
+ getPublicChannels(): Set<number>;
7863
+ getLeavesByChannelMap(): Map<any, any>;
7864
+ getRecordByChannels(): RecordByChannels;
7865
+ getChannelIds(): number[];
7866
+ getChannelPepper(channelId: number): Uint8Array<ArrayBufferLike>;
7867
+ getChannelRootHash(channelId: number): Uint8Array<ArrayBufferLike>;
7868
+ private getChannel;
7869
+ private flatItemsToPositionedLeaves;
7870
+ private flatItemToLeaf;
7871
+ }
7872
+
7854
7873
  export declare class MerkleTree {
7855
7874
  leaves: Uint8Array[];
7856
7875
  nLeaves: number;
@@ -11696,6 +11715,25 @@ export declare const OnChainItemSchema: val.ObjectSchema<{
11696
11715
  }, undefined>], undefined>, undefined>;
11697
11716
  }, undefined>;
11698
11717
 
11718
+ export declare class OnChainRecord {
11719
+ private encoder;
11720
+ private channelMap;
11721
+ private publicChannels;
11722
+ constructor();
11723
+ static fromMerkleRecord(merkleRecord: MerkleRecord): OnChainRecord;
11724
+ private logger;
11725
+ private setChannelsFromMerkleRecord;
11726
+ getChannelIds(): number[];
11727
+ getOnChainData(channelId: number, pack?: boolean): {
11728
+ isPublic: boolean;
11729
+ merkleRootHash: Uint8Array<ArrayBufferLike>;
11730
+ data: Uint8Array<ArrayBufferLike>;
11731
+ };
11732
+ addOnChainData(channelId: number, isPublic: boolean, rootHash: Uint8Array, encodedData: Uint8Array): void;
11733
+ toMerkleRecord(checkHashes?: boolean): MerkleRecord;
11734
+ private getChannel;
11735
+ }
11736
+
11699
11737
  export declare interface OnMicroblockInsertionEventListener {
11700
11738
  onMicroblockInserted(virtualBlockchain: VirtualBlockchain, microblock: Microblock): void | Promise<void>;
11701
11739
  }
@@ -11869,7 +11907,7 @@ export declare abstract class PasswordBasedKeyDerivationFunction {
11869
11907
  deriveKeyNoSalt(password: string, keyLength: number): Uint8Array;
11870
11908
  }
11871
11909
 
11872
- declare enum PasswordBasedKeyDerivationFunctionSchemeId {
11910
+ export declare enum PasswordBasedKeyDerivationFunctionSchemeId {
11873
11911
  PBKDF2 = 0,
11874
11912
  SCRYPT = 1
11875
11913
  }
@@ -12320,6 +12358,30 @@ declare const ProofMicroblockSchema: val.ObjectSchema<{
12320
12358
  }, undefined>, undefined>;
12321
12359
  }, undefined>;
12322
12360
 
12361
+ export declare class ProofRecord {
12362
+ private channelMap;
12363
+ private fieldMap;
12364
+ private publicChannels;
12365
+ constructor();
12366
+ static fromMerkleRecord(merkleRecord: MerkleRecord): ProofRecord;
12367
+ static fromProofChannels(proofChannels: ProofChannel[]): ProofRecord;
12368
+ private setChannelsFromMerkleRecord;
12369
+ private setChannelsFromProofChannels;
12370
+ toJson(withDisclosureTypes?: boolean): JsonData;
12371
+ private buildTrees;
12372
+ private buildWitnesses;
12373
+ private buildFieldMap;
12374
+ private getLeafByPath;
12375
+ private getFieldByPath;
12376
+ private getChannel;
12377
+ removeField(path: Path): void;
12378
+ setFieldToHashed(path: Path): void;
12379
+ setFieldToMasked(path: Path): void;
12380
+ getRootHashAsBinary(channelId: number): Uint8Array<ArrayBufferLike>;
12381
+ getRootHashAsHexString(channelId: number): string;
12382
+ toProofChannels(): ProofChannel[];
12383
+ }
12384
+
12323
12385
  export declare type ProofSignatureCommitment = val.InferOutput<typeof ProofSignatureCommitmentSchema>;
12324
12386
 
12325
12387
  declare const ProofSignatureCommitmentSchema: val.ObjectSchema<{
@@ -13202,6 +13264,13 @@ export declare interface PublicEncryptionKey {
13202
13264
  export declare interface PublicEncryptionKeyEncoderInterface extends EncoderInterface<AbstractPublicEncryptionKey, string> {
13203
13265
  }
13204
13266
 
13267
+ /**
13268
+ * @deprecated Will be removed soon!
13269
+ */
13270
+ export declare enum PublicKeyEncryptionAlgorithmId {
13271
+ ML_KEM_768_AES_256_GCM = 0
13272
+ }
13273
+
13205
13274
  export declare interface PublicKeyEncryptionScheme {
13206
13275
  /**
13207
13276
  * Returns the identifier of the scheme.
@@ -13209,7 +13278,7 @@ export declare interface PublicKeyEncryptionScheme {
13209
13278
  getSchemeId(): PublicKeyEncryptionSchemeId;
13210
13279
  }
13211
13280
 
13212
- declare enum PublicKeyEncryptionSchemeId {
13281
+ export declare enum PublicKeyEncryptionSchemeId {
13213
13282
  ML_KEM_768_AES_256_GCM = 0
13214
13283
  }
13215
13284
 
@@ -13352,6 +13421,7 @@ declare class Record_2 {
13352
13421
  private buildArrayItem;
13353
13422
  private buildObjectItem;
13354
13423
  }
13424
+ export { Record_2 as Record }
13355
13425
 
13356
13426
  export declare const RECORD_DESCRIPTION: Schema;
13357
13427
 
@@ -14534,6 +14604,21 @@ export declare const SIGNATURE_SCHEMA: {
14534
14604
  }[];
14535
14605
  };
14536
14606
 
14607
+ /**
14608
+ * @deprecated Will be removed soon!
14609
+ */
14610
+ export declare enum SignatureAlgorithmId {
14611
+ SECP256K1 = 0,
14612
+ ML_DSA_65 = 1
14613
+ }
14614
+
14615
+ export declare class SignatureCacheDisabled implements SignatureCacheInterface {
14616
+ constructor();
14617
+ has(entry: SignatureCacheEntry): Promise<boolean>;
14618
+ get(entry: SignatureCacheEntry): Promise<boolean>;
14619
+ set(entry: SignatureCacheEntry, result: boolean): Promise<void>;
14620
+ }
14621
+
14537
14622
  export declare class SignatureCacheEntry {
14538
14623
  private key;
14539
14624
  constructor(signatureAlgorithm: number, publicKeyString: string, messageHashString: string);
@@ -14546,6 +14631,14 @@ export declare interface SignatureCacheInterface {
14546
14631
  set(entry: SignatureCacheEntry, result: boolean): void;
14547
14632
  }
14548
14633
 
14634
+ export declare class SignatureCacheMonothread implements SignatureCacheInterface {
14635
+ private map;
14636
+ constructor();
14637
+ has(entry: SignatureCacheEntry): Promise<boolean>;
14638
+ get(entry: SignatureCacheEntry): Promise<boolean | undefined>;
14639
+ set(entry: SignatureCacheEntry, result: boolean): Promise<void>;
14640
+ }
14641
+
14549
14642
  /**
14550
14643
  * An interface for encoding and decoding cryptographic signature keys and signatures.
14551
14644
  *
@@ -14632,7 +14725,7 @@ export declare interface SignatureScheme {
14632
14725
  * - ML_DSA_65: Represents the ML-DSA-65 signature algorithm.
14633
14726
  * - PKMS_SECP256K1: Represents the P(roxy)KMS-based SECP256K1 signature algorithm.
14634
14727
  */
14635
- declare enum SignatureSchemeId {
14728
+ export declare enum SignatureSchemeId {
14636
14729
  SECP256K1 = 0,
14637
14730
  ML_DSA_65 = 1,
14638
14731
  PKMS_SECP256K1 = 2,