diff --git a/package.json b/package.json index 412aa1c..1ffed98 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@auxo-dev/dkg-libs", - "version": "0.1.4", + "version": "0.1.5", "description": "", "author": "", "license": "Apache-2.0", diff --git a/src/utils/DynamicArray.ts b/src/utils/DynamicArray.ts index 49efda4..7318e66 100644 --- a/src/utils/DynamicArray.ts +++ b/src/utils/DynamicArray.ts @@ -1,15 +1,43 @@ import { Bool, - Circuit, Field, - FlexibleProvable, + Group, Poseidon, Provable, ProvablePure, + PublicKey, Struct, } from 'o1js'; +import { CustomScalar } from './CustomScalar'; + +export { + DynamicArray, + BoolDynamicArray, + FieldDynamicArray, + GroupDynamicArray, + ScalarDynamicArray, + PublicKeyDynamicArray, +}; + +function BoolDynamicArray(maxLength: number) { + return DynamicArray(Bool, maxLength); +} + +function FieldDynamicArray(maxLength: number) { + return DynamicArray(Field, maxLength); +} -export { DynamicArray }; +function GroupDynamicArray(maxLength: number) { + return DynamicArray(Group, maxLength); +} + +function ScalarDynamicArray(maxLength: number) { + return DynamicArray(CustomScalar, maxLength); +} + +function PublicKeyDynamicArray(maxLength: number) { + return DynamicArray(PublicKey, maxLength); +} type HashableProvable = Provable & { hash(x: T): Field;