Browse Source

Update types

Leszek Wiesner 4 years ago
parent
commit
03e0a64b79
34 changed files with 1333 additions and 1292 deletions
  1. 145 65
      types/augment-codec/augment-types.ts
  2. 225 139
      types/augment/all/defs.json
  3. 286 138
      types/augment/all/types.ts
  4. 6 0
      types/augment/augment-api-consts.ts
  5. 83 5
      types/augment/augment-api-query.ts
  6. 239 9
      types/augment/augment-api-tx.ts
  7. 0 0
      types/augment/augment-types.ts
  8. 29 2
      types/src/common.ts
  9. 297 0
      types/src/content-directory/index.ts
  10. 4 5
      types/src/content-working-group/index.ts
  11. 4 3
      types/src/council/index.ts
  12. 3 4
      types/src/hiring/index.ts
  13. 3 6
      types/src/index.ts
  14. 2 4
      types/src/media.ts
  15. 2 4
      types/src/scripts/generateCodecDefs.ts
  16. 2 0
      types/src/scripts/generateRegistryJson.ts
  17. 0 3
      types/src/versioned-store/ClassId.ts
  18. 0 292
      types/src/versioned-store/EntityCodec.ts
  19. 0 3
      types/src/versioned-store/EntityId.ts
  20. 0 55
      types/src/versioned-store/PropertyType.ts
  21. 0 75
      types/src/versioned-store/PropertyValue.ts
  22. 0 170
      types/src/versioned-store/index.ts
  23. 0 27
      types/src/versioned-store/permissions/ClassPermissions.ts
  24. 0 15
      types/src/versioned-store/permissions/EntityPermissions.ts
  25. 0 15
      types/src/versioned-store/permissions/PropertyOfClass.ts
  26. 0 15
      types/src/versioned-store/permissions/batching/ParametrizedClassPropertyValue.ts
  27. 0 17
      types/src/versioned-store/permissions/batching/index.ts
  28. 0 55
      types/src/versioned-store/permissions/batching/operation-types.ts
  29. 0 49
      types/src/versioned-store/permissions/batching/operations.ts
  30. 0 23
      types/src/versioned-store/permissions/batching/parametrized-entity.ts
  31. 0 33
      types/src/versioned-store/permissions/batching/parametrized-property-value.ts
  32. 0 43
      types/src/versioned-store/permissions/index.ts
  33. 0 15
      types/src/versioned-store/permissions/reference-constraint.ts
  34. 3 3
      types/src/working-group/index.ts

+ 145 - 65
types/augment-codec/augment-types.ts

@@ -11,13 +11,12 @@ import { Stake as Stake, StakingStatus as StakingStatus, Staked as Staked, Stake
 import { Mint as Mint, NextAdjustment as NextAdjustment, AdjustOnInterval as AdjustOnInterval, AdjustCapacityBy as AdjustCapacityBy } from '../mint'
 import { Recipient as Recipient, RewardRelationship as RewardRelationship } from '../recurring-rewards'
 import { Application as Application, ApplicationStage as ApplicationStage, ActivateOpeningAt as ActivateOpeningAt, ApplicationRationingPolicy as ApplicationRationingPolicy, OpeningStage as OpeningStage, StakingPolicy as StakingPolicy, Opening as Opening, WaitingToBeingOpeningStageVariant as WaitingToBeingOpeningStageVariant, ActiveOpeningStageVariant as ActiveOpeningStageVariant, ActiveOpeningStage as ActiveOpeningStage, AcceptingApplications as AcceptingApplications, ReviewPeriod as ReviewPeriod, Deactivated as Deactivated, OpeningDeactivationCause as OpeningDeactivationCause, InactiveApplicationStage as InactiveApplicationStage, UnstakingApplicationStage as UnstakingApplicationStage, ApplicationDeactivationCause as ApplicationDeactivationCause, StakingAmountLimitMode as StakingAmountLimitMode } from '../hiring'
-import { ClassId as ClassId, EntityId as EntityId, Class as Class, Entity as Entity, ClassSchema as ClassSchema, Property as Property, PropertyType as PropertyType, PropertyValue as PropertyValue, ClassPropertyValue as ClassPropertyValue } from '../versioned-store'
-import { EntityPermissions as EntityPermissions, ReferenceConstraint as ReferenceConstraint, ClassPermissionsType as ClassPermissionsType, Operation as Operation, OperationType as OperationType, CreateEntity as CreateEntity, UpdatePropertyValues as UpdatePropertyValues, AddSchemaSupportToEntity as AddSchemaSupportToEntity, ParametrizedEntity as ParametrizedEntity, ParametrizedClassPropertyValue as ParametrizedClassPropertyValue, ParametrizedPropertyValue as ParametrizedPropertyValue, PropertyOfClass as PropertyOfClass } from '../versioned-store/permissions'
 import { ChannelId as ChannelId, CuratorId as CuratorId, CuratorOpeningId as CuratorOpeningId, CuratorApplicationId as CuratorApplicationId, LeadId as LeadId, PrincipalId as PrincipalId, OptionalText as OptionalText, Channel as Channel, ChannelContentType as ChannelContentType, ChannelCurationStatus as ChannelCurationStatus, ChannelPublicationStatus as ChannelPublicationStatus, CurationActor as CurationActor, Curator as Curator, CuratorApplication as CuratorApplication, CuratorOpening as CuratorOpening, Lead as Lead, OpeningPolicyCommitment as OpeningPolicyCommitment, Principal as Principal, WorkingGroupUnstaker as WorkingGroupUnstaker, CuratorApplicationIdToCuratorIdMap as CuratorApplicationIdToCuratorIdMap, CuratorApplicationIdSet as CuratorApplicationIdSet, CuratorRoleStakeProfile as CuratorRoleStakeProfile, CuratorRoleStage as CuratorRoleStage, CuratorExitSummary as CuratorExitSummary, CuratorExitInitiationOrigin as CuratorExitInitiationOrigin, LeadRoleState as LeadRoleState, ExitedLeadRole as ExitedLeadRole, CuratorInduction as CuratorInduction } from '../content-working-group'
 import { RationaleText as RationaleText, Application as ApplicationOf, ApplicationIdSet as ApplicationIdSet, ApplicationIdToWorkerIdMap as ApplicationIdToWorkerIdMap, WorkerId as WorkerId, Worker as WorkerOf, Opening as OpeningOf, StorageProviderId as StorageProviderId, OpeningType as OpeningType, ApplicationId as HiringApplicationId, RewardPolicy as RewardPolicy, WorkingGroupOpeningPolicyCommitment as WorkingGroupOpeningPolicyCommitment, RoleStakeProfile as RoleStakeProfile } from '../working-group'
 import { Url as Url, IPNSIdentity as IPNSIdentity, ServiceProviderRecord as ServiceProviderRecord } from '../discovery'
 import { ContentId as ContentId, LiaisonJudgement as LiaisonJudgement, DataObject as DataObject, DataObjectStorageRelationshipId as DataObjectStorageRelationshipId, DataObjectStorageRelationship as DataObjectStorageRelationship, DataObjectTypeId as DataObjectTypeId, DataObjectType as DataObjectType, DataObjectsMap as DataObjectsMap } from '../media'
 import { ProposalId as ProposalId, ProposalStatus as ProposalStatus, Proposal as ProposalOf, ProposalDetails as ProposalDetails, ProposalDetails as ProposalDetailsOf, VotingResults as VotingResults, ProposalParameters as ProposalParameters, VoteKind as VoteKind, ThreadCounter as ThreadCounter, DiscussionThread as DiscussionThread, DiscussionPost as DiscussionPost, AddOpeningParameters as AddOpeningParameters, FillOpeningParameters as FillOpeningParameters, TerminateRoleParameters as TerminateRoleParameters, ActiveStake as ActiveStake, Finalized as Finalized, ProposalDecisionStatus as ProposalDecisionStatus, ExecutionFailed as ExecutionFailed, Approved as Approved, SetLeadParams as SetLeadParams } from '../proposals'
+import { Nonce as Nonce, EntityId as EntityId, ClassId as ClassId, CuratorGroupId as CuratorGroupId, VecMaxLength as VecMaxLength, TextMaxLength as TextMaxLength, HashedTextMaxLength as HashedTextMaxLength, PropertyId as PropertyId, SchemaId as SchemaId, SameController as SameController, ClassPermissions as ClassPermissions, SinglePropertyType as SinglePropertyType, VecPropertyType as VecPropertyType, PropertyType as PropertyType, PropertyLockingPolicy as PropertyLockingPolicy, Property as Property, Schema as Schema, Class as Class, EntityController as EntityController, EntityPermissions as EntityPermissions, StoredValue as StoredValue, VecStoredValue as VecStoredValue, VecStoredPropertyValue as VecStoredPropertyValue, StoredPropertyValue as StoredPropertyValue, InboundReferenceCounter as InboundReferenceCounter, Entity as Entity, CuratorGroup as CuratorGroup, EntityCreationVoucher as EntityCreationVoucher, Actor as Actor, EntityReferenceCounterSideEffect as EntityReferenceCounterSideEffect, ReferenceCounterSideEffects as ReferenceCounterSideEffects, SideEffects as SideEffects, SideEffect as SideEffect, Status as Status, InputValue as InputValue, VecInputValue as VecInputValue, InputPropertyValue as InputPropertyValue, ParameterizedEntity as ParameterizedEntity, ParametrizedPropertyValue as ParametrizedPropertyValue, ParametrizedClassPropertyValue as ParametrizedClassPropertyValue, CreateEntityOperation as CreateEntityOperation, UpdatePropertyValuesOperation as UpdatePropertyValuesOperation, AddSchemaSupportToEntityOperation as AddSchemaSupportToEntityOperation, OperationType as OperationType, ClassPermissionsType as ClassPermissionsType, ClassPropertyValue as ClassPropertyValue, Operation as Operation, ReferenceConstraint as ReferenceConstraint } from '../content-directory'
 /** /CUSTOMIMPORTS **/
 import { Compact, Option, Raw, Vec } from '@polkadot/types/codec';
 import { BitVec, Bytes, Data, DoNotConstruct, Null, StorageKey, Text, Type, U256, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types/primitive';
@@ -286,69 +285,6 @@ declare module '@polkadot/types/types/registry' {
     "StakingAmountLimitMode": StakingAmountLimitMode;
     "Option<StakingAmountLimitMode>": Option<StakingAmountLimitMode>;
     "Vec<StakingAmountLimitMode>": Vec<StakingAmountLimitMode>;
-    "ClassId": ClassId;
-    "Option<ClassId>": Option<ClassId>;
-    "Vec<ClassId>": Vec<ClassId>;
-    "EntityId": EntityId;
-    "Option<EntityId>": Option<EntityId>;
-    "Vec<EntityId>": Vec<EntityId>;
-    "Class": Class;
-    "Option<Class>": Option<Class>;
-    "Vec<Class>": Vec<Class>;
-    "Entity": Entity;
-    "Option<Entity>": Option<Entity>;
-    "Vec<Entity>": Vec<Entity>;
-    "ClassSchema": ClassSchema;
-    "Option<ClassSchema>": Option<ClassSchema>;
-    "Vec<ClassSchema>": Vec<ClassSchema>;
-    "Property": Property;
-    "Option<Property>": Option<Property>;
-    "Vec<Property>": Vec<Property>;
-    "PropertyType": PropertyType;
-    "Option<PropertyType>": Option<PropertyType>;
-    "Vec<PropertyType>": Vec<PropertyType>;
-    "PropertyValue": PropertyValue;
-    "Option<PropertyValue>": Option<PropertyValue>;
-    "Vec<PropertyValue>": Vec<PropertyValue>;
-    "ClassPropertyValue": ClassPropertyValue;
-    "Option<ClassPropertyValue>": Option<ClassPropertyValue>;
-    "Vec<ClassPropertyValue>": Vec<ClassPropertyValue>;
-    "EntityPermissions": EntityPermissions;
-    "Option<EntityPermissions>": Option<EntityPermissions>;
-    "Vec<EntityPermissions>": Vec<EntityPermissions>;
-    "ReferenceConstraint": ReferenceConstraint;
-    "Option<ReferenceConstraint>": Option<ReferenceConstraint>;
-    "Vec<ReferenceConstraint>": Vec<ReferenceConstraint>;
-    "ClassPermissionsType": ClassPermissionsType;
-    "Option<ClassPermissionsType>": Option<ClassPermissionsType>;
-    "Vec<ClassPermissionsType>": Vec<ClassPermissionsType>;
-    "Operation": Operation;
-    "Option<Operation>": Option<Operation>;
-    "Vec<Operation>": Vec<Operation>;
-    "OperationType": OperationType;
-    "Option<OperationType>": Option<OperationType>;
-    "Vec<OperationType>": Vec<OperationType>;
-    "CreateEntity": CreateEntity;
-    "Option<CreateEntity>": Option<CreateEntity>;
-    "Vec<CreateEntity>": Vec<CreateEntity>;
-    "UpdatePropertyValues": UpdatePropertyValues;
-    "Option<UpdatePropertyValues>": Option<UpdatePropertyValues>;
-    "Vec<UpdatePropertyValues>": Vec<UpdatePropertyValues>;
-    "AddSchemaSupportToEntity": AddSchemaSupportToEntity;
-    "Option<AddSchemaSupportToEntity>": Option<AddSchemaSupportToEntity>;
-    "Vec<AddSchemaSupportToEntity>": Vec<AddSchemaSupportToEntity>;
-    "ParametrizedEntity": ParametrizedEntity;
-    "Option<ParametrizedEntity>": Option<ParametrizedEntity>;
-    "Vec<ParametrizedEntity>": Vec<ParametrizedEntity>;
-    "ParametrizedClassPropertyValue": ParametrizedClassPropertyValue;
-    "Option<ParametrizedClassPropertyValue>": Option<ParametrizedClassPropertyValue>;
-    "Vec<ParametrizedClassPropertyValue>": Vec<ParametrizedClassPropertyValue>;
-    "ParametrizedPropertyValue": ParametrizedPropertyValue;
-    "Option<ParametrizedPropertyValue>": Option<ParametrizedPropertyValue>;
-    "Vec<ParametrizedPropertyValue>": Vec<ParametrizedPropertyValue>;
-    "PropertyOfClass": PropertyOfClass;
-    "Option<PropertyOfClass>": Option<PropertyOfClass>;
-    "Vec<PropertyOfClass>": Vec<PropertyOfClass>;
     "ChannelId": ChannelId;
     "Option<ChannelId>": Option<ChannelId>;
     "Vec<ChannelId>": Vec<ChannelId>;
@@ -565,6 +501,150 @@ declare module '@polkadot/types/types/registry' {
     "SetLeadParams": SetLeadParams;
     "Option<SetLeadParams>": Option<SetLeadParams>;
     "Vec<SetLeadParams>": Vec<SetLeadParams>;
+    "Nonce": Nonce;
+    "Option<Nonce>": Option<Nonce>;
+    "Vec<Nonce>": Vec<Nonce>;
+    "EntityId": EntityId;
+    "Option<EntityId>": Option<EntityId>;
+    "Vec<EntityId>": Vec<EntityId>;
+    "ClassId": ClassId;
+    "Option<ClassId>": Option<ClassId>;
+    "Vec<ClassId>": Vec<ClassId>;
+    "CuratorGroupId": CuratorGroupId;
+    "Option<CuratorGroupId>": Option<CuratorGroupId>;
+    "Vec<CuratorGroupId>": Vec<CuratorGroupId>;
+    "VecMaxLength": VecMaxLength;
+    "Option<VecMaxLength>": Option<VecMaxLength>;
+    "Vec<VecMaxLength>": Vec<VecMaxLength>;
+    "TextMaxLength": TextMaxLength;
+    "Option<TextMaxLength>": Option<TextMaxLength>;
+    "Vec<TextMaxLength>": Vec<TextMaxLength>;
+    "HashedTextMaxLength": HashedTextMaxLength;
+    "Option<HashedTextMaxLength>": Option<HashedTextMaxLength>;
+    "Vec<HashedTextMaxLength>": Vec<HashedTextMaxLength>;
+    "PropertyId": PropertyId;
+    "Option<PropertyId>": Option<PropertyId>;
+    "Vec<PropertyId>": Vec<PropertyId>;
+    "SchemaId": SchemaId;
+    "Option<SchemaId>": Option<SchemaId>;
+    "Vec<SchemaId>": Vec<SchemaId>;
+    "SameController": SameController;
+    "Option<SameController>": Option<SameController>;
+    "Vec<SameController>": Vec<SameController>;
+    "ClassPermissions": ClassPermissions;
+    "Option<ClassPermissions>": Option<ClassPermissions>;
+    "Vec<ClassPermissions>": Vec<ClassPermissions>;
+    "SinglePropertyType": SinglePropertyType;
+    "Option<SinglePropertyType>": Option<SinglePropertyType>;
+    "Vec<SinglePropertyType>": Vec<SinglePropertyType>;
+    "VecPropertyType": VecPropertyType;
+    "Option<VecPropertyType>": Option<VecPropertyType>;
+    "Vec<VecPropertyType>": Vec<VecPropertyType>;
+    "PropertyType": PropertyType;
+    "Option<PropertyType>": Option<PropertyType>;
+    "Vec<PropertyType>": Vec<PropertyType>;
+    "PropertyLockingPolicy": PropertyLockingPolicy;
+    "Option<PropertyLockingPolicy>": Option<PropertyLockingPolicy>;
+    "Vec<PropertyLockingPolicy>": Vec<PropertyLockingPolicy>;
+    "Property": Property;
+    "Option<Property>": Option<Property>;
+    "Vec<Property>": Vec<Property>;
+    "Schema": Schema;
+    "Option<Schema>": Option<Schema>;
+    "Vec<Schema>": Vec<Schema>;
+    "Class": Class;
+    "Option<Class>": Option<Class>;
+    "Vec<Class>": Vec<Class>;
+    "EntityController": EntityController;
+    "Option<EntityController>": Option<EntityController>;
+    "Vec<EntityController>": Vec<EntityController>;
+    "EntityPermissions": EntityPermissions;
+    "Option<EntityPermissions>": Option<EntityPermissions>;
+    "Vec<EntityPermissions>": Vec<EntityPermissions>;
+    "StoredValue": StoredValue;
+    "Option<StoredValue>": Option<StoredValue>;
+    "Vec<StoredValue>": Vec<StoredValue>;
+    "VecStoredValue": VecStoredValue;
+    "Option<VecStoredValue>": Option<VecStoredValue>;
+    "Vec<VecStoredValue>": Vec<VecStoredValue>;
+    "VecStoredPropertyValue": VecStoredPropertyValue;
+    "Option<VecStoredPropertyValue>": Option<VecStoredPropertyValue>;
+    "Vec<VecStoredPropertyValue>": Vec<VecStoredPropertyValue>;
+    "StoredPropertyValue": StoredPropertyValue;
+    "Option<StoredPropertyValue>": Option<StoredPropertyValue>;
+    "Vec<StoredPropertyValue>": Vec<StoredPropertyValue>;
+    "InboundReferenceCounter": InboundReferenceCounter;
+    "Option<InboundReferenceCounter>": Option<InboundReferenceCounter>;
+    "Vec<InboundReferenceCounter>": Vec<InboundReferenceCounter>;
+    "Entity": Entity;
+    "Option<Entity>": Option<Entity>;
+    "Vec<Entity>": Vec<Entity>;
+    "CuratorGroup": CuratorGroup;
+    "Option<CuratorGroup>": Option<CuratorGroup>;
+    "Vec<CuratorGroup>": Vec<CuratorGroup>;
+    "EntityCreationVoucher": EntityCreationVoucher;
+    "Option<EntityCreationVoucher>": Option<EntityCreationVoucher>;
+    "Vec<EntityCreationVoucher>": Vec<EntityCreationVoucher>;
+    "Actor": Actor;
+    "Option<Actor>": Option<Actor>;
+    "Vec<Actor>": Vec<Actor>;
+    "EntityReferenceCounterSideEffect": EntityReferenceCounterSideEffect;
+    "Option<EntityReferenceCounterSideEffect>": Option<EntityReferenceCounterSideEffect>;
+    "Vec<EntityReferenceCounterSideEffect>": Vec<EntityReferenceCounterSideEffect>;
+    "ReferenceCounterSideEffects": ReferenceCounterSideEffects;
+    "Option<ReferenceCounterSideEffects>": Option<ReferenceCounterSideEffects>;
+    "Vec<ReferenceCounterSideEffects>": Vec<ReferenceCounterSideEffects>;
+    "SideEffects": SideEffects;
+    "Option<SideEffects>": Option<SideEffects>;
+    "Vec<SideEffects>": Vec<SideEffects>;
+    "SideEffect": SideEffect;
+    "Option<SideEffect>": Option<SideEffect>;
+    "Vec<SideEffect>": Vec<SideEffect>;
+    "Status": Status;
+    "Option<Status>": Option<Status>;
+    "Vec<Status>": Vec<Status>;
+    "InputValue": InputValue;
+    "Option<InputValue>": Option<InputValue>;
+    "Vec<InputValue>": Vec<InputValue>;
+    "VecInputValue": VecInputValue;
+    "Option<VecInputValue>": Option<VecInputValue>;
+    "Vec<VecInputValue>": Vec<VecInputValue>;
+    "InputPropertyValue": InputPropertyValue;
+    "Option<InputPropertyValue>": Option<InputPropertyValue>;
+    "Vec<InputPropertyValue>": Vec<InputPropertyValue>;
+    "ParameterizedEntity": ParameterizedEntity;
+    "Option<ParameterizedEntity>": Option<ParameterizedEntity>;
+    "Vec<ParameterizedEntity>": Vec<ParameterizedEntity>;
+    "ParametrizedPropertyValue": ParametrizedPropertyValue;
+    "Option<ParametrizedPropertyValue>": Option<ParametrizedPropertyValue>;
+    "Vec<ParametrizedPropertyValue>": Vec<ParametrizedPropertyValue>;
+    "ParametrizedClassPropertyValue": ParametrizedClassPropertyValue;
+    "Option<ParametrizedClassPropertyValue>": Option<ParametrizedClassPropertyValue>;
+    "Vec<ParametrizedClassPropertyValue>": Vec<ParametrizedClassPropertyValue>;
+    "CreateEntityOperation": CreateEntityOperation;
+    "Option<CreateEntityOperation>": Option<CreateEntityOperation>;
+    "Vec<CreateEntityOperation>": Vec<CreateEntityOperation>;
+    "UpdatePropertyValuesOperation": UpdatePropertyValuesOperation;
+    "Option<UpdatePropertyValuesOperation>": Option<UpdatePropertyValuesOperation>;
+    "Vec<UpdatePropertyValuesOperation>": Vec<UpdatePropertyValuesOperation>;
+    "AddSchemaSupportToEntityOperation": AddSchemaSupportToEntityOperation;
+    "Option<AddSchemaSupportToEntityOperation>": Option<AddSchemaSupportToEntityOperation>;
+    "Vec<AddSchemaSupportToEntityOperation>": Vec<AddSchemaSupportToEntityOperation>;
+    "OperationType": OperationType;
+    "Option<OperationType>": Option<OperationType>;
+    "Vec<OperationType>": Vec<OperationType>;
+    "ClassPermissionsType": ClassPermissionsType;
+    "Option<ClassPermissionsType>": Option<ClassPermissionsType>;
+    "Vec<ClassPermissionsType>": Vec<ClassPermissionsType>;
+    "ClassPropertyValue": ClassPropertyValue;
+    "Option<ClassPropertyValue>": Option<ClassPropertyValue>;
+    "Vec<ClassPropertyValue>": Vec<ClassPropertyValue>;
+    "Operation": Operation;
+    "Option<Operation>": Option<Operation>;
+    "Vec<Operation>": Vec<Operation>;
+    "ReferenceConstraint": ReferenceConstraint;
+    "Option<ReferenceConstraint>": Option<ReferenceConstraint>;
+    "Vec<ReferenceConstraint>": Vec<ReferenceConstraint>;
     /** /CUSTOMTYPES **/
     BitVec: BitVec;
     'Option<BitVec>': Option<BitVec>;

+ 225 - 139
types/augment/all/defs.json

@@ -67,7 +67,7 @@
     },
     "SealedVote": {
         "voter": "GenericAccountId",
-        "commitment": "[u8;32]",
+        "commitment": "Hash",
         "stake": "ElectionStake",
         "vote": "Option<GenericAccountId>"
     },
@@ -350,144 +350,6 @@
             "Exact"
         ]
     },
-    "ClassId": "u64",
-    "EntityId": "u64",
-    "Class": {
-        "id": "ClassId",
-        "properties": "Vec<Property>",
-        "schemas": "Vec<ClassSchema>",
-        "name": "Text",
-        "description": "Text"
-    },
-    "Entity": {
-        "id": "EntityId",
-        "class_id": "ClassId",
-        "in_class_schema_indexes": "Vec<u16>"
-    },
-    "ClassSchema": {
-        "properties": "Vec<u16>"
-    },
-    "Property": {
-        "prop_type": "PropertyType",
-        "required": "bool",
-        "name": "Text",
-        "description": "Text"
-    },
-    "PropertyType": {
-        "_enum": {
-            "None": "Null",
-            "Bool": "Null",
-            "Uint16": "Null",
-            "Uint32": "Null",
-            "Uint64": "Null",
-            "Int16": "Null",
-            "Int32": "Null",
-            "Int64": "Null",
-            "Text": "u16",
-            "Internal": "u64",
-            "BoolVec": "u16",
-            "Uint16Vec": "u16",
-            "Uint32Vec": "u16",
-            "Uint64Vec": "u16",
-            "Int16Vec": "u16",
-            "Int32Vec": "u16",
-            "Int64Vec": "u16",
-            "TextVec": "(u16,u16)",
-            "InternalVec": "(u16,ClassId)"
-        }
-    },
-    "PropertyValue": {
-        "_enum": {
-            "None": "Null",
-            "Bool": "bool",
-            "Uint16": "u16",
-            "Uint32": "u32",
-            "Uint64": "u64",
-            "Int16": "i16",
-            "Int32": "i32",
-            "Int64": "i64",
-            "Text": "Text",
-            "Internal": "u64",
-            "BoolVec": "Vec<bool>",
-            "Uint16Vec": "Vec<u16>",
-            "Uint32Vec": "Vec<u32>",
-            "Uint64Vec": "Vec<u64>",
-            "Int16Vec": "Vec<i16>",
-            "Int32Vec": "Vec<i32>",
-            "Int64Vec": "Vec<i64>",
-            "TextVec": "Vec<Text>",
-            "InternalVec": "Vec<EntityId>"
-        }
-    },
-    "ClassPropertyValue": {
-        "in_class_index": "u16",
-        "value": "PropertyValue"
-    },
-    "EntityPermissions": {
-        "update": "CredentialSet",
-        "maintainer_has_all_permissions": "bool"
-    },
-    "ReferenceConstraint": {
-        "_enum": {
-            "NoReferencingAllowed": "Null",
-            "NoConstraint": "Null",
-            "Restricted": "Vec<PropertyOfClass>"
-        }
-    },
-    "ClassPermissionsType": {
-        "entity_permissions": "EntityPermissions",
-        "entities_can_be_created": "bool",
-        "add_schemas": "CredentialSet",
-        "create_entities": "CredentialSet",
-        "reference_constraint": "ReferenceConstraint",
-        "admins": "CredentialSet",
-        "last_permissions_update": "u32"
-    },
-    "Operation": {
-        "with_credential": "Option<Credential>",
-        "as_entity_maintainer": "bool",
-        "operation_type": "OperationType"
-    },
-    "OperationType": {
-        "_enum": {
-            "CreateEntity": "CreateEntity",
-            "UpdatePropertyValues": "UpdatePropertyValues",
-            "AddSchemaSupportToEntity": "AddSchemaSupportToEntity"
-        }
-    },
-    "CreateEntity": {
-        "class_id": "ClassId"
-    },
-    "UpdatePropertyValues": {
-        "entity_id": "ParametrizedEntity",
-        "parametrized_property_values": "Vec<ParametrizedClassPropertyValue>"
-    },
-    "AddSchemaSupportToEntity": {
-        "entity_id": "ParametrizedEntity",
-        "schema_id": "u16",
-        "parametrized_property_values": "Vec<ParametrizedClassPropertyValue>"
-    },
-    "ParametrizedEntity": {
-        "_enum": {
-            "InternalEntityJustAdded": "u32",
-            "ExistingEntity": "u64"
-        }
-    },
-    "ParametrizedClassPropertyValue": {
-        "in_class_index": "u16",
-        "value": "ParametrizedPropertyValue"
-    },
-    "ParametrizedPropertyValue": {
-        "_enum": {
-            "PropertyValue": "PropertyValue",
-            "InternalEntityJustAdded": "u32",
-            "InternalEntityVec": "Vec<ParametrizedEntity>"
-        }
-    },
-    "PropertyOfClass": {
-        "class_id": "ClassId",
-        "property_index": "u16"
-    },
     "ChannelId": "u64",
     "CuratorId": "u64",
     "CuratorOpeningId": "u64",
@@ -862,6 +724,230 @@
         }
     },
     "SetLeadParams": "(MemberId,GenericAccountId)",
+    "Nonce": "u64",
+    "EntityId": "u64",
+    "ClassId": "u64",
+    "CuratorGroupId": "u64",
+    "VecMaxLength": "u16",
+    "TextMaxLength": "u16",
+    "HashedTextMaxLength": "Option<u16>",
+    "PropertyId": "u16",
+    "SchemaId": "u16",
+    "SameController": "bool",
+    "ClassPermissions": {
+        "any_member": "bool",
+        "entity_creation_blocked": "bool",
+        "all_entity_property_values_locked": "bool",
+        "maintainers": "Vec<CuratorGroupId>"
+    },
+    "SinglePropertyType": {
+        "_enum": {
+            "Bool": "Null",
+            "Uint16": "Null",
+            "Uint32": "Null",
+            "Uint64": "Null",
+            "Int16": "Null",
+            "Int32": "Null",
+            "Int64": "Null",
+            "Text": "TextMaxLength",
+            "Hash": "HashedTextMaxLength",
+            "Reference": "(ClassId,SameController)"
+        }
+    },
+    "VecPropertyType": {
+        "vec_type": "SinglePropertyType",
+        "max_length": "VecMaxLength"
+    },
+    "PropertyType": {
+        "_enum": {
+            "Single": "SinglePropertyType",
+            "Vector": "VecPropertyType"
+        }
+    },
+    "PropertyLockingPolicy": {
+        "is_locked_from_maintainer": "bool",
+        "is_locked_from_controller": "bool"
+    },
+    "Property": {
+        "property_type": "PropertyType",
+        "required": "bool",
+        "unique": "bool",
+        "name": "Text",
+        "description": "Text",
+        "locking_policy": "PropertyLockingPolicy"
+    },
+    "Schema": {
+        "properties": "Vec<PropertyId>",
+        "is_active": "bool"
+    },
+    "Class": {
+        "class_permissions": "ClassPermissions",
+        "properties": "Vec<Property>",
+        "schemas": "Vec<Schema>",
+        "name": "Text",
+        "description": "Text",
+        "maximum_entities_count": "EntityId",
+        "current_number_of_entities": "EntityId",
+        "default_entity_creation_voucher_upper_bound": "EntityId"
+    },
+    "EntityController": {
+        "_enum": {
+            "Maintainers": "Null",
+            "Member": "MemberId",
+            "Lead": "Null"
+        }
+    },
+    "EntityPermissions": {
+        "controller": "EntityController",
+        "frozen": "bool",
+        "referenceable": "bool"
+    },
+    "StoredValue": {
+        "_enum": {
+            "Bool": "bool",
+            "Uint16": "u16",
+            "Uint32": "u32",
+            "Uint64": "u64",
+            "Int16": "i16",
+            "Int32": "i32",
+            "Int64": "i64",
+            "Text": "Text",
+            "Hash": "Hash",
+            "Reference": "EntityId"
+        }
+    },
+    "VecStoredValue": {
+        "_enum": {
+            "Bool": "Vec<bool>",
+            "Uint16": "Vec<u16>",
+            "Uint32": "Vec<u32>",
+            "Uint64": "Vec<u64>",
+            "Int16": "Vec<i16>",
+            "Int32": "Vec<i32>",
+            "Int64": "Vec<i64>",
+            "Hash": "Vec<Hash>",
+            "Text": "Vec<Text>",
+            "Reference": "Vec<EntityId>"
+        }
+    },
+    "VecStoredPropertyValue": {
+        "vec_value": "VecStoredValue",
+        "nonce": "Nonce"
+    },
+    "StoredPropertyValue": {
+        "_enum": {
+            "Single": "StoredValue",
+            "Vector": "VecStoredPropertyValue"
+        }
+    },
+    "InboundReferenceCounter": {
+        "total": "u32",
+        "same_owner": "u32"
+    },
+    "Entity": {
+        "entity_permissions": "EntityPermissions",
+        "class_id": "ClassId",
+        "supported_schemas": "Vec<SchemaId>",
+        "reference_counter": "InboundReferenceCounter"
+    },
+    "CuratorGroup": {
+        "curators": "Vec<u64>",
+        "active": "bool",
+        "number_of_classes_maintained": "u32"
+    },
+    "EntityCreationVoucher": {
+        "maximum_entities_count": "EntityId",
+        "entities_created": "EntityId"
+    },
+    "Actor": {
+        "_enum": {
+            "Curator": "(CuratorGroupId,u64)",
+            "Member": "MemberId",
+            "Lead": "Null"
+        }
+    },
+    "EntityReferenceCounterSideEffect": {
+        "total": "i32",
+        "same_owner": "i32"
+    },
+    "ReferenceCounterSideEffects": "BTreeMap<EntityId,EntityReferenceCounterSideEffect>",
+    "SideEffects": "Option<ReferenceCounterSideEffects>",
+    "SideEffect": "Option<(EntityId,EntityReferenceCounterSideEffect)>",
+    "Status": "bool",
+    "InputValue": {
+        "_enum": {
+            "Bool": "bool",
+            "Uint16": "u16",
+            "Uint32": "u32",
+            "Uint64": "u64",
+            "Int16": "i16",
+            "Int32": "i32",
+            "Int64": "i64",
+            "Text": "Text",
+            "TextToHash": "Text",
+            "Reference": "EntityId"
+        }
+    },
+    "VecInputValue": {
+        "_enum": {
+            "Bool": "Vec<bool>",
+            "Uint16": "Vec<u16>",
+            "Uint32": "Vec<u32>",
+            "Uint64": "Vec<u64>",
+            "Int16": "Vec<i16>",
+            "Int32": "Vec<i32>",
+            "Int64": "Vec<i64>",
+            "TextToHash": "Vec<Text>",
+            "Text": "Vec<Text>",
+            "Reference": "Vec<EntityId>"
+        }
+    },
+    "InputPropertyValue": {
+        "_enum": {
+            "Single": "InputValue",
+            "Vector": "VecInputValue"
+        }
+    },
+    "ParameterizedEntity": {
+        "_enum": {
+            "InternalEntityJustAdded": "u32",
+            "ExistingEntity": "EntityId"
+        }
+    },
+    "ParametrizedPropertyValue": {
+        "_enum": {
+            "InputPropertyValue": "InputPropertyValue",
+            "InternalEntityJustAdded": "u32",
+            "InternalEntityVec": "Vec<ParameterizedEntity>"
+        }
+    },
+    "ParametrizedClassPropertyValue": {
+        "in_class_index": "PropertyId",
+        "value": "ParametrizedPropertyValue"
+    },
+    "CreateEntityOperation": {
+        "class_id": "ClassId"
+    },
+    "UpdatePropertyValuesOperation": {
+        "entity_id": "ParameterizedEntity",
+        "new_parametrized_property_values": "Vec<ParametrizedClassPropertyValue>"
+    },
+    "AddSchemaSupportToEntityOperation": {
+        "entity_id": "ParameterizedEntity",
+        "schema_id": "u16",
+        "parametrized_property_values": "Vec<ParametrizedClassPropertyValue>"
+    },
+    "OperationType": {
+        "_enum": {
+            "CreateEntity": "CreateEntityOperation",
+            "UpdatePropertyValues": "UpdatePropertyValuesOperation",
+            "AddSchemaSupportToEntity": "AddSchemaSupportToEntityOperation"
+        }
+    },
+    "ClassPermissionsType": "Null",
+    "ClassPropertyValue": "Null",
+    "Operation": "Null",
+    "ReferenceConstraint": "Null",
     "Address": "AccountId",
     "LookupSource": "AccountId"
 }

+ 286 - 138
types/augment/all/types.ts

@@ -4,8 +4,8 @@
 import { ITuple } from '@polkadot/types/types';
 import { BTreeMap, BTreeSet, Enum, Option, Struct, U8aFixed, Vec } from '@polkadot/types/codec';
 import { GenericAccountId } from '@polkadot/types/generic';
-import { Bytes, Text, bool, i16, i32, i64, u128, u16, u32, u64 } from '@polkadot/types/primitive';
-import { AccountId, Balance } from '@polkadot/types/interfaces/runtime';
+import { Bytes, Null, Text, bool, i16, i32, i64, u128, u16, u32, u64 } from '@polkadot/types/primitive';
+import { AccountId, Balance, Hash } from '@polkadot/types/interfaces/runtime';
 
 /** @name AcceptingApplications */
 export interface AcceptingApplications extends Struct {
@@ -44,6 +44,15 @@ export interface ActiveStake extends Struct {
   readonly source_account_id: GenericAccountId;
 }
 
+/** @name Actor */
+export interface Actor extends Enum {
+  readonly isCurator: boolean;
+  readonly asCurator: ITuple<[CuratorGroupId, u64]>;
+  readonly isMember: boolean;
+  readonly asMember: MemberId;
+  readonly isLead: boolean;
+}
+
 /** @name ActorId */
 export interface ActorId extends u64 {}
 
@@ -58,9 +67,9 @@ export interface AddOpeningParameters extends Struct {
 /** @name Address */
 export interface Address extends AccountId {}
 
-/** @name AddSchemaSupportToEntity */
-export interface AddSchemaSupportToEntity extends Struct {
-  readonly entity_id: ParametrizedEntity;
+/** @name AddSchemaSupportToEntityOperation */
+export interface AddSchemaSupportToEntityOperation extends Struct {
+  readonly entity_id: ParameterizedEntity;
   readonly schema_id: u16;
   readonly parametrized_property_values: Vec<ParametrizedClassPropertyValue>;
 }
@@ -225,43 +234,38 @@ export interface ChildPositionInParentCategory extends Struct {
 
 /** @name Class */
 export interface Class extends Struct {
-  readonly id: ClassId;
+  readonly class_permissions: ClassPermissions;
   readonly properties: Vec<Property>;
-  readonly schemas: Vec<ClassSchema>;
+  readonly schemas: Vec<Schema>;
   readonly name: Text;
   readonly description: Text;
+  readonly maximum_entities_count: EntityId;
+  readonly current_number_of_entities: EntityId;
+  readonly default_entity_creation_voucher_upper_bound: EntityId;
 }
 
 /** @name ClassId */
 export interface ClassId extends u64 {}
 
-/** @name ClassPermissionsType */
-export interface ClassPermissionsType extends Struct {
-  readonly entity_permissions: EntityPermissions;
-  readonly entities_can_be_created: bool;
-  readonly add_schemas: CredentialSet;
-  readonly create_entities: CredentialSet;
-  readonly reference_constraint: ReferenceConstraint;
-  readonly admins: CredentialSet;
-  readonly last_permissions_update: u32;
+/** @name ClassPermissions */
+export interface ClassPermissions extends Struct {
+  readonly any_member: bool;
+  readonly entity_creation_blocked: bool;
+  readonly all_entity_property_values_locked: bool;
+  readonly maintainers: Vec<CuratorGroupId>;
 }
 
-/** @name ClassPropertyValue */
-export interface ClassPropertyValue extends Struct {
-  readonly in_class_index: u16;
-  readonly value: PropertyValue;
-}
+/** @name ClassPermissionsType */
+export interface ClassPermissionsType extends Null {}
 
-/** @name ClassSchema */
-export interface ClassSchema extends Struct {
-  readonly properties: Vec<u16>;
-}
+/** @name ClassPropertyValue */
+export interface ClassPropertyValue extends Null {}
 
 /** @name ContentId */
 export interface ContentId extends U8aFixed {}
 
-/** @name CreateEntity */
-export interface CreateEntity extends Struct {
+/** @name CreateEntityOperation */
+export interface CreateEntityOperation extends Struct {
   readonly class_id: ClassId;
 }
 
@@ -318,6 +322,16 @@ export interface CuratorExitSummary extends Struct {
   readonly rationale_text: Text;
 }
 
+/** @name CuratorGroup */
+export interface CuratorGroup extends Struct {
+  readonly curators: Vec<u64>;
+  readonly active: bool;
+  readonly number_of_classes_maintained: u32;
+}
+
+/** @name CuratorGroupId */
+export interface CuratorGroupId extends u64 {}
+
 /** @name CuratorId */
 export interface CuratorId extends u64 {}
 
@@ -441,9 +455,24 @@ export interface ElectionStake extends Struct {
 
 /** @name Entity */
 export interface Entity extends Struct {
-  readonly id: EntityId;
+  readonly entity_permissions: EntityPermissions;
   readonly class_id: ClassId;
-  readonly in_class_schema_indexes: Vec<u16>;
+  readonly supported_schemas: Vec<SchemaId>;
+  readonly reference_counter: InboundReferenceCounter;
+}
+
+/** @name EntityController */
+export interface EntityController extends Enum {
+  readonly isMaintainers: boolean;
+  readonly isMember: boolean;
+  readonly asMember: MemberId;
+  readonly isLead: boolean;
+}
+
+/** @name EntityCreationVoucher */
+export interface EntityCreationVoucher extends Struct {
+  readonly maximum_entities_count: EntityId;
+  readonly entities_created: EntityId;
 }
 
 /** @name EntityId */
@@ -451,8 +480,15 @@ export interface EntityId extends u64 {}
 
 /** @name EntityPermissions */
 export interface EntityPermissions extends Struct {
-  readonly update: CredentialSet;
-  readonly maintainer_has_all_permissions: bool;
+  readonly controller: EntityController;
+  readonly frozen: bool;
+  readonly referenceable: bool;
+}
+
+/** @name EntityReferenceCounterSideEffect */
+export interface EntityReferenceCounterSideEffect extends Struct {
+  readonly total: i32;
+  readonly same_owner: i32;
 }
 
 /** @name EntryMethod */
@@ -490,6 +526,9 @@ export interface Finalized extends Struct {
   readonly stakeDataAfterUnstakingError: Option<ActiveStake>;
 }
 
+/** @name HashedTextMaxLength */
+export interface HashedTextMaxLength extends Option<u16> {}
+
 /** @name HiringApplicationId */
 export interface HiringApplicationId extends u64 {}
 
@@ -500,12 +539,50 @@ export interface InactiveApplicationStage extends Struct {
   readonly cause: ApplicationDeactivationCause;
 }
 
+/** @name InboundReferenceCounter */
+export interface InboundReferenceCounter extends Struct {
+  readonly total: u32;
+  readonly same_owner: u32;
+}
+
+/** @name InputPropertyValue */
+export interface InputPropertyValue extends Enum {
+  readonly isSingle: boolean;
+  readonly asSingle: InputValue;
+  readonly isVector: boolean;
+  readonly asVector: VecInputValue;
+}
+
 /** @name InputValidationLengthConstraint */
 export interface InputValidationLengthConstraint extends Struct {
   readonly min: u16;
   readonly max_min_diff: u16;
 }
 
+/** @name InputValue */
+export interface InputValue extends Enum {
+  readonly isBool: boolean;
+  readonly asBool: bool;
+  readonly isUint16: boolean;
+  readonly asUint16: u16;
+  readonly isUint32: boolean;
+  readonly asUint32: u32;
+  readonly isUint64: boolean;
+  readonly asUint64: u64;
+  readonly isInt16: boolean;
+  readonly asInt16: i16;
+  readonly isInt32: boolean;
+  readonly asInt32: i32;
+  readonly isInt64: boolean;
+  readonly asInt64: i64;
+  readonly isText: boolean;
+  readonly asText: Text;
+  readonly isTextToHash: boolean;
+  readonly asTextToHash: Text;
+  readonly isReference: boolean;
+  readonly asReference: EntityId;
+}
+
 /** @name IPNSIdentity */
 export interface IPNSIdentity extends Text {}
 
@@ -585,6 +662,9 @@ export interface NextAdjustment extends Struct {
   readonly at_block: u32;
 }
 
+/** @name Nonce */
+export interface Nonce extends u64 {}
+
 /** @name Opening */
 export interface Opening extends Struct {
   readonly created: u32;
@@ -647,20 +727,16 @@ export interface OpeningType extends Enum {
 }
 
 /** @name Operation */
-export interface Operation extends Struct {
-  readonly with_credential: Option<Credential>;
-  readonly as_entity_maintainer: bool;
-  readonly operation_type: OperationType;
-}
+export interface Operation extends Null {}
 
 /** @name OperationType */
 export interface OperationType extends Enum {
   readonly isCreateEntity: boolean;
-  readonly asCreateEntity: CreateEntity;
+  readonly asCreateEntity: CreateEntityOperation;
   readonly isUpdatePropertyValues: boolean;
-  readonly asUpdatePropertyValues: UpdatePropertyValues;
+  readonly asUpdatePropertyValues: UpdatePropertyValuesOperation;
   readonly isAddSchemaSupportToEntity: boolean;
-  readonly asAddSchemaSupportToEntity: AddSchemaSupportToEntity;
+  readonly asAddSchemaSupportToEntity: AddSchemaSupportToEntityOperation;
 }
 
 /** @name OptionalText */
@@ -675,28 +751,28 @@ export interface PaidMembershipTerms extends Struct {
 /** @name PaidTermId */
 export interface PaidTermId extends u64 {}
 
-/** @name ParametrizedClassPropertyValue */
-export interface ParametrizedClassPropertyValue extends Struct {
-  readonly in_class_index: u16;
-  readonly value: ParametrizedPropertyValue;
-}
-
-/** @name ParametrizedEntity */
-export interface ParametrizedEntity extends Enum {
+/** @name ParameterizedEntity */
+export interface ParameterizedEntity extends Enum {
   readonly isInternalEntityJustAdded: boolean;
   readonly asInternalEntityJustAdded: u32;
   readonly isExistingEntity: boolean;
-  readonly asExistingEntity: u64;
+  readonly asExistingEntity: EntityId;
+}
+
+/** @name ParametrizedClassPropertyValue */
+export interface ParametrizedClassPropertyValue extends Struct {
+  readonly in_class_index: PropertyId;
+  readonly value: ParametrizedPropertyValue;
 }
 
 /** @name ParametrizedPropertyValue */
 export interface ParametrizedPropertyValue extends Enum {
-  readonly isPropertyValue: boolean;
-  readonly asPropertyValue: PropertyValue;
+  readonly isInputPropertyValue: boolean;
+  readonly asInputPropertyValue: InputPropertyValue;
   readonly isInternalEntityJustAdded: boolean;
   readonly asInternalEntityJustAdded: u32;
   readonly isInternalEntityVec: boolean;
-  readonly asInternalEntityVec: Vec<ParametrizedEntity>;
+  readonly asInternalEntityVec: Vec<ParameterizedEntity>;
 }
 
 /** @name Post */
@@ -734,91 +810,29 @@ export interface PrincipalId extends u64 {}
 
 /** @name Property */
 export interface Property extends Struct {
-  readonly prop_type: PropertyType;
+  readonly property_type: PropertyType;
   readonly required: bool;
+  readonly unique: bool;
   readonly name: Text;
   readonly description: Text;
+  readonly locking_policy: PropertyLockingPolicy;
 }
 
-/** @name PropertyOfClass */
-export interface PropertyOfClass extends Struct {
-  readonly class_id: ClassId;
-  readonly property_index: u16;
+/** @name PropertyId */
+export interface PropertyId extends u16 {}
+
+/** @name PropertyLockingPolicy */
+export interface PropertyLockingPolicy extends Struct {
+  readonly is_locked_from_maintainer: bool;
+  readonly is_locked_from_controller: bool;
 }
 
 /** @name PropertyType */
 export interface PropertyType extends Enum {
-  readonly isNone: boolean;
-  readonly isBool: boolean;
-  readonly isUint16: boolean;
-  readonly isUint32: boolean;
-  readonly isUint64: boolean;
-  readonly isInt16: boolean;
-  readonly isInt32: boolean;
-  readonly isInt64: boolean;
-  readonly isText: boolean;
-  readonly asText: u16;
-  readonly isInternal: boolean;
-  readonly asInternal: u64;
-  readonly isBoolVec: boolean;
-  readonly asBoolVec: u16;
-  readonly isUint16Vec: boolean;
-  readonly asUint16Vec: u16;
-  readonly isUint32Vec: boolean;
-  readonly asUint32Vec: u16;
-  readonly isUint64Vec: boolean;
-  readonly asUint64Vec: u16;
-  readonly isInt16Vec: boolean;
-  readonly asInt16Vec: u16;
-  readonly isInt32Vec: boolean;
-  readonly asInt32Vec: u16;
-  readonly isInt64Vec: boolean;
-  readonly asInt64Vec: u16;
-  readonly isTextVec: boolean;
-  readonly asTextVec: ITuple<[u16, u16]>;
-  readonly isInternalVec: boolean;
-  readonly asInternalVec: ITuple<[u16, ClassId]>;
-}
-
-/** @name PropertyValue */
-export interface PropertyValue extends Enum {
-  readonly isNone: boolean;
-  readonly isBool: boolean;
-  readonly asBool: bool;
-  readonly isUint16: boolean;
-  readonly asUint16: u16;
-  readonly isUint32: boolean;
-  readonly asUint32: u32;
-  readonly isUint64: boolean;
-  readonly asUint64: u64;
-  readonly isInt16: boolean;
-  readonly asInt16: i16;
-  readonly isInt32: boolean;
-  readonly asInt32: i32;
-  readonly isInt64: boolean;
-  readonly asInt64: i64;
-  readonly isText: boolean;
-  readonly asText: Text;
-  readonly isInternal: boolean;
-  readonly asInternal: u64;
-  readonly isBoolVec: boolean;
-  readonly asBoolVec: Vec<bool>;
-  readonly isUint16Vec: boolean;
-  readonly asUint16Vec: Vec<u16>;
-  readonly isUint32Vec: boolean;
-  readonly asUint32Vec: Vec<u32>;
-  readonly isUint64Vec: boolean;
-  readonly asUint64Vec: Vec<u64>;
-  readonly isInt16Vec: boolean;
-  readonly asInt16Vec: Vec<i16>;
-  readonly isInt32Vec: boolean;
-  readonly asInt32Vec: Vec<i32>;
-  readonly isInt64Vec: boolean;
-  readonly asInt64Vec: Vec<i64>;
-  readonly isTextVec: boolean;
-  readonly asTextVec: Vec<Text>;
-  readonly isInternalVec: boolean;
-  readonly asInternalVec: Vec<EntityId>;
+  readonly isSingle: boolean;
+  readonly asSingle: SinglePropertyType;
+  readonly isVector: boolean;
+  readonly asVector: VecPropertyType;
 }
 
 /** @name ProposalDecisionStatus */
@@ -954,12 +968,10 @@ export interface Recipient extends Struct {
 export interface RecipientId extends u64 {}
 
 /** @name ReferenceConstraint */
-export interface ReferenceConstraint extends Enum {
-  readonly isNoReferencingAllowed: boolean;
-  readonly isNoConstraint: boolean;
-  readonly isRestricted: boolean;
-  readonly asRestricted: Vec<PropertyOfClass>;
-}
+export interface ReferenceConstraint extends Null {}
+
+/** @name ReferenceCounterSideEffects */
+export interface ReferenceCounterSideEffects extends BTreeMap<EntityId, EntityReferenceCounterSideEffect> {}
 
 /** @name Reply */
 export interface Reply extends Struct {
@@ -1021,10 +1033,22 @@ export interface RoleStakeProfile extends Struct {
   readonly exit_unstaking_period: Option<u32>;
 }
 
+/** @name SameController */
+export interface SameController extends bool {}
+
+/** @name Schema */
+export interface Schema extends Struct {
+  readonly properties: Vec<PropertyId>;
+  readonly is_active: bool;
+}
+
+/** @name SchemaId */
+export interface SchemaId extends u16 {}
+
 /** @name SealedVote */
 export interface SealedVote extends Struct {
   readonly voter: GenericAccountId;
-  readonly commitment: U8aFixed;
+  readonly commitment: Hash;
   readonly stake: ElectionStake;
   readonly vote: Option<GenericAccountId>;
 }
@@ -1048,6 +1072,29 @@ export interface ServiceProviderRecord extends Struct {
 /** @name SetLeadParams */
 export interface SetLeadParams extends ITuple<[MemberId, GenericAccountId]> {}
 
+/** @name SideEffect */
+export interface SideEffect extends Option<ITuple<[EntityId, EntityReferenceCounterSideEffect]>> {}
+
+/** @name SideEffects */
+export interface SideEffects extends Option<ReferenceCounterSideEffects> {}
+
+/** @name SinglePropertyType */
+export interface SinglePropertyType extends Enum {
+  readonly isBool: boolean;
+  readonly isUint16: boolean;
+  readonly isUint32: boolean;
+  readonly isUint64: boolean;
+  readonly isInt16: boolean;
+  readonly isInt32: boolean;
+  readonly isInt64: boolean;
+  readonly isText: boolean;
+  readonly asText: TextMaxLength;
+  readonly isHash: boolean;
+  readonly asHash: HashedTextMaxLength;
+  readonly isReference: boolean;
+  readonly asReference: ITuple<[ClassId, SameController]>;
+}
+
 /** @name Slash */
 export interface Slash extends Struct {
   readonly started_at_block: u32;
@@ -1114,9 +1161,44 @@ export interface StakingStatus extends Enum {
   readonly asStaked: Staked;
 }
 
+/** @name Status */
+export interface Status extends bool {}
+
 /** @name StorageProviderId */
 export interface StorageProviderId extends u64 {}
 
+/** @name StoredPropertyValue */
+export interface StoredPropertyValue extends Enum {
+  readonly isSingle: boolean;
+  readonly asSingle: StoredValue;
+  readonly isVector: boolean;
+  readonly asVector: VecStoredPropertyValue;
+}
+
+/** @name StoredValue */
+export interface StoredValue extends Enum {
+  readonly isBool: boolean;
+  readonly asBool: bool;
+  readonly isUint16: boolean;
+  readonly asUint16: u16;
+  readonly isUint32: boolean;
+  readonly asUint32: u32;
+  readonly isUint64: boolean;
+  readonly asUint64: u64;
+  readonly isInt16: boolean;
+  readonly asInt16: i16;
+  readonly isInt32: boolean;
+  readonly asInt32: i32;
+  readonly isInt64: boolean;
+  readonly asInt64: i64;
+  readonly isText: boolean;
+  readonly asText: Text;
+  readonly isHash: boolean;
+  readonly asHash: Hash;
+  readonly isReference: boolean;
+  readonly asReference: EntityId;
+}
+
 /** @name SubscriptionId */
 export interface SubscriptionId extends u64 {}
 
@@ -1128,6 +1210,9 @@ export interface TerminateRoleParameters extends Struct {
   readonly working_group: WorkingGroup;
 }
 
+/** @name TextMaxLength */
+export interface TextMaxLength extends u16 {}
+
 /** @name Thread */
 export interface Thread extends Struct {
   readonly id: ThreadId;
@@ -1169,15 +1254,78 @@ export interface UnstakingApplicationStage extends Struct {
   readonly cause: ApplicationDeactivationCause;
 }
 
-/** @name UpdatePropertyValues */
-export interface UpdatePropertyValues extends Struct {
-  readonly entity_id: ParametrizedEntity;
-  readonly parametrized_property_values: Vec<ParametrizedClassPropertyValue>;
+/** @name UpdatePropertyValuesOperation */
+export interface UpdatePropertyValuesOperation extends Struct {
+  readonly entity_id: ParameterizedEntity;
+  readonly new_parametrized_property_values: Vec<ParametrizedClassPropertyValue>;
 }
 
 /** @name Url */
 export interface Url extends Text {}
 
+/** @name VecInputValue */
+export interface VecInputValue extends Enum {
+  readonly isBool: boolean;
+  readonly asBool: Vec<bool>;
+  readonly isUint16: boolean;
+  readonly asUint16: Vec<u16>;
+  readonly isUint32: boolean;
+  readonly asUint32: Vec<u32>;
+  readonly isUint64: boolean;
+  readonly asUint64: Vec<u64>;
+  readonly isInt16: boolean;
+  readonly asInt16: Vec<i16>;
+  readonly isInt32: boolean;
+  readonly asInt32: Vec<i32>;
+  readonly isInt64: boolean;
+  readonly asInt64: Vec<i64>;
+  readonly isTextToHash: boolean;
+  readonly asTextToHash: Vec<Text>;
+  readonly isText: boolean;
+  readonly asText: Vec<Text>;
+  readonly isReference: boolean;
+  readonly asReference: Vec<EntityId>;
+}
+
+/** @name VecMaxLength */
+export interface VecMaxLength extends u16 {}
+
+/** @name VecPropertyType */
+export interface VecPropertyType extends Struct {
+  readonly vec_type: SinglePropertyType;
+  readonly max_length: VecMaxLength;
+}
+
+/** @name VecStoredPropertyValue */
+export interface VecStoredPropertyValue extends Struct {
+  readonly vec_value: VecStoredValue;
+  readonly nonce: Nonce;
+}
+
+/** @name VecStoredValue */
+export interface VecStoredValue extends Enum {
+  readonly isBool: boolean;
+  readonly asBool: Vec<bool>;
+  readonly isUint16: boolean;
+  readonly asUint16: Vec<u16>;
+  readonly isUint32: boolean;
+  readonly asUint32: Vec<u32>;
+  readonly isUint64: boolean;
+  readonly asUint64: Vec<u64>;
+  readonly isInt16: boolean;
+  readonly asInt16: Vec<i16>;
+  readonly isInt32: boolean;
+  readonly asInt32: Vec<i32>;
+  readonly isInt64: boolean;
+  readonly asInt64: Vec<i64>;
+  readonly isHash: boolean;
+  readonly asHash: Vec<Hash>;
+  readonly isText: boolean;
+  readonly asText: Vec<Text>;
+  readonly isReference: boolean;
+  readonly asReference: Vec<EntityId>;
+}
+
 /** @name VoteKind */
 export interface VoteKind extends Enum {
   readonly isApprove: boolean;

+ 6 - 0
types/augment/augment-api-consts.ts

@@ -31,6 +31,12 @@ declare module '@polkadot/metadata/Decorated/consts/types' {
        **/
       existentialDeposit: AugmentedConst<Balance>;
     };
+    contentDirectoryWorkingGroup: {
+      /**
+       * Exports const -  max simultaneous active worker number.
+       **/
+      maxWorkerNumberLimit: AugmentedConst<u32>;
+    };
     dataDirectory: {
       /**
        * Maximum objects allowed per inject_data_objects() transaction

+ 83 - 5
types/augment/augment-api-query.ts

@@ -4,7 +4,7 @@
 import { AnyNumber, ITuple, Observable } from '@polkadot/types/types';
 import { Option, Vec } from '@polkadot/types/codec';
 import { Bytes, bool, u32, u64 } from '@polkadot/types/primitive';
-import { Application, ApplicationId, ApplicationOf, Category, CategoryId, Channel, ChannelId, Class, ClassId, ClassPermissionsType, ContentId, Credential, Curator, CuratorApplication, CuratorApplicationId, CuratorId, CuratorOpening, CuratorOpeningId, DataObject, DataObjectStorageRelationship, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DiscussionPost, DiscussionThread, ElectionStage, ElectionStake, Entity, EntityId, HiringApplicationId, InputValidationLengthConstraint, Lead, LeadId, MemberId, Membership, MemoText, Mint, MintId, Opening, OpeningId, OpeningOf, PaidMembershipTerms, PaidTermId, Post, PostId, Principal, PrincipalId, ProposalDetailsOf, ProposalId, ProposalOf, Recipient, RecipientId, RewardRelationship, RewardRelationshipId, SealedVote, Seats, ServiceProviderRecord, Stake, StakeId, StorageProviderId, Thread, ThreadCounter, ThreadId, TransferableStake, Url, VoteKind, WorkerId, WorkerOf, WorkingGroupUnstaker } from './all';
+import { Application, ApplicationId, ApplicationOf, Category, CategoryId, Channel, ChannelId, Class, ClassId, ClassPermissionsType, ContentId, Credential, Curator, CuratorApplication, CuratorApplicationId, CuratorGroup, CuratorGroupId, CuratorId, CuratorOpening, CuratorOpeningId, DataObject, DataObjectStorageRelationship, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DiscussionPost, DiscussionThread, ElectionStage, ElectionStake, Entity, EntityController, EntityCreationVoucher, EntityId, HiringApplicationId, InputValidationLengthConstraint, Lead, LeadId, MemberId, Membership, MemoText, Mint, MintId, Opening, OpeningId, OpeningOf, PaidMembershipTerms, PaidTermId, Post, PostId, Principal, PrincipalId, PropertyId, ProposalDetailsOf, ProposalId, ProposalOf, Recipient, RecipientId, RewardRelationship, RewardRelationshipId, SealedVote, Seats, ServiceProviderRecord, Stake, StakeId, StorageProviderId, Thread, ThreadCounter, ThreadId, TransferableStake, Url, VoteKind, WorkerId, WorkerOf, WorkingGroupUnstaker } from './all';
 import { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
 import { BabeAuthorityWeight, MaybeRandomness, NextConfigDescriptor, Randomness } from '@polkadot/types/interfaces/babe';
 import { AccountData, BalanceLock } from '@polkadot/types/interfaces/balances';
@@ -127,6 +127,86 @@ declare module '@polkadot/api/types/storage' {
        **/
       totalIssuance: AugmentedQuery<ApiType, () => Observable<Balance>>;
     };
+    contentDirectory: {
+      /**
+       * Map, representing ClassId -> Class relation
+       **/
+      classById: AugmentedQuery<ApiType, (arg: ClassId | AnyNumber | Uint8Array) => Observable<Class>>;
+      /**
+       * Map, representing  CuratorGroupId -> CuratorGroup relation
+       **/
+      curatorGroupById: AugmentedQuery<ApiType, (arg: CuratorGroupId | AnyNumber | Uint8Array) => Observable<CuratorGroup>>;
+      /**
+       * Map, representing EntityId -> Entity relation
+       **/
+      entityById: AugmentedQuery<ApiType, (arg: EntityId | AnyNumber | Uint8Array) => Observable<Entity>>;
+      entityCreationVouchers: AugmentedQueryDoubleMap<ApiType, (key1: ClassId | AnyNumber | Uint8Array, key2: EntityController | { Maintainers: any } | { Member: any } | { Lead: any } | string | Uint8Array) => Observable<EntityCreationVoucher>>;
+      /**
+       * Next runtime storage values used to maintain next id value, used on creation of respective curator groups, classes and entities
+       **/
+      nextClassId: AugmentedQuery<ApiType, () => Observable<ClassId>>;
+      nextCuratorGroupId: AugmentedQuery<ApiType, () => Observable<CuratorGroupId>>;
+      nextEntityId: AugmentedQuery<ApiType, () => Observable<EntityId>>;
+      /**
+       * Mapping of class id and its property id to the respective entity id and property value hash.
+       **/
+      uniquePropertyValueHashes: AugmentedQueryDoubleMap<ApiType, (key1: ITuple<[ClassId, PropertyId]> | [ClassId | AnyNumber | Uint8Array, PropertyId | AnyNumber | Uint8Array], key2: Hash | string | Uint8Array) => Observable<ITuple<[]>>>;
+    };
+    contentDirectoryWorkingGroup: {
+      /**
+       * Count of active workers.
+       **/
+      activeWorkerCount: AugmentedQuery<ApiType, () => Observable<u32>>;
+      /**
+       * Maps identifier to worker application on opening.
+       **/
+      applicationById: AugmentedQuery<ApiType, (arg: ApplicationId | AnyNumber | Uint8Array) => Observable<ApplicationOf>>;
+      /**
+       * The current lead.
+       **/
+      currentLead: AugmentedQuery<ApiType, () => Observable<Option<WorkerId>>>;
+      /**
+       * Map member id by hiring application id.
+       * Required by StakingEventsHandler callback call to refund the balance on unstaking.
+       **/
+      memberIdByHiringApplicationId: AugmentedQuery<ApiType, (arg: HiringApplicationId | AnyNumber | Uint8Array) => Observable<MemberId>>;
+      /**
+       * The mint currently funding the rewards for this module.
+       **/
+      mint: AugmentedQuery<ApiType, () => Observable<MintId>>;
+      /**
+       * Next identifier value for new worker application.
+       **/
+      nextApplicationId: AugmentedQuery<ApiType, () => Observable<ApplicationId>>;
+      /**
+       * Next identifier value for new worker opening.
+       **/
+      nextOpeningId: AugmentedQuery<ApiType, () => Observable<OpeningId>>;
+      /**
+       * Next identifier for new worker.
+       **/
+      nextWorkerId: AugmentedQuery<ApiType, () => Observable<WorkerId>>;
+      /**
+       * Maps identifier to worker opening.
+       **/
+      openingById: AugmentedQuery<ApiType, (arg: OpeningId | AnyNumber | Uint8Array) => Observable<OpeningOf>>;
+      /**
+       * Opening human readable text length limits
+       **/
+      openingHumanReadableText: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      /**
+       * Worker application human readable text length limits
+       **/
+      workerApplicationHumanReadableText: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      /**
+       * Maps identifier to corresponding worker.
+       **/
+      workerById: AugmentedQuery<ApiType, (arg: WorkerId | AnyNumber | Uint8Array) => Observable<WorkerOf>>;
+      /**
+       * Worker exit rationale text length limits.
+       **/
+      workerExitRationaleText: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+    };
     contentWorkingGroup: {
       channelAvatarConstraint: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
       channelBannerConstraint: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
@@ -214,11 +294,9 @@ declare module '@polkadot/api/types/storage' {
        **/
       amountPerPayout: AugmentedQuery<ApiType, () => Observable<BalanceOf>>;
       /**
-       * The mint that funds council member rewards and spending proposals budget. It is an Option
-       * because it was introduced in a runtime upgrade. It will be automatically created when
-       * a successful call to set_council_mint_capacity() is made.
+       * The mint that funds council member rewards and spending proposals budget
        **/
-      councilMint: AugmentedQuery<ApiType, () => Observable<Option<MintId>>>;
+      councilMint: AugmentedQuery<ApiType, () => Observable<MintId>>;
       /**
        * How many blocks after the reward is created, the first payout will be made
        **/

+ 239 - 9
types/augment/augment-api-tx.ts

@@ -2,9 +2,9 @@
 /* eslint-disable */
 
 import { AnyNumber, ITuple } from '@polkadot/types/types';
-import { Compact, Option, Vec } from '@polkadot/types/codec';
+import { BTreeMap, BTreeSet, Compact, Option, Vec } from '@polkadot/types/codec';
 import { Bytes, bool, u16, u32, u64 } from '@polkadot/types/primitive';
-import { ActivateOpeningAt, AddOpeningParameters, ApplicationId, ApplicationIdSet, BalanceOfMint, CategoryId, ChannelContentType, ChannelCurationStatus, ChannelId, ChannelPublicationStatus, ClassId, ClassPermissionsType, ClassPropertyValue, ContentId, Credential, CredentialSet, CurationActor, CuratorApplicationId, CuratorApplicationIdSet, CuratorId, CuratorOpeningId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, ElectionParameters, EntityId, EntityPermissions, FillOpeningParameters, MemberId, MemoText, OpeningId, OpeningPolicyCommitment, OpeningType, Operation, OptionalText, PaidTermId, PostId, Property, ProposalId, ReferenceConstraint, RewardPolicy, StorageProviderId, TerminateRoleParameters, ThreadId, Url, VoteKind, WorkerId, WorkingGroup } from './all';
+import { ActivateOpeningAt, Actor, AddOpeningParameters, ApplicationId, ApplicationIdSet, BalanceOfMint, CategoryId, ChannelContentType, ChannelCurationStatus, ChannelId, ChannelPublicationStatus, ClassId, ClassPermissions, ClassPermissionsType, ClassPropertyValue, ContentId, Credential, CredentialSet, CurationActor, CuratorApplicationId, CuratorApplicationIdSet, CuratorGroupId, CuratorId, CuratorOpeningId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, ElectionParameters, EntityController, EntityId, EntityPermissions, FillOpeningParameters, InputPropertyValue, InputValue, MemberId, MemoText, Nonce, OpeningId, OpeningPolicyCommitment, OpeningType, Operation, OperationType, OptionalText, PaidTermId, PostId, Property, PropertyId, ProposalId, ReferenceConstraint, RewardPolicy, SchemaId, StorageProviderId, TerminateRoleParameters, ThreadId, Url, VecMaxLength, VoteKind, WorkerId, WorkingGroup } from './all';
 import { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics';
 import { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa';
 import { Heartbeat } from '@polkadot/types/interfaces/imOnline';
@@ -98,6 +98,178 @@ declare module '@polkadot/api/types/submittable' {
        **/
       transferKeepAlive: AugmentedSubmittable<(dest: LookupSource | string | Uint8Array, value: Compact<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
     };
+    contentDirectory: {
+      /**
+       * Create new class schema from existing property ids and new properties
+       **/
+      addClassSchema: AugmentedSubmittable<(classId: ClassId | AnyNumber | Uint8Array, existingProperties: BTreeSet<PropertyId>, newProperties: Vec<Property> | (Property | { property_type?: any; required?: any; unique?: any; name?: any; description?: any; locking_policy?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Add new curator group to runtime storage
+       **/
+      addCuratorGroup: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Add curator to curator group under given `curator_group_id`
+       **/
+      addCuratorToGroup: AugmentedSubmittable<(curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array, curatorId: CuratorId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Add curator group under given `curator_group_id` as `Class` maintainer
+       **/
+      addMaintainerToClass: AugmentedSubmittable<(classId: ClassId | AnyNumber | Uint8Array, curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Add schema support to entity under given `schema_id` and provided `property_values`
+       **/
+      addSchemaSupportToEntity: AugmentedSubmittable<(actor: Actor | { Curator: any } | { Member: any } | { Lead: any } | string | Uint8Array, entityId: EntityId | AnyNumber | Uint8Array, schemaId: SchemaId | AnyNumber | Uint8Array, newPropertyValues: BTreeMap<PropertyId, InputPropertyValue>) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Clear `PropertyValueVec` under given `entity_id` & `in_class_schema_property_id`
+       **/
+      clearEntityPropertyVector: AugmentedSubmittable<(actor: Actor | { Curator: any } | { Member: any } | { Lead: any } | string | Uint8Array, entityId: EntityId | AnyNumber | Uint8Array, inClassSchemaPropertyId: PropertyId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create new `Class` with provided parameters
+       **/
+      createClass: AugmentedSubmittable<(name: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, classPermissions: ClassPermissions | { any_member?: any; entity_creation_blocked?: any; all_entity_property_values_locked?: any; maintainers?: any } | string | Uint8Array, maximumEntitiesCount: EntityId | AnyNumber | Uint8Array, defaultEntityCreationVoucherUpperBound: EntityId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create entity.
+       * If someone is making an entity of this class for first time,
+       * then a voucher is also added with the class limit as the default limit value.
+       **/
+      createEntity: AugmentedSubmittable<(classId: ClassId | AnyNumber | Uint8Array, actor: Actor | { Curator: any } | { Member: any } | { Lead: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Insert `SingleInputPropertyValue` at given `index_in_property_vector`
+       * into `PropertyValueVec` under `in_class_schema_property_id`
+       **/
+      insertAtEntityPropertyVector: AugmentedSubmittable<(actor: Actor | { Curator: any } | { Member: any } | { Lead: any } | string | Uint8Array, entityId: EntityId | AnyNumber | Uint8Array, inClassSchemaPropertyId: PropertyId | AnyNumber | Uint8Array, indexInPropertyVector: VecMaxLength | AnyNumber | Uint8Array, value: InputValue | { Bool: any } | { Uint16: any } | { Uint32: any } | { Uint64: any } | { Int16: any } | { Int32: any } | { Int64: any } | { Text: any } | { TextToHash: any } | { Reference: any } | string | Uint8Array, nonce: Nonce | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Remove value at given `index_in_property_vector`
+       * from `PropertyValueVec` under `in_class_schema_property_id`
+       **/
+      removeAtEntityPropertyVector: AugmentedSubmittable<(actor: Actor | { Curator: any } | { Member: any } | { Lead: any } | string | Uint8Array, entityId: EntityId | AnyNumber | Uint8Array, inClassSchemaPropertyId: PropertyId | AnyNumber | Uint8Array, indexInPropertyVector: VecMaxLength | AnyNumber | Uint8Array, nonce: Nonce | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Remove curator from a given curator group
+       **/
+      removeCuratorFromGroup: AugmentedSubmittable<(curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array, curatorId: CuratorId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Remove curator group under given `curator_group_id` from runtime storage
+       **/
+      removeCuratorGroup: AugmentedSubmittable<(curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Remove `Entity` under provided `entity_id`
+       **/
+      removeEntity: AugmentedSubmittable<(actor: Actor | { Curator: any } | { Member: any } | { Lead: any } | string | Uint8Array, entityId: EntityId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Remove curator group under given `curator_group_id` from `Class` maintainers set
+       **/
+      removeMaintainerFromClass: AugmentedSubmittable<(classId: ClassId | AnyNumber | Uint8Array, curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Set `is_active` status for curator group under given `curator_group_id`
+       **/
+      setCuratorGroupStatus: AugmentedSubmittable<(curatorGroupId: CuratorGroupId | AnyNumber | Uint8Array, isActive: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Batch transaction
+       **/
+      transaction: AugmentedSubmittable<(actor: Actor | { Curator: any } | { Member: any } | { Lead: any } | string | Uint8Array, operations: Vec<OperationType> | (OperationType | { CreateEntity: any } | { UpdatePropertyValues: any } | { AddSchemaSupportToEntity: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Transfer ownership to new `EntityController` for `Entity` under given `entity_id`
+       * `new_property_value_references_with_same_owner_flag_set` should be provided manually
+       **/
+      transferEntityOwnership: AugmentedSubmittable<(entityId: EntityId | AnyNumber | Uint8Array, newController: EntityController | { Maintainers: any } | { Member: any } | { Lead: any } | string | Uint8Array, newPropertyValueReferencesWithSameOwnerFlagSet: BTreeMap<PropertyId, InputPropertyValue>) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Update `ClassPermissions` under specific `class_id`
+       **/
+      updateClassPermissions: AugmentedSubmittable<(classId: ClassId | AnyNumber | Uint8Array, updatedAnyMember: Option<bool> | null | object | string | Uint8Array, updatedEntityCreationBlocked: Option<bool> | null | object | string | Uint8Array, updatedAllEntityPropertyValuesLocked: Option<bool> | null | object | string | Uint8Array, updatedMaintainers: Option<BTreeSet<CuratorGroupId>> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Update `schema_status` under specific `schema_id` in `Class`
+       **/
+      updateClassSchemaStatus: AugmentedSubmittable<(classId: ClassId | AnyNumber | Uint8Array, schemaId: SchemaId | AnyNumber | Uint8Array, schemaStatus: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Updates or creates new `EntityCreationVoucher` for given `EntityController` with individual limit
+       **/
+      updateEntityCreationVoucher: AugmentedSubmittable<(classId: ClassId | AnyNumber | Uint8Array, controller: EntityController | { Maintainers: any } | { Member: any } | { Lead: any } | string | Uint8Array, maximumEntitiesCount: EntityId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Update entity permissions
+       **/
+      updateEntityPermissions: AugmentedSubmittable<(entityId: EntityId | AnyNumber | Uint8Array, updatedFrozen: Option<bool> | null | object | string | Uint8Array, updatedReferenceable: Option<bool> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Update `Entity` `InputPropertyValue`'s with provided ones
+       **/
+      updateEntityPropertyValues: AugmentedSubmittable<(actor: Actor | { Curator: any } | { Member: any } | { Lead: any } | string | Uint8Array, entityId: EntityId | AnyNumber | Uint8Array, newPropertyValues: BTreeMap<PropertyId, InputPropertyValue>) => SubmittableExtrinsic<ApiType>>;
+    };
+    contentDirectoryWorkingGroup: {
+      /**
+       * Begin accepting worker applications to an opening that is active.
+       * Require signed leader origin or the root (to accept applications for the leader position).
+       **/
+      acceptApplications: AugmentedSubmittable<(openingId: OpeningId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Add an opening for a worker role.
+       * Require signed leader origin or the root (to add opening for the leader position).
+       **/
+      addOpening: AugmentedSubmittable<(activateAt: ActivateOpeningAt | { CurrentBlock: any } | { ExactBlock: any } | string | Uint8Array, commitment: OpeningPolicyCommitment | { application_rationing_policy?: any; max_review_period_length?: any; application_staking_policy?: any; role_staking_policy?: any; role_slashing_terms?: any; fill_opening_successful_applicant_application_stake_unstaking_period?: any; fill_opening_failed_applicant_application_stake_unstaking_period?: any; fill_opening_failed_applicant_role_stake_unstaking_period?: any; terminate_curator_application_stake_unstaking_period?: any; terminate_curator_role_stake_unstaking_period?: any; exit_curator_role_application_stake_unstaking_period?: any; exit_curator_role_stake_unstaking_period?: any } | string | Uint8Array, humanReadableText: Bytes | string | Uint8Array, openingType: OpeningType | 'Leader'|'Worker' | number | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Apply on a worker opening.
+       **/
+      applyOnOpening: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, openingId: OpeningId | AnyNumber | Uint8Array, roleAccountId: AccountId | string | Uint8Array, optRoleStakeBalance: Option<BalanceOf> | null | object | string | Uint8Array, optApplicationStakeBalance: Option<BalanceOf> | null | object | string | Uint8Array, humanReadableText: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Begin reviewing, and therefore not accepting new applications.
+       * Require signed leader origin or the root (to begin review applications for the leader position).
+       **/
+      beginApplicantReview: AugmentedSubmittable<(openingId: OpeningId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Decreases the worker/lead stake and returns the remainder to the worker role_account_id.
+       * Can be decreased to zero, no actions on zero stake.
+       * Require signed leader origin or the root (to decrease the leader stake).
+       **/
+      decreaseStake: AugmentedSubmittable<(workerId: WorkerId | AnyNumber | Uint8Array, balance: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Fill opening for worker/lead.
+       * Require signed leader origin or the root (to fill opening for the leader position).
+       **/
+      fillOpening: AugmentedSubmittable<(openingId: OpeningId | AnyNumber | Uint8Array, successfulApplicationIds: ApplicationIdSet, rewardPolicy: Option<RewardPolicy> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Increases the worker/lead stake, demands a worker origin. Transfers tokens from the worker
+       * role_account_id to the stake. No limits on the stake.
+       **/
+      increaseStake: AugmentedSubmittable<(workerId: WorkerId | AnyNumber | Uint8Array, balance: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Leave the role by the active worker.
+       **/
+      leaveRole: AugmentedSubmittable<(workerId: WorkerId | AnyNumber | Uint8Array, rationaleText: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Sets the capacity to enable working group budget. Requires root origin.
+       **/
+      setMintCapacity: AugmentedSubmittable<(newCapacity: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Slashes the worker stake, demands a leader origin. No limits, no actions on zero stake.
+       * If slashing balance greater than the existing stake - stake is slashed to zero.
+       * Require signed leader origin or the root (to slash the leader stake).
+       **/
+      slashStake: AugmentedSubmittable<(workerId: WorkerId | AnyNumber | Uint8Array, balance: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Terminate the worker application. Can be done by the lead only.
+       **/
+      terminateApplication: AugmentedSubmittable<(applicationId: ApplicationId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Terminate the active worker by the lead.
+       * Require signed leader origin or the root (to terminate the leader role).
+       **/
+      terminateRole: AugmentedSubmittable<(workerId: WorkerId | AnyNumber | Uint8Array, rationaleText: Bytes | string | Uint8Array, slashStake: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Update the reward account associated with a set reward relationship for the active worker.
+       **/
+      updateRewardAccount: AugmentedSubmittable<(workerId: WorkerId | AnyNumber | Uint8Array, newRewardAccountId: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Update the reward amount associated with a set reward relationship for the active worker.
+       * Require signed leader origin or the root (to update leader reward amount).
+       **/
+      updateRewardAmount: AugmentedSubmittable<(workerId: WorkerId | AnyNumber | Uint8Array, newAmount: BalanceOfMint | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Update the associated role account of the active worker/lead.
+       **/
+      updateRoleAccount: AugmentedSubmittable<(workerId: WorkerId | AnyNumber | Uint8Array, newRoleAccountId: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Withdraw the worker application. Can be done by the worker itself only.
+       **/
+      withdrawApplication: AugmentedSubmittable<(applicationId: ApplicationId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
     contentWorkingGroup: {
       /**
        * Begin accepting curator applications to an opening that is active.
@@ -1314,10 +1486,68 @@ declare module '@polkadot/api/types/submittable' {
        **/
       set: AugmentedSubmittable<(now: Compact<Moment> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
     };
+    utility: {
+      /**
+       * Send a call through an indexed pseudonym of the sender.
+       * 
+       * Filter from origin are passed along. The call will be dispatched with an origin which
+       * use the same filter as the origin of this call.
+       * 
+       * NOTE: If you need to ensure that any account-based filtering is not honored (i.e.
+       * because you expect `proxy` to have been used prior in the call stack and you do not want
+       * the call restrictions to apply to any sub-accounts), then use `as_sub` instead.
+       * 
+       * The dispatch origin for this call must be _Signed_.
+       * 
+       * # <weight>
+       * - Base weight: 2.861 µs
+       * - Plus the weight of the `call`
+       * # </weight>
+       **/
+      asLimitedSub: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Send a call through an indexed pseudonym of the sender.
+       * 
+       * NOTE: If you need to ensure that any account-based filtering is honored (i.e. because
+       * you expect `proxy` to have been used prior in the call stack and you want it to apply to
+       * any sub-accounts), then use `as_limited_sub` instead.
+       * 
+       * The dispatch origin for this call must be _Signed_.
+       * 
+       * # <weight>
+       * - Base weight: 2.861 µs
+       * - Plus the weight of the `call`
+       * # </weight>
+       **/
+      asSub: AugmentedSubmittable<(index: u16 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Send a batch of dispatch calls.
+       * 
+       * May be called from any origin.
+       * 
+       * - `calls`: The calls to be dispatched from the same origin.
+       * 
+       * If origin is root then call are dispatch without checking origin filter. (This includes
+       * bypassing `frame_system::Trait::BaseCallFilter`).
+       * 
+       * # <weight>
+       * - Base weight: 14.39 + .987 * c µs
+       * - Plus the sum of the weights of the `calls`.
+       * - Plus one additional event. (repeat read/write)
+       * # </weight>
+       * 
+       * This will return `Ok` in all circumstances. To determine the success of the batch, an
+       * event is deposited. If a call failed and the batch was interrupted, then the
+       * `BatchInterrupted` event is deposited, along with the number of successful calls made
+       * and the error of the failed call. If all were successful, then the `BatchCompleted`
+       * event is deposited.
+       **/
+      batch: AugmentedSubmittable<(calls: Vec<Call> | (Call | { callIndex?: any; args?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
+    };
     versionedStorePermissions: {
-      addClassSchema: AugmentedSubmittable<(withCredential: Option<Credential> | null | object | string | Uint8Array, classId: ClassId | AnyNumber | Uint8Array, existingProperties: Vec<u16> | (u16 | AnyNumber | Uint8Array)[], newProperties: Vec<Property> | (Property | { prop_type?: any; required?: any; name?: any; description?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
-      addSchemaSupportToEntity: AugmentedSubmittable<(withCredential: Option<Credential> | null | object | string | Uint8Array, asEntityMaintainer: bool | boolean | Uint8Array, entityId: EntityId | AnyNumber | Uint8Array, schemaId: u16 | AnyNumber | Uint8Array, propertyValues: Vec<ClassPropertyValue> | (ClassPropertyValue | { in_class_index?: any; value?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
-      createClass: AugmentedSubmittable<(name: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, classPermissions: ClassPermissionsType | { entity_permissions?: any; entities_can_be_created?: any; add_schemas?: any; create_entities?: any; reference_constraint?: any; admins?: any; last_permissions_update?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      addClassSchema: AugmentedSubmittable<(withCredential: Option<Credential> | null | object | string | Uint8Array, classId: ClassId | AnyNumber | Uint8Array, existingProperties: Vec<u16> | (u16 | AnyNumber | Uint8Array)[], newProperties: Vec<Property> | (Property | { property_type?: any; required?: any; unique?: any; name?: any; description?: any; locking_policy?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
+      addSchemaSupportToEntity: AugmentedSubmittable<(withCredential: Option<Credential> | null | object | string | Uint8Array, asEntityMaintainer: bool | boolean | Uint8Array, entityId: EntityId | AnyNumber | Uint8Array, schemaId: u16 | AnyNumber | Uint8Array, propertyValues: Vec<ClassPropertyValue> | (ClassPropertyValue | null)[]) => SubmittableExtrinsic<ApiType>>;
+      createClass: AugmentedSubmittable<(name: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, classPermissions: ClassPermissionsType | null) => SubmittableExtrinsic<ApiType>>;
       createClassWithDefaultPermissions: AugmentedSubmittable<(name: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Creates a new entity of type class_id. The maintainer is set to be either None if the origin is root, or the provided credential
@@ -1331,10 +1561,10 @@ declare module '@polkadot/api/types/submittable' {
       setClassAdmins: AugmentedSubmittable<(classId: ClassId | AnyNumber | Uint8Array, admins: CredentialSet) => SubmittableExtrinsic<ApiType>>;
       setClassCreateEntitiesSet: AugmentedSubmittable<(withCredential: Option<Credential> | null | object | string | Uint8Array, classId: ClassId | AnyNumber | Uint8Array, credentialSet: CredentialSet) => SubmittableExtrinsic<ApiType>>;
       setClassEntitiesCanBeCreated: AugmentedSubmittable<(withCredential: Option<Credential> | null | object | string | Uint8Array, classId: ClassId | AnyNumber | Uint8Array, canBeCreated: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>>;
-      setClassEntityPermissions: AugmentedSubmittable<(withCredential: Option<Credential> | null | object | string | Uint8Array, classId: ClassId | AnyNumber | Uint8Array, entityPermissions: EntityPermissions | { update?: any; maintainer_has_all_permissions?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
-      setClassReferenceConstraint: AugmentedSubmittable<(withCredential: Option<Credential> | null | object | string | Uint8Array, classId: ClassId | AnyNumber | Uint8Array, constraint: ReferenceConstraint | { NoReferencingAllowed: any } | { NoConstraint: any } | { Restricted: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
-      transaction: AugmentedSubmittable<(operations: Vec<Operation> | (Operation | { with_credential?: any; as_entity_maintainer?: any; operation_type?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
-      updateEntityPropertyValues: AugmentedSubmittable<(withCredential: Option<Credential> | null | object | string | Uint8Array, asEntityMaintainer: bool | boolean | Uint8Array, entityId: EntityId | AnyNumber | Uint8Array, propertyValues: Vec<ClassPropertyValue> | (ClassPropertyValue | { in_class_index?: any; value?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
+      setClassEntityPermissions: AugmentedSubmittable<(withCredential: Option<Credential> | null | object | string | Uint8Array, classId: ClassId | AnyNumber | Uint8Array, entityPermissions: EntityPermissions | { controller?: any; frozen?: any; referenceable?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      setClassReferenceConstraint: AugmentedSubmittable<(withCredential: Option<Credential> | null | object | string | Uint8Array, classId: ClassId | AnyNumber | Uint8Array, constraint: ReferenceConstraint | null) => SubmittableExtrinsic<ApiType>>;
+      transaction: AugmentedSubmittable<(operations: Vec<Operation> | (Operation | null)[]) => SubmittableExtrinsic<ApiType>>;
+      updateEntityPropertyValues: AugmentedSubmittable<(withCredential: Option<Credential> | null | object | string | Uint8Array, asEntityMaintainer: bool | boolean | Uint8Array, entityId: EntityId | AnyNumber | Uint8Array, propertyValues: Vec<ClassPropertyValue> | (ClassPropertyValue | null)[]) => SubmittableExtrinsic<ApiType>>;
     };
   }
 

File diff suppressed because it is too large
+ 0 - 0
types/augment/augment-types.ts


+ 29 - 2
types/src/common.ts

@@ -1,6 +1,7 @@
-import { Struct, Option, Text, bool, Vec, u16, u32, u64, Null } from '@polkadot/types'
-import { BlockNumber, Moment } from '@polkadot/types/interfaces'
+import { Struct, Option, Text, bool, Vec, u16, u32, u64, Null, U8aFixed, BTreeSet, Compact } from '@polkadot/types'
+import { BlockNumber, H256, Moment } from '@polkadot/types/interfaces'
 import { Codec, RegistryTypes } from '@polkadot/types/types'
+import { u8aConcat, u8aToHex } from '@polkadot/util'
 // we get 'moment' because it is a dependency of @polkadot/util, via @polkadot/keyring
 import moment from 'moment'
 import { JoyStructCustom, JoyStructDecorated } from './JoyStruct'
@@ -8,6 +9,30 @@ import { JoyEnum } from './JoyEnum'
 
 export { JoyEnum, JoyStructCustom, JoyStructDecorated }
 
+// Adds ".sort()" during BTreeSet toU8a encoding (required by the runtime)
+// FIXME: Will not cover cases where BTreeSet is part of extrinsic args metadata
+export class JoyBTreeSet<V extends Codec> extends BTreeSet<V> {
+  public toU8a(isBare?: boolean): Uint8Array {
+    const encoded = new Array<Uint8Array>()
+
+    if (!isBare) {
+      encoded.push(Compact.encodeU8a(this.size))
+    }
+
+    Array.from(this)
+      .sort()
+      .forEach((v: V) => {
+        encoded.push(v.toU8a(isBare))
+      })
+
+    return u8aConcat(...encoded)
+  }
+
+  public toHex(): string {
+    return u8aToHex(this.toU8a())
+  }
+}
+
 export class Credential extends u64 {}
 export class CredentialSet extends Vec.with(Credential) {} // BtreeSet ?
 
@@ -15,6 +40,8 @@ export class CredentialSet extends Vec.with(Credential) {} // BtreeSet ?
 export class ThreadId extends u64 {}
 export class PostId extends u64 {}
 
+export class Hash extends U8aFixed implements H256 {}
+
 export type BlockAndTimeType = {
   block: BlockNumber
   time: Moment

+ 297 - 0
types/src/content-directory/index.ts

@@ -0,0 +1,297 @@
+import { BTreeMap, Option, Tuple, Text, Vec } from '@polkadot/types'
+import { bool, u64, u32, u16, i16, i32, i64, Null } from '@polkadot/types/primitive'
+import { MemberId } from '../members'
+import { JoyStructDecorated, JoyEnum, Hash, JoyBTreeSet } from '../common'
+
+export class Nonce extends u64 {}
+export class EntityId extends u64 {}
+export class ClassId extends u64 {}
+export class CuratorId extends u64 {}
+export class CuratorGroupId extends u64 {}
+export class VecMaxLength extends u16 {}
+export class TextMaxLength extends u16 {}
+export class HashedTextMaxLength extends Option.with(u16) {}
+export class PropertyId extends u16 {}
+export class SchemaId extends u16 {}
+export class SameController extends bool {}
+
+export class ClassPermissions extends JoyStructDecorated({
+  any_member: bool,
+  entity_creation_blocked: bool,
+  all_entity_property_values_locked: bool,
+  maintainers: JoyBTreeSet.with(CuratorGroupId),
+}) {}
+
+// Named just "Type" in the runtime, but this name conflicts with @polkadot/types/primitive/Type.ts
+export class SinglePropertyType extends JoyEnum({
+  Bool: Null,
+  Uint16: Null,
+  Uint32: Null,
+  Uint64: Null,
+  Int16: Null,
+  Int32: Null,
+  Int64: Null,
+  Text: TextMaxLength,
+  Hash: HashedTextMaxLength,
+  Reference: Tuple.with([ClassId, SameController]),
+}) {}
+
+export class VecPropertyType extends JoyStructDecorated({
+  vec_type: SinglePropertyType,
+  max_length: VecMaxLength,
+}) {}
+
+export class PropertyType extends JoyEnum({
+  Single: SinglePropertyType,
+  Vector: VecPropertyType,
+}) {}
+
+export class PropertyLockingPolicy extends JoyStructDecorated({
+  is_locked_from_maintainer: bool,
+  is_locked_from_controller: bool,
+}) {}
+
+export class Property extends JoyStructDecorated({
+  property_type: PropertyType,
+  required: bool,
+  unique: bool,
+  name: Text,
+  description: Text,
+  locking_policy: PropertyLockingPolicy,
+}) {}
+
+export class Schema extends JoyStructDecorated({
+  properties: JoyBTreeSet.with(PropertyId),
+  is_active: bool,
+}) {}
+
+export class Class extends JoyStructDecorated({
+  class_permissions: ClassPermissions,
+  properties: Vec.with(Property),
+  schemas: Vec.with(Schema),
+  name: Text,
+  description: Text,
+  maximum_entities_count: EntityId,
+  current_number_of_entities: EntityId,
+  default_entity_creation_voucher_upper_bound: EntityId,
+}) {}
+
+export class EntityController extends JoyEnum({
+  Maintainers: Null,
+  Member: MemberId,
+  Lead: Null,
+}) {}
+
+export class EntityPermissions extends JoyStructDecorated({
+  controller: EntityController,
+  frozen: bool,
+  referenceable: bool,
+}) {}
+
+export class StoredValue extends JoyEnum({
+  Bool: bool,
+  Uint16: u16,
+  Uint32: u32,
+  Uint64: u64,
+  Int16: i16,
+  Int32: i32,
+  Int64: i64,
+  Text: Text,
+  Hash: Hash,
+  Reference: EntityId,
+}) {}
+
+export class VecStoredValue extends JoyEnum({
+  Bool: Vec.with(bool),
+  Uint16: Vec.with(u16),
+  Uint32: Vec.with(u32),
+  Uint64: Vec.with(u64),
+  Int16: Vec.with(i16),
+  Int32: Vec.with(i32),
+  Int64: Vec.with(i64),
+  Hash: Vec.with(Hash),
+  Text: Vec.with(Text),
+  Reference: Vec.with(EntityId),
+}) {}
+
+export class VecStoredPropertyValue extends JoyStructDecorated({
+  vec_value: VecStoredValue,
+  nonce: Nonce,
+}) {}
+
+export class StoredPropertyValue extends JoyEnum({
+  Single: StoredValue,
+  Vector: VecStoredPropertyValue,
+}) {}
+
+export class InboundReferenceCounter extends JoyStructDecorated({
+  total: u32,
+  same_owner: u32,
+}) {}
+
+export class Entity extends JoyStructDecorated({
+  entity_permissions: EntityPermissions,
+  class_id: ClassId,
+  supported_schemas: JoyBTreeSet.with(SchemaId),
+  values: BTreeMap.with(PropertyId, StoredPropertyValue),
+  reference_counter: InboundReferenceCounter,
+}) {}
+
+export class CuratorGroup extends JoyStructDecorated({
+  curators: JoyBTreeSet.with(CuratorId),
+  active: bool,
+  number_of_classes_maintained: u32,
+}) {}
+
+export class EntityCreationVoucher extends JoyStructDecorated({
+  maximum_entities_count: EntityId,
+  entities_created: EntityId,
+}) {}
+
+export class Actor extends JoyEnum({
+  Curator: Tuple.with([CuratorGroupId, CuratorId]),
+  Member: MemberId,
+  Lead: Null,
+}) {}
+
+export class EntityReferenceCounterSideEffect extends JoyStructDecorated({
+  /// Delta number of all inbound references from another entities
+  total: i32,
+  /// Delta number of inbound references from another entities with `SameOwner` flag set
+  same_owner: i32,
+}) {}
+
+export class ReferenceCounterSideEffects extends BTreeMap.with(EntityId, EntityReferenceCounterSideEffect) {}
+
+export class SideEffects extends Option.with(ReferenceCounterSideEffects) {}
+export class SideEffect extends Option.with(Tuple.with([EntityId, EntityReferenceCounterSideEffect])) {}
+export class Status extends bool {}
+
+export class InputValue extends JoyEnum({
+  Bool: bool,
+  Uint16: u16,
+  Uint32: u32,
+  Uint64: u64,
+  Int16: i16,
+  Int32: i32,
+  Int64: i64,
+  Text: Text,
+  // Used to pass text value, which respective hash should be stored
+  TextToHash: Text,
+  Reference: EntityId,
+}) {}
+
+export class VecInputValue extends JoyEnum({
+  Bool: Vec.with(bool),
+  Uint16: Vec.with(u16),
+  Uint32: Vec.with(u32),
+  Uint64: Vec.with(u64),
+  Int16: Vec.with(i16),
+  Int32: Vec.with(i32),
+  Int64: Vec.with(i64),
+  TextToHash: Vec.with(Text),
+  Text: Vec.with(Text),
+  Reference: Vec.with(EntityId),
+}) {}
+
+export class InputPropertyValue extends JoyEnum({
+  Single: InputValue,
+  Vector: VecInputValue,
+}) {}
+
+export class ParameterizedEntity extends JoyEnum({
+  InternalEntityJustAdded: u32,
+  ExistingEntity: EntityId,
+}) {}
+
+export class ParametrizedPropertyValue extends JoyEnum({
+  InputPropertyValue: InputPropertyValue,
+  InternalEntityJustAdded: u32,
+  InternalEntityVec: Vec.with(ParameterizedEntity),
+}) {}
+
+export class ParametrizedClassPropertyValue extends JoyStructDecorated({
+  in_class_index: PropertyId,
+  value: ParametrizedPropertyValue,
+}) {}
+
+export class CreateEntityOperation extends JoyStructDecorated({
+  class_id: ClassId,
+}) {}
+
+export class UpdatePropertyValuesOperation extends JoyStructDecorated({
+  entity_id: ParameterizedEntity,
+  new_parametrized_property_values: Vec.with(ParametrizedClassPropertyValue),
+}) {}
+
+export class AddSchemaSupportToEntityOperation extends JoyStructDecorated({
+  entity_id: ParameterizedEntity,
+  schema_id: SchemaId,
+  parametrized_property_values: Vec.with(ParametrizedClassPropertyValue),
+}) {}
+
+export class OperationType extends JoyEnum({
+  CreateEntity: CreateEntityOperation,
+  UpdatePropertyValues: UpdatePropertyValuesOperation,
+  AddSchemaSupportToEntity: AddSchemaSupportToEntityOperation,
+}) {}
+
+// Versioned store relicts - to be removed:
+export class ClassPermissionsType extends Null {}
+export class ClassPropertyValue extends Null {}
+export class Operation extends Null {}
+export class ReferenceConstraint extends Null {}
+
+export const contentDirectoryTypes = {
+  Nonce,
+  EntityId,
+  ClassId,
+  CuratorGroupId,
+  VecMaxLength,
+  TextMaxLength,
+  HashedTextMaxLength,
+  PropertyId,
+  SchemaId,
+  SameController,
+  ClassPermissions,
+  SinglePropertyType,
+  VecPropertyType,
+  PropertyType,
+  PropertyLockingPolicy,
+  Property,
+  Schema,
+  Class,
+  EntityController,
+  EntityPermissions,
+  StoredValue,
+  VecStoredValue,
+  VecStoredPropertyValue,
+  StoredPropertyValue,
+  InboundReferenceCounter,
+  Entity,
+  CuratorGroup,
+  EntityCreationVoucher,
+  Actor,
+  EntityReferenceCounterSideEffect,
+  ReferenceCounterSideEffects,
+  SideEffects,
+  SideEffect,
+  Status,
+  InputValue,
+  VecInputValue,
+  InputPropertyValue,
+  ParameterizedEntity,
+  ParametrizedPropertyValue,
+  ParametrizedClassPropertyValue,
+  CreateEntityOperation,
+  UpdatePropertyValuesOperation,
+  AddSchemaSupportToEntityOperation,
+  OperationType,
+  // Versioned store relicts - to be removed:
+  ClassPermissionsType,
+  ClassPropertyValue,
+  Operation,
+  ReferenceConstraint,
+}
+
+export default contentDirectoryTypes

+ 4 - 5
types/src/content-working-group/index.ts

@@ -1,6 +1,6 @@
-import { BTreeMap, BTreeSet, bool, u32, Text, Null, Option, Vec } from '@polkadot/types'
+import { BTreeMap, bool, u32, Text, Null, Option, Vec } from '@polkadot/types'
 import { BlockNumber } from '@polkadot/types/interfaces'
-import { OptionText, Credential, JoyEnum, JoyStructDecorated, SlashingTerms } from '../common'
+import { OptionText, Credential, JoyEnum, JoyStructDecorated, SlashingTerms, JoyBTreeSet } from '../common'
 import { ActorId, MemberId } from '../members'
 import { StakeId } from '../stake'
 import { OpeningId, ApplicationId, ApplicationRationingPolicy, StakingPolicy } from '../hiring/index'
@@ -235,16 +235,15 @@ export class OpeningPolicyCommitment
   })
   implements IOpeningPolicyCommitment {}
 
-// Not entierly sure that using BTreeSet will work correctly when reading/decoding this type from chain state
 export type ICuratorOpening = {
   opening_id: OpeningId
-  curator_applications: BTreeSet<CuratorApplicationId>
+  curator_applications: JoyBTreeSet<CuratorApplicationId>
   policy_commitment: OpeningPolicyCommitment
 }
 export class CuratorOpening
   extends JoyStructDecorated({
     opening_id: OpeningId,
-    curator_applications: BTreeSet.with(CuratorApplicationId),
+    curator_applications: JoyBTreeSet.with(CuratorApplicationId),
     policy_commitment: OpeningPolicyCommitment,
   })
   implements ICuratorOpening {

+ 4 - 3
types/src/council/index.ts

@@ -1,11 +1,12 @@
-import { Option, U8aFixed } from '@polkadot/types/codec'
+import { Option } from '@polkadot/types/codec'
 import { Vec } from '@polkadot/types'
-import { BlockNumber, Balance, Hash } from '@polkadot/types/interfaces'
+import { BlockNumber, Balance } from '@polkadot/types/interfaces'
 import { u32, u128 } from '@polkadot/types/primitive'
 import { RegistryTypes } from '@polkadot/types/types'
 import { JoyStructDecorated } from '../JoyStruct'
 import { JoyEnum } from '../JoyEnum'
 import AccountId from '@polkadot/types/generic/AccountId'
+import { Hash } from '../common'
 
 export type ITransferableStake = {
   seat: Balance
@@ -52,7 +53,7 @@ export type ISealedVote = {
 export class SealedVote
   extends JoyStructDecorated({
     voter: AccountId,
-    commitment: U8aFixed, // Hash
+    commitment: Hash,
     stake: ElectionStake,
     vote: Option.with(AccountId),
   })

+ 3 - 4
types/src/hiring/index.ts

@@ -1,7 +1,6 @@
 import { Null, u128, u64, u32, Option, Text } from '@polkadot/types'
-import { BTreeSet } from '@polkadot/types/codec'
 import { BlockNumber, Balance } from '@polkadot/types/interfaces'
-import { JoyEnum, JoyStructDecorated } from '../common'
+import { JoyBTreeSet, JoyEnum, JoyStructDecorated } from '../common'
 import { StakeId } from '../stake'
 
 import { GenericJoyStreamRoleSchema } from './schemas/role.schema.typings'
@@ -167,14 +166,14 @@ export class ActiveOpeningStage extends JoyEnum(ActiveOpeningStageDef) {}
 
 export type ActiveOpeningStageVariantType = {
   stage: ActiveOpeningStage
-  applications_added: BTreeSet<ApplicationId>
+  applications_added: JoyBTreeSet<ApplicationId>
   active_application_count: u32
   unstaking_application_count: u32
   deactivated_application_count: u32
 }
 export class ActiveOpeningStageVariant extends JoyStructDecorated({
   stage: ActiveOpeningStage,
-  applications_added: BTreeSet.with(ApplicationId),
+  applications_added: JoyBTreeSet.with(ApplicationId),
   active_application_count: u32,
   unstaking_application_count: u32,
   deactivated_application_count: u32,

+ 3 - 6
types/src/index.ts

@@ -8,13 +8,12 @@ import stake from './stake'
 import mint from './mint'
 import recurringRewards from './recurring-rewards'
 import hiring from './hiring'
-import versionedStore from './versioned-store'
-import versionedStorePermissions from './versioned-store/permissions'
 import contentWorkingGroup from './content-working-group'
 import workingGroup from './working-group'
 import discovery from './discovery'
 import media from './media'
 import proposals from './proposals'
+import contentDirectory from './content-directory'
 import { InterfaceTypes } from '@polkadot/types/types/registry'
 import { TypeRegistry } from '@polkadot/types'
 
@@ -28,13 +27,12 @@ export {
   mint,
   recurringRewards,
   hiring,
-  versionedStore,
-  versionedStorePermissions,
   contentWorkingGroup,
   workingGroup,
   discovery,
   media,
   proposals,
+  contentDirectory,
 }
 
 export const types: RegistryTypes = {
@@ -48,13 +46,12 @@ export const types: RegistryTypes = {
   ...mint,
   ...recurringRewards,
   ...hiring,
-  ...versionedStore,
-  ...versionedStorePermissions,
   ...contentWorkingGroup,
   ...workingGroup,
   ...discovery,
   ...media,
   ...proposals,
+  ...contentDirectory,
   // Required since migration to Substrate 2.0,
   // see: https://polkadot.js.org/api/start/FAQ.html#the-node-returns-a-could-not-convert-error-on-send
   Address: 'AccountId',

+ 2 - 4
types/src/media.ts

@@ -1,14 +1,12 @@
 import { Option, Vec as Vector, BTreeMap, u64, bool, Text, Null } from '@polkadot/types'
-import { U8aFixed } from '@polkadot/types/codec'
-import { H256 } from '@polkadot/types/interfaces'
-import { BlockAndTime, JoyEnum, JoyStructDecorated } from './common'
+import { BlockAndTime, JoyEnum, JoyStructDecorated, Hash } from './common'
 import { MemberId } from './members'
 import { StorageProviderId } from './working-group' // this should be in discovery really
 import { randomAsU8a } from '@polkadot/util-crypto'
 import { encodeAddress, decodeAddress } from '@polkadot/keyring'
 import { RegistryTypes, Registry } from '@polkadot/types/types'
 
-export class ContentId extends U8aFixed implements H256 {
+export class ContentId extends Hash {
   static generate(registry: Registry): ContentId {
     // randomAsU8a uses https://www.npmjs.com/package/tweetnacl#random-bytes-generation
     return new ContentId(registry, randomAsU8a())

+ 2 - 4
types/src/scripts/generateCodecDefs.ts

@@ -10,13 +10,12 @@ import stake from '../stake'
 import mint from '../mint'
 import recurringRewards from '../recurring-rewards'
 import hiring from '../hiring'
-import versionedStore from '../versioned-store'
-import versionedStorePermissions from '../versioned-store/permissions'
 import contentWorkingGroup from '../content-working-group'
 import workingGroup from '../working-group'
 import discovery from '../discovery'
 import media from '../media'
 import proposals from '../proposals'
+import contentDirectory from '../content-directory'
 import fs from 'fs'
 import path from 'path'
 import * as defaultDefinitions from '@polkadot/types/interfaces/definitions'
@@ -35,13 +34,12 @@ const typesByModule = {
   'mint': mint,
   'recurring-rewards': recurringRewards,
   'hiring': hiring,
-  'versioned-store': versionedStore,
-  'versioned-store/permissions': versionedStorePermissions,
   'content-working-group': contentWorkingGroup,
   'working-group': workingGroup,
   'discovery': discovery,
   'media': media,
   'proposals': proposals,
+  'content-directory': contentDirectory,
 }
 
 type Imports = { [moduleName: string]: string[] }

+ 2 - 0
types/src/scripts/generateRegistryJson.ts

@@ -13,6 +13,8 @@ function normalizeDef(registry: Registry, defOrConstructor: any, typeName: strin
   if (typeof defOrConstructor === 'string') {
     // Replace unhandled BTreeSet with Vec
     defOrConstructor = defOrConstructor.replace('BTreeSet<', 'Vec<')
+    // Workaround for "Unhandled type VecFixed"
+    defOrConstructor = defOrConstructor.replace('[u8;32]', 'Hash')
     return defOrConstructor
   } else if (typeof defOrConstructor === 'function') {
     const defString = new (defOrConstructor as Constructor<Codec>)(registry).toRawType().toString()

+ 0 - 3
types/src/versioned-store/ClassId.ts

@@ -1,3 +0,0 @@
-import { u64 } from '@polkadot/types'
-
-export default class ClassId extends u64 {}

+ 0 - 292
types/src/versioned-store/EntityCodec.ts

@@ -1,292 +0,0 @@
-import BN from 'bn.js'
-import { Text, bool, Vec } from '@polkadot/types'
-import { Codec, Registry } from '@polkadot/types/types'
-import { Class, Entity, VecClassPropertyValue, ClassPropertyValue, EntityId, ClassId, unifyPropName } from '.'
-import * as PV from './PropertyValue'
-import { PropertyValue } from './PropertyValue'
-import { PropertyTypeKeys } from './PropertyType'
-import ChannelId from '../content-working-group/ChannelId'
-
-/**
- * Convert a Substrate value to a plain JavaScript value of a corresponding type
- * like string, number, boolean, etc.
- */
-function substrateToPlain<T>(x: Codec): T | undefined {
-  let res: any
-
-  if (x instanceof PV.None) {
-    res = undefined
-  } else if (x instanceof Text) {
-    res = (x as Text).toString()
-  } else if (x instanceof BN) {
-    res = (x as BN).toNumber()
-  } else if (x instanceof bool) {
-    res = (x as bool).valueOf()
-  } else if (x instanceof Vec) {
-    res = x.map((y) => substrateToPlain(y))
-  } else if (typeof x !== 'undefined' && x !== null) {
-    res = x.toString()
-  }
-
-  return res
-}
-
-/**
- * Convert a plain JavaScript value of such type as string, number, boolean
- * to Substrate equivalent in Versioned Store module.
- *
- * Based on code of transformPropertyValue from another Joystream repo:
- * /versioned-store-js/src/transformPropertyValue.ts
- *
- * @throws Error
- */
-function plainToSubstrate(registry: Registry, propType: string, value: any): PropertyValue {
-  const ok = (typeEnum: PV.PropertyValueEnum) => {
-    return new PropertyValue(registry, { [propType]: typeEnum }) // FIXME: createType?
-  }
-
-  const valueAsBool = (): boolean => {
-    if (typeof value === 'string' || typeof value === 'number') {
-      value = value.toString().toLowerCase()
-      if (['true', 'yes', '1'].indexOf(value) >= 0) {
-        return true
-      }
-      return false
-    } else if (typeof value === 'boolean') {
-      return value
-    } else {
-      throw new Error('Unsupported representation of a boolean value: ' + value)
-    }
-  }
-
-  const valueAsArr = (): any[] => {
-    if (Array.isArray(value)) {
-      return value as any[]
-    }
-
-    // The next line was: "return typeof value === undefined ? [] : [ value ]" before
-    // This condition was never met (spotted by linter), because "typeof value" can be 'undefined'
-    // (a string), but not actually undefined. Changing it to 'undefined' would change this function's behavior though
-    // and that may lead to unexpected consequences.
-    return [value]
-  }
-
-  const valueAsBoolArr = (): boolean[] => {
-    return valueAsArr().map(valueAsBool)
-  }
-
-  const valueAsStrArr = (): string[] => {
-    return valueAsArr() as string[]
-  }
-
-  // FIXME: use createType?
-  switch (propType) {
-    // Primitives:
-    case 'None':
-      return ok(new PV.None(registry))
-    case 'Bool':
-      return ok(new PV.Bool(registry, valueAsBool()))
-    case 'Uint16':
-      return ok(new PV.Uint16(registry, value as string))
-    case 'Uint32':
-      return ok(new PV.Uint32(registry, value as string))
-    case 'Uint64':
-      return ok(new PV.Uint64(registry, value as string))
-    case 'Int16':
-      return ok(new PV.Int16(registry, value as string))
-    case 'Int32':
-      return ok(new PV.Int32(registry, value as string))
-    case 'Int64':
-      return ok(new PV.Int64(registry, value as string))
-    case 'Text':
-      return ok(new PV.Text(registry, value as string))
-    case 'Internal':
-      return ok(new PV.Internal(registry, value as string))
-    // Vectors:
-    case 'BoolVec':
-      return ok(new PV.BoolVec(registry, valueAsBoolArr()))
-    case 'Uint16Vec':
-      return ok(new PV.Uint16Vec(registry, valueAsStrArr()))
-    case 'Uint32Vec':
-      return ok(new PV.Uint32Vec(registry, valueAsStrArr()))
-    case 'Uint64Vec':
-      return ok(new PV.Uint64Vec(registry, valueAsStrArr()))
-    case 'Int16Vec':
-      return ok(new PV.Int16Vec(registry, valueAsStrArr()))
-    case 'Int32Vec':
-      return ok(new PV.Int32Vec(registry, valueAsStrArr()))
-    case 'Int64Vec':
-      return ok(new PV.Int64Vec(registry, valueAsStrArr()))
-    case 'TextVec':
-      return ok(new PV.TextVec(registry, valueAsStrArr()))
-    case 'InternalVec':
-      return ok(new PV.InternalVec(registry, valueAsArr()))
-    default: {
-      throw new Error(`Unknown property type name: ${propType}`)
-    }
-  }
-}
-
-interface HasTypeField {
-  type: string
-}
-
-export function isInternalProp(field: HasTypeField): boolean {
-  return field.type === 'Internal'
-}
-
-export function isInternalVecProp(field: HasTypeField): boolean {
-  return field.type === 'InternalVec'
-}
-
-type PropMeta = {
-  index: number
-  type: string
-}
-
-export type PlainEntity = {
-  // Fields common for every entity class:
-  classId: number
-  inClassSchemaIndexes: number[]
-  id: number
-
-  // Unique fields per entity class:
-  [propName: string]: any
-}
-
-export type TextValueEntity = PlainEntity & {
-  value: string
-}
-
-// TODO delete this hack once EntityCodec extracted from types to media app
-type EntityType = any
-type ChannelEntity = any
-
-export interface ToPlainObjectProps {
-  loadInternals?: boolean
-  loadEntityById?: (id: EntityId) => Promise<EntityType | undefined>
-  loadChannelById?: (id: ChannelId) => Promise<ChannelEntity | undefined>
-}
-
-export abstract class EntityCodec<T extends PlainEntity> {
-  private propNameToMetaMap: Map<string, PropMeta> = new Map()
-  private propIndexToNameMap: Map<number, string> = new Map()
-  private registry: Registry
-
-  public constructor(entityClass: Class) {
-    this.registry = entityClass.registry
-    entityClass.properties.map((p, index) => {
-      const propName = unifyPropName(p.name.toString())
-      const propMeta = { index, type: p.prop_type.type.toString() }
-      this.propNameToMetaMap.set(propName, propMeta)
-      this.propIndexToNameMap.set(index, propName)
-    })
-  }
-
-  inClassIndexOfProp(propName: string): number | undefined {
-    return this.propNameToMetaMap.get(propName)?.index
-  }
-
-  /**
-   * Converts an entity of Substrate codec type to a plain JS object.
-   */
-  async toPlainObject(entity: Entity, props: ToPlainObjectProps = {}): Promise<T | undefined> {
-    const { loadInternals, loadEntityById, loadChannelById } = props || {}
-
-    const res: PlainEntity = {
-      classId: entity.class_id.toNumber(),
-      inClassSchemaIndexes: entity.in_class_schema_indexes.map((x) => x.toNumber()),
-      id: entity.id.toNumber(),
-    }
-
-    if (!entity.in_class_schema_indexes.toArray().length) {
-      throw new Error(`No schema support exists for entity! Entity id: ${res.id}`)
-    }
-
-    for (const v of entity.entity_values) {
-      const propIdx = v.in_class_index.toNumber()
-      const propName = this.propIndexToNameMap.get(propIdx)
-
-      if (propName) {
-        const propValue = v.value.value
-        let convertedValue: any
-
-        // Load a referred internal entity:
-        if (loadInternals) {
-          if (propValue instanceof PV.Internal && typeof loadEntityById === 'function') {
-            convertedValue = await loadEntityById(propValue as EntityId)
-          } else if (propName === 'channelId' && typeof loadChannelById === 'function') {
-            res.channel = await loadChannelById(propValue as ChannelId)
-          }
-        }
-
-        // Just convert a Substrate codec value to JS plain object:
-        if (!convertedValue) {
-          convertedValue = substrateToPlain(propValue)
-        }
-
-        res[propName] = convertedValue
-      }
-    }
-
-    return res as T
-  }
-
-  /**
-   * Converts an object with updated property values to a Substrate vector
-   * that can be passed to the extrinsic `update_entity_property_values`
-   * of Substrate runtime module `substrate-versioned-store`.
-   */
-  toSubstrateUpdate(updatedProps: Partial<{ [propName: string]: any }>): VecClassPropertyValue {
-    // TODO check required fields! save prop metadata in constructor?
-
-    // console.log('propNameToMetaMap propNameToMetaMap', this.propNameToMetaMap)
-    // console.log('toSubstrateUpdate updatedProps', updatedProps)
-
-    const res = new VecClassPropertyValue(this.registry) // FIXME: createType?
-    Object.keys(updatedProps).map((propName) => {
-      const meta = this.propNameToMetaMap.get(propName)
-      if (meta) {
-        const propType = meta.type as PropertyTypeKeys
-        const plainValue = (updatedProps as any)[propName]
-
-        let codecValue: PropertyValue | undefined
-        try {
-          codecValue = plainToSubstrate(this.registry, propType, plainValue)
-        } catch (err) {
-          console.error(`Failed to convert plain value '${plainValue}' to Substrate codec. Error:`, err)
-        }
-
-        if (codecValue) {
-          res.push(
-            new ClassPropertyValue(
-              this.registry, // FIXME: createType?
-              {
-                in_class_index: this.registry.createType('u16', meta.index),
-                value: codecValue,
-              }
-            )
-          )
-        }
-      }
-    })
-    return res
-  }
-}
-
-/** This class is created just to satisfy TypeScript in some cases */
-export class AnyEntityCodec extends EntityCodec<any> {}
-
-export class EntityCodecResolver {
-  private codecByClassIdMap = new Map<string, AnyEntityCodec>()
-
-  constructor(classes: Class[]) {
-    classes.forEach((c) => {
-      this.codecByClassIdMap.set(c.id.toString(), new AnyEntityCodec(c))
-    })
-  }
-
-  getCodecByClassId<C extends EntityCodec<any>>(classId: ClassId): C | undefined {
-    return this.codecByClassIdMap.get(classId.toString()) as C
-  }
-}

+ 0 - 3
types/src/versioned-store/EntityId.ts

@@ -1,3 +0,0 @@
-import { u64 } from '@polkadot/types'
-
-export default class EntityId extends u64 {}

+ 0 - 55
types/src/versioned-store/PropertyType.ts

@@ -1,55 +0,0 @@
-import { u16, Null } from '@polkadot/types'
-import { Tuple } from '@polkadot/types/codec'
-import ClassId from './ClassId'
-import { JoyEnum } from '../common'
-
-export class None extends Null {}
-
-// Single values:
-export class Bool extends Null {}
-export class Uint16 extends Null {}
-export class Uint32 extends Null {}
-export class Uint64 extends Null {}
-export class Int16 extends Null {}
-export class Int32 extends Null {}
-export class Int64 extends Null {}
-export class Text extends u16 {}
-export class Internal extends ClassId {}
-// Vectors:
-export class BoolVec extends u16 {}
-export class Uint16Vec extends u16 {}
-export class Uint32Vec extends u16 {}
-export class Uint64Vec extends u16 {}
-export class Int16Vec extends u16 {}
-export class Int32Vec extends u16 {}
-export class Int64Vec extends u16 {}
-export class TextVec extends Tuple.with([u16, u16]) {} // [maxItems, maxTextLength]
-export class InternalVec extends Tuple.with([u16, ClassId]) {} // [maxItems, classId]
-
-export const PropertyTypeDef = {
-  None,
-  // Single values:
-  Bool,
-  Uint16,
-  Uint32,
-  Uint64,
-  Int16,
-  Int32,
-  Int64,
-  Text,
-  Internal,
-  // Vectors:
-  BoolVec,
-  Uint16Vec,
-  Uint32Vec,
-  Uint64Vec,
-  Int16Vec,
-  Int32Vec,
-  Int64Vec,
-  TextVec,
-  InternalVec,
-} as const
-export type PropertyTypeKeys = keyof typeof PropertyTypeDef
-export class PropertyType extends JoyEnum(PropertyTypeDef) {}
-
-export default PropertyType

+ 0 - 75
types/src/versioned-store/PropertyValue.ts

@@ -1,75 +0,0 @@
-import {
-  Vec as Vector,
-  Text as PolkaText,
-  bool as PolkaBool,
-  Null,
-  u16,
-  u32,
-  u64,
-  i16,
-  i32,
-  i64,
-} from '@polkadot/types'
-import EntityId from './EntityId'
-import { JoyEnum } from '../common'
-
-export class None extends Null {}
-
-// Single values:
-
-export class Bool extends PolkaBool {}
-export class Uint16 extends u16 {}
-export class Uint32 extends u32 {}
-export class Uint64 extends u64 {}
-export class Int16 extends i16 {}
-export class Int32 extends i32 {}
-export class Int64 extends i64 {}
-export class Text extends PolkaText {}
-export class Internal extends EntityId {}
-
-// Vectors:
-
-export class BoolVec extends Vector.with(PolkaBool) {}
-export class Uint16Vec extends Vector.with(u16) {}
-export class Uint32Vec extends Vector.with(u32) {}
-export class Uint64Vec extends Vector.with(u64) {}
-export class Int16Vec extends Vector.with(i16) {}
-export class Int32Vec extends Vector.with(i32) {}
-export class Int64Vec extends Vector.with(i64) {}
-
-export class TextVec extends Vector.with(PolkaText) {}
-export class InternalVec extends Vector.with(EntityId) {}
-
-export const PropertyValueDef = {
-  None,
-  // Single values:
-  Bool,
-  Uint16,
-  Uint32,
-  Uint64,
-  Int16,
-  Int32,
-  Int64,
-  Text,
-  Internal,
-  // Vectors:
-  BoolVec,
-  Uint16Vec,
-  Uint32Vec,
-  Uint64Vec,
-  Int16Vec,
-  Int32Vec,
-  Int64Vec,
-  TextVec,
-  InternalVec,
-} as const
-
-// FIXME: Fix naming conventions, or remove those later?
-export type PropertyValueEnum = InstanceType<typeof PropertyValueDef[keyof typeof PropertyValueDef]>
-export type PropertyValueEnumValue = {
-  [typeName: string]: PropertyValueEnum
-}
-
-export class PropertyValue extends JoyEnum(PropertyValueDef) {}
-
-export default PropertyValue

+ 0 - 170
types/src/versioned-store/index.ts

@@ -1,170 +0,0 @@
-import { u16, Text, bool as Bool } from '@polkadot/types'
-import { Vec as Vector } from '@polkadot/types/codec'
-import EntityId from './EntityId'
-import ClassId from './ClassId'
-import PropertyType from './PropertyType'
-import PropertyValue from './PropertyValue'
-import { camelCase, upperFirst } from 'lodash'
-import { RegistryTypes } from '@polkadot/types/types'
-import { JoyStructDecorated, JoyStructCustom } from '../common'
-
-export { ClassId, EntityId, PropertyType, PropertyValue }
-
-export type PropertyTsType = {
-  prop_type: PropertyType
-  required: Bool
-  name: Text
-  description: Text
-}
-
-export class Property extends JoyStructCustom({
-  prop_type: PropertyType,
-  required: Bool,
-  name: Text,
-  description: Text,
-})
-// FIXME: Make it JoyStructDecorated compatible
-{
-  get prop_type(): PropertyType {
-    return this.getField('prop_type')
-  }
-
-  get required(): boolean {
-    return this.getField('required').valueOf()
-  }
-
-  get name(): string {
-    return this.getString('name')
-  }
-
-  get description(): string {
-    return this.getString('description')
-  }
-}
-
-export class VecProperty extends Vector.with(Property) {}
-
-export class VecU16 extends Vector.with(u16) {}
-
-export type ClassSchemaType = {
-  properties: VecU16
-}
-
-export class ClassSchema
-  extends JoyStructDecorated({
-    properties: VecU16,
-  })
-  implements ClassSchemaType {}
-
-export class VecClassSchema extends Vector.with(ClassSchema) {}
-
-export type ClassPropertyValueType = {
-  in_class_index: u16
-  value: PropertyValue
-}
-
-export class ClassPropertyValue
-  extends JoyStructDecorated({
-    in_class_index: u16,
-    value: PropertyValue,
-  })
-  implements ClassPropertyValueType {}
-
-export class VecClassPropertyValue extends Vector.with(ClassPropertyValue) {}
-
-export type ClassType = {
-  id: ClassId
-  properties: VecProperty
-  schemas: VecClassSchema
-  name: Text
-  description: Text
-}
-
-export class Class extends JoyStructCustom({
-  id: ClassId,
-  properties: VecProperty,
-  schemas: VecClassSchema,
-  name: Text,
-  description: Text,
-})
-// FIXME: Make it JoyStructDecorated compatible
-{
-  get id(): ClassId {
-    return this.getField('id')
-  }
-
-  get properties(): VecProperty {
-    return this.getField('properties')
-  }
-
-  get schemas(): VecClassSchema {
-    return this.getField('schemas')
-  }
-
-  get name(): string {
-    return this.getString('name')
-  }
-
-  get description(): string {
-    return this.getString('description')
-  }
-}
-
-export type EntityType = {
-  id: EntityId
-  class_id: ClassId
-  in_class_schema_indexes: VecU16
-  values: VecClassPropertyValue
-}
-
-export class Entity extends JoyStructDecorated({
-  id: EntityId,
-  class_id: ClassId,
-  in_class_schema_indexes: VecU16,
-  values: VecClassPropertyValue,
-}) {
-  /** NOTE: Renamed to `entity_values` because `values` is already in use (Map's original method). */
-  get entity_values(): VecClassPropertyValue {
-    return this.getField('values')
-  }
-}
-
-export interface ClassIdByNameMap {
-  ContentLicense?: ClassId
-  CurationStatus?: ClassId
-  FeaturedContent?: ClassId
-  Language?: ClassId
-  MediaObject?: ClassId
-  MusicAlbum?: ClassId
-  MusicGenre?: ClassId
-  MusicMood?: ClassId
-  MusicTheme?: ClassId
-  MusicTrack?: ClassId
-  PublicationStatus?: ClassId
-  Video?: ClassId
-  VideoCategory?: ClassId
-}
-
-export type ClassName = keyof ClassIdByNameMap
-
-export function unifyClassName(className: string): ClassName {
-  return upperFirst(camelCase(className)) as ClassName
-}
-
-export function unifyPropName(propName: string): string {
-  return camelCase(propName)
-}
-
-export const versionedStoreTypes: RegistryTypes = {
-  ClassId,
-  EntityId,
-  Class,
-  Entity,
-  ClassSchema,
-  Property,
-  PropertyType,
-  PropertyValue,
-  ClassPropertyValue,
-}
-
-export default versionedStoreTypes

+ 0 - 27
types/src/versioned-store/permissions/ClassPermissions.ts

@@ -1,27 +0,0 @@
-import { u32, bool } from '@polkadot/types'
-import { BlockNumber } from '@polkadot/types/interfaces'
-import { CredentialSet, JoyStructDecorated } from '../../common'
-import EntityPermissions from './EntityPermissions'
-import { ReferenceConstraint } from './reference-constraint'
-
-type IClassPermissions = {
-  entity_permissions: EntityPermissions
-  entities_can_be_created: bool
-  add_schemas: CredentialSet
-  create_entities: CredentialSet
-  reference_constraint: ReferenceConstraint
-  admins: CredentialSet
-  last_permissions_update: BlockNumber
-}
-
-export default class ClassPermissionsType
-  extends JoyStructDecorated({
-    entity_permissions: EntityPermissions,
-    entities_can_be_created: bool,
-    add_schemas: CredentialSet,
-    create_entities: CredentialSet,
-    reference_constraint: ReferenceConstraint,
-    admins: CredentialSet,
-    last_permissions_update: u32, // BlockNumber,
-  })
-  implements IClassPermissions {}

+ 0 - 15
types/src/versioned-store/permissions/EntityPermissions.ts

@@ -1,15 +0,0 @@
-import { JoyStructDecorated } from '../../JoyStruct'
-import { bool } from '@polkadot/types'
-import { CredentialSet } from '../../common'
-
-type IEntityPermissions = {
-  update: CredentialSet
-  maintainer_has_all_permissions: bool
-}
-
-export default class EntityPermissions
-  extends JoyStructDecorated({
-    update: CredentialSet,
-    maintainer_has_all_permissions: bool,
-  })
-  implements IEntityPermissions {}

+ 0 - 15
types/src/versioned-store/permissions/PropertyOfClass.ts

@@ -1,15 +0,0 @@
-import { u16 } from '@polkadot/types'
-import ClassId from '../ClassId'
-import { JoyStructDecorated } from '../../common'
-
-type IPropertyOfClass = {
-  class_id: ClassId
-  property_index: u16
-}
-
-export default class PropertyOfClass
-  extends JoyStructDecorated({
-    class_id: ClassId,
-    property_index: u16,
-  })
-  implements IPropertyOfClass {}

+ 0 - 15
types/src/versioned-store/permissions/batching/ParametrizedClassPropertyValue.ts

@@ -1,15 +0,0 @@
-import { ParametrizedPropertyValue } from './parametrized-property-value'
-import { u16 } from '@polkadot/types'
-import { JoyStructDecorated } from '../../../common'
-
-type IParametrizedClassPropertyValue = {
-  in_class_index: u16
-  value: ParametrizedPropertyValue
-}
-
-export default class ParametrizedClassPropertyValue
-  extends JoyStructDecorated({
-    in_class_index: u16,
-    value: ParametrizedPropertyValue,
-  })
-  implements IParametrizedClassPropertyValue {}

+ 0 - 17
types/src/versioned-store/permissions/batching/index.ts

@@ -1,17 +0,0 @@
-import { Credential, JoyStructDecorated } from '../../../common'
-import { OperationType } from './operation-types'
-import { bool, Option } from '@polkadot/types'
-
-type IOperation = {
-  with_credential: Option<Credential>
-  as_entity_maintainer: bool
-  operation_type: OperationType
-}
-
-export class Operation
-  extends JoyStructDecorated({
-    with_credential: Option.with(Credential),
-    as_entity_maintainer: bool,
-    operation_type: OperationType,
-  })
-  implements IOperation {}

+ 0 - 55
types/src/versioned-store/permissions/batching/operation-types.ts

@@ -1,55 +0,0 @@
-import { u16 } from '@polkadot/types'
-import {
-  CreateEntityOperation,
-  UpdatePropertyValuesOperation,
-  AddSchemaSupportToEntityOperation,
-  ParameterizedClassPropertyValues,
-} from './operations'
-import ClassId from '../../ClassId'
-import { ParametrizedEntity } from './parametrized-entity'
-import { JoyEnum } from '../../../common'
-import { Registry } from '@polkadot/types/types'
-
-export class CreateEntity extends CreateEntityOperation {}
-export class UpdatePropertyValues extends UpdatePropertyValuesOperation {}
-export class AddSchemaSupportToEntity extends AddSchemaSupportToEntityOperation {}
-
-export const OperationTypeDef = {
-  CreateEntity,
-  UpdatePropertyValues,
-  AddSchemaSupportToEntity,
-} as const
-
-export class OperationType extends JoyEnum(OperationTypeDef) {
-  // TODO: Are those are worth preserving?
-  static CreateEntity(registry: Registry, class_id: ClassId): OperationType {
-    const value = new CreateEntity(registry, { class_id })
-    return new OperationType(registry, { CreateEntity: value })
-  }
-
-  static UpdatePropertyValues(
-    registry: Registry,
-    entity_id: ParametrizedEntity,
-    parametrized_property_values: ParameterizedClassPropertyValues
-  ): OperationType {
-    const value = new UpdatePropertyValues(registry, {
-      entity_id,
-      parametrized_property_values,
-    })
-    return new OperationType(registry, { UpdatePropertyValues: value })
-  }
-
-  static AddSchemaSupportToEntity(
-    registry: Registry,
-    entity_id: ParametrizedEntity,
-    schema_id: u16,
-    parametrized_property_values: ParameterizedClassPropertyValues
-  ): OperationType {
-    const value = new AddSchemaSupportToEntity(registry, {
-      entity_id,
-      schema_id,
-      parametrized_property_values,
-    })
-    return new OperationType(registry, { AddSchemaSupportToEntity: value })
-  }
-}

+ 0 - 49
types/src/versioned-store/permissions/batching/operations.ts

@@ -1,49 +0,0 @@
-import ClassId from '../../ClassId'
-import { ParametrizedEntity } from './parametrized-entity'
-import { Vec, u16 } from '@polkadot/types'
-import ParametrizedClassPropertyValue from './ParametrizedClassPropertyValue'
-import { JoyStructDecorated } from '../../../common'
-
-// TODO Rename to ParametrizedClassPropertyValue
-export class ParameterizedClassPropertyValues extends Vec.with(ParametrizedClassPropertyValue) {}
-
-export type ICreateEntityOperation = {
-  class_id: ClassId
-}
-
-export type IUpdatePropertyValuesOperation = {
-  entity_id: ParametrizedEntity
-  parametrized_property_values: ParameterizedClassPropertyValues
-}
-
-export type IAddSchemaSupportToEntityOperation = {
-  entity_id: ParametrizedEntity
-  schema_id: u16
-  parametrized_property_values: ParameterizedClassPropertyValues
-}
-
-export class CreateEntityOperation
-  extends JoyStructDecorated({
-    class_id: ClassId,
-  })
-  implements ICreateEntityOperation {}
-
-export class UpdatePropertyValuesOperation
-  extends JoyStructDecorated({
-    entity_id: ParametrizedEntity,
-    parametrized_property_values: ParameterizedClassPropertyValues,
-  })
-  implements IUpdatePropertyValuesOperation {}
-
-export class AddSchemaSupportToEntityOperation
-  extends JoyStructDecorated({
-    entity_id: ParametrizedEntity,
-    schema_id: u16,
-    parametrized_property_values: ParameterizedClassPropertyValues,
-  })
-  implements IAddSchemaSupportToEntityOperation {
-  // Additional helper
-  get property_values(): ParameterizedClassPropertyValues {
-    return this.parametrized_property_values
-  }
-}

+ 0 - 23
types/src/versioned-store/permissions/batching/parametrized-entity.ts

@@ -1,23 +0,0 @@
-import { u32 } from '@polkadot/types'
-import EntityId from '../../EntityId'
-import { Registry } from '@polkadot/types/types'
-import { JoyEnum } from '../../../common'
-
-export class InternalEntityJustAdded extends u32 {}
-export class ExistingEntity extends EntityId {}
-
-export const ParametrizedEntityDef = {
-  InternalEntityJustAdded,
-  ExistingEntity,
-} as const
-
-export class ParametrizedEntity extends JoyEnum(ParametrizedEntityDef) {
-  // TODO: Are those worth preserving?
-  static InternalEntityJustAdded(registry: Registry, index: u32): ParametrizedEntity {
-    return new ParametrizedEntity(registry, { InternalEntityJustAdded: new InternalEntityJustAdded(registry, index) })
-  }
-
-  static ExistingEntity(registry: Registry, entity_id: EntityId): ParametrizedEntity {
-    return new ParametrizedEntity(registry, { ExistingEntity: new ExistingEntity(registry, entity_id) })
-  }
-}

+ 0 - 33
types/src/versioned-store/permissions/batching/parametrized-property-value.ts

@@ -1,33 +0,0 @@
-import { u32, Vec } from '@polkadot/types'
-import { PropertyValue, PropertyValueEnumValue } from '../../PropertyValue'
-import { ParametrizedEntity } from './parametrized-entity'
-import { Registry } from '@polkadot/types/types'
-import { JoyEnum } from '../../../common'
-
-export class InternalEntityJustAdded extends u32 {}
-export class InternalEntityVec extends Vec.with(ParametrizedEntity) {}
-
-export const ParametrizedPropertyValueDef = {
-  PropertyValue,
-  InternalEntityJustAdded,
-  InternalEntityVec,
-} as const
-export class ParametrizedPropertyValue extends JoyEnum(ParametrizedPropertyValueDef) {
-  // TODO: Are those worth preserving?
-  static PropertyValue(registry: Registry, value: PropertyValueEnumValue): ParametrizedPropertyValue {
-    return new ParametrizedPropertyValue(registry, { PropertyValue: new PropertyValue(registry, value) })
-  }
-
-  static InternalEntityJustAdded(registry: Registry, index: number | u32): ParametrizedPropertyValue {
-    return new ParametrizedPropertyValue(registry, {
-      InternalEntityJustAdded: new InternalEntityJustAdded(registry, index),
-    })
-  }
-
-  static InternalEntityVec(
-    registry: Registry,
-    entities: ParametrizedEntity[] | Vec<ParametrizedEntity>
-  ): ParametrizedPropertyValue {
-    return new ParametrizedPropertyValue(registry, { InternalEntityVec: new InternalEntityVec(registry, entities) })
-  }
-}

+ 0 - 43
types/src/versioned-store/permissions/index.ts

@@ -1,43 +0,0 @@
-import EntityPermissions from './EntityPermissions'
-import { ReferenceConstraint } from './reference-constraint'
-import ClassPermissionsType from './ClassPermissions'
-import { Operation } from './batching/'
-import { OperationType, CreateEntity, UpdatePropertyValues, AddSchemaSupportToEntity } from './batching/operation-types'
-import { ParametrizedEntity } from './batching/parametrized-entity'
-import { RegistryTypes } from '@polkadot/types/types'
-import ParametrizedClassPropertyValue from './batching/ParametrizedClassPropertyValue'
-import { ParametrizedPropertyValue } from './batching/parametrized-property-value'
-import PropertyOfClass from './PropertyOfClass'
-
-export {
-  EntityPermissions,
-  ReferenceConstraint,
-  ClassPermissionsType,
-  Operation,
-  OperationType,
-  CreateEntity,
-  UpdatePropertyValues,
-  AddSchemaSupportToEntity,
-  ParametrizedEntity,
-  ParametrizedClassPropertyValue,
-  ParametrizedPropertyValue,
-  PropertyOfClass,
-}
-
-export const versionedStorePermissionsTypes: RegistryTypes = {
-  EntityPermissions,
-  ReferenceConstraint,
-  ClassPermissionsType,
-  Operation,
-  // Expose in registry for api.createType purposes:
-  OperationType,
-  CreateEntity,
-  UpdatePropertyValues,
-  AddSchemaSupportToEntity,
-  ParametrizedEntity,
-  ParametrizedClassPropertyValue,
-  ParametrizedPropertyValue,
-  PropertyOfClass,
-}
-
-export default versionedStorePermissionsTypes

+ 0 - 15
types/src/versioned-store/permissions/reference-constraint.ts

@@ -1,15 +0,0 @@
-import { Null, BTreeSet } from '@polkadot/types'
-import PropertyOfClass from './PropertyOfClass'
-import { JoyEnum } from '../../common'
-
-export class NoReferencingAllowed extends Null {}
-export class NoConstraint extends Null {}
-export class Restricted extends BTreeSet.with(PropertyOfClass) {}
-
-export const ReferenceConstraintDef = {
-  NoReferencingAllowed,
-  NoConstraint,
-  Restricted,
-} as const
-
-export class ReferenceConstraint extends JoyEnum(ReferenceConstraintDef) {}

+ 3 - 3
types/src/working-group/index.ts

@@ -6,7 +6,7 @@ import { MemberId, ActorId } from '../members'
 import { RewardRelationshipId } from '../recurring-rewards'
 import { StakeId } from '../stake'
 import { ApplicationId, OpeningId, ApplicationRationingPolicy, StakingPolicy } from '../hiring'
-import { JoyEnum, JoyStructDecorated, SlashingTerms } from '../common'
+import { JoyEnum, JoyStructDecorated, SlashingTerms, JoyBTreeSet } from '../common'
 import { RegistryTypes } from '@polkadot/types/types'
 
 export class RationaleText extends Bytes {}
@@ -34,7 +34,7 @@ export class WorkerId extends ActorId {}
 
 export class StorageProviderId extends WorkerId {}
 
-export class ApplicationIdSet extends BTreeSet.with(ApplicationId) {}
+export class ApplicationIdSet extends JoyBTreeSet.with(ApplicationId) {}
 
 export class ApplicationIdToWorkerIdMap extends BTreeMap.with(ApplicationId, WorkerId) {}
 
@@ -138,7 +138,7 @@ export type IOpening = {
 export class Opening
   extends JoyStructDecorated({
     hiring_opening_id: OpeningId,
-    applications: BTreeSet.with(ApplicationId),
+    applications: JoyBTreeSet.with(ApplicationId),
     policy_commitment: WorkingGroupOpeningPolicyCommitment,
     opening_type: OpeningType,
   })

Some files were not shown because too many files changed in this diff