import { ISerializable , PolynomialID , StringifiedType } from "../baseTypes/commonTypes" ; import Share from "./Share" ; class ShareStore implements ISerializable { share : Share ; polynomialID : PolynomialID ; constructor ( share , polynomialID ) { this . share = share ; this . polynomialID = polynomialID ; } static fromJSON ( value ) { const { share , polynomialID } = value ; return new ShareStore ( Share . fromJSON ( share ) , polynomialID ) ; } toJSON ( ) { return { share : this . share , polynomialID : this . polynomialID . toString ( ) , } ; } } export type EncryptedShareStore = { [ shareCommitment ] : ShareStore ; } ; export type ShareStoreMap = { [ shareIndex ] : ShareStore ; } ; export type ShareStorePolyIDShareIndexMap = { [ polynomialID ] : ShareStoreMap ; } ; export default ShareStore ;