Browse Source

content-directory: update types

Mokhtar Naamani 4 years ago
parent
commit
8a80f4e368

+ 3 - 2
runtime-modules/common/src/storage.rs

@@ -12,9 +12,10 @@ pub struct ContentParameters<ContentId, DataObjectTypeId> {
     pub ipfs_content_id: Vec<u8>,
 }
 
+// TODO Reuse enum in ../working_group.rs
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
 #[derive(Clone, Encode, Decode, PartialEq, Eq, Debug)]
-pub enum WorkinGroupType {
+pub enum WorkingGroupType {
     ContentDirectory,
     Builders,
     StorageProviders,
@@ -26,7 +27,7 @@ pub enum AbstractStorageObjectOwner<ChannelId, DAOId> {
     Channel(ChannelId), // acts through content directory module, where again DAOs can own channels for example
     DAO(DAOId),         // acts through upcoming `content_finance` module
     Council,            // acts through proposal system
-    WorkingGroup(WorkinGroupType), // acts through new extrinsic in working group
+    WorkingGroup(WorkingGroupType), // acts through new extrinsic in working group
 }
 
 // New owner type for storage object struct

+ 8 - 7
runtime-modules/content/src/lib.rs

@@ -194,7 +194,6 @@ pub struct ChannelUpdateParameters<ChannelCategoryId> {
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq)]
 pub struct VideoCategory {
-    meta: Vec<u8>,
     number_of_videos_in_category: u32,
 }
 
@@ -231,8 +230,8 @@ pub struct Video<ChannelId, SeriesId, PlaylistId> {
     // keep track of which seasons and playlists which reference the video
     // - prevent removing a video if it is in a season (because order is important)
     // - remove from playlist on deletion
-    in_series: Option<Vec<SeriesId>>,
-    in_playlists: Option<Vec<PlaylistId>>,
+    in_series: Vec<SeriesId>,
+    in_playlists: Vec<PlaylistId>,
 
     // Only curator can update..
     is_curated: bool,
@@ -310,7 +309,7 @@ pub struct SeriesCreationParameters<VideoCategoryId, VideoId> {
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq)]
 pub struct SeriesUpdateParameters<VideoCategoryId, VideoId> {
     seasons: Option<Vec<Option<SeasonUpdateParameters<VideoCategoryId, VideoId>>>>,
-    new_meta: Vec<u8>,
+    new_meta: Option<Vec<u8>>,
 }
 
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))]
@@ -332,10 +331,12 @@ pub enum PersonActor<MemberId, CuratorId> {
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))]
 #[derive(Encode, Decode, Clone, PartialEq, Eq)]
 pub enum PersonController<MemberId> {
-    Member(MemberId),
-    Curators,
     /// Do not use - Default value representing empty value
     Nobody,
+    /// Member controls the person
+    Member(MemberId),
+    /// Any curator controls the person
+    Curators,
 }
 
 impl<MemberId> Default for PersonController<MemberId> {
@@ -353,7 +354,7 @@ pub struct PersonCreationParameters {
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))]
 #[derive(Encode, Decode, Default, Clone, PartialEq, Eq)]
 pub struct PersonUpdateParameters {
-    new_meta: Option<Vec<u8>>,
+    new_meta: Vec<u8>,
 }
 
 #[cfg_attr(feature = "std", derive(Serialize, Deserialize, Debug))]

File diff suppressed because it is too large
+ 1 - 1
types/augment-codec/all.ts


+ 42 - 38
types/augment-codec/augment-api-consts.ts

@@ -7,15 +7,16 @@ import { Balance, BalanceOf, BlockNumber, Moment, Perbill, RuntimeDbWeight, Weig
 import { SessionIndex } from '@polkadot/types/interfaces/session';
 import { EraIndex } from '@polkadot/types/interfaces/staking';
 import { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
+import { ApiTypes } from '@polkadot/api/types';
 
-declare module '@polkadot/metadata/Decorated/consts/types' {
-  export interface Constants {
+declare module '@polkadot/api/types/consts' {
+  export interface AugmentedConsts<ApiType> {
     babe: {
       /**
        * The number of **slots** that an epoch takes. We couple sessions to
        * epochs, i.e. we start a new session once the new epoch begins.
        **/
-      epochDuration: AugmentedConst<u64>;
+      epochDuration: u64 & AugmentedConst<ApiType>;
       /**
        * The expected average block time at which BABE should be creating
        * blocks. Since BABE is probabilistic it is not trivial to figure out
@@ -23,97 +24,97 @@ declare module '@polkadot/metadata/Decorated/consts/types' {
        * duration and the security parameter `c` (where `1 - c` represents
        * the probability of a slot being empty).
        **/
-      expectedBlockTime: AugmentedConst<Moment>;
+      expectedBlockTime: Moment & AugmentedConst<ApiType>;
     };
     balances: {
       /**
        * The minimum amount required to keep an account open.
        **/
-      existentialDeposit: AugmentedConst<Balance>;
+      existentialDeposit: Balance & AugmentedConst<ApiType>;
     };
     content: {
       /**
        * Exports const -  max number of curators per group
        **/
-      maxNumberOfCuratorsPerGroup: AugmentedConst<MaxNumber>;
+      maxNumberOfCuratorsPerGroup: MaxNumber & AugmentedConst<ApiType>;
     };
     contentDirectoryWorkingGroup: {
       /**
        * Exports const -  max simultaneous active worker number.
        **/
-      maxWorkerNumberLimit: AugmentedConst<u32>;
+      maxWorkerNumberLimit: u32 & AugmentedConst<ApiType>;
     };
     dataDirectory: {
       /**
        * Maximum objects allowed per inject_data_objects() transaction
        **/
-      maxObjectsPerInjection: AugmentedConst<u32>;
+      maxObjectsPerInjection: u32 & AugmentedConst<ApiType>;
     };
     finalityTracker: {
       /**
        * The delay after which point things become suspicious. Default is 1000.
        **/
-      reportLatency: AugmentedConst<BlockNumber>;
+      reportLatency: BlockNumber & AugmentedConst<ApiType>;
       /**
        * The number of recent samples to keep from this chain. Default is 101.
        **/
-      windowSize: AugmentedConst<BlockNumber>;
+      windowSize: BlockNumber & AugmentedConst<ApiType>;
     };
     proposalsCodex: {
       /**
        * Exports max wasm code length of the runtime upgrade proposal const.
        **/
-      runtimeUpgradeWasmProposalMaxLength: AugmentedConst<u32>;
+      runtimeUpgradeWasmProposalMaxLength: u32 & AugmentedConst<ApiType>;
       /**
        * Exports max allowed text proposal length const.
        **/
-      textProposalMaxLength: AugmentedConst<u32>;
+      textProposalMaxLength: u32 & AugmentedConst<ApiType>;
     };
     proposalsDiscussion: {
       /**
        * Exports post edition number limit const.
        **/
-      maxPostEditionNumber: AugmentedConst<u32>;
+      maxPostEditionNumber: u32 & AugmentedConst<ApiType>;
       /**
        * Exports max thread by same author in a row number limit const.
        **/
-      maxThreadInARowNumber: AugmentedConst<u32>;
+      maxThreadInARowNumber: u32 & AugmentedConst<ApiType>;
       /**
        * Exports post length limit const.
        **/
-      postLengthLimit: AugmentedConst<u32>;
+      postLengthLimit: u32 & AugmentedConst<ApiType>;
       /**
        * Exports thread title length limit const.
        **/
-      threadTitleLengthLimit: AugmentedConst<u32>;
+      threadTitleLengthLimit: u32 & AugmentedConst<ApiType>;
     };
     proposalsEngine: {
       /**
        * Exports const - the fee is applied when cancel the proposal. A fee would be slashed (burned).
        **/
-      cancellationFee: AugmentedConst<BalanceOf>;
+      cancellationFee: BalanceOf & AugmentedConst<ApiType>;
       /**
        * Exports const -  max allowed proposal description length.
        **/
-      descriptionMaxLength: AugmentedConst<u32>;
+      descriptionMaxLength: u32 & AugmentedConst<ApiType>;
       /**
        * Exports const -  max simultaneous active proposals number.
        **/
-      maxActiveProposalLimit: AugmentedConst<u32>;
+      maxActiveProposalLimit: u32 & AugmentedConst<ApiType>;
       /**
        * Exports const -  the fee is applied when the proposal gets rejected. A fee would be slashed (burned).
        **/
-      rejectionFee: AugmentedConst<BalanceOf>;
+      rejectionFee: BalanceOf & AugmentedConst<ApiType>;
       /**
        * Exports const -  max allowed proposal title length.
        **/
-      titleMaxLength: AugmentedConst<u32>;
+      titleMaxLength: u32 & AugmentedConst<ApiType>;
     };
     staking: {
       /**
        * Number of eras that staked funds must remain bonded for.
        **/
-      bondingDuration: AugmentedConst<EraIndex>;
+      bondingDuration: EraIndex & AugmentedConst<ApiType>;
       /**
        * The number of blocks before the end of the era from which election submissions are allowed.
        * 
@@ -123,28 +124,28 @@ declare module '@polkadot/metadata/Decorated/consts/types' {
        * This is bounded by being within the last session. Hence, setting it to a value more than the
        * length of a session will be pointless.
        **/
-      electionLookahead: AugmentedConst<BlockNumber>;
+      electionLookahead: BlockNumber & AugmentedConst<ApiType>;
       /**
        * Maximum number of balancing iterations to run in the offchain submission.
        * 
        * If set to 0, balance_solution will not be executed at all.
        **/
-      maxIterations: AugmentedConst<u32>;
+      maxIterations: u32 & AugmentedConst<ApiType>;
       /**
        * The maximum number of nominators rewarded for each validator.
        * 
        * For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can claim
        * their reward. This used to limit the i/o cost for the nominator payout.
        **/
-      maxNominatorRewardedPerValidator: AugmentedConst<u32>;
+      maxNominatorRewardedPerValidator: u32 & AugmentedConst<ApiType>;
       /**
        * The threshold of improvement that should be provided for a new solution to be accepted.
        **/
-      minSolutionScoreBump: AugmentedConst<Perbill>;
+      minSolutionScoreBump: Perbill & AugmentedConst<ApiType>;
       /**
        * Number of sessions per era.
        **/
-      sessionsPerEra: AugmentedConst<SessionIndex>;
+      sessionsPerEra: SessionIndex & AugmentedConst<ApiType>;
       /**
        * Number of eras that slashes are deferred by, after computation.
        * 
@@ -152,39 +153,39 @@ declare module '@polkadot/metadata/Decorated/consts/types' {
        * Set to 0 if slashes should be applied immediately, without opportunity for
        * intervention.
        **/
-      slashDeferDuration: AugmentedConst<EraIndex>;
+      slashDeferDuration: EraIndex & AugmentedConst<ApiType>;
     };
     storageWorkingGroup: {
       /**
        * Exports const -  max simultaneous active worker number.
        **/
-      maxWorkerNumberLimit: AugmentedConst<u32>;
+      maxWorkerNumberLimit: u32 & AugmentedConst<ApiType>;
     };
     system: {
       /**
        * The base weight of executing a block, independent of the transactions in the block.
        **/
-      blockExecutionWeight: AugmentedConst<Weight>;
+      blockExecutionWeight: Weight & AugmentedConst<ApiType>;
       /**
        * The maximum number of blocks to allow in mortal eras.
        **/
-      blockHashCount: AugmentedConst<BlockNumber>;
+      blockHashCount: BlockNumber & AugmentedConst<ApiType>;
       /**
        * The weight of runtime database operations the runtime can invoke.
        **/
-      dbWeight: AugmentedConst<RuntimeDbWeight>;
+      dbWeight: RuntimeDbWeight & AugmentedConst<ApiType>;
       /**
        * The base weight of an Extrinsic in the block, independent of the of extrinsic being executed.
        **/
-      extrinsicBaseWeight: AugmentedConst<Weight>;
+      extrinsicBaseWeight: Weight & AugmentedConst<ApiType>;
       /**
        * The maximum length of a block (in bytes).
        **/
-      maximumBlockLength: AugmentedConst<u32>;
+      maximumBlockLength: u32 & AugmentedConst<ApiType>;
       /**
        * The maximum weight of a block.
        **/
-      maximumBlockWeight: AugmentedConst<Weight>;
+      maximumBlockWeight: Weight & AugmentedConst<ApiType>;
     };
     timestamp: {
       /**
@@ -193,17 +194,20 @@ declare module '@polkadot/metadata/Decorated/consts/types' {
        * work with this to determine a sensible block time. e.g. For Aura, it will be double this
        * period on default settings.
        **/
-      minimumPeriod: AugmentedConst<Moment>;
+      minimumPeriod: Moment & AugmentedConst<ApiType>;
     };
     transactionPayment: {
       /**
        * The fee to be paid for making a transaction; the per-byte portion.
        **/
-      transactionByteFee: AugmentedConst<BalanceOf>;
+      transactionByteFee: BalanceOf & AugmentedConst<ApiType>;
       /**
        * The polynomial that is applied in order to derive fee from weight.
        **/
-      weightToFee: AugmentedConst<Vec<WeightToFeeCoefficient>>;
+      weightToFee: Vec<WeightToFeeCoefficient> & AugmentedConst<ApiType>;
     };
   }
+
+  export interface QueryableConsts<ApiType extends ApiTypes> extends AugmentedConsts<ApiType> {
+  }
 }

+ 2 - 2
types/augment-codec/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, ChannelCategoryId, ChannelId, ContentId, CuratorGroup, CuratorGroupId, DataObject, DataObjectStorageRelationship, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DiscussionPost, DiscussionThread, ElectionStage, ElectionStake, HiringApplicationId, InputValidationLengthConstraint, MemberId, Membership, MemoText, Mint, MintId, Opening, OpeningId, OpeningOf, PaidMembershipTerms, PaidTermId, PersonId, PlaylistId, Post, PostId, ProposalDetailsOf, ProposalId, ProposalOf, Recipient, RecipientId, RewardRelationship, RewardRelationshipId, SealedVote, Seats, SeriesId, ServiceProviderRecord, Stake, StakeId, StorageProviderId, Thread, ThreadCounter, ThreadId, TransferableStake, Url, VideoCategoryId, VideoId, VoteKind, WorkerId, WorkerOf } from './all';
+import { Application, ApplicationId, ApplicationOf, Category, CategoryId, Channel, ChannelCategory, ChannelCategoryId, ChannelId, ChannelOwnershipTransferRequest, ChannelOwnershipTransferRequestId, ContentId, CuratorGroup, CuratorGroupId, DataObject, DataObjectStorageRelationship, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DiscussionPost, DiscussionThread, ElectionStage, ElectionStake, HiringApplicationId, InputValidationLengthConstraint, MemberId, Membership, MemoText, Mint, MintId, Opening, OpeningId, OpeningOf, PaidMembershipTerms, PaidTermId, Person, PersonId, Playlist, PlaylistId, Post, PostId, ProposalDetailsOf, ProposalId, ProposalOf, Recipient, RecipientId, RewardRelationship, RewardRelationshipId, SealedVote, Seats, Series, SeriesId, ServiceProviderRecord, Stake, StakeId, StorageProviderId, Thread, ThreadCounter, ThreadId, TransferableStake, Url, Video, VideoCategory, VideoCategoryId, VideoId, VoteKind, WorkerId, WorkerOf } 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';
@@ -130,7 +130,7 @@ declare module '@polkadot/api/types/storage' {
     content: {
       channelById: AugmentedQuery<ApiType, (arg: ChannelId | AnyNumber | Uint8Array) => Observable<Channel>>;
       channelCategoryById: AugmentedQuery<ApiType, (arg: ChannelCategoryId | AnyNumber | Uint8Array) => Observable<ChannelCategory>>;
-      channelOwnershipTransferRequestById: AugmentedQuery<ApiType, (arg: ChannelOwnershipTransferRequestId | null) => Observable<ChannelOwnershipTransferRequest>>;
+      channelOwnershipTransferRequestById: AugmentedQuery<ApiType, (arg: ChannelOwnershipTransferRequestId | AnyNumber | Uint8Array) => Observable<ChannelOwnershipTransferRequest>>;
       /**
        * Map, representing  CuratorGroupId -> CuratorGroup relation
        **/

+ 6 - 6
types/augment-codec/augment-api-tx.ts

@@ -4,7 +4,7 @@
 import { AnyNumber } from '@polkadot/types/types';
 import { Compact, Option, Vec } from '@polkadot/types/codec';
 import { Bytes, bool, u16, u32, u64 } from '@polkadot/types/primitive';
-import { ActivateOpeningAt, AddOpeningParameters, ApplicationId, ApplicationIdSet, BalanceOfMint, CategoryId, ContentId, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, ElectionParameters, FillOpeningParameters, MemberId, MemoText, OpeningId, OpeningPolicyCommitment, OpeningType, PaidTermId, PostId, ProposalId, RewardPolicy, StorageProviderId, TerminateRoleParameters, ThreadId, Url, VoteKind, WorkerId, WorkingGroup } from './all';
+import { AbstractStorageObjectOwner, ActivateOpeningAt, AddOpeningParameters, ApplicationId, ApplicationIdSet, BalanceOfMint, CategoryId, ContentId, ContentParameters, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, ElectionParameters, FillOpeningParameters, MemberId, MemoText, OpeningId, OpeningPolicyCommitment, OpeningType, PaidTermId, PostId, ProposalId, RewardPolicy, StorageProviderId, TerminateRoleParameters, ThreadId, Url, 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';
@@ -257,15 +257,15 @@ declare module '@polkadot/api/types/submittable' {
        **/
       acceptContent: AugmentedSubmittable<(storageProviderId: StorageProviderId | AnyNumber | Uint8Array, contentId: ContentId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
-       * Adds the content to the system. Member id should match its origin. The created DataObject
+       * Adds the content to the system. Requires root privileges. The created DataObject
        * awaits liaison to accept or reject it.
        **/
-      addContent: AugmentedSubmittable<(abstractOwner: AbstractStorageObjectOwner | null, contentId: ContentId | string | Uint8Array, typeId: DataObjectTypeId | AnyNumber | Uint8Array, size: u64 | AnyNumber | Uint8Array, ipfsContentId: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      addContent: AugmentedSubmittable<(abstractOwner: AbstractStorageObjectOwner | { Channel: any } | { DAO: any } | { Council: any } | { WorkingGroup: any } | string | Uint8Array, content: Vec<ContentParameters> | (ContentParameters | { content_id?: any; type_id?: any; ipfs_content_id?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
       /**
        * Adds the content to the system. Member id should match its origin. The created DataObject
        * awaits liaison to accept or reject it.
        **/
-      addContentAsMember: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, contentId: ContentId | string | Uint8Array, typeId: DataObjectTypeId | AnyNumber | Uint8Array, size: u64 | AnyNumber | Uint8Array, ipfsContentId: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      addContentAsMember: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, content: Vec<ContentParameters> | (ContentParameters | { content_id?: any; type_id?: any; ipfs_content_id?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
       /**
        * Injects a set of data objects and their corresponding content id into the directory.
        * The operation is "silent" - no events will be emitted as objects are added.
@@ -596,7 +596,7 @@ declare module '@polkadot/api/types/submittable' {
        * - Write: Bonded, Payee, [Origin Account], Locks, Ledger
        * # </weight>
        **/
-      bond: AugmentedSubmittable<(controller: LookupSource | string | Uint8Array, value: Compact<BalanceOf> | AnyNumber | Uint8Array, payee: RewardDestination | 'Staked'|'Stash'|'Controller' | number | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      bond: AugmentedSubmittable<(controller: LookupSource | string | Uint8Array, value: Compact<BalanceOf> | AnyNumber | Uint8Array, payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Add some extra amount that have appeared in the stash `free_balance` into the balance up
        * for staking.
@@ -891,7 +891,7 @@ declare module '@polkadot/api/types/submittable' {
        * - Write: Payee
        * # </weight>
        **/
-      setPayee: AugmentedSubmittable<(payee: RewardDestination | 'Staked'|'Stash'|'Controller' | number | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      setPayee: AugmentedSubmittable<(payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Sets the ideal number of validators.
        * 

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


+ 170 - 2
types/augment/all/defs.json

@@ -670,12 +670,180 @@
             "Lead": "Null"
         }
     },
+    "DAOId": "u64",
+    "ContentParameters": {
+        "content_id": "ContentId",
+        "type_id": "DataObjectTypeId",
+        "size": "u64",
+        "ipfs_content_id": "Bytes"
+    },
+    "StorageObjectOwner": {
+        "_enum": {
+            "Member": "MemberId",
+            "AbstractStorageObjectOwner": "AbstractStorageObjectOwner"
+        }
+    },
+    "AbstractStorageObjectOwner": {
+        "_enum": {
+            "Channel": "ChannelId",
+            "DAO": "DAOId",
+            "Council": "Null",
+            "WorkingGroup": "WorkingGroupType"
+        }
+    },
+    "WorkingGroupType": {
+        "_enum": [
+            "ContentDirectory",
+            "Builders",
+            "StorageProviders"
+        ]
+    },
+    "NewAsset": {
+        "_enum": {
+            "Upload": "ContentParameters",
+            "Uri": "Text"
+        }
+    },
+    "Channel": {
+        "owner": "ChannelOwner",
+        "in_category": "ChannelCategoryId",
+        "number_of_videos": "u32",
+        "number_of_playlists": "u32",
+        "number_of_series": "u32",
+        "is_curated": "bool",
+        "revenue": "u128"
+    },
+    "ChannelOwner": {
+        "_enum": {
+            "Nobody": "Null",
+            "Member": "MemberId",
+            "Curators": "CuratorGroupId",
+            "Dao": "DAOId"
+        }
+    },
     "ChannelId": "u64",
     "ChannelCategoryId": "u64",
+    "ChannelCategory": {
+        "number_of_channels_in": "u32"
+    },
+    "ChannelCategoryCreationParameters": {
+        "meta": "Bytes"
+    },
+    "ChannelCategoryUpdateParameters": {
+        "new_meta": "Bytes"
+    },
+    "ChannelCreationParameters": {
+        "in_category": "ChannelCategoryId",
+        "meta": "Bytes"
+    },
+    "ChannelUpdateParameters": {
+        "new_in_category": "Option<ChannelCategoryId>",
+        "new_meta": "Bytes"
+    },
+    "ChannelOwnershipTransferRequestId": "u64",
+    "ChannelOwnershipTransferRequest": {
+        "channel_id": "ChannelId",
+        "new_owner": "ChannelOwner",
+        "payment": "u128"
+    },
+    "Video": {
+        "in_channel": "ChannelId",
+        "in_series": "Vec<SeriesId>",
+        "in_playlists": "Vec<PlaylistId>",
+        "is_curated": "bool",
+        "is_featured": "bool"
+    },
     "VideoId": "u64",
     "VideoCategoryId": "u64",
-    "PlaylistId": "u64",
+    "VideoCategory": {
+        "number_of_videos_in_category": "u32"
+    },
+    "VideoCategoryCreationParameters": {
+        "meta": "Bytes"
+    },
+    "VideoCategoryUpdateParameters": {
+        "new_meta": "Bytes"
+    },
+    "VideoCreationParameters": {
+        "in_category": "VideoCategoryId",
+        "meta": "Bytes"
+    },
+    "VideoUpdateParameters": {
+        "new_in_category": "Option<VideoCategoryId>",
+        "new_meta": "Option<Bytes>"
+    },
+    "Person": {
+        "controlled_by": "PersonController",
+        "number_of_videos_person_involed_in": "u32"
+    },
     "PersonId": "u64",
+    "PersonController": {
+        "_enum": {
+            "Nobody": "Null",
+            "Member": "MemberId",
+            "Curators": "Null"
+        }
+    },
+    "PersonActor": {
+        "_enum": {
+            "Member": "MemberId",
+            "Curator": "CuratorId"
+        }
+    },
+    "PersonCreationParameters": {
+        "meta": "Bytes"
+    },
+    "PersonUpdateParameters": {
+        "meta": "Bytes"
+    },
+    "Playlist": {
+        "in_channel": "ChannelId",
+        "videos": "Vec<VideoId>"
+    },
+    "PlaylistId": "u64",
+    "PlaylistCreationParameters": {
+        "videos": "Vec<VideoId>",
+        "meta": "Bytes"
+    },
+    "PlaylistUpdateParameters": {
+        "new_videos": "Option<Vec<VideoId>>",
+        "new_meta": "Option<Bytes>"
+    },
     "SeriesId": "u64",
-    "ChannelTransferRequestId": "u64"
+    "Series": {
+        "in_channel": "ChannelId",
+        "seasons": "Vec<Season>"
+    },
+    "Season": {
+        "episodes": "Vec<VideoId>"
+    },
+    "SeriesCreationParameters": {
+        "seasons": "Vec<SeasonCreationParameters>",
+        "meta": "Bytes"
+    },
+    "SeriesUpdateParameters": {
+        "new_seasons": "Option<Vec<Option<SeasonUpdateParameters>>>",
+        "new_meta": "Option<Bytes>"
+    },
+    "SeasonCreationParameters": {
+        "episodes": "Vec<EpisodeCreationParameters>",
+        "meta": "Bytes"
+    },
+    "SeasonUpdateParameters": {
+        "new_episodes": "Option<Vec<Option<EpisodeUpdateParemters>>>",
+        "new_meta": "Option<Bytes>"
+    },
+    "EpisodeCreationParameters": {
+        "_enum": {
+            "NewVideo": "VideoCreationParameters",
+            "ExistingVideo": "VideoId"
+        }
+    },
+    "EpisodeUpdateParemters": {
+        "_enum": {
+            "UpdateVideo": "VideoUpdateParameters",
+            "ChangeExistingVideo": "VideoId"
+        }
+    },
+    "Content": "Vec<ContentParameters>"
 }

+ 242 - 2
types/augment/all/types.ts

@@ -7,6 +7,17 @@ import { GenericAccountId } from '@polkadot/types/generic';
 import { Bytes, Null, Text, bool, u128, u16, u32, u64 } from '@polkadot/types/primitive';
 import { AccountId, Balance, Hash } from '@polkadot/types/interfaces/runtime';
 
+/** @name AbstractStorageObjectOwner */
+export interface AbstractStorageObjectOwner extends Enum {
+  readonly isChannel: boolean;
+  readonly asChannel: ChannelId;
+  readonly isDao: boolean;
+  readonly asDao: DAOId;
+  readonly isCouncil: boolean;
+  readonly isWorkingGroup: boolean;
+  readonly asWorkingGroup: WorkingGroupType;
+}
+
 /** @name AcceptingApplications */
 export interface AcceptingApplications extends Struct {
   readonly started_accepting_applicants_at_block: u32;
@@ -177,23 +188,79 @@ export interface Category extends Struct {
 /** @name CategoryId */
 export interface CategoryId extends u64 {}
 
+/** @name Channel */
+export interface Channel extends Struct {
+  readonly owner: ChannelOwner;
+  readonly in_category: ChannelCategoryId;
+  readonly number_of_videos: u32;
+  readonly number_of_playlists: u32;
+  readonly number_of_series: u32;
+  readonly is_curated: bool;
+  readonly revenue: u128;
+}
+
+/** @name ChannelCategory */
+export interface ChannelCategory extends Struct {
+  readonly number_of_channels_in: u32;
+}
+
+/** @name ChannelCategoryCreationParameters */
+export interface ChannelCategoryCreationParameters extends Struct {
+  readonly meta: Bytes;
+}
+
 /** @name ChannelCategoryId */
 export interface ChannelCategoryId extends u64 {}
 
+/** @name ChannelCategoryUpdateParameters */
+export interface ChannelCategoryUpdateParameters extends Struct {
+  readonly new_meta: Bytes;
+}
+
 /** @name ChannelContentType */
 export interface ChannelContentType extends Null {}
 
+/** @name ChannelCreationParameters */
+export interface ChannelCreationParameters extends Struct {
+  readonly in_category: ChannelCategoryId;
+  readonly meta: Bytes;
+}
+
 /** @name ChannelCurationStatus */
 export interface ChannelCurationStatus extends Null {}
 
 /** @name ChannelId */
 export interface ChannelId extends u64 {}
 
+/** @name ChannelOwner */
+export interface ChannelOwner extends Enum {
+  readonly isNobody: boolean;
+  readonly isMember: boolean;
+  readonly asMember: MemberId;
+  readonly isCurators: boolean;
+  readonly asCurators: CuratorGroupId;
+  readonly isDao: boolean;
+  readonly asDao: DAOId;
+}
+
+/** @name ChannelOwnershipTransferRequest */
+export interface ChannelOwnershipTransferRequest extends Struct {
+  readonly channel_id: ChannelId;
+  readonly new_owner: ChannelOwner;
+  readonly payment: u128;
+}
+
+/** @name ChannelOwnershipTransferRequestId */
+export interface ChannelOwnershipTransferRequestId extends u64 {}
+
 /** @name ChannelPublicationStatus */
 export interface ChannelPublicationStatus extends Null {}
 
-/** @name ChannelTransferRequestId */
-export interface ChannelTransferRequestId extends u64 {}
+/** @name ChannelUpdateParameters */
+export interface ChannelUpdateParameters extends Struct {
+  readonly new_in_category: Option<ChannelCategoryId>;
+  readonly new_meta: Bytes;
+}
 
 /** @name ChildPositionInParentCategory */
 export interface ChildPositionInParentCategory extends Struct {
@@ -219,6 +286,9 @@ export interface ClassPermissionsType extends Null {}
 /** @name ClassPropertyValue */
 export interface ClassPropertyValue extends Null {}
 
+/** @name Content */
+export interface Content extends Vec<ContentParameters> {}
+
 /** @name ContentActor */
 export interface ContentActor extends Enum {
   readonly isCurator: boolean;
@@ -231,6 +301,13 @@ export interface ContentActor extends Enum {
 /** @name ContentId */
 export interface ContentId extends U8aFixed {}
 
+/** @name ContentParameters */
+export interface ContentParameters extends Struct {
+  readonly content_id: ContentId;
+  readonly type_id: DataObjectTypeId;
+  readonly ipfs_content_id: Bytes;
+}
+
 /** @name CreateEntityOperation */
 export interface CreateEntityOperation extends Null {}
 
@@ -277,6 +354,9 @@ export interface CuratorOpening extends Null {}
 /** @name CuratorOpeningId */
 export interface CuratorOpeningId extends Null {}
 
+/** @name DAOId */
+export interface DAOId extends u64 {}
+
 /** @name DataObject */
 export interface DataObject extends Struct {
   readonly owner: MemberId;
@@ -392,6 +472,22 @@ export interface EntryMethod extends Enum {
   readonly isGenesis: boolean;
 }
 
+/** @name EpisodeCreationParameters */
+export interface EpisodeCreationParameters extends Enum {
+  readonly isNewVideo: boolean;
+  readonly asNewVideo: VideoCreationParameters;
+  readonly isExistingVideo: boolean;
+  readonly asExistingVideo: VideoId;
+}
+
+/** @name EpisodeUpdateParemters */
+export interface EpisodeUpdateParemters extends Enum {
+  readonly isUpdateVideo: boolean;
+  readonly asUpdateVideo: VideoUpdateParameters;
+  readonly isChangeExistingVideo: boolean;
+  readonly asChangeExistingVideo: VideoId;
+}
+
 /** @name ExecutionFailed */
 export interface ExecutionFailed extends Struct {
   readonly error: Text;
@@ -507,6 +603,14 @@ export interface ModerationAction extends Struct {
   readonly rationale: Text;
 }
 
+/** @name NewAsset */
+export interface NewAsset extends Enum {
+  readonly isUpload: boolean;
+  readonly asUpload: ContentParameters;
+  readonly isUri: boolean;
+  readonly asUri: Text;
+}
+
 /** @name NextAdjustment */
 export interface NextAdjustment extends Struct {
   readonly adjustment: AdjustOnInterval;
@@ -604,12 +708,62 @@ export interface ParametrizedClassPropertyValue extends Null {}
 /** @name ParametrizedPropertyValue */
 export interface ParametrizedPropertyValue extends Null {}
 
+/** @name Person */
+export interface Person extends Struct {
+  readonly controlled_by: PersonController;
+  readonly number_of_videos_person_involed_in: u32;
+}
+
+/** @name PersonActor */
+export interface PersonActor extends Enum {
+  readonly isMember: boolean;
+  readonly asMember: MemberId;
+  readonly isCurator: boolean;
+  readonly asCurator: CuratorId;
+}
+
+/** @name PersonController */
+export interface PersonController extends Enum {
+  readonly isNobody: boolean;
+  readonly isMember: boolean;
+  readonly asMember: MemberId;
+  readonly isCurators: boolean;
+}
+
+/** @name PersonCreationParameters */
+export interface PersonCreationParameters extends Struct {
+  readonly meta: Bytes;
+}
+
 /** @name PersonId */
 export interface PersonId extends u64 {}
 
+/** @name PersonUpdateParameters */
+export interface PersonUpdateParameters extends Struct {
+  readonly meta: Bytes;
+}
+
+/** @name Playlist */
+export interface Playlist extends Struct {
+  readonly in_channel: ChannelId;
+  readonly videos: Vec<VideoId>;
+}
+
+/** @name PlaylistCreationParameters */
+export interface PlaylistCreationParameters extends Struct {
+  readonly videos: Vec<VideoId>;
+  readonly meta: Bytes;
+}
+
 /** @name PlaylistId */
 export interface PlaylistId extends u64 {}
 
+/** @name PlaylistUpdateParameters */
+export interface PlaylistUpdateParameters extends Struct {
+  readonly new_videos: Option<Vec<VideoId>>;
+  readonly new_meta: Option<Bytes>;
+}
+
 /** @name Post */
 export interface Post extends Struct {
   readonly id: PostId;
@@ -870,6 +1024,23 @@ export interface SealedVote extends Struct {
   readonly vote: Option<GenericAccountId>;
 }
 
+/** @name Season */
+export interface Season extends Struct {
+  readonly episodes: Vec<VideoId>;
+}
+
+/** @name SeasonCreationParameters */
+export interface SeasonCreationParameters extends Struct {
+  readonly episodes: Vec<EpisodeCreationParameters>;
+  readonly meta: Bytes;
+}
+
+/** @name SeasonUpdateParameters */
+export interface SeasonUpdateParameters extends Struct {
+  readonly new_episodes: Option<Vec<Option<EpisodeUpdateParemters>>>;
+  readonly new_meta: Option<Bytes>;
+}
+
 /** @name Seat */
 export interface Seat extends Struct {
   readonly member: GenericAccountId;
@@ -880,9 +1051,27 @@ export interface Seat extends Struct {
 /** @name Seats */
 export interface Seats extends Vec<Seat> {}
 
+/** @name Series */
+export interface Series extends Struct {
+  readonly in_channel: ChannelId;
+  readonly seasons: Vec<Season>;
+}
+
+/** @name SeriesCreationParameters */
+export interface SeriesCreationParameters extends Struct {
+  readonly seasons: Vec<SeasonCreationParameters>;
+  readonly meta: Bytes;
+}
+
 /** @name SeriesId */
 export interface SeriesId extends u64 {}
 
+/** @name SeriesUpdateParameters */
+export interface SeriesUpdateParameters extends Struct {
+  readonly new_seasons: Option<Vec<Option<SeasonUpdateParameters>>>;
+  readonly new_meta: Option<Bytes>;
+}
+
 /** @name ServiceProviderRecord */
 export interface ServiceProviderRecord extends Struct {
   readonly identity: IPNSIdentity;
@@ -967,6 +1156,14 @@ export interface StakingStatus extends Enum {
 /** @name Status */
 export interface Status extends Null {}
 
+/** @name StorageObjectOwner */
+export interface StorageObjectOwner extends Enum {
+  readonly isMember: boolean;
+  readonly asMember: MemberId;
+  readonly isAbstractStorageObjectOwner: boolean;
+  readonly asAbstractStorageObjectOwner: AbstractStorageObjectOwner;
+}
+
 /** @name StorageProviderId */
 export interface StorageProviderId extends u64 {}
 
@@ -1049,12 +1246,48 @@ export interface VecStoredPropertyValue extends Null {}
 /** @name VecStoredValue */
 export interface VecStoredValue extends Null {}
 
+/** @name Video */
+export interface Video extends Struct {
+  readonly in_channel: ChannelId;
+  readonly in_series: Vec<SeriesId>;
+  readonly in_playlists: Vec<PlaylistId>;
+  readonly is_curated: bool;
+  readonly is_featured: bool;
+}
+
+/** @name VideoCategory */
+export interface VideoCategory extends Struct {
+  readonly number_of_videos_in_category: u32;
+}
+
+/** @name VideoCategoryCreationParameters */
+export interface VideoCategoryCreationParameters extends Struct {
+  readonly meta: Bytes;
+}
+
 /** @name VideoCategoryId */
 export interface VideoCategoryId extends u64 {}
 
+/** @name VideoCategoryUpdateParameters */
+export interface VideoCategoryUpdateParameters extends Struct {
+  readonly new_meta: Bytes;
+}
+
+/** @name VideoCreationParameters */
+export interface VideoCreationParameters extends Struct {
+  readonly in_category: VideoCategoryId;
+  readonly meta: Bytes;
+}
+
 /** @name VideoId */
 export interface VideoId extends u64 {}
 
+/** @name VideoUpdateParameters */
+export interface VideoUpdateParameters extends Struct {
+  readonly new_in_category: Option<VideoCategoryId>;
+  readonly new_meta: Option<Bytes>;
+}
+
 /** @name VoteKind */
 export interface VoteKind extends Enum {
   readonly isApprove: boolean;
@@ -1093,6 +1326,13 @@ export interface WorkingGroup extends Enum {
   readonly isContent: boolean;
 }
 
+/** @name WorkingGroupType */
+export interface WorkingGroupType extends Enum {
+  readonly isContentDirectory: boolean;
+  readonly isBuilders: boolean;
+  readonly isStorageProviders: boolean;
+}
+
 /** @name WorkingGroupUnstaker */
 export interface WorkingGroupUnstaker extends Null {}
 

+ 42 - 38
types/augment/augment-api-consts.ts

@@ -7,15 +7,16 @@ import { Balance, BalanceOf, BlockNumber, Moment, Perbill, RuntimeDbWeight, Weig
 import { SessionIndex } from '@polkadot/types/interfaces/session';
 import { EraIndex } from '@polkadot/types/interfaces/staking';
 import { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
+import { ApiTypes } from '@polkadot/api/types';
 
-declare module '@polkadot/metadata/Decorated/consts/types' {
-  export interface Constants {
+declare module '@polkadot/api/types/consts' {
+  export interface AugmentedConsts<ApiType> {
     babe: {
       /**
        * The number of **slots** that an epoch takes. We couple sessions to
        * epochs, i.e. we start a new session once the new epoch begins.
        **/
-      epochDuration: AugmentedConst<u64>;
+      epochDuration: u64 & AugmentedConst<ApiType>;
       /**
        * The expected average block time at which BABE should be creating
        * blocks. Since BABE is probabilistic it is not trivial to figure out
@@ -23,97 +24,97 @@ declare module '@polkadot/metadata/Decorated/consts/types' {
        * duration and the security parameter `c` (where `1 - c` represents
        * the probability of a slot being empty).
        **/
-      expectedBlockTime: AugmentedConst<Moment>;
+      expectedBlockTime: Moment & AugmentedConst<ApiType>;
     };
     balances: {
       /**
        * The minimum amount required to keep an account open.
        **/
-      existentialDeposit: AugmentedConst<Balance>;
+      existentialDeposit: Balance & AugmentedConst<ApiType>;
     };
     content: {
       /**
        * Exports const -  max number of curators per group
        **/
-      maxNumberOfCuratorsPerGroup: AugmentedConst<MaxNumber>;
+      maxNumberOfCuratorsPerGroup: MaxNumber & AugmentedConst<ApiType>;
     };
     contentDirectoryWorkingGroup: {
       /**
        * Exports const -  max simultaneous active worker number.
        **/
-      maxWorkerNumberLimit: AugmentedConst<u32>;
+      maxWorkerNumberLimit: u32 & AugmentedConst<ApiType>;
     };
     dataDirectory: {
       /**
        * Maximum objects allowed per inject_data_objects() transaction
        **/
-      maxObjectsPerInjection: AugmentedConst<u32>;
+      maxObjectsPerInjection: u32 & AugmentedConst<ApiType>;
     };
     finalityTracker: {
       /**
        * The delay after which point things become suspicious. Default is 1000.
        **/
-      reportLatency: AugmentedConst<BlockNumber>;
+      reportLatency: BlockNumber & AugmentedConst<ApiType>;
       /**
        * The number of recent samples to keep from this chain. Default is 101.
        **/
-      windowSize: AugmentedConst<BlockNumber>;
+      windowSize: BlockNumber & AugmentedConst<ApiType>;
     };
     proposalsCodex: {
       /**
        * Exports max wasm code length of the runtime upgrade proposal const.
        **/
-      runtimeUpgradeWasmProposalMaxLength: AugmentedConst<u32>;
+      runtimeUpgradeWasmProposalMaxLength: u32 & AugmentedConst<ApiType>;
       /**
        * Exports max allowed text proposal length const.
        **/
-      textProposalMaxLength: AugmentedConst<u32>;
+      textProposalMaxLength: u32 & AugmentedConst<ApiType>;
     };
     proposalsDiscussion: {
       /**
        * Exports post edition number limit const.
        **/
-      maxPostEditionNumber: AugmentedConst<u32>;
+      maxPostEditionNumber: u32 & AugmentedConst<ApiType>;
       /**
        * Exports max thread by same author in a row number limit const.
        **/
-      maxThreadInARowNumber: AugmentedConst<u32>;
+      maxThreadInARowNumber: u32 & AugmentedConst<ApiType>;
       /**
        * Exports post length limit const.
        **/
-      postLengthLimit: AugmentedConst<u32>;
+      postLengthLimit: u32 & AugmentedConst<ApiType>;
       /**
        * Exports thread title length limit const.
        **/
-      threadTitleLengthLimit: AugmentedConst<u32>;
+      threadTitleLengthLimit: u32 & AugmentedConst<ApiType>;
     };
     proposalsEngine: {
       /**
        * Exports const - the fee is applied when cancel the proposal. A fee would be slashed (burned).
        **/
-      cancellationFee: AugmentedConst<BalanceOf>;
+      cancellationFee: BalanceOf & AugmentedConst<ApiType>;
       /**
        * Exports const -  max allowed proposal description length.
        **/
-      descriptionMaxLength: AugmentedConst<u32>;
+      descriptionMaxLength: u32 & AugmentedConst<ApiType>;
       /**
        * Exports const -  max simultaneous active proposals number.
        **/
-      maxActiveProposalLimit: AugmentedConst<u32>;
+      maxActiveProposalLimit: u32 & AugmentedConst<ApiType>;
       /**
        * Exports const -  the fee is applied when the proposal gets rejected. A fee would be slashed (burned).
        **/
-      rejectionFee: AugmentedConst<BalanceOf>;
+      rejectionFee: BalanceOf & AugmentedConst<ApiType>;
       /**
        * Exports const -  max allowed proposal title length.
        **/
-      titleMaxLength: AugmentedConst<u32>;
+      titleMaxLength: u32 & AugmentedConst<ApiType>;
     };
     staking: {
       /**
        * Number of eras that staked funds must remain bonded for.
        **/
-      bondingDuration: AugmentedConst<EraIndex>;
+      bondingDuration: EraIndex & AugmentedConst<ApiType>;
       /**
        * The number of blocks before the end of the era from which election submissions are allowed.
        * 
@@ -123,28 +124,28 @@ declare module '@polkadot/metadata/Decorated/consts/types' {
        * This is bounded by being within the last session. Hence, setting it to a value more than the
        * length of a session will be pointless.
        **/
-      electionLookahead: AugmentedConst<BlockNumber>;
+      electionLookahead: BlockNumber & AugmentedConst<ApiType>;
       /**
        * Maximum number of balancing iterations to run in the offchain submission.
        * 
        * If set to 0, balance_solution will not be executed at all.
        **/
-      maxIterations: AugmentedConst<u32>;
+      maxIterations: u32 & AugmentedConst<ApiType>;
       /**
        * The maximum number of nominators rewarded for each validator.
        * 
        * For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can claim
        * their reward. This used to limit the i/o cost for the nominator payout.
        **/
-      maxNominatorRewardedPerValidator: AugmentedConst<u32>;
+      maxNominatorRewardedPerValidator: u32 & AugmentedConst<ApiType>;
       /**
        * The threshold of improvement that should be provided for a new solution to be accepted.
        **/
-      minSolutionScoreBump: AugmentedConst<Perbill>;
+      minSolutionScoreBump: Perbill & AugmentedConst<ApiType>;
       /**
        * Number of sessions per era.
        **/
-      sessionsPerEra: AugmentedConst<SessionIndex>;
+      sessionsPerEra: SessionIndex & AugmentedConst<ApiType>;
       /**
        * Number of eras that slashes are deferred by, after computation.
        * 
@@ -152,39 +153,39 @@ declare module '@polkadot/metadata/Decorated/consts/types' {
        * Set to 0 if slashes should be applied immediately, without opportunity for
        * intervention.
        **/
-      slashDeferDuration: AugmentedConst<EraIndex>;
+      slashDeferDuration: EraIndex & AugmentedConst<ApiType>;
     };
     storageWorkingGroup: {
       /**
        * Exports const -  max simultaneous active worker number.
        **/
-      maxWorkerNumberLimit: AugmentedConst<u32>;
+      maxWorkerNumberLimit: u32 & AugmentedConst<ApiType>;
     };
     system: {
       /**
        * The base weight of executing a block, independent of the transactions in the block.
        **/
-      blockExecutionWeight: AugmentedConst<Weight>;
+      blockExecutionWeight: Weight & AugmentedConst<ApiType>;
       /**
        * The maximum number of blocks to allow in mortal eras.
        **/
-      blockHashCount: AugmentedConst<BlockNumber>;
+      blockHashCount: BlockNumber & AugmentedConst<ApiType>;
       /**
        * The weight of runtime database operations the runtime can invoke.
        **/
-      dbWeight: AugmentedConst<RuntimeDbWeight>;
+      dbWeight: RuntimeDbWeight & AugmentedConst<ApiType>;
       /**
        * The base weight of an Extrinsic in the block, independent of the of extrinsic being executed.
        **/
-      extrinsicBaseWeight: AugmentedConst<Weight>;
+      extrinsicBaseWeight: Weight & AugmentedConst<ApiType>;
       /**
        * The maximum length of a block (in bytes).
        **/
-      maximumBlockLength: AugmentedConst<u32>;
+      maximumBlockLength: u32 & AugmentedConst<ApiType>;
       /**
        * The maximum weight of a block.
        **/
-      maximumBlockWeight: AugmentedConst<Weight>;
+      maximumBlockWeight: Weight & AugmentedConst<ApiType>;
     };
     timestamp: {
       /**
@@ -193,17 +194,20 @@ declare module '@polkadot/metadata/Decorated/consts/types' {
        * work with this to determine a sensible block time. e.g. For Aura, it will be double this
        * period on default settings.
        **/
-      minimumPeriod: AugmentedConst<Moment>;
+      minimumPeriod: Moment & AugmentedConst<ApiType>;
     };
     transactionPayment: {
       /**
        * The fee to be paid for making a transaction; the per-byte portion.
        **/
-      transactionByteFee: AugmentedConst<BalanceOf>;
+      transactionByteFee: BalanceOf & AugmentedConst<ApiType>;
       /**
        * The polynomial that is applied in order to derive fee from weight.
        **/
-      weightToFee: AugmentedConst<Vec<WeightToFeeCoefficient>>;
+      weightToFee: Vec<WeightToFeeCoefficient> & AugmentedConst<ApiType>;
     };
   }
+
+  export interface QueryableConsts<ApiType extends ApiTypes> extends AugmentedConsts<ApiType> {
+  }
 }

+ 2 - 2
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, ChannelCategoryId, ChannelId, ContentId, CuratorGroup, CuratorGroupId, DataObject, DataObjectStorageRelationship, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DiscussionPost, DiscussionThread, ElectionStage, ElectionStake, HiringApplicationId, InputValidationLengthConstraint, MemberId, Membership, MemoText, Mint, MintId, Opening, OpeningId, OpeningOf, PaidMembershipTerms, PaidTermId, PersonId, PlaylistId, Post, PostId, ProposalDetailsOf, ProposalId, ProposalOf, Recipient, RecipientId, RewardRelationship, RewardRelationshipId, SealedVote, Seats, SeriesId, ServiceProviderRecord, Stake, StakeId, StorageProviderId, Thread, ThreadCounter, ThreadId, TransferableStake, Url, VideoCategoryId, VideoId, VoteKind, WorkerId, WorkerOf } from './all';
+import { Application, ApplicationId, ApplicationOf, Category, CategoryId, Channel, ChannelCategory, ChannelCategoryId, ChannelId, ChannelOwnershipTransferRequest, ChannelOwnershipTransferRequestId, ContentId, CuratorGroup, CuratorGroupId, DataObject, DataObjectStorageRelationship, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DiscussionPost, DiscussionThread, ElectionStage, ElectionStake, HiringApplicationId, InputValidationLengthConstraint, MemberId, Membership, MemoText, Mint, MintId, Opening, OpeningId, OpeningOf, PaidMembershipTerms, PaidTermId, Person, PersonId, Playlist, PlaylistId, Post, PostId, ProposalDetailsOf, ProposalId, ProposalOf, Recipient, RecipientId, RewardRelationship, RewardRelationshipId, SealedVote, Seats, Series, SeriesId, ServiceProviderRecord, Stake, StakeId, StorageProviderId, Thread, ThreadCounter, ThreadId, TransferableStake, Url, Video, VideoCategory, VideoCategoryId, VideoId, VoteKind, WorkerId, WorkerOf } 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';
@@ -130,7 +130,7 @@ declare module '@polkadot/api/types/storage' {
     content: {
       channelById: AugmentedQuery<ApiType, (arg: ChannelId | AnyNumber | Uint8Array) => Observable<Channel>>;
       channelCategoryById: AugmentedQuery<ApiType, (arg: ChannelCategoryId | AnyNumber | Uint8Array) => Observable<ChannelCategory>>;
-      channelOwnershipTransferRequestById: AugmentedQuery<ApiType, (arg: ChannelOwnershipTransferRequestId | null) => Observable<ChannelOwnershipTransferRequest>>;
+      channelOwnershipTransferRequestById: AugmentedQuery<ApiType, (arg: ChannelOwnershipTransferRequestId | AnyNumber | Uint8Array) => Observable<ChannelOwnershipTransferRequest>>;
       /**
        * Map, representing  CuratorGroupId -> CuratorGroup relation
        **/

+ 6 - 6
types/augment/augment-api-tx.ts

@@ -4,7 +4,7 @@
 import { AnyNumber } from '@polkadot/types/types';
 import { Compact, Option, Vec } from '@polkadot/types/codec';
 import { Bytes, bool, u16, u32, u64 } from '@polkadot/types/primitive';
-import { ActivateOpeningAt, AddOpeningParameters, ApplicationId, ApplicationIdSet, BalanceOfMint, CategoryId, ContentId, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, ElectionParameters, FillOpeningParameters, MemberId, MemoText, OpeningId, OpeningPolicyCommitment, OpeningType, PaidTermId, PostId, ProposalId, RewardPolicy, StorageProviderId, TerminateRoleParameters, ThreadId, Url, VoteKind, WorkerId, WorkingGroup } from './all';
+import { AbstractStorageObjectOwner, ActivateOpeningAt, AddOpeningParameters, ApplicationId, ApplicationIdSet, BalanceOfMint, CategoryId, ContentId, ContentParameters, CuratorGroupId, CuratorId, DataObjectStorageRelationshipId, DataObjectType, DataObjectTypeId, DataObjectsMap, ElectionParameters, FillOpeningParameters, MemberId, MemoText, OpeningId, OpeningPolicyCommitment, OpeningType, PaidTermId, PostId, ProposalId, RewardPolicy, StorageProviderId, TerminateRoleParameters, ThreadId, Url, 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';
@@ -257,15 +257,15 @@ declare module '@polkadot/api/types/submittable' {
        **/
       acceptContent: AugmentedSubmittable<(storageProviderId: StorageProviderId | AnyNumber | Uint8Array, contentId: ContentId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
-       * Adds the content to the system. Member id should match its origin. The created DataObject
+       * Adds the content to the system. Requires root privileges. The created DataObject
        * awaits liaison to accept or reject it.
        **/
-      addContent: AugmentedSubmittable<(abstractOwner: AbstractStorageObjectOwner | null, contentId: ContentId | string | Uint8Array, typeId: DataObjectTypeId | AnyNumber | Uint8Array, size: u64 | AnyNumber | Uint8Array, ipfsContentId: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      addContent: AugmentedSubmittable<(abstractOwner: AbstractStorageObjectOwner | { Channel: any } | { DAO: any } | { Council: any } | { WorkingGroup: any } | string | Uint8Array, content: Vec<ContentParameters> | (ContentParameters | { content_id?: any; type_id?: any; ipfs_content_id?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
       /**
        * Adds the content to the system. Member id should match its origin. The created DataObject
        * awaits liaison to accept or reject it.
        **/
-      addContentAsMember: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, contentId: ContentId | string | Uint8Array, typeId: DataObjectTypeId | AnyNumber | Uint8Array, size: u64 | AnyNumber | Uint8Array, ipfsContentId: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      addContentAsMember: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, content: Vec<ContentParameters> | (ContentParameters | { content_id?: any; type_id?: any; ipfs_content_id?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
       /**
        * Injects a set of data objects and their corresponding content id into the directory.
        * The operation is "silent" - no events will be emitted as objects are added.
@@ -596,7 +596,7 @@ declare module '@polkadot/api/types/submittable' {
        * - Write: Bonded, Payee, [Origin Account], Locks, Ledger
        * # </weight>
        **/
-      bond: AugmentedSubmittable<(controller: LookupSource | string | Uint8Array, value: Compact<BalanceOf> | AnyNumber | Uint8Array, payee: RewardDestination | 'Staked'|'Stash'|'Controller' | number | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      bond: AugmentedSubmittable<(controller: LookupSource | string | Uint8Array, value: Compact<BalanceOf> | AnyNumber | Uint8Array, payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Add some extra amount that have appeared in the stash `free_balance` into the balance up
        * for staking.
@@ -891,7 +891,7 @@ declare module '@polkadot/api/types/submittable' {
        * - Write: Payee
        * # </weight>
        **/
-      setPayee: AugmentedSubmittable<(payee: RewardDestination | 'Staked'|'Stash'|'Controller' | number | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      setPayee: AugmentedSubmittable<(payee: RewardDestination | { Staked: any } | { Stash: any } | { Controller: any } | { Account: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
       /**
        * Sets the ideal number of validators.
        * 

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


+ 2 - 2
types/package.json

@@ -1,7 +1,7 @@
 {
   "name": "@joystream/types",
-  "version": "0.14.0",
-  "description": "Types for Joystream Substrate Runtime - Babylon release",
+  "version": "0.16.0",
+  "description": "Types for Joystream Substrate Runtime - Sumer release",
   "main": "index.js",
   "types": "index.d.ts",
   "scripts": {

+ 1 - 5
types/src/common.ts

@@ -44,9 +44,6 @@ export function JoyBTreeSet<V extends UInt>(valType: Constructor<V>): Constructo
   }
 }
 
-export class Credential extends u64 {}
-export class CredentialSet extends JoyBTreeSet(Credential) {}
-
 // common types between Forum and Proposal Discussions modules
 export class ThreadId extends u64 {}
 export class PostId extends u64 {}
@@ -131,14 +128,13 @@ export class SlashingTerms extends JoyEnum({
 } as const) {}
 
 export class MemoText extends Text {}
+
 // @polkadot/types overrides 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
 export class Address extends AccountId {}
 export class LookupSource extends AccountId {}
 
 export const commonTypes: RegistryTypes = {
-  Credential,
-  CredentialSet,
   BlockAndTime,
   ThreadId,
   PostId,

+ 230 - 28
types/src/content/index.ts

@@ -1,7 +1,8 @@
-import { /* BTreeMap, Option, Text, Vec, */ Tuple } from '@polkadot/types'
-import { bool, u64, u32, Null } from '@polkadot/types/primitive'
+import { Text, Vec, Option, Tuple } from '@polkadot/types'
+import { bool, u64, u32, u128, Null, Bytes } from '@polkadot/types/primitive'
 import { MemberId } from '../members'
 import { JoyStructDecorated, JoyEnum, /* Hash, */ JoyBTreeSet } from '../common'
+import { ContentId, DataObjectTypeId } from '../storage'
 
 export class CuratorId extends u64 {}
 export class CuratorGroupId extends u64 {}
@@ -12,7 +13,8 @@ export class VideoCategoryId extends u64 {}
 export class PlaylistId extends u64 {}
 export class PersonId extends u64 {}
 export class SeriesId extends u64 {}
-export class ChannelTransferRequestId extends u64 {}
+export class ChannelOwnershipTransferRequestId extends u64 {}
+export class DAOId extends u64 {}
 
 export class CuratorGroup extends JoyStructDecorated({
   curators: JoyBTreeSet(CuratorId),
@@ -26,43 +28,243 @@ export class ContentActor extends JoyEnum({
   Lead: Null,
 }) {}
 
-/* 
-// from new content module
-ChannelOwner
-ChannelCreationParameters
-ChannelUpdateParameters
-ChannelOwnershipTransferRequestId
-ChannelOwnershipTransferRequest
-ChannelCategoryCreationParameters
-ChannelCategoryUpdateParameters
-VideoCategoryCreationParameters
-VideoCategoryUpdateParameters
-VideoCreationParameters
-VideoUpdateParameters
-PlaylistCreationParameters
-PlaylistUpdateParameters
-SeriesCreationParameters
-SeriesUpdateParameters
-PersonCreationParameters
-PersonUpdateParameters
-
-// from data_directory changes
-StorageObjectOwner
-*/
+export class ChannelOwner extends JoyEnum({
+  Nobody: Null,
+  Member: MemberId,
+  Curators: CuratorGroupId,
+  Dao: DAOId,
+}) {}
+
+export class Channel extends JoyStructDecorated({
+  owner: ChannelOwner,
+  in_category: ChannelCategoryId,
+  number_of_videos: u32,
+  number_of_playlists: u32,
+  number_of_series: u32,
+  is_curated: bool,
+  revenue: u128,
+}) {}
+
+export class ChannelCreationParameters extends JoyStructDecorated({
+  in_category: ChannelCategoryId,
+  meta: Bytes,
+}) {}
+
+export class ChannelUpdateParameters extends JoyStructDecorated({
+  new_in_category: Option.with(ChannelCategoryId),
+  new_meta: Bytes,
+}) {}
+
+export class ChannelOwnershipTransferRequest extends JoyStructDecorated({
+  channel_id: ChannelId,
+  new_owner: ChannelOwner,
+  payment: u128,
+}) {}
+
+export class ChannelCategory extends JoyStructDecorated({
+  number_of_channels_in: u32,
+}) {}
+
+export class ChannelCategoryCreationParameters extends JoyStructDecorated({
+  meta: Bytes,
+}) {}
+
+export class ChannelCategoryUpdateParameters extends JoyStructDecorated({
+  new_meta: Bytes,
+}) {}
+
+export class VideoCategory extends JoyStructDecorated({
+  number_of_videos_in_category: u32,
+}) {}
+
+export class VideoCategoryCreationParameters extends JoyStructDecorated({
+  meta: Bytes,
+}) {}
+
+export class VideoCategoryUpdateParameters extends JoyStructDecorated({
+  new_meta: Bytes,
+}) {}
+
+export class Video extends JoyStructDecorated({
+  in_channel: ChannelId,
+  in_series: Vec.with(SeriesId),
+  in_playlists: Vec.with(PlaylistId),
+  is_curated: bool,
+  is_featured: bool,
+}) {}
+
+export class VideoCreationParameters extends JoyStructDecorated({
+  in_category: VideoCategoryId,
+  meta: Bytes,
+}) {}
+
+export class VideoUpdateParameters extends JoyStructDecorated({
+  new_in_category: Option.with(VideoCategoryId),
+  new_meta: Option.with(Bytes),
+}) {}
+
+export class Playlist extends JoyStructDecorated({
+  in_channel: ChannelId,
+  videos: Vec.with(VideoId),
+}) {}
+
+export class PlaylistCreationParameters extends JoyStructDecorated({
+  videos: Vec.with(VideoId),
+  meta: Bytes,
+}) {}
+
+export class PlaylistUpdateParameters extends JoyStructDecorated({
+  new_videos: Option.with(Vec.with(VideoId)),
+  new_meta: Option.with(Bytes),
+}) {}
+
+export class EpisodeCreationParameters extends JoyEnum({
+  NewVideo: VideoCreationParameters,
+  ExistingVideo: VideoId,
+}) {}
+
+export class EpisodeUpdateParemters extends JoyEnum({
+  UpdateVideo: VideoUpdateParameters,
+  ChangeExistingVideo: VideoId,
+}) {}
+
+export class Season extends JoyStructDecorated({
+  episodes: Vec.with(VideoId),
+}) {}
+
+export class SeasonCreationParameters extends JoyStructDecorated({
+  episodes: Vec.with(EpisodeCreationParameters),
+  meta: Bytes,
+}) {}
+
+export class SeasonUpdateParameters extends JoyStructDecorated({
+  new_episodes: Option.with(Vec.with(Option.with(EpisodeUpdateParemters))),
+  new_meta: Option.with(Bytes),
+}) {}
+
+export class Series extends JoyStructDecorated({
+  in_channel: ChannelId,
+  seasons: Vec.with(Season),
+}) {}
+
+export class SeriesCreationParameters extends JoyStructDecorated({
+  seasons: Vec.with(SeasonCreationParameters),
+  meta: Bytes,
+}) {}
+
+export class SeriesUpdateParameters extends JoyStructDecorated({
+  new_seasons: Option.with(Vec.with(Option.with(SeasonUpdateParameters))),
+  new_meta: Option.with(Bytes),
+}) {}
+
+export class PersonController extends JoyEnum({
+  Nobody: Null,
+  Member: MemberId,
+  Curators: Null,
+}) {}
+
+export class Person extends JoyStructDecorated({
+  controlled_by: PersonController,
+  number_of_videos_person_involed_in: u32,
+}) {}
+
+export class PersonCreationParameters extends JoyStructDecorated({
+  meta: Bytes,
+}) {}
+
+export class PersonUpdateParameters extends JoyStructDecorated({
+  meta: Bytes,
+}) {}
+
+export class PersonActor extends JoyEnum({
+  Member: MemberId,
+  Curator: CuratorId,
+}) {}
+
+export class ContentParameters extends JoyStructDecorated({
+  content_id: ContentId,
+  type_id: DataObjectTypeId,
+  size: u64,
+  ipfs_content_id: Bytes,
+}) {}
+
+export class NewAsset extends JoyEnum({
+  Upload: ContentParameters,
+  Uri: Text,
+}) {}
+
+// mis-spelled in runtime
+export class WorkingGroupType extends JoyEnum({
+  ContentDirectory: Null,
+  Builders: Null,
+  StorageProviders: Null,
+}) {}
+
+export class AbstractStorageObjectOwner extends JoyEnum({
+  Channel: ChannelId,
+  DAO: DAOId,
+  Council: Null,
+  WorkingGroup: WorkingGroupType,
+}) {}
+
+export class StorageObjectOwner extends JoyEnum({
+  Member: MemberId,
+  AbstractStorageObjectOwner: AbstractStorageObjectOwner,
+}) {}
+
+export class Content extends Vec.with(ContentParameters) {}
 
 export const contentDirectoryTypes = {
   CuratorId,
   CuratorGroupId,
   CuratorGroup,
   ContentActor,
+  DAOId,
+  ContentParameters,
+  StorageObjectOwner,
+  AbstractStorageObjectOwner,
+  WorkingGroupType,
+  NewAsset,
+  Channel,
+  ChannelOwner,
   ChannelId,
   ChannelCategoryId,
+  ChannelCategory,
+  ChannelCategoryCreationParameters,
+  ChannelCategoryUpdateParameters,
+  ChannelCreationParameters,
+  ChannelUpdateParameters,
+  ChannelOwnershipTransferRequestId,
+  ChannelOwnershipTransferRequest,
+  Video,
   VideoId,
   VideoCategoryId,
-  PlaylistId,
+  VideoCategory,
+  VideoCategoryCreationParameters,
+  VideoCategoryUpdateParameters,
+  VideoCreationParameters,
+  VideoUpdateParameters,
+  Person,
   PersonId,
+  PersonController,
+  PersonActor,
+  PersonCreationParameters,
+  PersonUpdateParameters,
+  Playlist,
+  PlaylistId,
+  PlaylistCreationParameters,
+  PlaylistUpdateParameters,
   SeriesId,
-  ChannelTransferRequestId,
+  Series,
+  Season,
+  SeriesCreationParameters,
+  SeriesUpdateParameters,
+  SeasonCreationParameters,
+  SeasonUpdateParameters,
+  EpisodeCreationParameters,
+  EpisodeUpdateParemters,
+  // type used in data_directory Events
+  Content,
 }
 
 export default contentDirectoryTypes

+ 4 - 3
types/src/legacy.ts

@@ -19,10 +19,8 @@ import { RegistryTypes } from '@polkadot/types/types'
 import { Null } from '@polkadot/types'
 
 // from: versioned-store, versioned-store permissions, content-working-group
-export class Channel extends Null {} // in new content module
 export class ChannelContentType extends Null {}
 export class ChannelCurationStatus extends Null {}
-export class ChannelId extends Null {} // in new content module
 export class ChannelPublicationStatus extends Null {}
 export class CurationActor extends Null {}
 export class Curator extends Null {}
@@ -38,6 +36,8 @@ export class OptionalText extends Null {}
 export class Principal extends Null {}
 export class PrincipalId extends Null {}
 export class WorkingGroupUnstaker extends Null {}
+export class Credential extends Null {}
+export class CredentialSet extends Null {}
 
 // from: old content-directory
 export class Actor extends Null {}
@@ -107,7 +107,8 @@ export const legacyTypes: RegistryTypes = {
   Principal,
   PrincipalId,
   WorkingGroupUnstaker,
-
+  Credential,
+  CredentialSet,
   Nonce,
   EntityId,
   ClassId,

+ 15 - 1
yarn.lock

@@ -2262,8 +2262,22 @@
     "@types/yargs" "^15.0.0"
     chalk "^4.0.0"
 
-"@joystream/types@link:types":
+"@joystream/types@^0.14.0":
   version "0.14.0"
+  resolved "https://registry.yarnpkg.com/@joystream/types/-/types-0.14.0.tgz#3f243fb736d3cdd3dae90a90274c7a767fc96b75"
+  integrity sha512-t9LibCVM5j0NY2OQOXCGkZFFf1pbnQ9ccv0ZXMK7CfseRDwPtAlF/jVQUQQ03PAAGOKFWJQUenFUhPAbt6wKtg==
+  dependencies:
+    "@polkadot/api" "1.26.1"
+    "@polkadot/keyring" "^3.0.1"
+    "@polkadot/types" "1.26.1"
+    "@types/lodash" "^4.14.157"
+    "@types/vfile" "^4.0.0"
+    ajv "^6.11.0"
+    lodash "^4.17.15"
+    moment "^2.24.0"
+
+"@joystream/types@link:types":
+  version "0.16.0"
   dependencies:
     "@polkadot/api" "1.26.1"
     "@polkadot/keyring" "^3.0.1"

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