Przeglądaj źródła

Merge branch 'types-augment' into cli-upgrade

Leszek Wiesner 4 lat temu
rodzic
commit
0ee23eaa2e
37 zmienionych plików z 5140 dodań i 1907 usunięć
  1. 2 0
      types/.eslintignore
  2. 2 1
      types/.prettierignore
  3. 18 1822
      types/augment-codec/augment-types.ts
  4. 5 0
      types/augment/all/definitions.ts
  5. 867 0
      types/augment/all/defs.json
  6. 4 0
      types/augment/all/index.ts
  7. 1242 0
      types/augment/all/types.ts
  8. 247 0
      types/augment/augment-api-consts.ts
  9. 1149 0
      types/augment/augment-api-query.ts
  10. 1389 0
      types/augment/augment-api-tx.ts
  11. 7 0
      types/augment/augment-api.ts
  12. 5 0
      types/augment/augment-types.ts
  13. 1 0
      types/augment/definitions.ts
  14. 4 0
      types/augment/index.ts
  15. 4 0
      types/augment/types.ts
  16. 8 4
      types/package.json
  17. 4 0
      types/src/JoyEnum.ts
  18. 4 0
      types/src/JoyStruct.ts
  19. 1 1
      types/src/common.ts
  20. 3 1
      types/src/content-working-group/index.ts
  21. 0 2
      types/src/definitions/definitions.ts
  22. 2 2
      types/src/forum.ts
  23. 3 2
      types/src/hiring/index.ts
  24. 0 1
      types/src/mint/index.ts
  25. 4 2
      types/src/proposals.ts
  26. 0 41
      types/src/scripts/defsFromTypes.ts
  27. 43 9
      types/src/scripts/generateCodecDefs.ts
  28. 87 0
      types/src/scripts/generateRegistryJson.ts
  29. 1 1
      types/src/stake/index.ts
  30. 3 3
      types/src/versioned-store/EntityCodec.ts
  31. 2 3
      types/src/versioned-store/permissions/batching/parametrized-property-value.ts
  32. 3 0
      types/src/versioned-store/permissions/index.ts
  33. 0 2
      types/src/working-group/index.ts
  34. 12 0
      types/tsconfig-augment-codec.json
  35. 13 0
      types/tsconfig-augment.json
  36. 1 4
      types/tsconfig-base.json
  37. 0 6
      types/tsconfig-scripts.json

+ 2 - 0
types/.eslintignore

@@ -1 +1,3 @@
 **/*.d.ts
+augment/
+augment-types/

+ 2 - 1
types/.prettierignore

@@ -4,4 +4,5 @@
 hiring/schemas/role.schema.json
 lib/
 build/
-src/definitions
+augment/
+augment-codec/

Plik diff jest za duży
+ 18 - 1822
types/augment-codec/augment-types.ts


+ 5 - 0
types/augment/all/definitions.ts

@@ -0,0 +1,5 @@
+const defs = require('./defs.json');
+
+export default {
+  types: defs
+}

+ 867 - 0
types/augment/all/defs.json

@@ -0,0 +1,867 @@
+{
+    "MemoText": "Text",
+    "Credential": "u64",
+    "CredentialSet": "Vec<Credential>",
+    "BlockAndTime": {
+        "block": "u32",
+        "time": "u64"
+    },
+    "ThreadId": "u64",
+    "PostId": "u64",
+    "InputValidationLengthConstraint": {
+        "min": "u16",
+        "max_min_diff": "u16"
+    },
+    "WorkingGroup": {
+        "_enum": [
+            "Storage"
+        ]
+    },
+    "SlashingTerms": {
+        "_enum": {
+            "Unslashable": "Null",
+            "Slashable": "SlashableTerms"
+        }
+    },
+    "SlashableTerms": {
+        "max_count": "u16",
+        "max_percent_pts_per_time": "u16"
+    },
+    "EntryMethod": {
+        "_enum": {
+            "Paid": "u64",
+            "Screening": "AccountId",
+            "Genesis": "Null"
+        }
+    },
+    "MemberId": "u64",
+    "PaidTermId": "u64",
+    "SubscriptionId": "u64",
+    "Membership": {
+        "handle": "Text",
+        "avatar_uri": "Text",
+        "about": "Text",
+        "registered_at_block": "u32",
+        "registered_at_time": "u64",
+        "entry": "EntryMethod",
+        "suspended": "bool",
+        "subscription": "Option<SubscriptionId>",
+        "root_account": "GenericAccountId",
+        "controller_account": "GenericAccountId"
+    },
+    "PaidMembershipTerms": {
+        "fee": "u128",
+        "text": "Text"
+    },
+    "ActorId": "u64",
+    "ElectionStage": {
+        "_enum": {
+            "Announcing": "u32",
+            "Voting": "u32",
+            "Revealing": "u32"
+        }
+    },
+    "ElectionStake": {
+        "new": "u128",
+        "transferred": "u128"
+    },
+    "SealedVote": {
+        "voter": "GenericAccountId",
+        "commitment": "[u8;32]",
+        "stake": "ElectionStake",
+        "vote": "Option<GenericAccountId>"
+    },
+    "TransferableStake": {
+        "seat": "u128",
+        "backing": "u128"
+    },
+    "ElectionParameters": {
+        "announcing_period": "u32",
+        "voting_period": "u32",
+        "revealing_period": "u32",
+        "council_size": "u32",
+        "candidacy_limit": "u32",
+        "new_term_duration": "u32",
+        "min_council_stake": "u128",
+        "min_voting_stake": "u128"
+    },
+    "Seat": {
+        "member": "GenericAccountId",
+        "stake": "u128",
+        "backers": "Backers"
+    },
+    "Seats": "Vec<Seat>",
+    "Backer": {
+        "member": "GenericAccountId",
+        "stake": "u128"
+    },
+    "Backers": "Vec<Backer>",
+    "RoleParameters": {
+        "min_stake": "u128",
+        "min_actors": "u32",
+        "max_actors": "u32",
+        "reward": "u128",
+        "reward_period": "u32",
+        "bonding_period": "u32",
+        "unbonding_period": "u32",
+        "min_service_period": "u32",
+        "startup_grace_period": "u32",
+        "entry_request_fee": "u128"
+    },
+    "PostTextChange": {
+        "expired_at": "BlockAndTime",
+        "text": "Text"
+    },
+    "ModerationAction": {
+        "moderated_at": "BlockAndTime",
+        "moderator_id": "GenericAccountId",
+        "rationale": "Text"
+    },
+    "ChildPositionInParentCategory": {
+        "parent_id": "CategoryId",
+        "child_nr_in_parent_category": "u32"
+    },
+    "CategoryId": "u64",
+    "Category": {
+        "id": "CategoryId",
+        "title": "Text",
+        "description": "Text",
+        "created_at": "BlockAndTime",
+        "deleted": "bool",
+        "archived": "bool",
+        "num_direct_subcategories": "u32",
+        "num_direct_unmoderated_threads": "u32",
+        "num_direct_moderated_threads": "u32",
+        "position_in_parent_category": "Option<ChildPositionInParentCategory>",
+        "moderator_id": "GenericAccountId"
+    },
+    "Thread": {
+        "id": "ThreadId",
+        "title": "Text",
+        "category_id": "CategoryId",
+        "nr_in_category": "u32",
+        "moderation": "Option<ModerationAction>",
+        "num_unmoderated_posts": "u32",
+        "num_moderated_posts": "u32",
+        "created_at": "BlockAndTime",
+        "author_id": "GenericAccountId"
+    },
+    "Post": {
+        "id": "PostId",
+        "thread_id": "ThreadId",
+        "nr_in_thread": "u32",
+        "current_text": "Text",
+        "moderation": "Option<ModerationAction>",
+        "text_change_history": "Vec<PostTextChange>",
+        "created_at": "BlockAndTime",
+        "author_id": "GenericAccountId"
+    },
+    "ReplyId": "u64",
+    "Reply": {
+        "owner": "GenericAccountId",
+        "thread_id": "ThreadId",
+        "text": "Text",
+        "moderation": "Option<ModerationAction>"
+    },
+    "StakeId": "u64",
+    "Stake": {
+        "created": "u32",
+        "staking_status": "StakingStatus"
+    },
+    "StakingStatus": {
+        "_enum": {
+            "NotStaked": "Null",
+            "Staked": "Staked"
+        }
+    },
+    "Staked": {
+        "staked_amount": "u128",
+        "staked_status": "StakedStatus",
+        "next_slash_id": "u64",
+        "ongoing_slashes": "BTreeMap<u64,Slash>"
+    },
+    "StakedStatus": {
+        "_enum": {
+            "Normal": "Null",
+            "Unstaking": "Unstaking"
+        }
+    },
+    "Unstaking": {
+        "started_at_block": "u32",
+        "is_active": "bool",
+        "blocks_remaining_in_active_period_for_unstaking": "u32"
+    },
+    "Slash": {
+        "started_at_block": "u32",
+        "is_active": "bool",
+        "blocks_remaining_in_active_period_for_slashing": "u32",
+        "slash_amount": "u128"
+    },
+    "MintId": "u64",
+    "Mint": {
+        "capacity": "u128",
+        "next_adjustment": "Option<NextAdjustment>",
+        "created_at": "u32",
+        "total_minted": "u128"
+    },
+    "MintBalanceOf": "Balance",
+    "BalanceOfMint": "Balance",
+    "NextAdjustment": {
+        "adjustment": "AdjustOnInterval",
+        "at_block": "u32"
+    },
+    "AdjustOnInterval": {
+        "block_interval": "u32",
+        "adjustment_type": "AdjustCapacityBy"
+    },
+    "AdjustCapacityBy": {
+        "_enum": {
+            "Setting": "u128",
+            "Adding": "u128",
+            "Reducing": "u128"
+        }
+    },
+    "RecipientId": "u64",
+    "RewardRelationshipId": "u64",
+    "Recipient": {
+        "total_reward_received": "u128",
+        "total_reward_missed": "u128"
+    },
+    "RewardRelationship": {
+        "recipient": "u64",
+        "mint_id": "u64",
+        "account": "GenericAccountId",
+        "amount_per_payout": "u128",
+        "next_payment_at_block": "Option<u32>",
+        "payout_interval": "Option<u32>",
+        "total_reward_received": "u128",
+        "total_reward_missed": "u128"
+    },
+    "ApplicationId": "u64",
+    "OpeningId": "u64",
+    "Application": {
+        "opening_id": "u64",
+        "application_index_in_opening": "u32",
+        "add_to_opening_in_block": "u32",
+        "active_role_staking_id": "Option<u64>",
+        "active_application_staking_id": "Option<u64>",
+        "stage": "ApplicationStage",
+        "human_readable_text": "Text"
+    },
+    "ApplicationStage": {
+        "_enum": {
+            "Active": "Null",
+            "Unstaking": "UnstakingApplicationStage",
+            "Inactive": "InactiveApplicationStage"
+        }
+    },
+    "ActivateOpeningAt": {
+        "_enum": {
+            "CurrentBlock": "Null",
+            "ExactBlock": "u32"
+        }
+    },
+    "ApplicationRationingPolicy": {
+        "max_active_applicants": "u32"
+    },
+    "OpeningStage": {
+        "_enum": {
+            "WaitingToBegin": "WaitingToBeingOpeningStageVariant",
+            "Active": "ActiveOpeningStageVariant"
+        }
+    },
+    "StakingPolicy": {
+        "amount": "u128",
+        "amount_mode": "StakingAmountLimitMode",
+        "crowded_out_unstaking_period_length": "Option<u32>",
+        "review_period_expired_unstaking_period_length": "Option<u32>"
+    },
+    "Opening": {
+        "created": "u32",
+        "stage": "OpeningStage",
+        "max_review_period_length": "u32",
+        "application_rationing_policy": "Option<ApplicationRationingPolicy>",
+        "application_staking_policy": "Option<StakingPolicy>",
+        "role_staking_policy": "Option<StakingPolicy>",
+        "human_readable_text": "Text"
+    },
+    "WaitingToBeingOpeningStageVariant": {
+        "begins_at_block": "u32"
+    },
+    "ActiveOpeningStageVariant": {
+        "stage": "ActiveOpeningStage",
+        "applications_added": "Vec<HiringApplicationId>",
+        "active_application_count": "u32",
+        "unstaking_application_count": "u32",
+        "deactivated_application_count": "u32"
+    },
+    "ActiveOpeningStage": {
+        "_enum": {
+            "AcceptingApplications": "AcceptingApplications",
+            "ReviewPeriod": "ReviewPeriod",
+            "Deactivated": "Deactivated"
+        }
+    },
+    "AcceptingApplications": {
+        "started_accepting_applicants_at_block": "u32"
+    },
+    "ReviewPeriod": {
+        "started_accepting_applicants_at_block": "u32",
+        "started_review_period_at_block": "u32"
+    },
+    "Deactivated": {
+        "cause": "OpeningDeactivationCause",
+        "deactivated_at_block": "u32",
+        "started_accepting_applicants_at_block": "u32",
+        "started_review_period_at_block": "Option<u32>"
+    },
+    "OpeningDeactivationCause": {
+        "_enum": [
+            "CancelledBeforeActivation",
+            "CancelledAcceptingApplications",
+            "CancelledInReviewPeriod",
+            "ReviewPeriodExpired",
+            "Filled"
+        ]
+    },
+    "InactiveApplicationStage": {
+        "deactivation_initiated": "u32",
+        "deactivated": "u32",
+        "cause": "ApplicationDeactivationCause"
+    },
+    "UnstakingApplicationStage": {
+        "deactivation_initiated": "u32",
+        "cause": "ApplicationDeactivationCause"
+    },
+    "ApplicationDeactivationCause": {
+        "_enum": [
+            "External",
+            "Hired",
+            "NotHired",
+            "CrowdedOut",
+            "OpeningCancelled",
+            "ReviewPeriodExpired",
+            "OpeningFilled"
+        ]
+    },
+    "StakingAmountLimitMode": {
+        "_enum": [
+            "AtLeast",
+            "Exact"
+        ]
+    },
+    "ClassId": "u64",
+    "EntityId": "u64",
+    "Class": {
+        "id": "u64",
+        "properties": "Vec<Property>",
+        "schemas": "Vec<ClassSchema>",
+        "name": "Text",
+        "description": "Text"
+    },
+    "Entity": {
+        "id": "u64",
+        "class_id": "u64",
+        "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,u64)"
+        }
+    },
+    "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<u64>"
+        }
+    },
+    "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": "u64"
+    },
+    "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": "u64",
+        "property_index": "u16"
+    },
+    "ChannelId": "u64",
+    "CuratorId": "u64",
+    "CuratorOpeningId": "u64",
+    "CuratorApplicationId": "u64",
+    "LeadId": "u64",
+    "PrincipalId": "u64",
+    "OptionalText": "Option<Text>",
+    "Channel": {
+        "verified": "bool",
+        "handle": "Text",
+        "title": "OptionalText",
+        "description": "OptionalText",
+        "avatar": "OptionalText",
+        "banner": "OptionalText",
+        "content": "ChannelContentType",
+        "owner": "MemberId",
+        "role_account": "GenericAccountId",
+        "publication_status": "ChannelPublicationStatus",
+        "curation_status": "ChannelCurationStatus",
+        "created": "u32",
+        "principal_id": "u64"
+    },
+    "ChannelContentType": {
+        "_enum": [
+            "Video",
+            "Music",
+            "Ebook"
+        ]
+    },
+    "ChannelCurationStatus": {
+        "_enum": [
+            "Normal",
+            "Censored"
+        ]
+    },
+    "ChannelPublicationStatus": {
+        "_enum": [
+            "Public",
+            "Unlisted"
+        ]
+    },
+    "CurationActor": {
+        "_enum": {
+            "Lead": "Null",
+            "Curator": "u64"
+        }
+    },
+    "Curator": {
+        "role_account": "GenericAccountId",
+        "reward_relationship": "Option<u64>",
+        "role_stake_profile": "Option<CuratorRoleStakeProfile>",
+        "stage": "CuratorRoleStage",
+        "induction": "CuratorInduction",
+        "principal_id": "u64"
+    },
+    "CuratorApplication": {
+        "role_account": "GenericAccountId",
+        "curator_opening_id": "u64",
+        "member_id": "MemberId",
+        "application_id": "HiringApplicationId"
+    },
+    "CuratorOpening": {
+        "opening_id": "u64",
+        "curator_applications": "Vec<u64>",
+        "policy_commitment": "OpeningPolicyCommitment"
+    },
+    "Lead": {
+        "member_id": "MemberId",
+        "role_account": "GenericAccountId",
+        "reward_relationship": "Option<u64>",
+        "inducted": "u32",
+        "stage": "LeadRoleState"
+    },
+    "OpeningPolicyCommitment": {
+        "application_rationing_policy": "Option<ApplicationRationingPolicy>",
+        "max_review_period_length": "u32",
+        "application_staking_policy": "Option<StakingPolicy>",
+        "role_staking_policy": "Option<StakingPolicy>",
+        "role_slashing_terms": "SlashingTerms",
+        "fill_opening_successful_applicant_application_stake_unstaking_period": "Option<u32>",
+        "fill_opening_failed_applicant_application_stake_unstaking_period": "Option<u32>",
+        "fill_opening_failed_applicant_role_stake_unstaking_period": "Option<u32>",
+        "terminate_curator_application_stake_unstaking_period": "Option<u32>",
+        "terminate_curator_role_stake_unstaking_period": "Option<u32>",
+        "exit_curator_role_application_stake_unstaking_period": "Option<u32>",
+        "exit_curator_role_stake_unstaking_period": "Option<u32>"
+    },
+    "Principal": {
+        "_enum": {
+            "Lead": "Null",
+            "Curator": "u64",
+            "ChannelOwner": "u64"
+        }
+    },
+    "WorkingGroupUnstaker": {
+        "_enum": {
+            "Lead": "u64",
+            "Curator": "u64"
+        }
+    },
+    "CuratorApplicationIdToCuratorIdMap": "BTreeMap<HiringApplicationId,u64>",
+    "CuratorApplicationIdSet": "Vec<u64>",
+    "CuratorRoleStakeProfile": {
+        "stake_id": "u64",
+        "termination_unstaking_period": "Option<u32>",
+        "exit_unstaking_period": "Option<u32>"
+    },
+    "CuratorRoleStage": {
+        "_enum": {
+            "Active": "Null",
+            "Unstaking": "CuratorExitSummary",
+            "Exited": "CuratorExitSummary"
+        }
+    },
+    "CuratorExitSummary": {
+        "origin": "CuratorExitInitiationOrigin",
+        "initiated_at_block_number": "u32",
+        "rationale_text": "Text"
+    },
+    "CuratorExitInitiationOrigin": {
+        "_enum": [
+            "Lead",
+            "Curator"
+        ]
+    },
+    "LeadRoleState": {
+        "_enum": {
+            "Active": "Null",
+            "Exited": "ExitedLeadRole"
+        }
+    },
+    "ExitedLeadRole": {
+        "initiated_at_block_number": "u32"
+    },
+    "CuratorInduction": {
+        "lead": "u64",
+        "curator_application_id": "u64",
+        "at_block": "u32"
+    },
+    "RationaleText": "Bytes",
+    "ApplicationOf": {
+        "role_account_id": "GenericAccountId",
+        "opening_id": "u64",
+        "member_id": "MemberId",
+        "application_id": "HiringApplicationId"
+    },
+    "ApplicationIdSet": "BTreeSet<HiringApplicationId>",
+    "ApplicationIdToWorkerIdMap": "BTreeMap<HiringApplicationId,WorkerId>",
+    "WorkerId": "u64",
+    "WorkerOf": {
+        "member_id": "MemberId",
+        "role_account_id": "GenericAccountId",
+        "reward_relationship": "Option<u64>",
+        "role_stake_profile": "Option<RoleStakeProfile>"
+    },
+    "OpeningOf": {
+        "hiring_opening_id": "u64",
+        "applications": "Vec<HiringApplicationId>",
+        "policy_commitment": "WorkingGroupOpeningPolicyCommitment",
+        "opening_type": "OpeningType"
+    },
+    "StorageProviderId": "u64",
+    "OpeningType": {
+        "_enum": {
+            "Leader": "Null",
+            "Worker": "Null"
+        }
+    },
+    "HiringApplicationId": "u64",
+    "RewardPolicy": {
+        "amount_per_payout": "u128",
+        "next_payment_at_block": "u32",
+        "payout_interval": "Option<u32>"
+    },
+    "WorkingGroupOpeningPolicyCommitment": {
+        "application_rationing_policy": "Option<ApplicationRationingPolicy>",
+        "max_review_period_length": "u32",
+        "application_staking_policy": "Option<StakingPolicy>",
+        "role_staking_policy": "Option<StakingPolicy>",
+        "role_slashing_terms": "SlashingTerms",
+        "fill_opening_successful_applicant_application_stake_unstaking_period": "Option<u32>",
+        "fill_opening_failed_applicant_application_stake_unstaking_period": "Option<u32>",
+        "fill_opening_failed_applicant_role_stake_unstaking_period": "Option<u32>",
+        "terminate_application_stake_unstaking_period": "Option<u32>",
+        "terminate_role_stake_unstaking_period": "Option<u32>",
+        "exit_role_application_stake_unstaking_period": "Option<u32>",
+        "exit_role_stake_unstaking_period": "Option<u32>"
+    },
+    "RoleStakeProfile": {
+        "stake_id": "u64",
+        "termination_unstaking_period": "Option<u32>",
+        "exit_unstaking_period": "Option<u32>"
+    },
+    "Url": "Text",
+    "IPNSIdentity": "Text",
+    "ServiceProviderRecord": {
+        "identity": "IPNSIdentity",
+        "expires_at": "u32"
+    },
+    "ContentId": "[u8;32]",
+    "LiaisonJudgement": {
+        "_enum": [
+            "Pending",
+            "Accepted",
+            "Rejected"
+        ]
+    },
+    "DataObject": {
+        "owner": "MemberId",
+        "added_at": "BlockAndTime",
+        "type_id": "DataObjectTypeId",
+        "liaison": "StorageProviderId",
+        "liaison_judgement": "LiaisonJudgement",
+        "ipfs_content_id": "Text"
+    },
+    "DataObjectStorageRelationshipId": "u64",
+    "DataObjectStorageRelationship": {
+        "content_id": "ContentId",
+        "storage_provider": "StorageProviderId",
+        "ready": "bool"
+    },
+    "DataObjectTypeId": "u64",
+    "DataObjectType": {
+        "description": "Text",
+        "active": "bool"
+    },
+    "DataObjectsMap": "BTreeMap<ContentId,DataObject>",
+    "ProposalId": "u32",
+    "ProposalStatus": {
+        "_enum": {
+            "Active": "Option<ActiveStake>",
+            "Finalized": "Finalized"
+        }
+    },
+    "ProposalOf": {
+        "parameters": "ProposalParameters",
+        "proposerId": "MemberId",
+        "title": "Text",
+        "description": "Text",
+        "createdAt": "u32",
+        "status": "ProposalStatus",
+        "votingResults": "VotingResults"
+    },
+    "ProposalDetails": {
+        "_enum": {
+            "Text": "Text",
+            "RuntimeUpgrade": "Vec<u8>",
+            "SetElectionParameters": "ElectionParameters",
+            "Spending": "(Balance,AccountId)",
+            "SetLead": "Option<SetLeadParams>",
+            "SetContentWorkingGroupMintCapacity": "u128",
+            "EvictStorageProvider": "GenericAccountId",
+            "SetValidatorCount": "u32",
+            "SetStorageRoleParameters": "RoleParameters",
+            "AddWorkingGroupLeaderOpening": "AddOpeningParameters",
+            "BeginReviewWorkingGroupLeaderApplication": "(u64,WorkingGroup)",
+            "FillWorkingGroupLeaderOpening": "FillOpeningParameters",
+            "SetWorkingGroupMintCapacity": "(Balance,WorkingGroup)",
+            "DecreaseWorkingGroupLeaderStake": "(WorkerId,Balance,WorkingGroup)",
+            "SlashWorkingGroupLeaderStake": "(WorkerId,Balance,WorkingGroup)",
+            "SetWorkingGroupLeaderReward": "(WorkerId,Balance,WorkingGroup)",
+            "TerminateWorkingGroupLeaderRole": "TerminateRoleParameters"
+        }
+    },
+    "ProposalDetailsOf": {
+        "_enum": {
+            "Text": "Text",
+            "RuntimeUpgrade": "Vec<u8>",
+            "SetElectionParameters": "ElectionParameters",
+            "Spending": "(Balance,AccountId)",
+            "SetLead": "Option<SetLeadParams>",
+            "SetContentWorkingGroupMintCapacity": "u128",
+            "EvictStorageProvider": "GenericAccountId",
+            "SetValidatorCount": "u32",
+            "SetStorageRoleParameters": "RoleParameters",
+            "AddWorkingGroupLeaderOpening": "AddOpeningParameters",
+            "BeginReviewWorkingGroupLeaderApplication": "(u64,WorkingGroup)",
+            "FillWorkingGroupLeaderOpening": "FillOpeningParameters",
+            "SetWorkingGroupMintCapacity": "(Balance,WorkingGroup)",
+            "DecreaseWorkingGroupLeaderStake": "(WorkerId,Balance,WorkingGroup)",
+            "SlashWorkingGroupLeaderStake": "(WorkerId,Balance,WorkingGroup)",
+            "SetWorkingGroupLeaderReward": "(WorkerId,Balance,WorkingGroup)",
+            "TerminateWorkingGroupLeaderRole": "TerminateRoleParameters"
+        }
+    },
+    "VotingResults": {
+        "abstensions": "u32",
+        "approvals": "u32",
+        "rejections": "u32",
+        "slashes": "u32"
+    },
+    "ProposalParameters": {
+        "votingPeriod": "u32",
+        "gracePeriod": "u32",
+        "approvalQuorumPercentage": "u32",
+        "approvalThresholdPercentage": "u32",
+        "slashingQuorumPercentage": "u32",
+        "slashingThresholdPercentage": "u32",
+        "requiredStake": "Option<u128>"
+    },
+    "VoteKind": {
+        "_enum": [
+            "Approve",
+            "Reject",
+            "Slash",
+            "Abstain"
+        ]
+    },
+    "ThreadCounter": {
+        "author_id": "MemberId",
+        "counter": "u32"
+    },
+    "DiscussionThread": {
+        "title": "Bytes",
+        "created_at": "u32",
+        "author_id": "MemberId"
+    },
+    "DiscussionPost": {
+        "text": "Bytes",
+        "created_at": "u32",
+        "updated_at": "u32",
+        "author_id": "MemberId",
+        "thread_id": "ThreadId",
+        "edition_number": "u32"
+    },
+    "AddOpeningParameters": {
+        "activate_at": "ActivateOpeningAt",
+        "commitment": "WorkingGroupOpeningPolicyCommitment",
+        "human_readable_text": "Bytes",
+        "working_group": "WorkingGroup"
+    },
+    "FillOpeningParameters": {
+        "opening_id": "u64",
+        "successful_application_id": "HiringApplicationId",
+        "reward_policy": "Option<RewardPolicy>",
+        "working_group": "WorkingGroup"
+    },
+    "TerminateRoleParameters": {
+        "worker_id": "WorkerId",
+        "rationale": "Bytes",
+        "slash": "bool",
+        "working_group": "WorkingGroup"
+    },
+    "ActiveStake": {
+        "stake_id": "u64",
+        "source_account_id": "GenericAccountId"
+    },
+    "Finalized": {
+        "proposalStatus": "ProposalDecisionStatus",
+        "finalizedAt": "u32",
+        "encodedUnstakingErrorDueToBrokenRuntime": "Option<Vec<u8>>",
+        "stakeDataAfterUnstakingError": "Option<ActiveStake>"
+    },
+    "ProposalDecisionStatus": {
+        "_enum": {
+            "Canceled": "Null",
+            "Vetoed": "Null",
+            "Rejected": "Null",
+            "Slashed": "Null",
+            "Expired": "Null",
+            "Approved": "Approved"
+        }
+    },
+    "ExecutionFailed": {
+        "error": "Vec<u8>"
+    },
+    "Approved": {
+        "_enum": {
+            "PendingExecution": "Null",
+            "Executed": "Null",
+            "ExecutionFailed": "ExecutionFailed"
+        }
+    },
+    "SetLeadParams": "(MemberId,GenericAccountId)",
+    "Address": "AccountId",
+    "LookupSource": "AccountId"
+}

+ 4 - 0
types/augment/all/index.ts

@@ -0,0 +1,4 @@
+// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
+/* eslint-disable */
+
+export * from './types';

+ 1242 - 0
types/augment/all/types.ts

@@ -0,0 +1,1242 @@
+// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
+/* eslint-disable */
+
+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';
+
+/** @name AcceptingApplications */
+export interface AcceptingApplications extends Struct {
+  readonly started_accepting_applicants_at_block: u32;
+}
+
+/** @name ActivateOpeningAt */
+export interface ActivateOpeningAt extends Enum {
+  readonly isCurrentBlock: boolean;
+  readonly isExactBlock: boolean;
+  readonly asExactBlock: u32;
+}
+
+/** @name ActiveOpeningStage */
+export interface ActiveOpeningStage extends Enum {
+  readonly isAcceptingApplications: boolean;
+  readonly asAcceptingApplications: AcceptingApplications;
+  readonly isReviewPeriod: boolean;
+  readonly asReviewPeriod: ReviewPeriod;
+  readonly isDeactivated: boolean;
+  readonly asDeactivated: Deactivated;
+}
+
+/** @name ActiveOpeningStageVariant */
+export interface ActiveOpeningStageVariant extends Struct {
+  readonly stage: ActiveOpeningStage;
+  readonly applications_added: Vec<HiringApplicationId>;
+  readonly active_application_count: u32;
+  readonly unstaking_application_count: u32;
+  readonly deactivated_application_count: u32;
+}
+
+/** @name ActiveStake */
+export interface ActiveStake extends Struct {
+  readonly stake_id: u64;
+  readonly source_account_id: GenericAccountId;
+}
+
+/** @name ActorId */
+export interface ActorId extends u64 {}
+
+/** @name AddOpeningParameters */
+export interface AddOpeningParameters extends Struct {
+  readonly activate_at: ActivateOpeningAt;
+  readonly commitment: WorkingGroupOpeningPolicyCommitment;
+  readonly human_readable_text: Bytes;
+  readonly working_group: WorkingGroup;
+}
+
+/** @name Address */
+export interface Address extends AccountId {}
+
+/** @name AddSchemaSupportToEntity */
+export interface AddSchemaSupportToEntity extends Struct {
+  readonly entity_id: ParametrizedEntity;
+  readonly schema_id: u16;
+  readonly parametrized_property_values: Vec<ParametrizedClassPropertyValue>;
+}
+
+/** @name AdjustCapacityBy */
+export interface AdjustCapacityBy extends Enum {
+  readonly isSetting: boolean;
+  readonly asSetting: u128;
+  readonly isAdding: boolean;
+  readonly asAdding: u128;
+  readonly isReducing: boolean;
+  readonly asReducing: u128;
+}
+
+/** @name AdjustOnInterval */
+export interface AdjustOnInterval extends Struct {
+  readonly block_interval: u32;
+  readonly adjustment_type: AdjustCapacityBy;
+}
+
+/** @name Application */
+export interface Application extends Struct {
+  readonly opening_id: u64;
+  readonly application_index_in_opening: u32;
+  readonly add_to_opening_in_block: u32;
+  readonly active_role_staking_id: Option<u64>;
+  readonly active_application_staking_id: Option<u64>;
+  readonly stage: ApplicationStage;
+  readonly human_readable_text: Text;
+}
+
+/** @name ApplicationDeactivationCause */
+export interface ApplicationDeactivationCause extends Enum {
+  readonly isExternal: boolean;
+  readonly isHired: boolean;
+  readonly isNotHired: boolean;
+  readonly isCrowdedOut: boolean;
+  readonly isOpeningCancelled: boolean;
+  readonly isReviewPeriodExpired: boolean;
+  readonly isOpeningFilled: boolean;
+}
+
+/** @name ApplicationId */
+export interface ApplicationId extends u64 {}
+
+/** @name ApplicationIdSet */
+export interface ApplicationIdSet extends BTreeSet<HiringApplicationId> {}
+
+/** @name ApplicationIdToWorkerIdMap */
+export interface ApplicationIdToWorkerIdMap extends BTreeMap<HiringApplicationId, WorkerId> {}
+
+/** @name ApplicationOf */
+export interface ApplicationOf extends Struct {
+  readonly role_account_id: GenericAccountId;
+  readonly opening_id: u64;
+  readonly member_id: MemberId;
+  readonly application_id: HiringApplicationId;
+}
+
+/** @name ApplicationRationingPolicy */
+export interface ApplicationRationingPolicy extends Struct {
+  readonly max_active_applicants: u32;
+}
+
+/** @name ApplicationStage */
+export interface ApplicationStage extends Enum {
+  readonly isActive: boolean;
+  readonly isUnstaking: boolean;
+  readonly asUnstaking: UnstakingApplicationStage;
+  readonly isInactive: boolean;
+  readonly asInactive: InactiveApplicationStage;
+}
+
+/** @name Approved */
+export interface Approved extends Enum {
+  readonly isPendingExecution: boolean;
+  readonly isExecuted: boolean;
+  readonly isExecutionFailed: boolean;
+  readonly asExecutionFailed: ExecutionFailed;
+}
+
+/** @name Backer */
+export interface Backer extends Struct {
+  readonly member: GenericAccountId;
+  readonly stake: u128;
+}
+
+/** @name Backers */
+export interface Backers extends Vec<Backer> {}
+
+/** @name BalanceOfMint */
+export interface BalanceOfMint extends Balance {}
+
+/** @name BlockAndTime */
+export interface BlockAndTime extends Struct {
+  readonly block: u32;
+  readonly time: u64;
+}
+
+/** @name Category */
+export interface Category extends Struct {
+  readonly id: CategoryId;
+  readonly title: Text;
+  readonly description: Text;
+  readonly created_at: BlockAndTime;
+  readonly deleted: bool;
+  readonly archived: bool;
+  readonly num_direct_subcategories: u32;
+  readonly num_direct_unmoderated_threads: u32;
+  readonly num_direct_moderated_threads: u32;
+  readonly position_in_parent_category: Option<ChildPositionInParentCategory>;
+  readonly moderator_id: GenericAccountId;
+}
+
+/** @name CategoryId */
+export interface CategoryId extends u64 {}
+
+/** @name Channel */
+export interface Channel extends Struct {
+  readonly verified: bool;
+  readonly handle: Text;
+  readonly title: OptionalText;
+  readonly description: OptionalText;
+  readonly avatar: OptionalText;
+  readonly banner: OptionalText;
+  readonly content: ChannelContentType;
+  readonly owner: MemberId;
+  readonly role_account: GenericAccountId;
+  readonly publication_status: ChannelPublicationStatus;
+  readonly curation_status: ChannelCurationStatus;
+  readonly created: u32;
+  readonly principal_id: u64;
+}
+
+/** @name ChannelContentType */
+export interface ChannelContentType extends Enum {
+  readonly isVideo: boolean;
+  readonly isMusic: boolean;
+  readonly isEbook: boolean;
+}
+
+/** @name ChannelCurationStatus */
+export interface ChannelCurationStatus extends Enum {
+  readonly isNormal: boolean;
+  readonly isCensored: boolean;
+}
+
+/** @name ChannelId */
+export interface ChannelId extends u64 {}
+
+/** @name ChannelPublicationStatus */
+export interface ChannelPublicationStatus extends Enum {
+  readonly isPublic: boolean;
+  readonly isUnlisted: boolean;
+}
+
+/** @name ChildPositionInParentCategory */
+export interface ChildPositionInParentCategory extends Struct {
+  readonly parent_id: CategoryId;
+  readonly child_nr_in_parent_category: u32;
+}
+
+/** @name Class */
+export interface Class extends Struct {
+  readonly id: u64;
+  readonly properties: Vec<Property>;
+  readonly schemas: Vec<ClassSchema>;
+  readonly name: Text;
+  readonly description: Text;
+}
+
+/** @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 ClassPropertyValue */
+export interface ClassPropertyValue extends Struct {
+  readonly in_class_index: u16;
+  readonly value: PropertyValue;
+}
+
+/** @name ClassSchema */
+export interface ClassSchema extends Struct {
+  readonly properties: Vec<u16>;
+}
+
+/** @name ContentId */
+export interface ContentId extends U8aFixed {}
+
+/** @name CreateEntity */
+export interface CreateEntity extends Struct {
+  readonly class_id: u64;
+}
+
+/** @name Credential */
+export interface Credential extends u64 {}
+
+/** @name CredentialSet */
+export interface CredentialSet extends Vec<Credential> {}
+
+/** @name CurationActor */
+export interface CurationActor extends Enum {
+  readonly isLead: boolean;
+  readonly isCurator: boolean;
+  readonly asCurator: u64;
+}
+
+/** @name Curator */
+export interface Curator extends Struct {
+  readonly role_account: GenericAccountId;
+  readonly reward_relationship: Option<u64>;
+  readonly role_stake_profile: Option<CuratorRoleStakeProfile>;
+  readonly stage: CuratorRoleStage;
+  readonly induction: CuratorInduction;
+  readonly principal_id: u64;
+}
+
+/** @name CuratorApplication */
+export interface CuratorApplication extends Struct {
+  readonly role_account: GenericAccountId;
+  readonly curator_opening_id: u64;
+  readonly member_id: MemberId;
+  readonly application_id: HiringApplicationId;
+}
+
+/** @name CuratorApplicationId */
+export interface CuratorApplicationId extends u64 {}
+
+/** @name CuratorApplicationIdSet */
+export interface CuratorApplicationIdSet extends Vec<u64> {}
+
+/** @name CuratorApplicationIdToCuratorIdMap */
+export interface CuratorApplicationIdToCuratorIdMap extends BTreeMap<HiringApplicationId, u64> {}
+
+/** @name CuratorExitInitiationOrigin */
+export interface CuratorExitInitiationOrigin extends Enum {
+  readonly isLead: boolean;
+  readonly isCurator: boolean;
+}
+
+/** @name CuratorExitSummary */
+export interface CuratorExitSummary extends Struct {
+  readonly origin: CuratorExitInitiationOrigin;
+  readonly initiated_at_block_number: u32;
+  readonly rationale_text: Text;
+}
+
+/** @name CuratorId */
+export interface CuratorId extends u64 {}
+
+/** @name CuratorInduction */
+export interface CuratorInduction extends Struct {
+  readonly lead: u64;
+  readonly curator_application_id: u64;
+  readonly at_block: u32;
+}
+
+/** @name CuratorOpening */
+export interface CuratorOpening extends Struct {
+  readonly opening_id: u64;
+  readonly curator_applications: Vec<u64>;
+  readonly policy_commitment: OpeningPolicyCommitment;
+}
+
+/** @name CuratorOpeningId */
+export interface CuratorOpeningId extends u64 {}
+
+/** @name CuratorRoleStage */
+export interface CuratorRoleStage extends Enum {
+  readonly isActive: boolean;
+  readonly isUnstaking: boolean;
+  readonly asUnstaking: CuratorExitSummary;
+  readonly isExited: boolean;
+  readonly asExited: CuratorExitSummary;
+}
+
+/** @name CuratorRoleStakeProfile */
+export interface CuratorRoleStakeProfile extends Struct {
+  readonly stake_id: u64;
+  readonly termination_unstaking_period: Option<u32>;
+  readonly exit_unstaking_period: Option<u32>;
+}
+
+/** @name DataObject */
+export interface DataObject extends Struct {
+  readonly owner: MemberId;
+  readonly added_at: BlockAndTime;
+  readonly type_id: DataObjectTypeId;
+  readonly liaison: StorageProviderId;
+  readonly liaison_judgement: LiaisonJudgement;
+  readonly ipfs_content_id: Text;
+}
+
+/** @name DataObjectsMap */
+export interface DataObjectsMap extends BTreeMap<ContentId, DataObject> {}
+
+/** @name DataObjectStorageRelationship */
+export interface DataObjectStorageRelationship extends Struct {
+  readonly content_id: ContentId;
+  readonly storage_provider: StorageProviderId;
+  readonly ready: bool;
+}
+
+/** @name DataObjectStorageRelationshipId */
+export interface DataObjectStorageRelationshipId extends u64 {}
+
+/** @name DataObjectType */
+export interface DataObjectType extends Struct {
+  readonly description: Text;
+  readonly active: bool;
+}
+
+/** @name DataObjectTypeId */
+export interface DataObjectTypeId extends u64 {}
+
+/** @name Deactivated */
+export interface Deactivated extends Struct {
+  readonly cause: OpeningDeactivationCause;
+  readonly deactivated_at_block: u32;
+  readonly started_accepting_applicants_at_block: u32;
+  readonly started_review_period_at_block: Option<u32>;
+}
+
+/** @name DiscussionPost */
+export interface DiscussionPost extends Struct {
+  readonly text: Bytes;
+  readonly created_at: u32;
+  readonly updated_at: u32;
+  readonly author_id: MemberId;
+  readonly thread_id: ThreadId;
+  readonly edition_number: u32;
+}
+
+/** @name DiscussionThread */
+export interface DiscussionThread extends Struct {
+  readonly title: Bytes;
+  readonly created_at: u32;
+  readonly author_id: MemberId;
+}
+
+/** @name ElectionParameters */
+export interface ElectionParameters extends Struct {
+  readonly announcing_period: u32;
+  readonly voting_period: u32;
+  readonly revealing_period: u32;
+  readonly council_size: u32;
+  readonly candidacy_limit: u32;
+  readonly new_term_duration: u32;
+  readonly min_council_stake: u128;
+  readonly min_voting_stake: u128;
+}
+
+/** @name ElectionStage */
+export interface ElectionStage extends Enum {
+  readonly isAnnouncing: boolean;
+  readonly asAnnouncing: u32;
+  readonly isVoting: boolean;
+  readonly asVoting: u32;
+  readonly isRevealing: boolean;
+  readonly asRevealing: u32;
+}
+
+/** @name ElectionStake */
+export interface ElectionStake extends Struct {
+  readonly new: u128;
+  readonly transferred: u128;
+}
+
+/** @name Entity */
+export interface Entity extends Struct {
+  readonly id: u64;
+  readonly class_id: u64;
+  readonly in_class_schema_indexes: Vec<u16>;
+}
+
+/** @name EntityId */
+export interface EntityId extends u64 {}
+
+/** @name EntityPermissions */
+export interface EntityPermissions extends Struct {
+  readonly update: CredentialSet;
+  readonly maintainer_has_all_permissions: bool;
+}
+
+/** @name EntryMethod */
+export interface EntryMethod extends Enum {
+  readonly isPaid: boolean;
+  readonly asPaid: u64;
+  readonly isScreening: boolean;
+  readonly asScreening: AccountId;
+  readonly isGenesis: boolean;
+}
+
+/** @name ExecutionFailed */
+export interface ExecutionFailed extends Struct {
+  readonly error: Bytes;
+}
+
+/** @name ExitedLeadRole */
+export interface ExitedLeadRole extends Struct {
+  readonly initiated_at_block_number: u32;
+}
+
+/** @name FillOpeningParameters */
+export interface FillOpeningParameters extends Struct {
+  readonly opening_id: u64;
+  readonly successful_application_id: HiringApplicationId;
+  readonly reward_policy: Option<RewardPolicy>;
+  readonly working_group: WorkingGroup;
+}
+
+/** @name Finalized */
+export interface Finalized extends Struct {
+  readonly proposalStatus: ProposalDecisionStatus;
+  readonly finalizedAt: u32;
+  readonly encodedUnstakingErrorDueToBrokenRuntime: Option<Bytes>;
+  readonly stakeDataAfterUnstakingError: Option<ActiveStake>;
+}
+
+/** @name HiringApplicationId */
+export interface HiringApplicationId extends u64 {}
+
+/** @name InactiveApplicationStage */
+export interface InactiveApplicationStage extends Struct {
+  readonly deactivation_initiated: u32;
+  readonly deactivated: u32;
+  readonly cause: ApplicationDeactivationCause;
+}
+
+/** @name InputValidationLengthConstraint */
+export interface InputValidationLengthConstraint extends Struct {
+  readonly min: u16;
+  readonly max_min_diff: u16;
+}
+
+/** @name IPNSIdentity */
+export interface IPNSIdentity extends Text {}
+
+/** @name Lead */
+export interface Lead extends Struct {
+  readonly member_id: MemberId;
+  readonly role_account: GenericAccountId;
+  readonly reward_relationship: Option<u64>;
+  readonly inducted: u32;
+  readonly stage: LeadRoleState;
+}
+
+/** @name LeadId */
+export interface LeadId extends u64 {}
+
+/** @name LeadRoleState */
+export interface LeadRoleState extends Enum {
+  readonly isActive: boolean;
+  readonly isExited: boolean;
+  readonly asExited: ExitedLeadRole;
+}
+
+/** @name LiaisonJudgement */
+export interface LiaisonJudgement extends Enum {
+  readonly isPending: boolean;
+  readonly isAccepted: boolean;
+  readonly isRejected: boolean;
+}
+
+/** @name LookupSource */
+export interface LookupSource extends AccountId {}
+
+/** @name MemberId */
+export interface MemberId extends u64 {}
+
+/** @name Membership */
+export interface Membership extends Struct {
+  readonly handle: Text;
+  readonly avatar_uri: Text;
+  readonly about: Text;
+  readonly registered_at_block: u32;
+  readonly registered_at_time: u64;
+  readonly entry: EntryMethod;
+  readonly suspended: bool;
+  readonly subscription: Option<SubscriptionId>;
+  readonly root_account: GenericAccountId;
+  readonly controller_account: GenericAccountId;
+}
+
+/** @name MemoText */
+export interface MemoText extends Text {}
+
+/** @name Mint */
+export interface Mint extends Struct {
+  readonly capacity: u128;
+  readonly next_adjustment: Option<NextAdjustment>;
+  readonly created_at: u32;
+  readonly total_minted: u128;
+}
+
+/** @name MintBalanceOf */
+export interface MintBalanceOf extends Balance {}
+
+/** @name MintId */
+export interface MintId extends u64 {}
+
+/** @name ModerationAction */
+export interface ModerationAction extends Struct {
+  readonly moderated_at: BlockAndTime;
+  readonly moderator_id: GenericAccountId;
+  readonly rationale: Text;
+}
+
+/** @name NextAdjustment */
+export interface NextAdjustment extends Struct {
+  readonly adjustment: AdjustOnInterval;
+  readonly at_block: u32;
+}
+
+/** @name Opening */
+export interface Opening extends Struct {
+  readonly created: u32;
+  readonly stage: OpeningStage;
+  readonly max_review_period_length: u32;
+  readonly application_rationing_policy: Option<ApplicationRationingPolicy>;
+  readonly application_staking_policy: Option<StakingPolicy>;
+  readonly role_staking_policy: Option<StakingPolicy>;
+  readonly human_readable_text: Text;
+}
+
+/** @name OpeningDeactivationCause */
+export interface OpeningDeactivationCause extends Enum {
+  readonly isCancelledBeforeActivation: boolean;
+  readonly isCancelledAcceptingApplications: boolean;
+  readonly isCancelledInReviewPeriod: boolean;
+  readonly isReviewPeriodExpired: boolean;
+  readonly isFilled: boolean;
+}
+
+/** @name OpeningId */
+export interface OpeningId extends u64 {}
+
+/** @name OpeningOf */
+export interface OpeningOf extends Struct {
+  readonly hiring_opening_id: u64;
+  readonly applications: Vec<HiringApplicationId>;
+  readonly policy_commitment: WorkingGroupOpeningPolicyCommitment;
+  readonly opening_type: OpeningType;
+}
+
+/** @name OpeningPolicyCommitment */
+export interface OpeningPolicyCommitment extends Struct {
+  readonly application_rationing_policy: Option<ApplicationRationingPolicy>;
+  readonly max_review_period_length: u32;
+  readonly application_staking_policy: Option<StakingPolicy>;
+  readonly role_staking_policy: Option<StakingPolicy>;
+  readonly role_slashing_terms: SlashingTerms;
+  readonly fill_opening_successful_applicant_application_stake_unstaking_period: Option<u32>;
+  readonly fill_opening_failed_applicant_application_stake_unstaking_period: Option<u32>;
+  readonly fill_opening_failed_applicant_role_stake_unstaking_period: Option<u32>;
+  readonly terminate_curator_application_stake_unstaking_period: Option<u32>;
+  readonly terminate_curator_role_stake_unstaking_period: Option<u32>;
+  readonly exit_curator_role_application_stake_unstaking_period: Option<u32>;
+  readonly exit_curator_role_stake_unstaking_period: Option<u32>;
+}
+
+/** @name OpeningStage */
+export interface OpeningStage extends Enum {
+  readonly isWaitingToBegin: boolean;
+  readonly asWaitingToBegin: WaitingToBeingOpeningStageVariant;
+  readonly isActive: boolean;
+  readonly asActive: ActiveOpeningStageVariant;
+}
+
+/** @name OpeningType */
+export interface OpeningType extends Enum {
+  readonly isLeader: boolean;
+  readonly isWorker: boolean;
+}
+
+/** @name Operation */
+export interface Operation extends Struct {
+  readonly with_credential: Option<Credential>;
+  readonly as_entity_maintainer: bool;
+  readonly operation_type: OperationType;
+}
+
+/** @name OperationType */
+export interface OperationType extends Enum {
+  readonly isCreateEntity: boolean;
+  readonly asCreateEntity: CreateEntity;
+  readonly isUpdatePropertyValues: boolean;
+  readonly asUpdatePropertyValues: UpdatePropertyValues;
+  readonly isAddSchemaSupportToEntity: boolean;
+  readonly asAddSchemaSupportToEntity: AddSchemaSupportToEntity;
+}
+
+/** @name OptionalText */
+export interface OptionalText extends Option<Text> {}
+
+/** @name PaidMembershipTerms */
+export interface PaidMembershipTerms extends Struct {
+  readonly fee: u128;
+  readonly text: Text;
+}
+
+/** @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 {
+  readonly isInternalEntityJustAdded: boolean;
+  readonly asInternalEntityJustAdded: u32;
+  readonly isExistingEntity: boolean;
+  readonly asExistingEntity: u64;
+}
+
+/** @name ParametrizedPropertyValue */
+export interface ParametrizedPropertyValue extends Enum {
+  readonly isPropertyValue: boolean;
+  readonly asPropertyValue: PropertyValue;
+  readonly isInternalEntityJustAdded: boolean;
+  readonly asInternalEntityJustAdded: u32;
+  readonly isInternalEntityVec: boolean;
+  readonly asInternalEntityVec: Vec<ParametrizedEntity>;
+}
+
+/** @name Post */
+export interface Post extends Struct {
+  readonly id: PostId;
+  readonly thread_id: ThreadId;
+  readonly nr_in_thread: u32;
+  readonly current_text: Text;
+  readonly moderation: Option<ModerationAction>;
+  readonly text_change_history: Vec<PostTextChange>;
+  readonly created_at: BlockAndTime;
+  readonly author_id: GenericAccountId;
+}
+
+/** @name PostId */
+export interface PostId extends u64 {}
+
+/** @name PostTextChange */
+export interface PostTextChange extends Struct {
+  readonly expired_at: BlockAndTime;
+  readonly text: Text;
+}
+
+/** @name Principal */
+export interface Principal extends Enum {
+  readonly isLead: boolean;
+  readonly isCurator: boolean;
+  readonly asCurator: u64;
+  readonly isChannelOwner: boolean;
+  readonly asChannelOwner: u64;
+}
+
+/** @name PrincipalId */
+export interface PrincipalId extends u64 {}
+
+/** @name Property */
+export interface Property extends Struct {
+  readonly prop_type: PropertyType;
+  readonly required: bool;
+  readonly name: Text;
+  readonly description: Text;
+}
+
+/** @name PropertyOfClass */
+export interface PropertyOfClass extends Struct {
+  readonly class_id: u64;
+  readonly property_index: u16;
+}
+
+/** @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, u64]>;
+}
+
+/** @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<u64>;
+}
+
+/** @name ProposalDecisionStatus */
+export interface ProposalDecisionStatus extends Enum {
+  readonly isCanceled: boolean;
+  readonly isVetoed: boolean;
+  readonly isRejected: boolean;
+  readonly isSlashed: boolean;
+  readonly isExpired: boolean;
+  readonly isApproved: boolean;
+  readonly asApproved: Approved;
+}
+
+/** @name ProposalDetails */
+export interface ProposalDetails extends Enum {
+  readonly isText: boolean;
+  readonly asText: Text;
+  readonly isRuntimeUpgrade: boolean;
+  readonly asRuntimeUpgrade: Bytes;
+  readonly isSetElectionParameters: boolean;
+  readonly asSetElectionParameters: ElectionParameters;
+  readonly isSpending: boolean;
+  readonly asSpending: ITuple<[Balance, AccountId]>;
+  readonly isSetLead: boolean;
+  readonly asSetLead: Option<SetLeadParams>;
+  readonly isSetContentWorkingGroupMintCapacity: boolean;
+  readonly asSetContentWorkingGroupMintCapacity: u128;
+  readonly isEvictStorageProvider: boolean;
+  readonly asEvictStorageProvider: GenericAccountId;
+  readonly isSetValidatorCount: boolean;
+  readonly asSetValidatorCount: u32;
+  readonly isSetStorageRoleParameters: boolean;
+  readonly asSetStorageRoleParameters: RoleParameters;
+  readonly isAddWorkingGroupLeaderOpening: boolean;
+  readonly asAddWorkingGroupLeaderOpening: AddOpeningParameters;
+  readonly isBeginReviewWorkingGroupLeaderApplication: boolean;
+  readonly asBeginReviewWorkingGroupLeaderApplication: ITuple<[u64, WorkingGroup]>;
+  readonly isFillWorkingGroupLeaderOpening: boolean;
+  readonly asFillWorkingGroupLeaderOpening: FillOpeningParameters;
+  readonly isSetWorkingGroupMintCapacity: boolean;
+  readonly asSetWorkingGroupMintCapacity: ITuple<[Balance, WorkingGroup]>;
+  readonly isDecreaseWorkingGroupLeaderStake: boolean;
+  readonly asDecreaseWorkingGroupLeaderStake: ITuple<[WorkerId, Balance, WorkingGroup]>;
+  readonly isSlashWorkingGroupLeaderStake: boolean;
+  readonly asSlashWorkingGroupLeaderStake: ITuple<[WorkerId, Balance, WorkingGroup]>;
+  readonly isSetWorkingGroupLeaderReward: boolean;
+  readonly asSetWorkingGroupLeaderReward: ITuple<[WorkerId, Balance, WorkingGroup]>;
+  readonly isTerminateWorkingGroupLeaderRole: boolean;
+  readonly asTerminateWorkingGroupLeaderRole: TerminateRoleParameters;
+}
+
+/** @name ProposalDetailsOf */
+export interface ProposalDetailsOf extends Enum {
+  readonly isText: boolean;
+  readonly asText: Text;
+  readonly isRuntimeUpgrade: boolean;
+  readonly asRuntimeUpgrade: Bytes;
+  readonly isSetElectionParameters: boolean;
+  readonly asSetElectionParameters: ElectionParameters;
+  readonly isSpending: boolean;
+  readonly asSpending: ITuple<[Balance, AccountId]>;
+  readonly isSetLead: boolean;
+  readonly asSetLead: Option<SetLeadParams>;
+  readonly isSetContentWorkingGroupMintCapacity: boolean;
+  readonly asSetContentWorkingGroupMintCapacity: u128;
+  readonly isEvictStorageProvider: boolean;
+  readonly asEvictStorageProvider: GenericAccountId;
+  readonly isSetValidatorCount: boolean;
+  readonly asSetValidatorCount: u32;
+  readonly isSetStorageRoleParameters: boolean;
+  readonly asSetStorageRoleParameters: RoleParameters;
+  readonly isAddWorkingGroupLeaderOpening: boolean;
+  readonly asAddWorkingGroupLeaderOpening: AddOpeningParameters;
+  readonly isBeginReviewWorkingGroupLeaderApplication: boolean;
+  readonly asBeginReviewWorkingGroupLeaderApplication: ITuple<[u64, WorkingGroup]>;
+  readonly isFillWorkingGroupLeaderOpening: boolean;
+  readonly asFillWorkingGroupLeaderOpening: FillOpeningParameters;
+  readonly isSetWorkingGroupMintCapacity: boolean;
+  readonly asSetWorkingGroupMintCapacity: ITuple<[Balance, WorkingGroup]>;
+  readonly isDecreaseWorkingGroupLeaderStake: boolean;
+  readonly asDecreaseWorkingGroupLeaderStake: ITuple<[WorkerId, Balance, WorkingGroup]>;
+  readonly isSlashWorkingGroupLeaderStake: boolean;
+  readonly asSlashWorkingGroupLeaderStake: ITuple<[WorkerId, Balance, WorkingGroup]>;
+  readonly isSetWorkingGroupLeaderReward: boolean;
+  readonly asSetWorkingGroupLeaderReward: ITuple<[WorkerId, Balance, WorkingGroup]>;
+  readonly isTerminateWorkingGroupLeaderRole: boolean;
+  readonly asTerminateWorkingGroupLeaderRole: TerminateRoleParameters;
+}
+
+/** @name ProposalId */
+export interface ProposalId extends u32 {}
+
+/** @name ProposalOf */
+export interface ProposalOf extends Struct {
+  readonly parameters: ProposalParameters;
+  readonly proposerId: MemberId;
+  readonly title: Text;
+  readonly description: Text;
+  readonly createdAt: u32;
+  readonly status: ProposalStatus;
+  readonly votingResults: VotingResults;
+}
+
+/** @name ProposalParameters */
+export interface ProposalParameters extends Struct {
+  readonly votingPeriod: u32;
+  readonly gracePeriod: u32;
+  readonly approvalQuorumPercentage: u32;
+  readonly approvalThresholdPercentage: u32;
+  readonly slashingQuorumPercentage: u32;
+  readonly slashingThresholdPercentage: u32;
+  readonly requiredStake: Option<u128>;
+}
+
+/** @name ProposalStatus */
+export interface ProposalStatus extends Enum {
+  readonly isActive: boolean;
+  readonly asActive: Option<ActiveStake>;
+  readonly isFinalized: boolean;
+  readonly asFinalized: Finalized;
+}
+
+/** @name RationaleText */
+export interface RationaleText extends Bytes {}
+
+/** @name Recipient */
+export interface Recipient extends Struct {
+  readonly total_reward_received: u128;
+  readonly total_reward_missed: u128;
+}
+
+/** @name RecipientId */
+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>;
+}
+
+/** @name Reply */
+export interface Reply extends Struct {
+  readonly owner: GenericAccountId;
+  readonly thread_id: ThreadId;
+  readonly text: Text;
+  readonly moderation: Option<ModerationAction>;
+}
+
+/** @name ReplyId */
+export interface ReplyId extends u64 {}
+
+/** @name ReviewPeriod */
+export interface ReviewPeriod extends Struct {
+  readonly started_accepting_applicants_at_block: u32;
+  readonly started_review_period_at_block: u32;
+}
+
+/** @name RewardPolicy */
+export interface RewardPolicy extends Struct {
+  readonly amount_per_payout: u128;
+  readonly next_payment_at_block: u32;
+  readonly payout_interval: Option<u32>;
+}
+
+/** @name RewardRelationship */
+export interface RewardRelationship extends Struct {
+  readonly recipient: u64;
+  readonly mint_id: u64;
+  readonly account: GenericAccountId;
+  readonly amount_per_payout: u128;
+  readonly next_payment_at_block: Option<u32>;
+  readonly payout_interval: Option<u32>;
+  readonly total_reward_received: u128;
+  readonly total_reward_missed: u128;
+}
+
+/** @name RewardRelationshipId */
+export interface RewardRelationshipId extends u64 {}
+
+/** @name RoleParameters */
+export interface RoleParameters extends Struct {
+  readonly min_stake: u128;
+  readonly min_actors: u32;
+  readonly max_actors: u32;
+  readonly reward: u128;
+  readonly reward_period: u32;
+  readonly bonding_period: u32;
+  readonly unbonding_period: u32;
+  readonly min_service_period: u32;
+  readonly startup_grace_period: u32;
+  readonly entry_request_fee: u128;
+}
+
+/** @name RoleStakeProfile */
+export interface RoleStakeProfile extends Struct {
+  readonly stake_id: u64;
+  readonly termination_unstaking_period: Option<u32>;
+  readonly exit_unstaking_period: Option<u32>;
+}
+
+/** @name SealedVote */
+export interface SealedVote extends Struct {
+  readonly voter: GenericAccountId;
+  readonly commitment: U8aFixed;
+  readonly stake: ElectionStake;
+  readonly vote: Option<GenericAccountId>;
+}
+
+/** @name Seat */
+export interface Seat extends Struct {
+  readonly member: GenericAccountId;
+  readonly stake: u128;
+  readonly backers: Backers;
+}
+
+/** @name Seats */
+export interface Seats extends Vec<Seat> {}
+
+/** @name ServiceProviderRecord */
+export interface ServiceProviderRecord extends Struct {
+  readonly identity: IPNSIdentity;
+  readonly expires_at: u32;
+}
+
+/** @name SetLeadParams */
+export interface SetLeadParams extends ITuple<[MemberId, GenericAccountId]> {}
+
+/** @name Slash */
+export interface Slash extends Struct {
+  readonly started_at_block: u32;
+  readonly is_active: bool;
+  readonly blocks_remaining_in_active_period_for_slashing: u32;
+  readonly slash_amount: u128;
+}
+
+/** @name SlashableTerms */
+export interface SlashableTerms extends Struct {
+  readonly max_count: u16;
+  readonly max_percent_pts_per_time: u16;
+}
+
+/** @name SlashingTerms */
+export interface SlashingTerms extends Enum {
+  readonly isUnslashable: boolean;
+  readonly isSlashable: boolean;
+  readonly asSlashable: SlashableTerms;
+}
+
+/** @name Stake */
+export interface Stake extends Struct {
+  readonly created: u32;
+  readonly staking_status: StakingStatus;
+}
+
+/** @name Staked */
+export interface Staked extends Struct {
+  readonly staked_amount: u128;
+  readonly staked_status: StakedStatus;
+  readonly next_slash_id: u64;
+  readonly ongoing_slashes: BTreeMap<u64, Slash>;
+}
+
+/** @name StakedStatus */
+export interface StakedStatus extends Enum {
+  readonly isNormal: boolean;
+  readonly isUnstaking: boolean;
+  readonly asUnstaking: Unstaking;
+}
+
+/** @name StakeId */
+export interface StakeId extends u64 {}
+
+/** @name StakingAmountLimitMode */
+export interface StakingAmountLimitMode extends Enum {
+  readonly isAtLeast: boolean;
+  readonly isExact: boolean;
+}
+
+/** @name StakingPolicy */
+export interface StakingPolicy extends Struct {
+  readonly amount: u128;
+  readonly amount_mode: StakingAmountLimitMode;
+  readonly crowded_out_unstaking_period_length: Option<u32>;
+  readonly review_period_expired_unstaking_period_length: Option<u32>;
+}
+
+/** @name StakingStatus */
+export interface StakingStatus extends Enum {
+  readonly isNotStaked: boolean;
+  readonly isStaked: boolean;
+  readonly asStaked: Staked;
+}
+
+/** @name StorageProviderId */
+export interface StorageProviderId extends u64 {}
+
+/** @name SubscriptionId */
+export interface SubscriptionId extends u64 {}
+
+/** @name TerminateRoleParameters */
+export interface TerminateRoleParameters extends Struct {
+  readonly worker_id: WorkerId;
+  readonly rationale: Bytes;
+  readonly slash: bool;
+  readonly working_group: WorkingGroup;
+}
+
+/** @name Thread */
+export interface Thread extends Struct {
+  readonly id: ThreadId;
+  readonly title: Text;
+  readonly category_id: CategoryId;
+  readonly nr_in_category: u32;
+  readonly moderation: Option<ModerationAction>;
+  readonly num_unmoderated_posts: u32;
+  readonly num_moderated_posts: u32;
+  readonly created_at: BlockAndTime;
+  readonly author_id: GenericAccountId;
+}
+
+/** @name ThreadCounter */
+export interface ThreadCounter extends Struct {
+  readonly author_id: MemberId;
+  readonly counter: u32;
+}
+
+/** @name ThreadId */
+export interface ThreadId extends u64 {}
+
+/** @name TransferableStake */
+export interface TransferableStake extends Struct {
+  readonly seat: u128;
+  readonly backing: u128;
+}
+
+/** @name Unstaking */
+export interface Unstaking extends Struct {
+  readonly started_at_block: u32;
+  readonly is_active: bool;
+  readonly blocks_remaining_in_active_period_for_unstaking: u32;
+}
+
+/** @name UnstakingApplicationStage */
+export interface UnstakingApplicationStage extends Struct {
+  readonly deactivation_initiated: u32;
+  readonly cause: ApplicationDeactivationCause;
+}
+
+/** @name UpdatePropertyValues */
+export interface UpdatePropertyValues extends Struct {
+  readonly entity_id: ParametrizedEntity;
+  readonly parametrized_property_values: Vec<ParametrizedClassPropertyValue>;
+}
+
+/** @name Url */
+export interface Url extends Text {}
+
+/** @name VoteKind */
+export interface VoteKind extends Enum {
+  readonly isApprove: boolean;
+  readonly isReject: boolean;
+  readonly isSlash: boolean;
+  readonly isAbstain: boolean;
+}
+
+/** @name VotingResults */
+export interface VotingResults extends Struct {
+  readonly abstensions: u32;
+  readonly approvals: u32;
+  readonly rejections: u32;
+  readonly slashes: u32;
+}
+
+/** @name WaitingToBeingOpeningStageVariant */
+export interface WaitingToBeingOpeningStageVariant extends Struct {
+  readonly begins_at_block: u32;
+}
+
+/** @name WorkerId */
+export interface WorkerId extends u64 {}
+
+/** @name WorkerOf */
+export interface WorkerOf extends Struct {
+  readonly member_id: MemberId;
+  readonly role_account_id: GenericAccountId;
+  readonly reward_relationship: Option<u64>;
+  readonly role_stake_profile: Option<RoleStakeProfile>;
+}
+
+/** @name WorkingGroup */
+export interface WorkingGroup extends Enum {
+  readonly isStorage: boolean;
+}
+
+/** @name WorkingGroupOpeningPolicyCommitment */
+export interface WorkingGroupOpeningPolicyCommitment extends Struct {
+  readonly application_rationing_policy: Option<ApplicationRationingPolicy>;
+  readonly max_review_period_length: u32;
+  readonly application_staking_policy: Option<StakingPolicy>;
+  readonly role_staking_policy: Option<StakingPolicy>;
+  readonly role_slashing_terms: SlashingTerms;
+  readonly fill_opening_successful_applicant_application_stake_unstaking_period: Option<u32>;
+  readonly fill_opening_failed_applicant_application_stake_unstaking_period: Option<u32>;
+  readonly fill_opening_failed_applicant_role_stake_unstaking_period: Option<u32>;
+  readonly terminate_application_stake_unstaking_period: Option<u32>;
+  readonly terminate_role_stake_unstaking_period: Option<u32>;
+  readonly exit_role_application_stake_unstaking_period: Option<u32>;
+  readonly exit_role_stake_unstaking_period: Option<u32>;
+}
+
+/** @name WorkingGroupUnstaker */
+export interface WorkingGroupUnstaker extends Enum {
+  readonly isLead: boolean;
+  readonly asLead: u64;
+  readonly isCurator: boolean;
+  readonly asCurator: u64;
+}
+
+export type PHANTOM_ALL = 'all';

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

@@ -0,0 +1,247 @@
+// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
+/* eslint-disable */
+
+import { Vec } from '@polkadot/types/codec';
+import { u32, u64 } from '@polkadot/types/primitive';
+import { Balance, BalanceOf, BlockNumber, Moment, Perbill, RuntimeDbWeight, Weight } from '@polkadot/types/interfaces/runtime';
+import { SessionIndex } from '@polkadot/types/interfaces/session';
+import { EraIndex } from '@polkadot/types/interfaces/staking';
+import { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
+
+declare module '@polkadot/metadata/Decorated/consts/types' {
+  export interface Constants {
+    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>;
+      /**
+       * The expected average block time at which BABE should be creating
+       * blocks. Since BABE is probabilistic it is not trivial to figure out
+       * what the expected average block time should be based on the slot
+       * duration and the security parameter `c` (where `1 - c` represents
+       * the probability of a slot being empty).
+       **/
+      expectedBlockTime: AugmentedConst<Moment>;
+    };
+    balances: {
+      /**
+       * The minimum amount required to keep an account open.
+       **/
+      existentialDeposit: AugmentedConst<Balance>;
+    };
+    contracts: {
+      /**
+       * The maximum nesting level of a call/instantiate stack. A reasonable default
+       * value is 100.
+       **/
+      maxDepth: AugmentedConst<u32>;
+      /**
+       * The maximum size of a storage value in bytes. A reasonable default is 16 KiB.
+       **/
+      maxValueSize: AugmentedConst<u32>;
+      /**
+       * Price of a byte of storage per one block interval. Should be greater than 0.
+       **/
+      rentByteFee: AugmentedConst<BalanceOf>;
+      /**
+       * The amount of funds a contract should deposit in order to offset
+       * the cost of one byte.
+       * 
+       * Let's suppose the deposit is 1,000 BU (balance units)/byte and the rent is 1 BU/byte/day,
+       * then a contract with 1,000,000 BU that uses 1,000 bytes of storage would pay no rent.
+       * But if the balance reduced to 500,000 BU and the storage stayed the same at 1,000,
+       * then it would pay 500 BU/day.
+       **/
+      rentDepositOffset: AugmentedConst<BalanceOf>;
+      /**
+       * Number of block delay an extrinsic claim surcharge has.
+       * 
+       * When claim surcharge is called by an extrinsic the rent is checked
+       * for current_block - delay
+       **/
+      signedClaimHandicap: AugmentedConst<BlockNumber>;
+      /**
+       * A size offset for an contract. A just created account with untouched storage will have that
+       * much of storage from the perspective of the state rent.
+       * 
+       * This is a simple way to ensure that contracts with empty storage eventually get deleted
+       * by making them pay rent. This creates an incentive to remove them early in order to save
+       * rent.
+       **/
+      storageSizeOffset: AugmentedConst<u32>;
+      /**
+       * Reward that is received by the party whose touch has led
+       * to removal of a contract.
+       **/
+      surchargeReward: AugmentedConst<BalanceOf>;
+      /**
+       * The minimum amount required to generate a tombstone.
+       **/
+      tombstoneDeposit: AugmentedConst<BalanceOf>;
+    };
+    dataDirectory: {
+      /**
+       * Maximum objects allowed per inject_data_objects() transaction
+       **/
+      maxObjectsPerInjection: AugmentedConst<u32>;
+    };
+    finalityTracker: {
+      /**
+       * The delay after which point things become suspicious. Default is 1000.
+       **/
+      reportLatency: AugmentedConst<BlockNumber>;
+      /**
+       * The number of recent samples to keep from this chain. Default is 101.
+       **/
+      windowSize: AugmentedConst<BlockNumber>;
+    };
+    proposalsCodex: {
+      /**
+       * Exports max wasm code length of the runtime upgrade proposal const.
+       **/
+      runtimeUpgradeWasmProposalMaxLength: AugmentedConst<u32>;
+      /**
+       * Exports max allowed text proposal length const.
+       **/
+      textProposalMaxLength: AugmentedConst<u32>;
+    };
+    proposalsDiscussion: {
+      /**
+       * Exports post edition number limit const.
+       **/
+      maxPostEditionNumber: AugmentedConst<u32>;
+      /**
+       * Exports max thread by same author in a row number limit const.
+       **/
+      maxThreadInARowNumber: AugmentedConst<u32>;
+      /**
+       * Exports post length limit const.
+       **/
+      postLengthLimit: AugmentedConst<u32>;
+      /**
+       * Exports thread title length limit const.
+       **/
+      threadTitleLengthLimit: AugmentedConst<u32>;
+    };
+    proposalsEngine: {
+      /**
+       * Exports const - the fee is applied when cancel the proposal. A fee would be slashed (burned).
+       **/
+      cancellationFee: AugmentedConst<BalanceOf>;
+      /**
+       * Exports const -  max allowed proposal description length.
+       **/
+      descriptionMaxLength: AugmentedConst<u32>;
+      /**
+       * Exports const -  max simultaneous active proposals number.
+       **/
+      maxActiveProposalLimit: AugmentedConst<u32>;
+      /**
+       * Exports const -  the fee is applied when the proposal gets rejected. A fee would be slashed (burned).
+       **/
+      rejectionFee: AugmentedConst<BalanceOf>;
+      /**
+       * Exports const -  max allowed proposal title length.
+       **/
+      titleMaxLength: AugmentedConst<u32>;
+    };
+    staking: {
+      /**
+       * Number of eras that staked funds must remain bonded for.
+       **/
+      bondingDuration: AugmentedConst<EraIndex>;
+      /**
+       * The number of blocks before the end of the era from which election submissions are allowed.
+       * 
+       * Setting this to zero will disable the offchain compute and only on-chain seq-phragmen will
+       * be used.
+       * 
+       * 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>;
+      /**
+       * 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>;
+      /**
+       * 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>;
+      /**
+       * The threshold of improvement that should be provided for a new solution to be accepted.
+       **/
+      minSolutionScoreBump: AugmentedConst<Perbill>;
+      /**
+       * Number of sessions per era.
+       **/
+      sessionsPerEra: AugmentedConst<SessionIndex>;
+      /**
+       * Number of eras that slashes are deferred by, after computation.
+       * 
+       * This should be less than the bonding duration.
+       * Set to 0 if slashes should be applied immediately, without opportunity for
+       * intervention.
+       **/
+      slashDeferDuration: AugmentedConst<EraIndex>;
+    };
+    storageWorkingGroup: {
+      /**
+       * Exports const -  max simultaneous active worker number.
+       **/
+      maxWorkerNumberLimit: AugmentedConst<u32>;
+    };
+    system: {
+      /**
+       * The base weight of executing a block, independent of the transactions in the block.
+       **/
+      blockExecutionWeight: AugmentedConst<Weight>;
+      /**
+       * The maximum number of blocks to allow in mortal eras.
+       **/
+      blockHashCount: AugmentedConst<BlockNumber>;
+      /**
+       * The weight of runtime database operations the runtime can invoke.
+       **/
+      dbWeight: AugmentedConst<RuntimeDbWeight>;
+      /**
+       * The base weight of an Extrinsic in the block, independent of the of extrinsic being executed.
+       **/
+      extrinsicBaseWeight: AugmentedConst<Weight>;
+      /**
+       * The maximum length of a block (in bytes).
+       **/
+      maximumBlockLength: AugmentedConst<u32>;
+      /**
+       * The maximum weight of a block.
+       **/
+      maximumBlockWeight: AugmentedConst<Weight>;
+    };
+    timestamp: {
+      /**
+       * The minimum period between blocks. Beware that this is different to the *expected* period
+       * that the block production apparatus provides. Your chosen consensus system will generally
+       * 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>;
+    };
+    transactionPayment: {
+      /**
+       * The fee to be paid for making a transaction; the per-byte portion.
+       **/
+      transactionByteFee: AugmentedConst<BalanceOf>;
+      /**
+       * The polynomial that is applied in order to derive fee from weight.
+       **/
+      weightToFee: AugmentedConst<Vec<WeightToFeeCoefficient>>;
+    };
+  }
+}

+ 1149 - 0
types/augment/augment-api-query.ts

@@ -0,0 +1,1149 @@
+// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
+/* eslint-disable */
+
+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, 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';
+import { AuthorityId } from '@polkadot/types/interfaces/consensus';
+import { CodeHash, ContractInfo, PrefabWasmModule, Schedule } from '@polkadot/types/interfaces/contracts';
+import { SetId, StoredPendingChange, StoredState } from '@polkadot/types/interfaces/grandpa';
+import { AuthIndex } from '@polkadot/types/interfaces/imOnline';
+import { DeferredOffenceOf, Kind, OffenceDetails, OpaqueTimeSlot, ReportIdOf } from '@polkadot/types/interfaces/offences';
+import { AccountId, Balance, BalanceOf, BlockNumber, ExtrinsicsWeight, Hash, KeyTypeId, Moment, Perbill, Releases, ValidatorId } from '@polkadot/types/interfaces/runtime';
+import { Keys, SessionIndex } from '@polkadot/types/interfaces/session';
+import { ActiveEraInfo, ElectionResult, ElectionScore, ElectionStatus, EraIndex, EraRewardPoints, Exposure, Forcing, Nominations, RewardDestination, SlashingSpans, SpanIndex, SpanRecord, StakingLedger, UnappliedSlash, ValidatorPrefs } from '@polkadot/types/interfaces/staking';
+import { AccountInfo, DigestOf, EventIndex, EventRecord, LastRuntimeUpgradeInfo, Phase } from '@polkadot/types/interfaces/system';
+import { Multiplier } from '@polkadot/types/interfaces/txpayment';
+import { ApiTypes } from '@polkadot/api/types';
+
+declare module '@polkadot/api/types/storage' {
+  export interface AugmentedQueries<ApiType> {
+    authorship: {
+      /**
+       * Author of current block.
+       **/
+      author: AugmentedQuery<ApiType, () => Observable<Option<AccountId>>>;
+      /**
+       * Whether uncles were already set in this block.
+       **/
+      didSetUncles: AugmentedQuery<ApiType, () => Observable<bool>>;
+      /**
+       * Uncles
+       **/
+      uncles: AugmentedQuery<ApiType, () => Observable<Vec<UncleEntryItem>>>;
+    };
+    babe: {
+      /**
+       * Current epoch authorities.
+       **/
+      authorities: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[AuthorityId, BabeAuthorityWeight]>>>>;
+      /**
+       * Current slot number.
+       **/
+      currentSlot: AugmentedQuery<ApiType, () => Observable<u64>>;
+      /**
+       * Current epoch index.
+       **/
+      epochIndex: AugmentedQuery<ApiType, () => Observable<u64>>;
+      /**
+       * The slot at which the first epoch actually started. This is 0
+       * until the first block of the chain.
+       **/
+      genesisSlot: AugmentedQuery<ApiType, () => Observable<u64>>;
+      /**
+       * Temporary value (cleared at block finalization) which is `Some`
+       * if per-block initialization has already been called for current block.
+       **/
+      initialized: AugmentedQuery<ApiType, () => Observable<Option<MaybeRandomness>>>;
+      /**
+       * How late the current block is compared to its parent.
+       * 
+       * This entry is populated as part of block execution and is cleaned up
+       * on block finalization. Querying this storage entry outside of block
+       * execution context should always yield zero.
+       **/
+      lateness: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Next epoch configuration, if changed.
+       **/
+      nextEpochConfig: AugmentedQuery<ApiType, () => Observable<Option<NextConfigDescriptor>>>;
+      /**
+       * Next epoch randomness.
+       **/
+      nextRandomness: AugmentedQuery<ApiType, () => Observable<Randomness>>;
+      /**
+       * The epoch randomness for the *current* epoch.
+       * 
+       * # Security
+       * 
+       * This MUST NOT be used for gambling, as it can be influenced by a
+       * malicious validator in the short term. It MAY be used in many
+       * cryptographic protocols, however, so long as one remembers that this
+       * (like everything else on-chain) it is public. For example, it can be
+       * used where a number is needed that cannot have been chosen by an
+       * adversary, for purposes such as public-coin zero-knowledge proofs.
+       **/
+      randomness: AugmentedQuery<ApiType, () => Observable<Randomness>>;
+      /**
+       * Randomness under construction.
+       * 
+       * We make a tradeoff between storage accesses and list length.
+       * We store the under-construction randomness in segments of up to
+       * `UNDER_CONSTRUCTION_SEGMENT_LENGTH`.
+       * 
+       * Once a segment reaches this length, we begin the next one.
+       * We reset all segments and return to `0` at the beginning of every
+       * epoch.
+       **/
+      segmentIndex: AugmentedQuery<ApiType, () => Observable<u32>>;
+      /**
+       * TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay.
+       **/
+      underConstruction: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<Randomness>>>;
+    };
+    balances: {
+      /**
+       * The balance of an account.
+       * 
+       * NOTE: This is only used in the case that this module is used to store balances.
+       **/
+      account: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<AccountData>>;
+      /**
+       * Any liquidity locks on some account balances.
+       * NOTE: Should only be accessed when setting, changing and freeing a lock.
+       **/
+      locks: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Vec<BalanceLock>>>;
+      /**
+       * Storage version of the pallet.
+       * 
+       * This is set to v2.0.0 for new networks.
+       **/
+      storageVersion: AugmentedQuery<ApiType, () => Observable<Releases>>;
+      /**
+       * The total units issued in the system.
+       **/
+      totalIssuance: AugmentedQuery<ApiType, () => Observable<Balance>>;
+    };
+    contentWorkingGroup: {
+      channelAvatarConstraint: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      channelBannerConstraint: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      /**
+       * Maps identifier to corresponding channel.
+       **/
+      channelById: AugmentedQuery<ApiType, (arg: ChannelId | AnyNumber | Uint8Array) => Observable<Channel>>;
+      /**
+       * Whether it is currently possible to create a channel via `create_channel` extrinsic.
+       **/
+      channelCreationEnabled: AugmentedQuery<ApiType, () => Observable<bool>>;
+      channelDescriptionConstraint: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      channelHandleConstraint: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      /**
+       * Maps (unique) channel handle to the corresponding identifier for the channel.
+       * Mapping is required to allow efficient (O(log N)) on-chain verification that a proposed handle is indeed unique
+       * at the time it is being proposed.
+       **/
+      channelIdByHandle: AugmentedQuery<ApiType, (arg: Bytes | string | Uint8Array) => Observable<ChannelId>>;
+      channelTitleConstraint: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      /**
+       * Maps identifier to curator application on opening.
+       **/
+      curatorApplicationById: AugmentedQuery<ApiType, (arg: CuratorApplicationId | AnyNumber | Uint8Array) => Observable<CuratorApplication>>;
+      curatorApplicationHumanReadableText: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      /**
+       * Maps identifier to corresponding curator.
+       **/
+      curatorById: AugmentedQuery<ApiType, (arg: CuratorId | AnyNumber | Uint8Array) => Observable<Curator>>;
+      curatorExitRationaleText: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      /**
+       * Maps identifeir to curator opening.
+       **/
+      curatorOpeningById: AugmentedQuery<ApiType, (arg: CuratorOpeningId | AnyNumber | Uint8Array) => Observable<CuratorOpening>>;
+      /**
+       * The current lead.
+       **/
+      currentLeadId: AugmentedQuery<ApiType, () => Observable<Option<LeadId>>>;
+      /**
+       * Maps identifier to corresponding lead.
+       **/
+      leadById: AugmentedQuery<ApiType, (arg: LeadId | AnyNumber | Uint8Array) => Observable<Lead>>;
+      /**
+       * The mint currently funding the rewards for this module.
+       **/
+      mint: AugmentedQuery<ApiType, () => Observable<MintId>>;
+      /**
+       * Identifier to be used by the next channel introduced.
+       **/
+      nextChannelId: AugmentedQuery<ApiType, () => Observable<ChannelId>>;
+      /**
+       * Next identifier value for new curator application.
+       **/
+      nextCuratorApplicationId: AugmentedQuery<ApiType, () => Observable<CuratorApplicationId>>;
+      /**
+       * Next identifier for new curator.
+       **/
+      nextCuratorId: AugmentedQuery<ApiType, () => Observable<CuratorId>>;
+      /**
+       * Next identifier valuefor new curator opening.
+       **/
+      nextCuratorOpeningId: AugmentedQuery<ApiType, () => Observable<CuratorOpeningId>>;
+      /**
+       * Next identifier for new current lead.
+       **/
+      nextLeadId: AugmentedQuery<ApiType, () => Observable<LeadId>>;
+      /**
+       * Next identifier for
+       **/
+      nextPrincipalId: AugmentedQuery<ApiType, () => Observable<PrincipalId>>;
+      openingHumanReadableText: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      /**
+       * Maps identifier to principal.
+       **/
+      principalById: AugmentedQuery<ApiType, (arg: PrincipalId | AnyNumber | Uint8Array) => Observable<Principal>>;
+      /**
+       * Recover curator by the role stake which is currently unstaking.
+       **/
+      unstakerByStakeId: AugmentedQuery<ApiType, (arg: StakeId | AnyNumber | Uint8Array) => Observable<WorkingGroupUnstaker>>;
+    };
+    contracts: {
+      /**
+       * The subtrie counter.
+       **/
+      accountCounter: AugmentedQuery<ApiType, () => Observable<u64>>;
+      /**
+       * A mapping between an original code hash and instrumented wasm code, ready for execution.
+       **/
+      codeStorage: AugmentedQuery<ApiType, (arg: CodeHash | string | Uint8Array) => Observable<Option<PrefabWasmModule>>>;
+      /**
+       * The code associated with a given account.
+       * 
+       * TWOX-NOTE: SAFE since `AccountId` is a secure hash.
+       **/
+      contractInfoOf: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Option<ContractInfo>>>;
+      /**
+       * Current cost schedule for contracts.
+       **/
+      currentSchedule: AugmentedQuery<ApiType, () => Observable<Schedule>>;
+      /**
+       * A mapping from an original code hash to the original code, untouched by instrumentation.
+       **/
+      pristineCode: AugmentedQuery<ApiType, (arg: CodeHash | string | Uint8Array) => Observable<Option<Bytes>>>;
+    };
+    council: {
+      activeCouncil: AugmentedQuery<ApiType, () => Observable<Seats>>;
+      /**
+       * Reward amount paid out at each PayoutInterval
+       **/
+      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.
+       **/
+      councilMint: AugmentedQuery<ApiType, () => Observable<Option<MintId>>>;
+      /**
+       * How many blocks after the reward is created, the first payout will be made
+       **/
+      firstPayoutAfterRewardCreated: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Optional interval in blocks on which a reward payout will be made to each council member
+       **/
+      payoutInterval: AugmentedQuery<ApiType, () => Observable<Option<BlockNumber>>>;
+      /**
+       * The reward relationships currently in place. There may not necessarily be a 1-1 correspondance with
+       * the active council, since there are multiple ways of setting/adding/removing council members, some of which
+       * do not involve creating a relationship.
+       **/
+      rewardRelationships: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<RewardRelationshipId>>;
+      termEndsAt: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+    };
+    councilElection: {
+      announcingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      applicants: AugmentedQuery<ApiType, () => Observable<Vec<AccountId>>>;
+      applicantStakes: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<ElectionStake>>;
+      autoStart: AugmentedQuery<ApiType, () => Observable<bool>>;
+      candidacyLimit: AugmentedQuery<ApiType, () => Observable<u32>>;
+      commitments: AugmentedQuery<ApiType, () => Observable<Vec<Hash>>>;
+      councilSize: AugmentedQuery<ApiType, () => Observable<u32>>;
+      existingStakeHolders: AugmentedQuery<ApiType, () => Observable<Vec<AccountId>>>;
+      minCouncilStake: AugmentedQuery<ApiType, () => Observable<BalanceOf>>;
+      minVotingStake: AugmentedQuery<ApiType, () => Observable<BalanceOf>>;
+      newTermDuration: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      revealingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      round: AugmentedQuery<ApiType, () => Observable<u32>>;
+      stage: AugmentedQuery<ApiType, () => Observable<Option<ElectionStage>>>;
+      transferableStakes: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<TransferableStake>>;
+      votes: AugmentedQuery<ApiType, (arg: Hash | string | Uint8Array) => Observable<SealedVote>>;
+      votingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+    };
+    dataDirectory: {
+      /**
+       * Maps data objects by their content id.
+       **/
+      dataObjectByContentId: AugmentedQuery<ApiType, (arg: ContentId | string | Uint8Array) => Observable<Option<DataObject>>>;
+      /**
+       * List of ids known to the system.
+       **/
+      knownContentIds: AugmentedQuery<ApiType, () => Observable<Vec<ContentId>>>;
+    };
+    dataObjectStorageRegistry: {
+      /**
+       * Defines first relationship id.
+       **/
+      firstRelationshipId: AugmentedQuery<ApiType, () => Observable<DataObjectStorageRelationshipId>>;
+      /**
+       * Defines next relationship id.
+       **/
+      nextRelationshipId: AugmentedQuery<ApiType, () => Observable<DataObjectStorageRelationshipId>>;
+      /**
+       * Mapping of Data object types
+       **/
+      relationships: AugmentedQuery<ApiType, (arg: DataObjectStorageRelationshipId | AnyNumber | Uint8Array) => Observable<Option<DataObjectStorageRelationship>>>;
+      /**
+       * Keeps a list of storage relationships per content id.
+       **/
+      relationshipsByContentId: AugmentedQuery<ApiType, (arg: ContentId | string | Uint8Array) => Observable<Vec<DataObjectStorageRelationshipId>>>;
+    };
+    dataObjectTypeRegistry: {
+      /**
+       * Mapping of Data object types.
+       **/
+      dataObjectTypes: AugmentedQuery<ApiType, (arg: DataObjectTypeId | AnyNumber | Uint8Array) => Observable<Option<DataObjectType>>>;
+      /**
+       * Data object type ids should start at this value.
+       **/
+      firstDataObjectTypeId: AugmentedQuery<ApiType, () => Observable<DataObjectTypeId>>;
+      /**
+       * Provides id counter for the data object types.
+       **/
+      nextDataObjectTypeId: AugmentedQuery<ApiType, () => Observable<DataObjectTypeId>>;
+    };
+    discovery: {
+      /**
+       * Mapping of service providers' storage provider id to their AccountInfo
+       **/
+      accountInfoByStorageProviderId: AugmentedQuery<ApiType, (arg: StorageProviderId | AnyNumber | Uint8Array) => Observable<AccountInfo>>;
+      /**
+       * Bootstrap endpoints maintained by root
+       **/
+      bootstrapEndpoints: AugmentedQuery<ApiType, () => Observable<Vec<Url>>>;
+      /**
+       * Lifetime of an AccountInfo record in AccountInfoByAccountId map
+       **/
+      defaultLifetime: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+    };
+    forum: {
+      /**
+       * Map category identifier to corresponding category.
+       **/
+      categoryById: AugmentedQuery<ApiType, (arg: CategoryId | AnyNumber | Uint8Array) => Observable<Category>>;
+      categoryDescriptionConstraint: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      /**
+       * Input constraints
+       * These are all forward looking, that is they are enforced on all
+       * future calls.
+       **/
+      categoryTitleConstraint: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      /**
+       * Account of forum sudo.
+       **/
+      forumSudo: AugmentedQuery<ApiType, () => Observable<Option<AccountId>>>;
+      /**
+       * Category identifier value to be used for the next Category created.
+       **/
+      nextCategoryId: AugmentedQuery<ApiType, () => Observable<CategoryId>>;
+      /**
+       * Post identifier value to be used for for next post created.
+       **/
+      nextPostId: AugmentedQuery<ApiType, () => Observable<PostId>>;
+      /**
+       * Thread identifier value to be used for next Thread in threadById.
+       **/
+      nextThreadId: AugmentedQuery<ApiType, () => Observable<ThreadId>>;
+      /**
+       * Map post identifier to corresponding post.
+       **/
+      postById: AugmentedQuery<ApiType, (arg: PostId | AnyNumber | Uint8Array) => Observable<Post>>;
+      postModerationRationaleConstraint: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      postTextConstraint: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      /**
+       * Map thread identifier to corresponding thread.
+       **/
+      threadById: AugmentedQuery<ApiType, (arg: ThreadId | AnyNumber | Uint8Array) => Observable<Thread>>;
+      threadModerationRationaleConstraint: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      threadTitleConstraint: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+    };
+    grandpa: {
+      /**
+       * The number of changes (both in terms of keys and underlying economic responsibilities)
+       * in the "set" of Grandpa validators from genesis.
+       **/
+      currentSetId: AugmentedQuery<ApiType, () => Observable<SetId>>;
+      /**
+       * next block number where we can force a change.
+       **/
+      nextForced: AugmentedQuery<ApiType, () => Observable<Option<BlockNumber>>>;
+      /**
+       * Pending change: (signaled at, scheduled change).
+       **/
+      pendingChange: AugmentedQuery<ApiType, () => Observable<Option<StoredPendingChange>>>;
+      /**
+       * A mapping from grandpa set ID to the index of the *most recent* session for which its
+       * members were responsible.
+       * 
+       * TWOX-NOTE: `SetId` is not under user control.
+       **/
+      setIdSession: AugmentedQuery<ApiType, (arg: SetId | AnyNumber | Uint8Array) => Observable<Option<SessionIndex>>>;
+      /**
+       * `true` if we are currently stalled.
+       **/
+      stalled: AugmentedQuery<ApiType, () => Observable<Option<ITuple<[BlockNumber, BlockNumber]>>>>;
+      /**
+       * State of the current authority set.
+       **/
+      state: AugmentedQuery<ApiType, () => Observable<StoredState>>;
+    };
+    hiring: {
+      /**
+       * Applications
+       **/
+      applicationById: AugmentedQuery<ApiType, (arg: ApplicationId | AnyNumber | Uint8Array) => Observable<Application>>;
+      /**
+       * Internal purpose of given stake, i.e. fro what application, and whether for the role or for the application.
+       **/
+      applicationIdByStakingId: AugmentedQuery<ApiType, (arg: StakeId | AnyNumber | Uint8Array) => Observable<ApplicationId>>;
+      /**
+       * Identifier for next application to be added.
+       **/
+      nextApplicationId: AugmentedQuery<ApiType, () => Observable<ApplicationId>>;
+      /**
+       * Identifier for next opening to be added.
+       **/
+      nextOpeningId: AugmentedQuery<ApiType, () => Observable<OpeningId>>;
+      /**
+       * Openings.
+       **/
+      openingById: AugmentedQuery<ApiType, (arg: OpeningId | AnyNumber | Uint8Array) => Observable<Opening>>;
+    };
+    imOnline: {
+      /**
+       * For each session index, we keep a mapping of `T::ValidatorId` to the
+       * number of blocks authored by the given authority.
+       **/
+      authoredBlocks: AugmentedQueryDoubleMap<ApiType, (key1: SessionIndex | AnyNumber | Uint8Array, key2: ValidatorId | string | Uint8Array) => Observable<u32>>;
+      /**
+       * The block number after which it's ok to send heartbeats in current session.
+       * 
+       * At the beginning of each session we set this to a value that should
+       * fall roughly in the middle of the session duration.
+       * The idea is to first wait for the validators to produce a block
+       * in the current session, so that the heartbeat later on will not be necessary.
+       **/
+      heartbeatAfter: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * The current set of keys that may issue a heartbeat.
+       **/
+      keys: AugmentedQuery<ApiType, () => Observable<Vec<AuthorityId>>>;
+      /**
+       * For each session index, we keep a mapping of `AuthIndex` to
+       * `offchain::OpaqueNetworkState`.
+       **/
+      receivedHeartbeats: AugmentedQueryDoubleMap<ApiType, (key1: SessionIndex | AnyNumber | Uint8Array, key2: AuthIndex | AnyNumber | Uint8Array) => Observable<Option<Bytes>>>;
+    };
+    members: {
+      /**
+       * Active Paid membership terms
+       **/
+      activePaidMembershipTerms: AugmentedQuery<ApiType, () => Observable<Vec<PaidTermId>>>;
+      maxAboutTextLength: AugmentedQuery<ApiType, () => Observable<u32>>;
+      maxAvatarUriLength: AugmentedQuery<ApiType, () => Observable<u32>>;
+      maxHandleLength: AugmentedQuery<ApiType, () => Observable<u32>>;
+      /**
+       * Registered unique handles and their mapping to their owner
+       **/
+      memberIdByHandle: AugmentedQuery<ApiType, (arg: Bytes | string | Uint8Array) => Observable<MemberId>>;
+      /**
+       * Mapping of a controller account id to vector of member ids it controls
+       **/
+      memberIdsByControllerAccountId: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Vec<MemberId>>>;
+      /**
+       * Mapping of a root account id to vector of member ids it controls.
+       **/
+      memberIdsByRootAccountId: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Vec<MemberId>>>;
+      /**
+       * Mapping of member's id to their membership profile
+       **/
+      membershipById: AugmentedQuery<ApiType, (arg: MemberId | AnyNumber | Uint8Array) => Observable<Membership>>;
+      minHandleLength: AugmentedQuery<ApiType, () => Observable<u32>>;
+      /**
+       * Is the platform is accepting new members or not
+       **/
+      newMembershipsAllowed: AugmentedQuery<ApiType, () => Observable<bool>>;
+      /**
+       * MemberId to assign to next member that is added to the registry, and is also the
+       * total number of members created. MemberIds start at Zero.
+       **/
+      nextMemberId: AugmentedQuery<ApiType, () => Observable<MemberId>>;
+      /**
+       * Next paid membership terms id
+       **/
+      nextPaidMembershipTermsId: AugmentedQuery<ApiType, () => Observable<PaidTermId>>;
+      /**
+       * Paid membership terms record
+       **/
+      paidMembershipTermsById: AugmentedQuery<ApiType, (arg: PaidTermId | AnyNumber | Uint8Array) => Observable<PaidMembershipTerms>>;
+      screeningAuthority: AugmentedQuery<ApiType, () => Observable<AccountId>>;
+    };
+    memo: {
+      maxMemoLength: AugmentedQuery<ApiType, () => Observable<u32>>;
+      memo: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<MemoText>>;
+    };
+    minting: {
+      /**
+       * Mints
+       **/
+      mints: AugmentedQuery<ApiType, (arg: MintId | AnyNumber | Uint8Array) => Observable<Mint>>;
+      /**
+       * The number of mints created.
+       **/
+      mintsCreated: AugmentedQuery<ApiType, () => Observable<MintId>>;
+    };
+    offences: {
+      /**
+       * A vector of reports of the same kind that happened at the same time slot.
+       **/
+      concurrentReportsIndex: AugmentedQueryDoubleMap<ApiType, (key1: Kind | string | Uint8Array, key2: OpaqueTimeSlot | string | Uint8Array) => Observable<Vec<ReportIdOf>>>;
+      /**
+       * Deferred reports that have been rejected by the offence handler and need to be submitted
+       * at a later time.
+       **/
+      deferredOffences: AugmentedQuery<ApiType, () => Observable<Vec<DeferredOffenceOf>>>;
+      /**
+       * The primary structure that holds all offence records keyed by report identifiers.
+       **/
+      reports: AugmentedQuery<ApiType, (arg: ReportIdOf | string | Uint8Array) => Observable<Option<OffenceDetails>>>;
+      /**
+       * Enumerates all reports of a kind along with the time they happened.
+       * 
+       * All reports are sorted by the time of offence.
+       * 
+       * Note that the actual type of this mapping is `Vec<u8>`, this is because values of
+       * different types are not supported at the moment so we are doing the manual serialization.
+       **/
+      reportsByKindIndex: AugmentedQuery<ApiType, (arg: Kind | string | Uint8Array) => Observable<Bytes>>;
+    };
+    proposalsCodex: {
+      /**
+       * Grace period for the 'add working group opening' proposal
+       **/
+      addWorkingGroupOpeningProposalGracePeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Voting period for the 'add working group opening' proposal
+       **/
+      addWorkingGroupOpeningProposalVotingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Grace period for the 'begin review working group leader applications' proposal
+       **/
+      beginReviewWorkingGroupLeaderApplicationsProposalGracePeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Voting period for the 'begin review working group leader applications' proposal
+       **/
+      beginReviewWorkingGroupLeaderApplicationsProposalVotingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Grace period for the 'decrease working group leader stake' proposal
+       **/
+      decreaseWorkingGroupLeaderStakeProposalGracePeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Voting period for the 'decrease working group leader stake' proposal
+       **/
+      decreaseWorkingGroupLeaderStakeProposalVotingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Grace period for the 'fill working group leader opening' proposal
+       **/
+      fillWorkingGroupLeaderOpeningProposalGracePeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Voting period for the 'fill working group leader opening' proposal
+       **/
+      fillWorkingGroupLeaderOpeningProposalVotingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Map proposal id to proposal details
+       **/
+      proposalDetailsByProposalId: AugmentedQuery<ApiType, (arg: ProposalId | AnyNumber | Uint8Array) => Observable<ProposalDetailsOf>>;
+      /**
+       * Grace period for the 'runtime upgrade' proposal
+       **/
+      runtimeUpgradeProposalGracePeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Voting period for the 'runtime upgrade' proposal
+       **/
+      runtimeUpgradeProposalVotingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Grace period for the 'set content working group mint capacity' proposal
+       **/
+      setContentWorkingGroupMintCapacityProposalGracePeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Voting period for the 'set content working group mint capacity' proposal
+       **/
+      setContentWorkingGroupMintCapacityProposalVotingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Grace period for the 'set election parameters' proposal
+       **/
+      setElectionParametersProposalGracePeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Voting period for the 'set election parameters' proposal
+       **/
+      setElectionParametersProposalVotingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Grace period for the 'set lead' proposal
+       **/
+      setLeadProposalGracePeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Voting period for the 'set lead' proposal
+       **/
+      setLeadProposalVotingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Grace period for the 'set validator count' proposal
+       **/
+      setValidatorCountProposalGracePeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Voting period for the 'set validator count' proposal
+       **/
+      setValidatorCountProposalVotingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Grace period for the 'set working group leader reward' proposal
+       **/
+      setWorkingGroupLeaderRewardProposalGracePeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Voting period for the 'set working group leader reward' proposal
+       **/
+      setWorkingGroupLeaderRewardProposalVotingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Grace period for the 'set working group mint capacity' proposal
+       **/
+      setWorkingGroupMintCapacityProposalGracePeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Voting period for the 'set working group mint capacity' proposal
+       **/
+      setWorkingGroupMintCapacityProposalVotingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Grace period for the 'slash working group leader stake' proposal
+       **/
+      slashWorkingGroupLeaderStakeProposalGracePeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Voting period for the 'slash working group leader stake' proposal
+       **/
+      slashWorkingGroupLeaderStakeProposalVotingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Grace period for the 'spending' proposal
+       **/
+      spendingProposalGracePeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Voting period for the 'spending' proposal
+       **/
+      spendingProposalVotingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Grace period for the 'terminate working group leader role' proposal
+       **/
+      terminateWorkingGroupLeaderRoleProposalGracePeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Voting period for the 'terminate working group leader role' proposal
+       **/
+      terminateWorkingGroupLeaderRoleProposalVotingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Grace period for the 'text' proposal
+       **/
+      textProposalGracePeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Voting period for the 'text' proposal
+       **/
+      textProposalVotingPeriod: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Map proposal id to its discussion thread id
+       **/
+      threadIdByProposalId: AugmentedQuery<ApiType, (arg: ProposalId | AnyNumber | Uint8Array) => Observable<ThreadId>>;
+    };
+    proposalsDiscussion: {
+      /**
+       * Last author thread counter (part of the antispam mechanism)
+       **/
+      lastThreadAuthorCounter: AugmentedQuery<ApiType, () => Observable<Option<ThreadCounter>>>;
+      /**
+       * Count of all posts that have been created.
+       **/
+      postCount: AugmentedQuery<ApiType, () => Observable<u64>>;
+      /**
+       * Map thread id and post id to corresponding post.
+       **/
+      postThreadIdByPostId: AugmentedQueryDoubleMap<ApiType, (key1: ThreadId | AnyNumber | Uint8Array, key2: PostId | AnyNumber | Uint8Array) => Observable<DiscussionPost>>;
+      /**
+       * Map thread identifier to corresponding thread.
+       **/
+      threadById: AugmentedQuery<ApiType, (arg: ThreadId | AnyNumber | Uint8Array) => Observable<DiscussionThread>>;
+      /**
+       * Count of all threads that have been created.
+       **/
+      threadCount: AugmentedQuery<ApiType, () => Observable<u64>>;
+    };
+    proposalsEngine: {
+      /**
+       * Count of active proposals.
+       **/
+      activeProposalCount: AugmentedQuery<ApiType, () => Observable<u32>>;
+      /**
+       * Ids of proposals that are open for voting (have not been finalized yet).
+       **/
+      activeProposalIds: AugmentedQuery<ApiType, (arg: ProposalId | AnyNumber | Uint8Array) => Observable<ITuple<[]>>>;
+      /**
+       * Map proposal executable code by proposal id.
+       **/
+      dispatchableCallCode: AugmentedQuery<ApiType, (arg: ProposalId | AnyNumber | Uint8Array) => Observable<Bytes>>;
+      /**
+       * Ids of proposals that were approved and theirs grace period was not expired.
+       **/
+      pendingExecutionProposalIds: AugmentedQuery<ApiType, (arg: ProposalId | AnyNumber | Uint8Array) => Observable<ITuple<[]>>>;
+      /**
+       * Count of all proposals that have been created.
+       **/
+      proposalCount: AugmentedQuery<ApiType, () => Observable<u32>>;
+      /**
+       * Map proposal by its id.
+       **/
+      proposals: AugmentedQuery<ApiType, (arg: ProposalId | AnyNumber | Uint8Array) => Observable<ProposalOf>>;
+      /**
+       * Map proposal id by stake id. Required by StakingEventsHandler callback call
+       **/
+      stakesProposals: AugmentedQuery<ApiType, (arg: StakeId | AnyNumber | Uint8Array) => Observable<ProposalId>>;
+      /**
+       * Double map for preventing duplicate votes. Should be cleaned after usage.
+       **/
+      voteExistsByProposalByVoter: AugmentedQueryDoubleMap<ApiType, (key1: ProposalId | AnyNumber | Uint8Array, key2: MemberId | AnyNumber | Uint8Array) => Observable<VoteKind>>;
+    };
+    randomnessCollectiveFlip: {
+      /**
+       * Series of block headers from the last 81 blocks that acts as random seed material. This
+       * is arranged as a ring buffer with `block_number % 81` being the index into the `Vec` of
+       * the oldest hash.
+       **/
+      randomMaterial: AugmentedQuery<ApiType, () => Observable<Vec<Hash>>>;
+    };
+    recurringRewards: {
+      recipients: AugmentedQuery<ApiType, (arg: RecipientId | AnyNumber | Uint8Array) => Observable<Recipient>>;
+      recipientsCreated: AugmentedQuery<ApiType, () => Observable<RecipientId>>;
+      rewardRelationships: AugmentedQuery<ApiType, (arg: RewardRelationshipId | AnyNumber | Uint8Array) => Observable<RewardRelationship>>;
+      rewardRelationshipsCreated: AugmentedQuery<ApiType, () => Observable<RewardRelationshipId>>;
+    };
+    session: {
+      /**
+       * Current index of the session.
+       **/
+      currentIndex: AugmentedQuery<ApiType, () => Observable<SessionIndex>>;
+      /**
+       * Indices of disabled validators.
+       * 
+       * The set is cleared when `on_session_ending` returns a new set of identities.
+       **/
+      disabledValidators: AugmentedQuery<ApiType, () => Observable<Vec<u32>>>;
+      /**
+       * The owner of a key. The key is the `KeyTypeId` + the encoded key.
+       **/
+      keyOwner: AugmentedQuery<ApiType, (arg: ITuple<[KeyTypeId, Bytes]> | [KeyTypeId | AnyNumber | Uint8Array, Bytes | string | Uint8Array]) => Observable<Option<ValidatorId>>>;
+      /**
+       * The next session keys for a validator.
+       **/
+      nextKeys: AugmentedQuery<ApiType, (arg: ValidatorId | string | Uint8Array) => Observable<Option<Keys>>>;
+      /**
+       * True if the underlying economic identities or weighting behind the validators
+       * has changed in the queued validator set.
+       **/
+      queuedChanged: AugmentedQuery<ApiType, () => Observable<bool>>;
+      /**
+       * The queued keys for the next session. When the next session begins, these keys
+       * will be used to determine the validator's session keys.
+       **/
+      queuedKeys: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[ValidatorId, Keys]>>>>;
+      /**
+       * The current set of validators.
+       **/
+      validators: AugmentedQuery<ApiType, () => Observable<Vec<ValidatorId>>>;
+    };
+    stake: {
+      /**
+       * Maps identifiers to a stake.
+       **/
+      stakes: AugmentedQuery<ApiType, (arg: StakeId | AnyNumber | Uint8Array) => Observable<Stake>>;
+      /**
+       * Identifier value for next stake, and count of total stakes created (not necessarily the number of current
+       * stakes in the Stakes map as stakes can be removed.)
+       **/
+      stakesCreated: AugmentedQuery<ApiType, () => Observable<StakeId>>;
+    };
+    staking: {
+      /**
+       * The active era information, it holds index and start.
+       * 
+       * The active era is the era currently rewarded.
+       * Validator set of this era must be equal to `SessionInterface::validators`.
+       **/
+      activeEra: AugmentedQuery<ApiType, () => Observable<Option<ActiveEraInfo>>>;
+      /**
+       * Map from all locked "stash" accounts to the controller account.
+       **/
+      bonded: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Option<AccountId>>>;
+      /**
+       * A mapping from still-bonded eras to the first session index of that era.
+       * 
+       * Must contains information for eras for the range:
+       * `[active_era - bounding_duration; active_era]`
+       **/
+      bondedEras: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[EraIndex, SessionIndex]>>>>;
+      /**
+       * The amount of currency given to reporters of a slash event which was
+       * canceled by extraordinary circumstances (e.g. governance).
+       **/
+      canceledSlashPayout: AugmentedQuery<ApiType, () => Observable<BalanceOf>>;
+      /**
+       * The current era index.
+       * 
+       * This is the latest planned era, depending on how the Session pallet queues the validator
+       * set, it might be active or not.
+       **/
+      currentEra: AugmentedQuery<ApiType, () => Observable<Option<EraIndex>>>;
+      /**
+       * The earliest era for which we have a pending, unapplied slash.
+       **/
+      earliestUnappliedSlash: AugmentedQuery<ApiType, () => Observable<Option<EraIndex>>>;
+      /**
+       * Flag to control the execution of the offchain election. When `Open(_)`, we accept
+       * solutions to be submitted.
+       **/
+      eraElectionStatus: AugmentedQuery<ApiType, () => Observable<ElectionStatus>>;
+      /**
+       * Rewards for the last `HISTORY_DEPTH` eras.
+       * If reward hasn't been set or has been removed then 0 reward is returned.
+       **/
+      erasRewardPoints: AugmentedQuery<ApiType, (arg: EraIndex | AnyNumber | Uint8Array) => Observable<EraRewardPoints>>;
+      /**
+       * Exposure of validator at era.
+       * 
+       * This is keyed first by the era index to allow bulk deletion and then the stash account.
+       * 
+       * Is it removed after `HISTORY_DEPTH` eras.
+       * If stakers hasn't been set or has been removed then empty exposure is returned.
+       **/
+      erasStakers: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<Exposure>>;
+      /**
+       * Clipped Exposure of validator at era.
+       * 
+       * This is similar to [`ErasStakers`] but number of nominators exposed is reduced to the
+       * `T::MaxNominatorRewardedPerValidator` biggest stakers.
+       * (Note: the field `total` and `own` of the exposure remains unchanged).
+       * This is used to limit the i/o cost for the nominator payout.
+       * 
+       * This is keyed fist by the era index to allow bulk deletion and then the stash account.
+       * 
+       * Is it removed after `HISTORY_DEPTH` eras.
+       * If stakers hasn't been set or has been removed then empty exposure is returned.
+       **/
+      erasStakersClipped: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<Exposure>>;
+      /**
+       * The session index at which the era start for the last `HISTORY_DEPTH` eras.
+       **/
+      erasStartSessionIndex: AugmentedQuery<ApiType, (arg: EraIndex | AnyNumber | Uint8Array) => Observable<Option<SessionIndex>>>;
+      /**
+       * The total amount staked for the last `HISTORY_DEPTH` eras.
+       * If total hasn't been set or has been removed then 0 stake is returned.
+       **/
+      erasTotalStake: AugmentedQuery<ApiType, (arg: EraIndex | AnyNumber | Uint8Array) => Observable<BalanceOf>>;
+      /**
+       * Similar to `ErasStakers`, this holds the preferences of validators.
+       * 
+       * This is keyed first by the era index to allow bulk deletion and then the stash account.
+       * 
+       * Is it removed after `HISTORY_DEPTH` eras.
+       **/
+      erasValidatorPrefs: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<ValidatorPrefs>>;
+      /**
+       * The total validator era payout for the last `HISTORY_DEPTH` eras.
+       * 
+       * Eras that haven't finished yet or has been removed doesn't have reward.
+       **/
+      erasValidatorReward: AugmentedQuery<ApiType, (arg: EraIndex | AnyNumber | Uint8Array) => Observable<Option<BalanceOf>>>;
+      /**
+       * Mode of era forcing.
+       **/
+      forceEra: AugmentedQuery<ApiType, () => Observable<Forcing>>;
+      /**
+       * Number of eras to keep in history.
+       * 
+       * Information is kept for eras in `[current_era - history_depth; current_era]`.
+       * 
+       * Must be more than the number of eras delayed by session otherwise. I.e. active era must
+       * always be in history. I.e. `active_era > current_era - history_depth` must be
+       * guaranteed.
+       **/
+      historyDepth: AugmentedQuery<ApiType, () => Observable<u32>>;
+      /**
+       * Any validators that may never be slashed or forcibly kicked. It's a Vec since they're
+       * easy to initialize and the performance hit is minimal (we expect no more than four
+       * invulnerables) and restricted to testnets.
+       **/
+      invulnerables: AugmentedQuery<ApiType, () => Observable<Vec<AccountId>>>;
+      /**
+       * True if the current **planned** session is final. Note that this does not take era
+       * forcing into account.
+       **/
+      isCurrentSessionFinal: AugmentedQuery<ApiType, () => Observable<bool>>;
+      /**
+       * Map from all (unlocked) "controller" accounts to the info regarding the staking.
+       **/
+      ledger: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Option<StakingLedger>>>;
+      /**
+       * Minimum number of staking participants before emergency conditions are imposed.
+       **/
+      minimumValidatorCount: AugmentedQuery<ApiType, () => Observable<u32>>;
+      /**
+       * The map from nominator stash key to the set of stash keys of all validators to nominate.
+       **/
+      nominators: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Option<Nominations>>>;
+      /**
+       * All slashing events on nominators, mapped by era to the highest slash value of the era.
+       **/
+      nominatorSlashInEra: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<Option<BalanceOf>>>;
+      /**
+       * Where the reward payment should be made. Keyed by stash.
+       **/
+      payee: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<RewardDestination>>;
+      /**
+       * The next validator set. At the end of an era, if this is available (potentially from the
+       * result of an offchain worker), it is immediately used. Otherwise, the on-chain election
+       * is executed.
+       **/
+      queuedElected: AugmentedQuery<ApiType, () => Observable<Option<ElectionResult>>>;
+      /**
+       * The score of the current [`QueuedElected`].
+       **/
+      queuedScore: AugmentedQuery<ApiType, () => Observable<Option<ElectionScore>>>;
+      /**
+       * Slashing spans for stash accounts.
+       **/
+      slashingSpans: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<Option<SlashingSpans>>>;
+      /**
+       * The percentage of the slash that is distributed to reporters.
+       * 
+       * The rest of the slashed value is handled by the `Slash`.
+       **/
+      slashRewardFraction: AugmentedQuery<ApiType, () => Observable<Perbill>>;
+      /**
+       * Snapshot of nominators at the beginning of the current election window. This should only
+       * have a value when [`EraElectionStatus`] == `ElectionStatus::Open(_)`.
+       **/
+      snapshotNominators: AugmentedQuery<ApiType, () => Observable<Option<Vec<AccountId>>>>;
+      /**
+       * Snapshot of validators at the beginning of the current election window. This should only
+       * have a value when [`EraElectionStatus`] == `ElectionStatus::Open(_)`.
+       **/
+      snapshotValidators: AugmentedQuery<ApiType, () => Observable<Option<Vec<AccountId>>>>;
+      /**
+       * Records information about the maximum slash of a stash within a slashing span,
+       * as well as how much reward has been paid out.
+       **/
+      spanSlash: AugmentedQuery<ApiType, (arg: ITuple<[AccountId, SpanIndex]> | [AccountId | string | Uint8Array, SpanIndex | AnyNumber | Uint8Array]) => Observable<SpanRecord>>;
+      /**
+       * True if network has been upgraded to this version.
+       * Storage version of the pallet.
+       * 
+       * This is set to v3.0.0 for new networks.
+       **/
+      storageVersion: AugmentedQuery<ApiType, () => Observable<Releases>>;
+      /**
+       * All unapplied slashes that are queued for later.
+       **/
+      unappliedSlashes: AugmentedQuery<ApiType, (arg: EraIndex | AnyNumber | Uint8Array) => Observable<Vec<UnappliedSlash>>>;
+      /**
+       * The ideal number of staking participants.
+       **/
+      validatorCount: AugmentedQuery<ApiType, () => Observable<u32>>;
+      /**
+       * The map from (wannabe) validator stash key to the preferences of that validator.
+       **/
+      validators: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<ValidatorPrefs>>;
+      /**
+       * All slashing events on validators, mapped by era to the highest slash proportion
+       * and slash value of the era.
+       **/
+      validatorSlashInEra: AugmentedQueryDoubleMap<ApiType, (key1: EraIndex | AnyNumber | Uint8Array, key2: AccountId | string | Uint8Array) => Observable<Option<ITuple<[Perbill, BalanceOf]>>>>;
+    };
+    storageWorkingGroup: {
+      /**
+       * 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>>;
+    };
+    sudo: {
+      /**
+       * The `AccountId` of the sudo key.
+       **/
+      key: AugmentedQuery<ApiType, () => Observable<AccountId>>;
+    };
+    system: {
+      /**
+       * The full account information for a particular account ID.
+       **/
+      account: AugmentedQuery<ApiType, (arg: AccountId | string | Uint8Array) => Observable<AccountInfo>>;
+      /**
+       * Total length (in bytes) for all extrinsics put together, for the current block.
+       **/
+      allExtrinsicsLen: AugmentedQuery<ApiType, () => Observable<Option<u32>>>;
+      /**
+       * Map of block numbers to block hashes.
+       **/
+      blockHash: AugmentedQuery<ApiType, (arg: BlockNumber | AnyNumber | Uint8Array) => Observable<Hash>>;
+      /**
+       * The current weight for the block.
+       **/
+      blockWeight: AugmentedQuery<ApiType, () => Observable<ExtrinsicsWeight>>;
+      /**
+       * Digest of the current block, also part of the block header.
+       **/
+      digest: AugmentedQuery<ApiType, () => Observable<DigestOf>>;
+      /**
+       * The number of events in the `Events<T>` list.
+       **/
+      eventCount: AugmentedQuery<ApiType, () => Observable<EventIndex>>;
+      /**
+       * Events deposited for the current block.
+       **/
+      events: AugmentedQuery<ApiType, () => Observable<Vec<EventRecord>>>;
+      /**
+       * Mapping between a topic (represented by T::Hash) and a vector of indexes
+       * of events in the `<Events<T>>` list.
+       * 
+       * All topic vectors have deterministic storage locations depending on the topic. This
+       * allows light-clients to leverage the changes trie storage tracking mechanism and
+       * in case of changes fetch the list of events of interest.
+       * 
+       * The value has the type `(T::BlockNumber, EventIndex)` because if we used only just
+       * the `EventIndex` then in case if the topic has the same contents on the next block
+       * no notification will be triggered thus the event might be lost.
+       **/
+      eventTopics: AugmentedQuery<ApiType, (arg: Hash | string | Uint8Array) => Observable<Vec<ITuple<[BlockNumber, EventIndex]>>>>;
+      /**
+       * The execution phase of the block.
+       **/
+      executionPhase: AugmentedQuery<ApiType, () => Observable<Option<Phase>>>;
+      /**
+       * Total extrinsics count for the current block.
+       **/
+      extrinsicCount: AugmentedQuery<ApiType, () => Observable<Option<u32>>>;
+      /**
+       * Extrinsics data for the current block (maps an extrinsic's index to its data).
+       **/
+      extrinsicData: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Bytes>>;
+      /**
+       * Extrinsics root of the current block, also part of the block header.
+       **/
+      extrinsicsRoot: AugmentedQuery<ApiType, () => Observable<Hash>>;
+      /**
+       * Stores the `spec_version` and `spec_name` of when the last runtime upgrade happened.
+       **/
+      lastRuntimeUpgrade: AugmentedQuery<ApiType, () => Observable<Option<LastRuntimeUpgradeInfo>>>;
+      /**
+       * The current block number being processed. Set by `execute_block`.
+       **/
+      number: AugmentedQuery<ApiType, () => Observable<BlockNumber>>;
+      /**
+       * Hash of the previous block.
+       **/
+      parentHash: AugmentedQuery<ApiType, () => Observable<Hash>>;
+    };
+    timestamp: {
+      /**
+       * Did the timestamp get updated in this block?
+       **/
+      didUpdate: AugmentedQuery<ApiType, () => Observable<bool>>;
+      /**
+       * Current time for the current block.
+       **/
+      now: AugmentedQuery<ApiType, () => Observable<Moment>>;
+    };
+    transactionPayment: {
+      nextFeeMultiplier: AugmentedQuery<ApiType, () => Observable<Multiplier>>;
+      storageVersion: AugmentedQuery<ApiType, () => Observable<Releases>>;
+    };
+    versionedStore: {
+      classById: AugmentedQuery<ApiType, (arg: ClassId | AnyNumber | Uint8Array) => Observable<Class>>;
+      classDescriptionConstraint: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      classNameConstraint: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      entityById: AugmentedQuery<ApiType, (arg: EntityId | AnyNumber | Uint8Array) => Observable<Entity>>;
+      nextClassId: AugmentedQuery<ApiType, () => Observable<ClassId>>;
+      nextEntityId: AugmentedQuery<ApiType, () => Observable<EntityId>>;
+      propertyDescriptionConstraint: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+      propertyNameConstraint: AugmentedQuery<ApiType, () => Observable<InputValidationLengthConstraint>>;
+    };
+    versionedStorePermissions: {
+      /**
+       * ClassPermissions of corresponding Classes in the versioned store
+       **/
+      classPermissionsByClassId: AugmentedQuery<ApiType, (arg: ClassId | AnyNumber | Uint8Array) => Observable<ClassPermissionsType>>;
+      /**
+       * Owner of an entity in the versioned store. If it is None then it is owned by the system.
+       **/
+      entityMaintainerByEntityId: AugmentedQuery<ApiType, (arg: EntityId | AnyNumber | Uint8Array) => Observable<Option<Credential>>>;
+    };
+  }
+
+  export interface QueryableStorage<ApiType extends ApiTypes> extends AugmentedQueries<ApiType> {
+  }
+}

+ 1389 - 0
types/augment/augment-api-tx.ts

@@ -0,0 +1,1389 @@
+// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
+/* eslint-disable */
+
+import { AnyNumber, ITuple } 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, 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 { CodeHash, Gas, Schedule } from '@polkadot/types/interfaces/contracts';
+import { Extrinsic, Signature } from '@polkadot/types/interfaces/extrinsics';
+import { GrandpaEquivocationProof, KeyOwnerProof } from '@polkadot/types/interfaces/grandpa';
+import { Heartbeat } from '@polkadot/types/interfaces/imOnline';
+import { AccountId, Balance, BalanceOf, BlockNumber, Call, ChangesTrieConfiguration, Hash, Header, KeyValue, LookupSource, Moment, Perbill, Percent, Weight } from '@polkadot/types/interfaces/runtime';
+import { Keys } from '@polkadot/types/interfaces/session';
+import { CompactAssignments, ElectionScore, ElectionSize, EraIndex, RewardDestination, ValidatorIndex, ValidatorPrefs } from '@polkadot/types/interfaces/staking';
+import { Key } from '@polkadot/types/interfaces/system';
+import { ApiTypes, SubmittableExtrinsic } from '@polkadot/api/types';
+
+declare module '@polkadot/api/types/submittable' {
+  export interface AugmentedSubmittables<ApiType> {
+    authorship: {
+      /**
+       * Provide a set of uncles.
+       **/
+      setUncles: AugmentedSubmittable<(newUncles: Vec<Header> | (Header | { parentHash?: any; number?: any; stateRoot?: any; extrinsicsRoot?: any; digest?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
+    };
+    balances: {
+      /**
+       * Exactly as `transfer`, except the origin must be root and the source account may be
+       * specified.
+       * # <weight>
+       * - Same as transfer, but additional read and write because the source account is
+       * not assumed to be in the overlay.
+       * # </weight>
+       **/
+      forceTransfer: AugmentedSubmittable<(source: LookupSource | string | Uint8Array, dest: LookupSource | string | Uint8Array, value: Compact<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Set the balances of a given account.
+       * 
+       * This will alter `FreeBalance` and `ReservedBalance` in storage. it will
+       * also decrease the total issuance of the system (`TotalIssuance`).
+       * If the new free or reserved balance is below the existential deposit,
+       * it will reset the account nonce (`frame_system::AccountNonce`).
+       * 
+       * The dispatch origin for this call is `root`.
+       * 
+       * # <weight>
+       * - Independent of the arguments.
+       * - Contains a limited number of reads and writes.
+       * ---------------------
+       * - Base Weight:
+       * - Creating: 27.56 µs
+       * - Killing: 35.11 µs
+       * - DB Weight: 1 Read, 1 Write to `who`
+       * # </weight>
+       **/
+      setBalance: AugmentedSubmittable<(who: LookupSource | string | Uint8Array, newFree: Compact<Balance> | AnyNumber | Uint8Array, newReserved: Compact<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Transfer some liquid free balance to another account.
+       * 
+       * `transfer` will set the `FreeBalance` of the sender and receiver.
+       * It will decrease the total issuance of the system by the `TransferFee`.
+       * If the sender's account is below the existential deposit as a result
+       * of the transfer, the account will be reaped.
+       * 
+       * The dispatch origin for this call must be `Signed` by the transactor.
+       * 
+       * # <weight>
+       * - Dependent on arguments but not critical, given proper implementations for
+       * input config types. See related functions below.
+       * - It contains a limited number of reads and writes internally and no complex computation.
+       * 
+       * Related functions:
+       * 
+       * - `ensure_can_withdraw` is always called internally but has a bounded complexity.
+       * - Transferring balances to accounts that did not exist before will cause
+       * `T::OnNewAccount::on_new_account` to be called.
+       * - Removing enough funds from an account will trigger `T::DustRemoval::on_unbalanced`.
+       * - `transfer_keep_alive` works the same way as `transfer`, but has an additional
+       * check that the transfer will not kill the origin account.
+       * ---------------------------------
+       * - Base Weight: 73.64 µs, worst case scenario (account created, account removed)
+       * - DB Weight: 1 Read and 1 Write to destination account
+       * - Origin account is already in memory, so no DB operations for them.
+       * # </weight>
+       **/
+      transfer: AugmentedSubmittable<(dest: LookupSource | string | Uint8Array, value: Compact<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Same as the [`transfer`] call, but with a check that the transfer will not kill the
+       * origin account.
+       * 
+       * 99% of the time you want [`transfer`] instead.
+       * 
+       * [`transfer`]: struct.Module.html#method.transfer
+       * # <weight>
+       * - Cheaper than transfer because account cannot be killed.
+       * - Base Weight: 51.4 µs
+       * - DB Weight: 1 Read and 1 Write to dest (sender is in overlay already)
+       * #</weight>
+       **/
+      transferKeepAlive: AugmentedSubmittable<(dest: LookupSource | string | Uint8Array, value: Compact<Balance> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    contentWorkingGroup: {
+      /**
+       * Begin accepting curator applications to an opening that is active.
+       **/
+      acceptCuratorApplications: AugmentedSubmittable<(curatorOpeningId: CuratorOpeningId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Add an opening for a curator role.
+       **/
+      addCuratorOpening: 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) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Apply on a curator opening.
+       **/
+      applyOnCuratorOpening: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, curatorOpeningId: CuratorOpeningId | AnyNumber | Uint8Array, roleAccount: 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.
+       **/
+      beginCuratorApplicantReview: AugmentedSubmittable<(curatorOpeningId: CuratorOpeningId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create a new channel.
+       **/
+      createChannel: AugmentedSubmittable<(owner: MemberId | AnyNumber | Uint8Array, roleAccount: AccountId | string | Uint8Array, content: ChannelContentType | 'Video'|'Music'|'Ebook' | number | Uint8Array, handle: Bytes | string | Uint8Array, title: OptionalText | null | object | string | Uint8Array, description: OptionalText | null | object | string | Uint8Array, avatar: OptionalText | null | object | string | Uint8Array, banner: OptionalText | null | object | string | Uint8Array, publicationStatus: ChannelPublicationStatus | 'Public'|'Unlisted' | number | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Fill opening for curator
+       **/
+      fillCuratorOpening: AugmentedSubmittable<(curatorOpeningId: CuratorOpeningId | AnyNumber | Uint8Array, successfulCuratorApplicationIds: CuratorApplicationIdSet, rewardPolicy: Option<RewardPolicy> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Add to capacity of current acive mint.
+       * This may be deprecated in the future, since set_mint_capacity is sufficient to
+       * both increase and decrease capacity. Although when considering that it may be executed
+       * by a proposal, given the temporal delay in approving a proposal, it might be more suitable
+       * than set_mint_capacity?
+       **/
+      increaseMintCapacity: AugmentedSubmittable<(additionalCapacity: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * An active curator leaves role
+       **/
+      leaveCuratorRole: AugmentedSubmittable<(curatorId: CuratorId | AnyNumber | Uint8Array, rationaleText: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Replace the current lead. First unsets the active lead if there is one.
+       * If a value is provided for new_lead it will then set that new lead.
+       * It is responsibility of the caller to ensure the new lead can be set
+       * to avoid the lead role being vacant at the end of the call.
+       **/
+      replaceLead: AugmentedSubmittable<(newLead: Option<ITuple<[MemberId, AccountId]>> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Add an opening for a curator role.
+       **/
+      setChannelCreationEnabled: AugmentedSubmittable<(enabled: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Sets the capacity of the current active mint
+       **/
+      setMintCapacity: AugmentedSubmittable<(newCapacity: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Lead terminate curator application
+       **/
+      terminateCuratorApplication: AugmentedSubmittable<(curatorApplicationId: CuratorApplicationId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Lead can terminate and active curator
+       **/
+      terminateCuratorRole: AugmentedSubmittable<(curatorId: CuratorId | AnyNumber | Uint8Array, rationaleText: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * An owner transfers channel ownership to a new owner.
+       * 
+       * Notice that working group participants cannot do this.
+       * Notice that censored or unlisted channel may still be transferred.
+       * Notice that transfers are unilateral, so new owner cannot block. This may be problematic: https://github.com/Joystream/substrate-runtime-joystream/issues/95
+       **/
+      transferChannelOwnership: AugmentedSubmittable<(channelId: ChannelId | AnyNumber | Uint8Array, newOwner: MemberId | AnyNumber | Uint8Array, newRoleAccount: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Update channel as a curation actor
+       **/
+      updateChannelAsCurationActor: AugmentedSubmittable<(curationActor: CurationActor | { Lead: any } | { Curator: any } | string | Uint8Array, channelId: ChannelId | AnyNumber | Uint8Array, newVerified: Option<bool> | null | object | string | Uint8Array, newCurationStatus: Option<ChannelCurationStatus> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Channel owner updates some channel properties
+       **/
+      updateChannelAsOwner: AugmentedSubmittable<(channelId: ChannelId | AnyNumber | Uint8Array, newHandle: Option<Bytes> | null | object | string | Uint8Array, newTitle: Option<OptionalText> | null | object | string | Uint8Array, newDescription: Option<OptionalText> | null | object | string | Uint8Array, newAvatar: Option<OptionalText> | null | object | string | Uint8Array, newBanner: Option<OptionalText> | null | object | string | Uint8Array, newPublicationStatus: Option<ChannelPublicationStatus> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * An active curator can update the reward account associated
+       * with a set reward relationship.
+       **/
+      updateCuratorRewardAccount: AugmentedSubmittable<(curatorId: CuratorId | AnyNumber | Uint8Array, newRewardAccount: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * An active curator can update the associated role account.
+       **/
+      updateCuratorRoleAccount: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, curatorId: CuratorId | AnyNumber | Uint8Array, newRoleAccount: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      withdrawCuratorApplication: AugmentedSubmittable<(curatorApplicationId: CuratorApplicationId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    contracts: {
+      /**
+       * Makes a call to an account, optionally transferring some balance.
+       * 
+       * * If the account is a smart-contract account, the associated code will be
+       * executed and any value will be transferred.
+       * * If the account is a regular account, any value will be transferred.
+       * * If no account exists and the call value is not less than `existential_deposit`,
+       * a regular account will be created and any value will be transferred.
+       **/
+      call: AugmentedSubmittable<(dest: LookupSource | string | Uint8Array, value: Compact<BalanceOf> | AnyNumber | Uint8Array, gasLimit: Compact<Gas> | AnyNumber | Uint8Array, data: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Allows block producers to claim a small reward for evicting a contract. If a block producer
+       * fails to do so, a regular users will be allowed to claim the reward.
+       * 
+       * If contract is not evicted as a result of this call, no actions are taken and
+       * the sender is not eligible for the reward.
+       **/
+      claimSurcharge: AugmentedSubmittable<(dest: AccountId | string | Uint8Array, auxSender: Option<AccountId> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Instantiates a new contract from the `codehash` generated by `put_code`, optionally transferring some balance.
+       * 
+       * Instantiation is executed as follows:
+       * 
+       * - The destination address is computed based on the sender and hash of the code.
+       * - The smart-contract account is created at the computed address.
+       * - The `ctor_code` is executed in the context of the newly-created account. Buffer returned
+       * after the execution is saved as the `code` of the account. That code will be invoked
+       * upon any call received by this account.
+       * - The contract is initialized.
+       **/
+      instantiate: AugmentedSubmittable<(endowment: Compact<BalanceOf> | AnyNumber | Uint8Array, gasLimit: Compact<Gas> | AnyNumber | Uint8Array, codeHash: CodeHash | string | Uint8Array, data: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Stores the given binary Wasm code into the chain's storage and returns its `codehash`.
+       * You can instantiate contracts only with stored code.
+       **/
+      putCode: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Updates the schedule for metering contracts.
+       * 
+       * The schedule must have a greater version than the stored schedule.
+       **/
+      updateSchedule: AugmentedSubmittable<(schedule: Schedule | { version?: any; putCodePerByteCost?: any; growMemCost?: any; regularOpCost?: any; returnDataPerByteCost?: any; eventDataPerByteCost?: any; eventPerTopicCost?: any; eventBaseCost?: any; sandboxDataReadCost?: any; sandboxDataWriteCost?: any; transferCost?: any; maxEventTopics?: any; maxStackHeight?: any; maxMemoryPages?: any; enablePrintln?: any; maxSubjectLen?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    council: {
+      /**
+       * Adds a zero staked council member. A member added in this way does not get a recurring reward.
+       **/
+      addCouncilMember: AugmentedSubmittable<(account: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Remove a single council member and their reward.
+       **/
+      removeCouncilMember: AugmentedSubmittable<(accountToRemove: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Force set a zero staked council. Stakes in existing council seats are not returned.
+       * Existing council rewards are removed and new council members do NOT get any rewards.
+       * Avoid using this call if possible, will be deprecated. The term of the new council is
+       * not extended.
+       **/
+      setCouncil: AugmentedSubmittable<(accounts: Vec<AccountId> | (AccountId | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Sets the capacity of the the council mint, if it doesn't exist, attempts to
+       * create a new one.
+       **/
+      setCouncilMintCapacity: AugmentedSubmittable<(capacity: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Sets the council rewards which is only applied on new council being elected.
+       **/
+      setCouncilRewards: AugmentedSubmittable<(amountPerPayout: BalanceOf | AnyNumber | Uint8Array, payoutInterval: Option<BlockNumber> | null | object | string | Uint8Array, firstPayoutAfterRewardCreated: BlockNumber | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Set blocknumber when council term will end
+       **/
+      setTermEndsAt: AugmentedSubmittable<(endsAt: BlockNumber | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Attempts to mint and transfer amount to destination account
+       **/
+      spendFromCouncilMint: AugmentedSubmittable<(amount: BalanceOf | AnyNumber | Uint8Array, destination: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    councilElection: {
+      apply: AugmentedSubmittable<(stake: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      forceStartElection: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>>;
+      forceStopElection: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>>;
+      reveal: AugmentedSubmittable<(commitment: Hash | string | Uint8Array, vote: AccountId | string | Uint8Array, salt: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      setAutoStart: AugmentedSubmittable<(flag: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Sets new election parameters. Some combination of parameters that are not desirable, so
+       * the parameters are checked for validity.
+       * The call will fail if an election is in progress. If a council is not being elected for some
+       * reaon after multiple rounds, force_stop_election() can be called to stop elections and followed by
+       * set_election_parameters().
+       **/
+      setElectionParameters: AugmentedSubmittable<(params: ElectionParameters | { announcing_period?: any; voting_period?: any; revealing_period?: any; council_size?: any; candidacy_limit?: any; new_term_duration?: any; min_council_stake?: any; min_voting_stake?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      setStageAnnouncing: AugmentedSubmittable<(endsAt: BlockNumber | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      setStageRevealing: AugmentedSubmittable<(endsAt: BlockNumber | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      setStageVoting: AugmentedSubmittable<(endsAt: BlockNumber | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      vote: AugmentedSubmittable<(commitment: Hash | string | Uint8Array, stake: BalanceOf | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    dataDirectory: {
+      /**
+       * Storage provider accepts a content. Requires signed storage provider account and its id.
+       * The LiaisonJudgement can be updated, but only by the liaison.
+       **/
+      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
+       * awaits liaison to accept or reject it.
+       **/
+      addContent: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, contentId: ContentId | string | Uint8Array, typeId: DataObjectTypeId | AnyNumber | Uint8Array, size: u64 | AnyNumber | Uint8Array, ipfsContentId: Bytes | 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.
+       * The number of objects that can be added per call is limited to prevent the dispatch
+       * from causing the block production to fail if it takes too much time to process.
+       * Existing data objects will be overwritten.
+       **/
+      injectDataObjects: AugmentedSubmittable<(objects: DataObjectsMap) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Storage provider rejects a content. Requires signed storage provider account and its id.
+       * The LiaisonJudgement can be updated, but only by the liaison.
+       **/
+      rejectContent: AugmentedSubmittable<(storageProviderId: StorageProviderId | AnyNumber | Uint8Array, contentId: ContentId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Removes the content id from the list of known content ids. Requires root privileges.
+       **/
+      removeKnownContentId: AugmentedSubmittable<(contentId: ContentId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    dataObjectStorageRegistry: {
+      /**
+       * Add storage provider-to-content relationship. The storage provider should be registered
+       * in the storage working group.
+       **/
+      addRelationship: AugmentedSubmittable<(storageProviderId: StorageProviderId | AnyNumber | Uint8Array, cid: ContentId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Activates storage provider-to-content relationship. The storage provider should be registered
+       * in the storage working group. A storage provider may flip their own ready state, but nobody else.
+       **/
+      setRelationshipReady: AugmentedSubmittable<(storageProviderId: StorageProviderId | AnyNumber | Uint8Array, id: DataObjectStorageRelationshipId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Deactivates storage provider-to-content relationship. The storage provider should be registered
+       * in the storage working group. A storage provider may flip their own ready state, but nobody else.
+       **/
+      unsetRelationshipReady: AugmentedSubmittable<(storageProviderId: StorageProviderId | AnyNumber | Uint8Array, id: DataObjectStorageRelationshipId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    dataObjectTypeRegistry: {
+      /**
+       * Activates existing data object type. Requires leader privileges.
+       **/
+      activateDataObjectType: AugmentedSubmittable<(id: DataObjectTypeId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Deactivates existing data object type. Requires leader privileges.
+       **/
+      deactivateDataObjectType: AugmentedSubmittable<(id: DataObjectTypeId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Registers the new data object type. Requires leader privileges.
+       **/
+      registerDataObjectType: AugmentedSubmittable<(dataObjectType: DataObjectType | { description?: any; active?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Updates existing data object type. Requires leader privileges.
+       **/
+      updateDataObjectType: AugmentedSubmittable<(id: DataObjectTypeId | AnyNumber | Uint8Array, dataObjectType: DataObjectType | { description?: any; active?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    discovery: {
+      /**
+       * Sets bootstrap endpoints for the Colossus. Requires root privileges.
+       **/
+      setBootstrapEndpoints: AugmentedSubmittable<(endpoints: Vec<Url> | (Url | string)[]) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Sets default lifetime for storage providers accounts info. Requires root privileges.
+       **/
+      setDefaultLifetime: AugmentedSubmittable<(lifetime: BlockNumber | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Creates the AccountInfo to save an IPNS identity for the storage provider.
+       * Requires signed storage provider credentials.
+       **/
+      setIpnsId: AugmentedSubmittable<(storageProviderId: StorageProviderId | AnyNumber | Uint8Array, id: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Deletes the AccountInfo with the IPNS identity for the storage provider.
+       * Requires signed storage provider credentials.
+       **/
+      unsetIpnsId: AugmentedSubmittable<(storageProviderId: StorageProviderId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    finalityTracker: {
+      /**
+       * Hint that the author of this block thinks the best finalized
+       * block is the given number.
+       **/
+      finalHint: AugmentedSubmittable<(hint: Compact<BlockNumber> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    forum: {
+      /**
+       * Edit post text
+       **/
+      addPost: AugmentedSubmittable<(threadId: ThreadId | AnyNumber | Uint8Array, text: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Add a new category.
+       **/
+      createCategory: AugmentedSubmittable<(parent: Option<CategoryId> | null | object | string | Uint8Array, title: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create new thread in category
+       **/
+      createThread: AugmentedSubmittable<(categoryId: CategoryId | AnyNumber | Uint8Array, title: Bytes | string | Uint8Array, text: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Edit post text
+       **/
+      editPostText: AugmentedSubmittable<(postId: PostId | AnyNumber | Uint8Array, newText: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Moderate post
+       **/
+      moderatePost: AugmentedSubmittable<(postId: PostId | AnyNumber | Uint8Array, rationale: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Moderate thread
+       **/
+      moderateThread: AugmentedSubmittable<(threadId: ThreadId | AnyNumber | Uint8Array, rationale: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Set forum sudo.
+       **/
+      setForumSudo: AugmentedSubmittable<(newForumSudo: Option<AccountId> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Update category
+       **/
+      updateCategory: AugmentedSubmittable<(categoryId: CategoryId | AnyNumber | Uint8Array, newArchivalStatus: Option<bool> | null | object | string | Uint8Array, newDeletionStatus: Option<bool> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    grandpa: {
+      /**
+       * Report voter equivocation/misbehavior. This method will verify the
+       * equivocation proof and validate the given key ownership proof
+       * against the extracted offender. If both are valid, the offence
+       * will be reported.
+       * 
+       * Since the weight of the extrinsic is 0, in order to avoid DoS by
+       * submission of invalid equivocation reports, a mandatory pre-validation of
+       * the extrinsic is implemented in a `SignedExtension`.
+       **/
+      reportEquivocation: AugmentedSubmittable<(equivocationProof: GrandpaEquivocationProof | { setId?: any; equivocation?: any } | string | Uint8Array, keyOwnerProof: KeyOwnerProof | { session?: any; trieNodes?: any; validatorCount?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    imOnline: {
+      /**
+       * # <weight>
+       * - Complexity: `O(K + E)` where K is length of `Keys` and E is length of
+       * `Heartbeat.network_state.external_address`
+       * 
+       * - `O(K)`: decoding of length `K`
+       * - `O(E)`: decoding/encoding of length `E`
+       * - DbReads: pallet_session `Validators`, pallet_session `CurrentIndex`, `Keys`,
+       * `ReceivedHeartbeats`
+       * - DbWrites: `ReceivedHeartbeats`
+       * # </weight>
+       **/
+      heartbeat: AugmentedSubmittable<(heartbeat: Heartbeat | { blockNumber?: any; networkState?: any; sessionIndex?: any; authorityIndex?: any; validatorsLen?: any } | string | Uint8Array, signature: Signature | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    members: {
+      addScreenedMember: AugmentedSubmittable<(newMemberAccount: AccountId | string | Uint8Array, handle: Option<Bytes> | null | object | string | Uint8Array, avatarUri: Option<Bytes> | null | object | string | Uint8Array, about: Option<Bytes> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Non-members can buy membership
+       **/
+      buyMembership: AugmentedSubmittable<(paidTermsId: PaidTermId | AnyNumber | Uint8Array, handle: Option<Bytes> | null | object | string | Uint8Array, avatarUri: Option<Bytes> | null | object | string | Uint8Array, about: Option<Bytes> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Change member's about text
+       **/
+      changeMemberAboutText: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, text: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Change member's avatar
+       **/
+      changeMemberAvatar: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, uri: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Change member's handle. Will ensure new handle is unique and old one will be available
+       * for other members to use.
+       **/
+      changeMemberHandle: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, handle: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      setControllerAccount: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, newControllerAccount: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      setRootAccount: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, newRootAccount: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      setScreeningAuthority: AugmentedSubmittable<(authority: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Update member's all or some of handle, avatar and about text.
+       **/
+      updateMembership: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, handle: Option<Bytes> | null | object | string | Uint8Array, avatarUri: Option<Bytes> | null | object | string | Uint8Array, about: Option<Bytes> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    memo: {
+      updateMemo: AugmentedSubmittable<(memo: MemoText | string) => SubmittableExtrinsic<ApiType>>;
+    };
+    proposalsCodex: {
+      /**
+       * Create 'Add working group leader opening' proposal type.
+       * This proposal uses `add_opening()` extrinsic from the Joystream `working group` module.
+       **/
+      createAddWorkingGroupLeaderOpeningProposal: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, title: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, stakeBalance: Option<BalanceOf> | null | object | string | Uint8Array, addOpeningParameters: AddOpeningParameters | { activate_at?: any; commitment?: any; human_readable_text?: any; working_group?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create 'Begin review working group leader applications' proposal type.
+       * This proposal uses `begin_applicant_review()` extrinsic from the Joystream `working group` module.
+       **/
+      createBeginReviewWorkingGroupLeaderApplicationsProposal: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, title: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, stakeBalance: Option<BalanceOf> | null | object | string | Uint8Array, openingId: OpeningId | AnyNumber | Uint8Array, workingGroup: WorkingGroup | 'Storage' | number | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create 'decrease working group leader stake' proposal type.
+       * This proposal uses `decrease_stake()` extrinsic from the `working-group`  module.
+       **/
+      createDecreaseWorkingGroupLeaderStakeProposal: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, title: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, stakeBalance: Option<BalanceOf> | null | object | string | Uint8Array, workerId: WorkerId | AnyNumber | Uint8Array, decreasingStake: BalanceOf | AnyNumber | Uint8Array, workingGroup: WorkingGroup | 'Storage' | number | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create 'Fill working group leader opening' proposal type.
+       * This proposal uses `fill_opening()` extrinsic from the Joystream `working group` module.
+       **/
+      createFillWorkingGroupLeaderOpeningProposal: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, title: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, stakeBalance: Option<BalanceOf> | null | object | string | Uint8Array, fillOpeningParameters: FillOpeningParameters | { opening_id?: any; successful_application_id?: any; reward_policy?: any; working_group?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create 'Runtime upgrade' proposal type. Runtime upgrade can be initiated only by
+       * members from the hardcoded list `RuntimeUpgradeProposalAllowedProposers`
+       **/
+      createRuntimeUpgradeProposal: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, title: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, stakeBalance: Option<BalanceOf> | null | object | string | Uint8Array, wasm: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create 'Set content working group mint capacity' proposal type.
+       * This proposal uses `set_mint_capacity()` extrinsic from the `content-working-group`  module.
+       **/
+      createSetContentWorkingGroupMintCapacityProposal: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, title: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, stakeBalance: Option<BalanceOf> | null | object | string | Uint8Array, mintBalance: BalanceOfMint | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create 'Set election parameters' proposal type. This proposal uses `set_election_parameters()`
+       * extrinsic from the `governance::election module`.
+       **/
+      createSetElectionParametersProposal: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, title: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, stakeBalance: Option<BalanceOf> | null | object | string | Uint8Array, electionParameters: ElectionParameters | { announcing_period?: any; voting_period?: any; revealing_period?: any; council_size?: any; candidacy_limit?: any; new_term_duration?: any; min_council_stake?: any; min_voting_stake?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create 'Set lead' proposal type.
+       * This proposal uses `replace_lead()` extrinsic from the `content_working_group`  module.
+       **/
+      createSetLeadProposal: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, title: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, stakeBalance: Option<BalanceOf> | null | object | string | Uint8Array, newLead: Option<ITuple<[MemberId, AccountId]>> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create 'Evict storage provider' proposal type.
+       * This proposal uses `set_validator_count()` extrinsic from the Substrate `staking`  module.
+       **/
+      createSetValidatorCountProposal: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, title: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, stakeBalance: Option<BalanceOf> | null | object | string | Uint8Array, newValidatorCount: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create 'set working group leader reward' proposal type.
+       * This proposal uses `update_reward_amount()` extrinsic from the `working-group`  module.
+       **/
+      createSetWorkingGroupLeaderRewardProposal: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, title: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, stakeBalance: Option<BalanceOf> | null | object | string | Uint8Array, workerId: WorkerId | AnyNumber | Uint8Array, rewardAmount: BalanceOfMint | AnyNumber | Uint8Array, workingGroup: WorkingGroup | 'Storage' | number | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create 'Set working group mint capacity' proposal type.
+       * This proposal uses `set_mint_capacity()` extrinsic from the `working-group`  module.
+       **/
+      createSetWorkingGroupMintCapacityProposal: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, title: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, stakeBalance: Option<BalanceOf> | null | object | string | Uint8Array, mintBalance: BalanceOfMint | AnyNumber | Uint8Array, workingGroup: WorkingGroup | 'Storage' | number | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create 'slash working group leader stake' proposal type.
+       * This proposal uses `slash_stake()` extrinsic from the `working-group`  module.
+       **/
+      createSlashWorkingGroupLeaderStakeProposal: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, title: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, stakeBalance: Option<BalanceOf> | null | object | string | Uint8Array, workerId: WorkerId | AnyNumber | Uint8Array, slashingStake: BalanceOf | AnyNumber | Uint8Array, workingGroup: WorkingGroup | 'Storage' | number | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create 'Spending' proposal type.
+       * This proposal uses `spend_from_council_mint()` extrinsic from the `governance::council`  module.
+       **/
+      createSpendingProposal: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, title: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, stakeBalance: Option<BalanceOf> | null | object | string | Uint8Array, balance: BalanceOfMint | AnyNumber | Uint8Array, destination: AccountId | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create 'terminate working group leader rolw' proposal type.
+       * This proposal uses `terminate_role()` extrinsic from the `working-group`  module.
+       **/
+      createTerminateWorkingGroupLeaderRoleProposal: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, title: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, stakeBalance: Option<BalanceOf> | null | object | string | Uint8Array, terminateRoleParameters: TerminateRoleParameters | { worker_id?: any; rationale?: any; slash?: any; working_group?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Create 'Text (signal)' proposal type.
+       **/
+      createTextProposal: AugmentedSubmittable<(memberId: MemberId | AnyNumber | Uint8Array, title: Bytes | string | Uint8Array, description: Bytes | string | Uint8Array, stakeBalance: Option<BalanceOf> | null | object | string | Uint8Array, text: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Runtime upgrade proposal extrinsic.
+       * Should be used as callable object to pass to the `engine` module.
+       **/
+      executeRuntimeUpgradeProposal: AugmentedSubmittable<(wasm: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Text proposal extrinsic. Should be used as callable object to pass to the `engine` module.
+       **/
+      executeTextProposal: AugmentedSubmittable<(text: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    proposalsDiscussion: {
+      /**
+       * Adds a post with author origin check.
+       **/
+      addPost: AugmentedSubmittable<(postAuthorId: MemberId | AnyNumber | Uint8Array, threadId: ThreadId | AnyNumber | Uint8Array, text: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Updates a post with author origin check. Update attempts number is limited.
+       **/
+      updatePost: AugmentedSubmittable<(postAuthorId: MemberId | AnyNumber | Uint8Array, threadId: ThreadId | AnyNumber | Uint8Array, postId: PostId | AnyNumber | Uint8Array, text: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    proposalsEngine: {
+      /**
+       * Cancel a proposal by its original proposer.
+       **/
+      cancelProposal: AugmentedSubmittable<(proposerId: MemberId | AnyNumber | Uint8Array, proposalId: ProposalId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Veto a proposal. Must be root.
+       **/
+      vetoProposal: AugmentedSubmittable<(proposalId: ProposalId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Vote extrinsic. Conditions:  origin must allow votes.
+       **/
+      vote: AugmentedSubmittable<(voterId: MemberId | AnyNumber | Uint8Array, proposalId: ProposalId | AnyNumber | Uint8Array, vote: VoteKind | 'Approve'|'Reject'|'Slash'|'Abstain' | number | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    session: {
+      /**
+       * Removes any session key(s) of the function caller.
+       * This doesn't take effect until the next session.
+       * 
+       * The dispatch origin of this function must be signed.
+       * 
+       * # <weight>
+       * - Complexity: `O(1)` in number of key types.
+       * Actual cost depends on the number of length of `T::Keys::key_ids()` which is fixed.
+       * - DbReads: `T::ValidatorIdOf`, `NextKeys`, `origin account`
+       * - DbWrites: `NextKeys`, `origin account`
+       * - DbWrites per key id: `KeyOwnder`
+       * # </weight>
+       **/
+      purgeKeys: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Sets the session key(s) of the function caller to `keys`.
+       * Allows an account to set its session key prior to becoming a validator.
+       * This doesn't take effect until the next session.
+       * 
+       * The dispatch origin of this function must be signed.
+       * 
+       * # <weight>
+       * - Complexity: `O(1)`
+       * Actual cost depends on the number of length of `T::Keys::key_ids()` which is fixed.
+       * - DbReads: `origin account`, `T::ValidatorIdOf`, `NextKeys`
+       * - DbWrites: `origin account`, `NextKeys`
+       * - DbReads per key id: `KeyOwner`
+       * - DbWrites per key id: `KeyOwner`
+       * # </weight>
+       **/
+      setKeys: AugmentedSubmittable<(keys: Keys, proof: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    staking: {
+      /**
+       * Take the origin account as a stash and lock up `value` of its balance. `controller` will
+       * be the account that controls it.
+       * 
+       * `value` must be more than the `minimum_balance` specified by `T::Currency`.
+       * 
+       * The dispatch origin for this call must be _Signed_ by the stash account.
+       * 
+       * Emits `Bonded`.
+       * 
+       * # <weight>
+       * - Independent of the arguments. Moderate complexity.
+       * - O(1).
+       * - Three extra DB entries.
+       * 
+       * NOTE: Two of the storage writes (`Self::bonded`, `Self::payee`) are _never_ cleaned
+       * unless the `origin` falls below _existential deposit_ and gets removed as dust.
+       * ------------------
+       * Base Weight: 67.87 µs
+       * DB Weight:
+       * - Read: Bonded, Ledger, [Origin Account], Current Era, History Depth, Locks
+       * - 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>>;
+      /**
+       * Add some extra amount that have appeared in the stash `free_balance` into the balance up
+       * for staking.
+       * 
+       * Use this if there are additional funds in your stash account that you wish to bond.
+       * Unlike [`bond`] or [`unbond`] this function does not impose any limitation on the amount
+       * that can be added.
+       * 
+       * The dispatch origin for this call must be _Signed_ by the stash, not the controller and
+       * it can be only called when [`EraElectionStatus`] is `Closed`.
+       * 
+       * Emits `Bonded`.
+       * 
+       * # <weight>
+       * - Independent of the arguments. Insignificant complexity.
+       * - O(1).
+       * - One DB entry.
+       * ------------
+       * Base Weight: 54.88 µs
+       * DB Weight:
+       * - Read: Era Election Status, Bonded, Ledger, [Origin Account], Locks
+       * - Write: [Origin Account], Locks, Ledger
+       * # </weight>
+       **/
+      bondExtra: AugmentedSubmittable<(maxAdditional: Compact<BalanceOf> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Cancel enactment of a deferred slash.
+       * 
+       * Can be called by the `T::SlashCancelOrigin`.
+       * 
+       * Parameters: era and indices of the slashes for that era to kill.
+       * 
+       * # <weight>
+       * Complexity: O(U + S)
+       * with U unapplied slashes weighted with U=1000
+       * and S is the number of slash indices to be canceled.
+       * - Base: 5870 + 34.61 * S µs
+       * - Read: Unapplied Slashes
+       * - Write: Unapplied Slashes
+       * # </weight>
+       **/
+      cancelDeferredSlash: AugmentedSubmittable<(era: EraIndex | AnyNumber | Uint8Array, slashIndices: Vec<u32> | (u32 | AnyNumber | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Declare no desire to either validate or nominate.
+       * 
+       * Effects will be felt at the beginning of the next era.
+       * 
+       * The dispatch origin for this call must be _Signed_ by the controller, not the stash.
+       * And, it can be only called when [`EraElectionStatus`] is `Closed`.
+       * 
+       * # <weight>
+       * - Independent of the arguments. Insignificant complexity.
+       * - Contains one read.
+       * - Writes are limited to the `origin` account key.
+       * --------
+       * Base Weight: 16.53 µs
+       * DB Weight:
+       * - Read: EraElectionStatus, Ledger
+       * - Write: Validators, Nominators
+       * # </weight>
+       **/
+      chill: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Force there to be a new era at the end of the next session. After this, it will be
+       * reset to normal (non-forced) behaviour.
+       * 
+       * The dispatch origin must be Root.
+       * 
+       * # <weight>
+       * - No arguments.
+       * - Base Weight: 1.959 µs
+       * - Write ForceEra
+       * # </weight>
+       **/
+      forceNewEra: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Force there to be a new era at the end of sessions indefinitely.
+       * 
+       * The dispatch origin must be Root.
+       * 
+       * # <weight>
+       * - Base Weight: 2.05 µs
+       * - Write: ForceEra
+       * # </weight>
+       **/
+      forceNewEraAlways: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Force there to be no new eras indefinitely.
+       * 
+       * The dispatch origin must be Root.
+       * 
+       * # <weight>
+       * - No arguments.
+       * - Base Weight: 1.857 µs
+       * - Write: ForceEra
+       * # </weight>
+       **/
+      forceNoEras: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Force a current staker to become completely unstaked, immediately.
+       * 
+       * The dispatch origin must be Root.
+       * 
+       * # <weight>
+       * O(S) where S is the number of slashing spans to be removed
+       * Base Weight: 53.07 + 2.365 * S µs
+       * Reads: Bonded, Slashing Spans, Account, Locks
+       * Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators, Account, Locks
+       * Writes Each: SpanSlash * S
+       * # </weight>
+       **/
+      forceUnstake: AugmentedSubmittable<(stash: AccountId | string | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Increments the ideal number of validators.
+       * 
+       * The dispatch origin must be Root.
+       * 
+       * # <weight>
+       * Base Weight: 1.717 µs
+       * Read/Write: Validator Count
+       * # </weight>
+       **/
+      increaseValidatorCount: AugmentedSubmittable<(additional: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Declare the desire to nominate `targets` for the origin controller.
+       * 
+       * Effects will be felt at the beginning of the next era. This can only be called when
+       * [`EraElectionStatus`] is `Closed`.
+       * 
+       * The dispatch origin for this call must be _Signed_ by the controller, not the stash.
+       * And, it can be only called when [`EraElectionStatus`] is `Closed`.
+       * 
+       * # <weight>
+       * - The transaction's complexity is proportional to the size of `targets` (N)
+       * which is capped at CompactAssignments::LIMIT (MAX_NOMINATIONS).
+       * - Both the reads and writes follow a similar pattern.
+       * ---------
+       * Base Weight: 22.34 + .36 * N µs
+       * where N is the number of targets
+       * DB Weight:
+       * - Reads: Era Election Status, Ledger, Current Era
+       * - Writes: Validators, Nominators
+       * # </weight>
+       **/
+      nominate: AugmentedSubmittable<(targets: Vec<LookupSource> | (LookupSource | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Pay out all the stakers behind a single validator for a single era.
+       * 
+       * - `validator_stash` is the stash account of the validator. Their nominators, up to
+       * `T::MaxNominatorRewardedPerValidator`, will also receive their rewards.
+       * - `era` may be any era between `[current_era - history_depth; current_era]`.
+       * 
+       * The origin of this call must be _Signed_. Any account can call this function, even if
+       * it is not one of the stakers.
+       * 
+       * This can only be called when [`EraElectionStatus`] is `Closed`.
+       * 
+       * # <weight>
+       * - Time complexity: at most O(MaxNominatorRewardedPerValidator).
+       * - Contains a limited number of reads and writes.
+       * -----------
+       * N is the Number of payouts for the validator (including the validator)
+       * Base Weight:
+       * - Reward Destination Staked: 110 + 54.2 * N µs (Median Slopes)
+       * - Reward Destination Controller (Creating): 120 + 41.95 * N µs (Median Slopes)
+       * DB Weight:
+       * - Read: EraElectionStatus, CurrentEra, HistoryDepth, ErasValidatorReward,
+       * ErasStakersClipped, ErasRewardPoints, ErasValidatorPrefs (8 items)
+       * - Read Each: Bonded, Ledger, Payee, Locks, System Account (5 items)
+       * - Write Each: System Account, Locks, Ledger (3 items)
+       * # </weight>
+       **/
+      payoutStakers: AugmentedSubmittable<(validatorStash: AccountId | string | Uint8Array, era: EraIndex | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Remove all data structure concerning a staker/stash once its balance is zero.
+       * This is essentially equivalent to `withdraw_unbonded` except it can be called by anyone
+       * and the target `stash` must have no funds left.
+       * 
+       * This can be called from any origin.
+       * 
+       * - `stash`: The stash account to reap. Its balance must be zero.
+       * 
+       * # <weight>
+       * Complexity: O(S) where S is the number of slashing spans on the account.
+       * Base Weight: 75.94 + 2.396 * S µs
+       * DB Weight:
+       * - Reads: Stash Account, Bonded, Slashing Spans, Locks
+       * - Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators, Stash Account, Locks
+       * - Writes Each: SpanSlash * S
+       * # </weight>
+       **/
+      reapStash: AugmentedSubmittable<(stash: AccountId | string | Uint8Array, numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Rebond a portion of the stash scheduled to be unlocked.
+       * 
+       * The dispatch origin must be signed by the controller, and it can be only called when
+       * [`EraElectionStatus`] is `Closed`.
+       * 
+       * # <weight>
+       * - Time complexity: O(L), where L is unlocking chunks
+       * - Bounded by `MAX_UNLOCKING_CHUNKS`.
+       * - Storage changes: Can't increase storage, only decrease it.
+       * ---------------
+       * - Base Weight: 34.51 µs * .048 L µs
+       * - DB Weight:
+       * - Reads: EraElectionStatus, Ledger, Locks, [Origin Account]
+       * - Writes: [Origin Account], Locks, Ledger
+       * # </weight>
+       **/
+      rebond: AugmentedSubmittable<(value: Compact<BalanceOf> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Scale up the ideal number of validators by a factor.
+       * 
+       * The dispatch origin must be Root.
+       * 
+       * # <weight>
+       * Base Weight: 1.717 µs
+       * Read/Write: Validator Count
+       * # </weight>
+       **/
+      scaleValidatorCount: AugmentedSubmittable<(factor: Percent | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * (Re-)set the controller of a stash.
+       * 
+       * Effects will be felt at the beginning of the next era.
+       * 
+       * The dispatch origin for this call must be _Signed_ by the stash, not the controller.
+       * 
+       * # <weight>
+       * - Independent of the arguments. Insignificant complexity.
+       * - Contains a limited number of reads.
+       * - Writes are limited to the `origin` account key.
+       * ----------
+       * Base Weight: 25.22 µs
+       * DB Weight:
+       * - Read: Bonded, Ledger New Controller, Ledger Old Controller
+       * - Write: Bonded, Ledger New Controller, Ledger Old Controller
+       * # </weight>
+       **/
+      setController: AugmentedSubmittable<(controller: LookupSource | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Set `HistoryDepth` value. This function will delete any history information
+       * when `HistoryDepth` is reduced.
+       * 
+       * Parameters:
+       * - `new_history_depth`: The new history depth you would like to set.
+       * - `era_items_deleted`: The number of items that will be deleted by this dispatch.
+       * This should report all the storage items that will be deleted by clearing old
+       * era history. Needed to report an accurate weight for the dispatch. Trusted by
+       * `Root` to report an accurate number.
+       * 
+       * Origin must be root.
+       * 
+       * # <weight>
+       * - E: Number of history depths removed, i.e. 10 -> 7 = 3
+       * - Base Weight: 29.13 * E µs
+       * - DB Weight:
+       * - Reads: Current Era, History Depth
+       * - Writes: History Depth
+       * - Clear Prefix Each: Era Stakers, EraStakersClipped, ErasValidatorPrefs
+       * - Writes Each: ErasValidatorReward, ErasRewardPoints, ErasTotalStake, ErasStartSessionIndex
+       * # </weight>
+       **/
+      setHistoryDepth: AugmentedSubmittable<(newHistoryDepth: Compact<EraIndex> | AnyNumber | Uint8Array, eraItemsDeleted: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Set the validators who cannot be slashed (if any).
+       * 
+       * The dispatch origin must be Root.
+       * 
+       * # <weight>
+       * - O(V)
+       * - Base Weight: 2.208 + .006 * V µs
+       * - Write: Invulnerables
+       * # </weight>
+       **/
+      setInvulnerables: AugmentedSubmittable<(validators: Vec<AccountId> | (AccountId | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * (Re-)set the payment target for a controller.
+       * 
+       * Effects will be felt at the beginning of the next era.
+       * 
+       * The dispatch origin for this call must be _Signed_ by the controller, not the stash.
+       * 
+       * # <weight>
+       * - Independent of the arguments. Insignificant complexity.
+       * - Contains a limited number of reads.
+       * - Writes are limited to the `origin` account key.
+       * ---------
+       * - Base Weight: 11.33 µs
+       * - DB Weight:
+       * - Read: Ledger
+       * - Write: Payee
+       * # </weight>
+       **/
+      setPayee: AugmentedSubmittable<(payee: RewardDestination | 'Staked'|'Stash'|'Controller' | number | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Sets the ideal number of validators.
+       * 
+       * The dispatch origin must be Root.
+       * 
+       * # <weight>
+       * Base Weight: 1.717 µs
+       * Write: Validator Count
+       * # </weight>
+       **/
+      setValidatorCount: AugmentedSubmittable<(updated: Compact<u32> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Submit an election result to the chain. If the solution:
+       * 
+       * 1. is valid.
+       * 2. has a better score than a potentially existing solution on chain.
+       * 
+       * then, it will be _put_ on chain.
+       * 
+       * A solution consists of two pieces of data:
+       * 
+       * 1. `winners`: a flat vector of all the winners of the round.
+       * 2. `assignments`: the compact version of an assignment vector that encodes the edge
+       * weights.
+       * 
+       * Both of which may be computed using _phragmen_, or any other algorithm.
+       * 
+       * Additionally, the submitter must provide:
+       * 
+       * - The `score` that they claim their solution has.
+       * 
+       * Both validators and nominators will be represented by indices in the solution. The
+       * indices should respect the corresponding types ([`ValidatorIndex`] and
+       * [`NominatorIndex`]). Moreover, they should be valid when used to index into
+       * [`SnapshotValidators`] and [`SnapshotNominators`]. Any invalid index will cause the
+       * solution to be rejected. These two storage items are set during the election window and
+       * may be used to determine the indices.
+       * 
+       * A solution is valid if:
+       * 
+       * 0. It is submitted when [`EraElectionStatus`] is `Open`.
+       * 1. Its claimed score is equal to the score computed on-chain.
+       * 2. Presents the correct number of winners.
+       * 3. All indexes must be value according to the snapshot vectors. All edge values must
+       * also be correct and should not overflow the granularity of the ratio type (i.e. 256
+       * or billion).
+       * 4. For each edge, all targets are actually nominated by the voter.
+       * 5. Has correct self-votes.
+       * 
+       * A solutions score is consisted of 3 parameters:
+       * 
+       * 1. `min { support.total }` for each support of a winner. This value should be maximized.
+       * 2. `sum { support.total }` for each support of a winner. This value should be minimized.
+       * 3. `sum { support.total^2 }` for each support of a winner. This value should be
+       * minimized (to ensure less variance)
+       * 
+       * # <weight>
+       * See `crate::weight` module.
+       * # </weight>
+       **/
+      submitElectionSolution: AugmentedSubmittable<(winners: Vec<ValidatorIndex> | (ValidatorIndex | AnyNumber | Uint8Array)[], compact: CompactAssignments | { votes1?: any; votes2?: any; votes3?: any; votes4?: any; votes5?: any; votes6?: any; votes7?: any; votes8?: any; votes9?: any; votes10?: any; votes11?: any; votes12?: any; votes13?: any; votes14?: any; votes15?: any; votes16?: any } | string | Uint8Array, score: ElectionScore, era: EraIndex | AnyNumber | Uint8Array, size: ElectionSize | { validators?: any; nominators?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Unsigned version of `submit_election_solution`.
+       * 
+       * Note that this must pass the [`ValidateUnsigned`] check which only allows transactions
+       * from the local node to be included. In other words, only the block author can include a
+       * transaction in the block.
+       * 
+       * # <weight>
+       * See `crate::weight` module.
+       * # </weight>
+       **/
+      submitElectionSolutionUnsigned: AugmentedSubmittable<(winners: Vec<ValidatorIndex> | (ValidatorIndex | AnyNumber | Uint8Array)[], compact: CompactAssignments | { votes1?: any; votes2?: any; votes3?: any; votes4?: any; votes5?: any; votes6?: any; votes7?: any; votes8?: any; votes9?: any; votes10?: any; votes11?: any; votes12?: any; votes13?: any; votes14?: any; votes15?: any; votes16?: any } | string | Uint8Array, score: ElectionScore, era: EraIndex | AnyNumber | Uint8Array, size: ElectionSize | { validators?: any; nominators?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Schedule a portion of the stash to be unlocked ready for transfer out after the bond
+       * period ends. If this leaves an amount actively bonded less than
+       * T::Currency::minimum_balance(), then it is increased to the full amount.
+       * 
+       * Once the unlock period is done, you can call `withdraw_unbonded` to actually move
+       * the funds out of management ready for transfer.
+       * 
+       * No more than a limited number of unlocking chunks (see `MAX_UNLOCKING_CHUNKS`)
+       * can co-exists at the same time. In that case, [`Call::withdraw_unbonded`] need
+       * to be called first to remove some of the chunks (if possible).
+       * 
+       * The dispatch origin for this call must be _Signed_ by the controller, not the stash.
+       * And, it can be only called when [`EraElectionStatus`] is `Closed`.
+       * 
+       * Emits `Unbonded`.
+       * 
+       * See also [`Call::withdraw_unbonded`].
+       * 
+       * # <weight>
+       * - Independent of the arguments. Limited but potentially exploitable complexity.
+       * - Contains a limited number of reads.
+       * - Each call (requires the remainder of the bonded balance to be above `minimum_balance`)
+       * will cause a new entry to be inserted into a vector (`Ledger.unlocking`) kept in storage.
+       * The only way to clean the aforementioned storage item is also user-controlled via
+       * `withdraw_unbonded`.
+       * - One DB entry.
+       * ----------
+       * Base Weight: 50.34 µs
+       * DB Weight:
+       * - Read: Era Election Status, Ledger, Current Era, Locks, [Origin Account]
+       * - Write: [Origin Account], Locks, Ledger
+       * </weight>
+       **/
+      unbond: AugmentedSubmittable<(value: Compact<BalanceOf> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Declare the desire to validate for the origin controller.
+       * 
+       * Effects will be felt at the beginning of the next era.
+       * 
+       * The dispatch origin for this call must be _Signed_ by the controller, not the stash.
+       * And, it can be only called when [`EraElectionStatus`] is `Closed`.
+       * 
+       * # <weight>
+       * - Independent of the arguments. Insignificant complexity.
+       * - Contains a limited number of reads.
+       * - Writes are limited to the `origin` account key.
+       * -----------
+       * Base Weight: 17.13 µs
+       * DB Weight:
+       * - Read: Era Election Status, Ledger
+       * - Write: Nominators, Validators
+       * # </weight>
+       **/
+      validate: AugmentedSubmittable<(prefs: ValidatorPrefs | { commission?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Remove any unlocked chunks from the `unlocking` queue from our management.
+       * 
+       * This essentially frees up that balance to be used by the stash account to do
+       * whatever it wants.
+       * 
+       * The dispatch origin for this call must be _Signed_ by the controller, not the stash.
+       * And, it can be only called when [`EraElectionStatus`] is `Closed`.
+       * 
+       * Emits `Withdrawn`.
+       * 
+       * See also [`Call::unbond`].
+       * 
+       * # <weight>
+       * - Could be dependent on the `origin` argument and how much `unlocking` chunks exist.
+       * It implies `consolidate_unlocked` which loops over `Ledger.unlocking`, which is
+       * indirectly user-controlled. See [`unbond`] for more detail.
+       * - Contains a limited number of reads, yet the size of which could be large based on `ledger`.
+       * - Writes are limited to the `origin` account key.
+       * ---------------
+       * Complexity O(S) where S is the number of slashing spans to remove
+       * Base Weight:
+       * Update: 50.52 + .028 * S µs
+       * - Reads: EraElectionStatus, Ledger, Current Era, Locks, [Origin Account]
+       * - Writes: [Origin Account], Locks, Ledger
+       * Kill: 79.41 + 2.366 * S µs
+       * - Reads: EraElectionStatus, Ledger, Current Era, Bonded, Slashing Spans, [Origin Account], Locks
+       * - Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators, [Origin Account], Locks
+       * - Writes Each: SpanSlash * S
+       * NOTE: Weight annotation is the kill scenario, we refund otherwise.
+       * # </weight>
+       **/
+      withdrawUnbonded: AugmentedSubmittable<(numSlashingSpans: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    storageWorkingGroup: {
+      /**
+       * 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>>;
+    };
+    sudo: {
+      /**
+       * Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo key.
+       * 
+       * The dispatch origin for this call must be _Signed_.
+       * 
+       * # <weight>
+       * - O(1).
+       * - Limited storage reads.
+       * - One DB change.
+       * # </weight>
+       **/
+      setKey: AugmentedSubmittable<(updated: LookupSource | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Authenticates the sudo key and dispatches a function call with `Root` origin.
+       * 
+       * The dispatch origin for this call must be _Signed_.
+       * 
+       * # <weight>
+       * - O(1).
+       * - Limited storage reads.
+       * - One DB write (event).
+       * - Weight of derivative `call` execution + 10,000.
+       * # </weight>
+       **/
+      sudo: AugmentedSubmittable<(call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Authenticates the sudo key and dispatches a function call with `Signed` origin from
+       * a given account.
+       * 
+       * The dispatch origin for this call must be _Signed_.
+       * 
+       * # <weight>
+       * - O(1).
+       * - Limited storage reads.
+       * - One DB write (event).
+       * - Weight of derivative `call` execution + 10,000.
+       * # </weight>
+       **/
+      sudoAs: AugmentedSubmittable<(who: LookupSource | string | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Authenticates the sudo key and dispatches a function call with `Root` origin.
+       * This function does not check the weight of the call, and instead allows the
+       * Sudo user to specify the weight of the call.
+       * 
+       * The dispatch origin for this call must be _Signed_.
+       * 
+       * # <weight>
+       * - O(1).
+       * - The weight of this call is defined by the caller.
+       * # </weight>
+       **/
+      sudoUncheckedWeight: AugmentedSubmittable<(call: Call | { callIndex?: any; args?: any } | string | Uint8Array, weight: Weight | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+    };
+    system: {
+      /**
+       * A dispatch that will fill the block weight up to the given ratio.
+       **/
+      fillBlock: AugmentedSubmittable<(ratio: Perbill | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Kill all storage items with a key that starts with the given prefix.
+       * 
+       * **NOTE:** We rely on the Root origin to provide us the number of subkeys under
+       * the prefix we are removing to accurately calculate the weight of this function.
+       * 
+       * # <weight>
+       * - `O(P)` where `P` amount of keys with prefix `prefix`
+       * - `P` storage deletions.
+       * - Base Weight: 0.834 * P µs
+       * - Writes: Number of subkeys + 1
+       * # </weight>
+       **/
+      killPrefix: AugmentedSubmittable<(prefix: Key | string | Uint8Array, subkeys: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Kill some items from storage.
+       * 
+       * # <weight>
+       * - `O(IK)` where `I` length of `keys` and `K` length of one key
+       * - `I` storage deletions.
+       * - Base Weight: .378 * i µs
+       * - Writes: Number of items
+       * # </weight>
+       **/
+      killStorage: AugmentedSubmittable<(keys: Vec<Key> | (Key | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Make some on-chain remark.
+       * 
+       * # <weight>
+       * - `O(1)`
+       * - Base Weight: 0.665 µs, independent of remark length.
+       * - No DB operations.
+       * # </weight>
+       **/
+      remark: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Set the new changes trie configuration.
+       * 
+       * # <weight>
+       * - `O(1)`
+       * - 1 storage write or delete (codec `O(1)`).
+       * - 1 call to `deposit_log`: Uses `append` API, so O(1)
+       * - Base Weight: 7.218 µs
+       * - DB Weight:
+       * - Writes: Changes Trie, System Digest
+       * # </weight>
+       **/
+      setChangesTrieConfig: AugmentedSubmittable<(changesTrieConfig: Option<ChangesTrieConfiguration> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Set the new runtime code.
+       * 
+       * # <weight>
+       * - `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code`
+       * - 1 storage write (codec `O(C)`).
+       * - 1 call to `can_set_code`: `O(S)` (calls `sp_io::misc::runtime_version` which is expensive).
+       * - 1 event.
+       * The weight of this function is dependent on the runtime, but generally this is very expensive.
+       * We will treat this as a full block.
+       * # </weight>
+       **/
+      setCode: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Set the new runtime code without doing any checks of the given `code`.
+       * 
+       * # <weight>
+       * - `O(C)` where `C` length of `code`
+       * - 1 storage write (codec `O(C)`).
+       * - 1 event.
+       * The weight of this function is dependent on the runtime. We will treat this as a full block.
+       * # </weight>
+       **/
+      setCodeWithoutChecks: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Set the number of pages in the WebAssembly environment's heap.
+       * 
+       * # <weight>
+       * - `O(1)`
+       * - 1 storage write.
+       * - Base Weight: 1.405 µs
+       * - 1 write to HEAP_PAGES
+       * # </weight>
+       **/
+      setHeapPages: AugmentedSubmittable<(pages: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Set some items of storage.
+       * 
+       * # <weight>
+       * - `O(I)` where `I` length of `items`
+       * - `I` storage writes (`O(1)`).
+       * - Base Weight: 0.568 * i µs
+       * - Writes: Number of items
+       * # </weight>
+       **/
+      setStorage: AugmentedSubmittable<(items: Vec<KeyValue> | (KeyValue)[]) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Kill the sending account, assuming there are no references outstanding and the composite
+       * data is equal to its default value.
+       * 
+       * # <weight>
+       * - `O(1)`
+       * - 1 storage read and deletion.
+       * --------------------
+       * Base Weight: 8.626 µs
+       * No DB Read or Write operations because caller is already in overlay
+       * # </weight>
+       **/
+      suicide: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>>;
+    };
+    timestamp: {
+      /**
+       * Set the current time.
+       * 
+       * This call should be invoked exactly once per block. It will panic at the finalization
+       * phase, if this call hasn't been invoked by that time.
+       * 
+       * The timestamp should be greater than the previous one by the amount specified by
+       * `MinimumPeriod`.
+       * 
+       * The dispatch origin for this call must be `Inherent`.
+       * 
+       * # <weight>
+       * - `O(T)` where `T` complexity of `on_timestamp_set`
+       * - 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in `on_finalize`)
+       * - 1 event handler `on_timestamp_set` `O(T)`.
+       * - Benchmark: 7.678 (min squares analysis)
+       * - NOTE: This benchmark was done for a runtime with insignificant `on_timestamp_set` handlers.
+       * New benchmarking is needed when adding new handlers.
+       * # </weight>
+       **/
+      set: AugmentedSubmittable<(now: Compact<Moment> | AnyNumber | 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>>;
+      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
+       * associated with signer.
+       **/
+      createEntity: AugmentedSubmittable<(withCredential: Option<Credential> | null | object | string | Uint8Array, classId: ClassId | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>>;
+      setClassAddSchemasSet: AugmentedSubmittable<(withCredential: Option<Credential> | null | object | string | Uint8Array, classId: ClassId | AnyNumber | Uint8Array, credentialSet: CredentialSet) => SubmittableExtrinsic<ApiType>>;
+      /**
+       * Sets the admins for a class
+       **/
+      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>>;
+    };
+  }
+
+  export interface SubmittableExtrinsics<ApiType extends ApiTypes> extends AugmentedSubmittables<ApiType> {
+    (extrinsic: Call | Extrinsic | Uint8Array | string): SubmittableExtrinsic<ApiType>;
+  }
+}

+ 7 - 0
types/augment/augment-api.ts

@@ -0,0 +1,7 @@
+// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
+/* eslint-disable */
+
+import '@polkadot/api/augment/rpc';
+import './augment-api-consts';
+import './augment-api-query';
+import './augment-api-tx';

Plik diff jest za duży
+ 5 - 0
types/augment/augment-types.ts


+ 1 - 0
types/augment/definitions.ts

@@ -0,0 +1 @@
+export { default as all } from './all/definitions'

+ 4 - 0
types/augment/index.ts

@@ -0,0 +1,4 @@
+// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
+/* eslint-disable */
+
+export * from './types';

+ 4 - 0
types/augment/types.ts

@@ -0,0 +1,4 @@
+// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
+/* eslint-disable */
+
+export * from './all/types';

+ 8 - 4
types/package.json

@@ -9,10 +9,14 @@
     "build": "tsc --build tsconfig.json",
     "lint": "eslint ./ --quiet --ext .ts",
     "format": "prettier ./ --write",
-    "checks": "yarn build && madge --circular ./ && yarn lint && prettier ./ --check",
-    "generate:defs": "ts-node node_modules/.bin/polkadot-types-from-defs --package ./src --input ./src/definitions",
-    "update:augment-types": "tsc --build tsconfig-scripts.json && node ./src/scripts/updateAugmentTypes.js",
-    "print:typedef": "tsc --build tsconfig-scripts.json && node ./src/scripts/defsFromTypes.js"
+    "check:augment": "tsc --build tsconfig-augment.json && tsc --build tsconfig-augment-codec.json",
+    "checks": "yarn build && madge --circular ./ && yarn lint && prettier ./ --check && yarn check:augment",
+    "generate:defs": "ts-node node_modules/.bin/polkadot-types-from-defs --package . --input ./augment",
+    "generate:meta": "ts-node node_modules/.bin/polkadot-types-from-chain --package . --endpoint ws://127.0.0.1:9944 --output ./augment --strict",
+    "generate:codec-defs": "ts-node ./src/scripts/generateCodecDefs.ts",
+    "generate:registry-json": "ts-node ./src/scripts/generateRegistryJson.ts",
+    "generate:augment": "yarn generate:registry-json && yarn generate:defs && yarn generate:meta",
+    "generate:all": "yarn generate:augment && yarn generate:codec-defs"
   },
   "author": "Joystream contributors",
   "maintainers": [],

+ 4 - 0
types/src/JoyEnum.ts

@@ -31,12 +31,16 @@ export function JoyEnum<Types extends Record<string, Constructor>>(types: Types)
     ) {
       return new JoyEnumObject(registry, { [typeKey]: value })
     }
+
+    // eslint-disable-next-line no-useless-constructor
     constructor(registry: Registry, value?: any, index?: number) {
       super(registry, value, index)
     }
+
     public isOfType(typeKey: keyof Types) {
       return this.type === typeKey
     }
+
     public asType<TypeKey extends keyof Types>(typeKey: TypeKey) {
       if (!this.isOfType(typeKey)) {
         throw new Error(`Enum.asType(${typeKey}) - value is not of type ${typeKey}`)

+ 4 - 0
types/src/JoyStruct.ts

@@ -42,15 +42,19 @@ export function JoyStructCustom<FieldTypes extends Record<string, Constructor>>(
   fields: FieldTypes
 ): ExtendedStructConstructor<FieldTypes> {
   return class JoyStructObject extends Struct.with(fields) {
+    // eslint-disable-next-line no-useless-constructor
     constructor(registry: Registry, value?: { [k in keyof FieldTypes]: InstanceType<FieldTypes[k]> }) {
       super(registry, value)
     }
+
     getField<FieldKey extends keyof FieldTypes>(key: FieldKey): InstanceType<FieldTypes[FieldKey]> {
       return this.get(key as string) as InstanceType<FieldTypes[FieldKey]>
     }
+
     getString<FieldKey extends keyof FieldTypes>(key: FieldKey): string {
       return this.getField(key).toString()
     }
+
     // TODO: Check why would this ever be needed
     cloneValues(): { [k in keyof FieldTypes]: FieldTypes[k] } {
       const objectClone = {} as Partial<{ [k in keyof FieldTypes]: Codec }>

+ 1 - 1
types/src/common.ts

@@ -61,7 +61,7 @@ export type InputValidationLengthConstraintType = {
 export class InputValidationLengthConstraint extends JoyStructDecorated({ min: u16, max_min_diff: u16 })
   implements InputValidationLengthConstraintType {
   get max(): u16 {
-    return new u16(this.registry, this.min.add(this.max_min_diff))
+    return this.registry.createType('u16', this.min.add(this.max_min_diff))
   }
 }
 

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

@@ -175,7 +175,7 @@ export class Curator
   }
 
   get is_active(): boolean {
-    return this.stage.type == CuratorRoleStageKeys.Active
+    return this.stage.isOfType('Active')
   }
 }
 
@@ -197,6 +197,7 @@ export class CuratorApplication
   get role_account_id(): AccountId {
     return this.role_account
   }
+
   // Helper for working-group compatibility
   get opening_id(): CuratorOpeningId {
     return this.curator_opening_id
@@ -325,6 +326,7 @@ export const contentWorkingGroupTypes = {
   CuratorRoleStage,
   CuratorExitSummary,
   CuratorExitInitiationOrigin,
+  LeadRoleState,
   ExitedLeadRole,
   CuratorInduction,
 }

+ 0 - 2
types/src/definitions/definitions.ts

@@ -1,2 +0,0 @@
-// We can put our types definitions here in the future (in order to use @polkadot/typegen)
-export {}

+ 2 - 2
types/src/forum.ts

@@ -144,7 +144,7 @@ export class Category extends JoyStructCustom({
   }
 
   get num_threads_created(): u32 {
-    return new u32(this.registry, this.num_direct_unmoderated_threads.add(this.num_direct_moderated_threads))
+    return this.registry.createType('u32', this.num_direct_unmoderated_threads.add(this.num_direct_moderated_threads))
   }
 
   get hasSubcategories(): boolean {
@@ -236,7 +236,7 @@ export class Thread extends JoyStructCustom({
   }
 
   get num_posts_ever_created(): u32 {
-    return new u32(this.registry, this.num_unmoderated_posts.add(this.num_moderated_posts))
+    return this.registry.createType('u32', this.num_unmoderated_posts.add(this.num_moderated_posts))
   }
 
   get created_at(): BlockAndTime {

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

@@ -6,7 +6,7 @@ import { StakeId } from '../stake'
 
 import { GenericJoyStreamRoleSchema } from './schemas/role.schema.typings'
 
-import ajv from 'ajv'
+import Ajv from 'ajv'
 
 import * as role_schema_json from './schemas/role.schema.json'
 import { RegistryTypes } from '@polkadot/types/types'
@@ -220,7 +220,7 @@ export class StakingPolicy
     review_period_expired_unstaking_period_length: Option.with(u32),
   })
   implements IStakingPolicy {}
-export const schemaValidator: ajv.ValidateFunction = new ajv({ allErrors: true }).compile(role_schema_json)
+export const schemaValidator: Ajv.ValidateFunction = new Ajv({ allErrors: true }).compile(role_schema_json)
 
 const OpeningHRTFallback: GenericJoyStreamRoleSchema = {
   version: 1,
@@ -355,6 +355,7 @@ export const hiringTypes: RegistryTypes = {
   InactiveApplicationStage,
   UnstakingApplicationStage,
   ApplicationDeactivationCause,
+  StakingAmountLimitMode,
 }
 
 export default hiringTypes

+ 0 - 1
types/src/mint/index.ts

@@ -53,7 +53,6 @@ export const mintTypes: RegistryTypes = {
   Mint,
   MintBalanceOf: 'Balance',
   BalanceOfMint: 'Balance',
-  'minting::BalanceOf': 'Balance',
   // Expose in registry for api.createType purposes:
   NextAdjustment,
   AdjustOnInterval,

+ 4 - 2
types/src/proposals.ts

@@ -153,7 +153,7 @@ export class ProposalId extends u32 {}
 
 export class SpendingParams extends Tuple.with(['Balance', 'AccountId']) {}
 
-class SetLeadParams extends Tuple.with([MemberId, AccountId]) {}
+export class SetLeadParams extends Tuple.with([MemberId, AccountId]) {}
 
 export class SetLead extends Option.with(SetLeadParams) {}
 
@@ -287,9 +287,11 @@ export const proposalsTypes = {
   TerminateRoleParameters,
   // Expose in registry for api.createType purposes:
   ActiveStake,
-  FinalizationData,
+  Finalized,
   ProposalDecisionStatus,
   ExecutionFailed,
+  Approved,
+  SetLeadParams,
 }
 
 export default proposalsTypes

+ 0 - 41
types/src/scripts/defsFromTypes.ts

@@ -1,41 +0,0 @@
-// Conversion of Joystream types into @polkadot/typegen compatible RegistryTypes object
-// (will require a few additonal tweaks to work, currently just logs the output in the console)
-
-import { types } from '../index'
-import { Constructor, Codec, RegistryTypes, Registry } from '@polkadot/types/types'
-import { TypeRegistry } from '@polkadot/types'
-
-function normalizeDef(registry: Registry, defOrConstructor: any, typeName: string) {
-  if (typeof defOrConstructor === 'string') {
-    return defOrConstructor
-  } else if (typeof defOrConstructor === 'function') {
-    const defString = new (defOrConstructor as Constructor<Codec>)(registry).toRawType().toString()
-    try {
-      const obj = JSON.parse(defString)
-      // def is an object:
-      return obj
-    } catch (e) {
-      // def if just a type name:
-      return defString
-    }
-  }
-
-  throw new Error(`Unkown type entry for ${typeName} found in registry!`)
-}
-
-async function defsFromTypes() {
-  const registry = new TypeRegistry()
-  registry.setKnownTypes({ types })
-  registry.register(types)
-  const defs: RegistryTypes = {}
-  Object.entries(registry.knownTypes.types as any).forEach(([typeName, defOrConstructor]) => {
-    const def = normalizeDef(registry, defOrConstructor, typeName)
-    defs[typeName] = def
-  })
-
-  return defs
-}
-
-defsFromTypes()
-  .then((defs) => console.log(defs))
-  .catch(console.error)

+ 43 - 9
types/src/scripts/updateAugmentTypes.ts → types/src/scripts/generateCodecDefs.ts

@@ -1,4 +1,5 @@
-// Adds Joystream types to /definitions/augment-types.ts allowing better api.createType TS support
+// Creates /augment-codec/augment-types.ts file with api augmentation that allows
+// creating custom Joystream "Codec types" with api.createType
 
 import common from '../common'
 import members from '../members'
@@ -18,6 +19,11 @@ import media from '../media'
 import proposals from '../proposals'
 import fs from 'fs'
 import path from 'path'
+import * as defaultDefinitions from '@polkadot/types/interfaces/definitions'
+import { generateInterfaceTypes } from '@polkadot/typegen/generate/interfaceRegistry'
+
+const OUTPUT_PATH = path.join(__dirname, '../../augment-codec/augment-types.ts')
+const IMPORTS_DIR = '..'
 
 const typesByModule = {
   'common': common,
@@ -44,7 +50,10 @@ type AugmentTypes = { [typeName: string]: string }
 const imports: Imports = {}
 const augmentTypes: AugmentTypes = {}
 
-const populateFileByTemplateTag = (fileContent: string, tag: string, lines: string[]) => {
+const CUSTOM_IMPORTS_TAG = 'CUSTOMIMPORTS'
+const CUSTOM_TYPES_TAG = 'CUSTOMTYPES'
+
+const populateFileByTemplateTag = (fileContent: string, tag: string, insertLines: string[]) => {
   const fileLines = fileContent.split('\n')
   const startIndex = fileLines.findIndex((line) => line.includes(`/** ${tag} **/`))
   const endIndex = fileLines.findIndex((line) => line.includes(`/** /${tag} **/`))
@@ -53,28 +62,49 @@ const populateFileByTemplateTag = (fileContent: string, tag: string, lines: stri
     throw new Error(`populateFileByTemplateTag: Invalid tag (${tag})`)
   }
 
-  const whitespaceMatch = fileLines[startIndex].match(/^(\s)+/)
-  const whitespace = whitespaceMatch ? whitespaceMatch[0] : ''
+  const [whitespace] = fileLines[startIndex].match(/^(\s)+/) || ['']
+  fileLines.splice(startIndex + 1, endIndex - (startIndex + 1), ...insertLines.map((line) => `${whitespace}${line}`))
+
+  return fileLines.join('\n')
+}
 
-  fileLines.splice(startIndex + 1, endIndex - (startIndex + 1), ...lines.map((line) => `${whitespace}${line}`))
+const addTagsIfDontExist = (fileContent: string): string => {
+  const fileLines = fileContent.split('\n')
+  // Custom imports
+  if (fileLines.findIndex((line) => line.includes(`/** ${CUSTOM_IMPORTS_TAG} **/`)) === -1) {
+    const firstImportIndex = fileLines.findIndex((line) => line.includes('import'))
+    fileLines.splice(firstImportIndex, 0, `/** ${CUSTOM_IMPORTS_TAG} **/`, `/** /${CUSTOM_IMPORTS_TAG} **/`)
+  }
+  // Custom types
+  if (fileLines.findIndex((line) => line.includes(`/** ${CUSTOM_TYPES_TAG} **/`)) === -1) {
+    const firstTypeIndex = fileLines.findIndex((line) => line.includes('export interface InterfaceTypes')) + 1
+    const [whitespace] = fileLines[firstTypeIndex].match(/^(\s)+/) || ['']
+    fileLines.splice(
+      firstTypeIndex,
+      0,
+      `${whitespace}/** ${CUSTOM_TYPES_TAG} **/`,
+      `${whitespace}/** /${CUSTOM_TYPES_TAG} **/`
+    )
+  }
 
   return fileLines.join('\n')
 }
 
 const updateAugmentTypesFile = (filePath: string, imports: Imports, augmentTypes: AugmentTypes) => {
   let fileContent = fs.readFileSync(filePath).toString()
+  fileContent = addTagsIfDontExist(fileContent)
   fileContent = populateFileByTemplateTag(
     fileContent,
-    'CUSTOMIMPORTS',
+    CUSTOM_IMPORTS_TAG,
     Object.entries(imports).map(
       ([moduleName, importStatements]) =>
         // import as to avoid namespace clashes
-        `import { ${importStatements.join(', ')} } from '../${moduleName}'`
+        `import { ${importStatements.join(', ')} } from '${IMPORTS_DIR}/${moduleName}'`
     )
   )
   fileContent = populateFileByTemplateTag(
     fileContent,
-    'CUSTOMTYPES',
+    CUSTOM_TYPES_TAG,
     Object.entries(augmentTypes).map(([typeName, constructorName]) => `"${typeName}": ${constructorName};`)
   )
 
@@ -87,6 +117,10 @@ const addAugmentTypes = (typeName: string, constructorName: string) => {
   augmentTypes[`Vec<${typeName}>`] = `Vec<${constructorName}>`
 }
 
+console.log('Generating default interface types based on current @polkadot/types definitions...')
+generateInterfaceTypes({ '@polkadot/types/interfaces': defaultDefinitions }, OUTPUT_PATH)
+
+console.log('Adding custom Joystream types...')
 Object.entries(typesByModule).forEach(([moduleName, types]) => {
   console.log('Module: ', moduleName)
   console.log('Types found:', Object.keys(types))
@@ -107,4 +141,4 @@ Object.entries(typesByModule).forEach(([moduleName, types]) => {
   })
 })
 
-updateAugmentTypesFile(path.join(__dirname, '../definitions/augment-types.ts'), imports, augmentTypes)
+updateAugmentTypesFile(OUTPUT_PATH, imports, augmentTypes)

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

@@ -0,0 +1,87 @@
+// Conversion of Joystream types into @polkadot/typegen compatible RegistryTypes json file
+
+import { types } from '../index'
+import { Constructor, Codec, RegistryTypes, Registry } from '@polkadot/types/types'
+import { Struct } from '@polkadot/types/codec'
+import { TypeRegistry } from '@polkadot/types'
+import fs from 'fs'
+import path from 'path'
+
+const OUTPUT_PATH = path.join(__dirname, '../../augment/all/defs.json')
+
+function normalizeDef(registry: Registry, defOrConstructor: any, typeName: string): RegistryTypes[string] {
+  if (typeof defOrConstructor === 'string') {
+    // Replace unhandled BTreeSet with Vec
+    defOrConstructor = defOrConstructor.replace('BTreeSet<', 'Vec<')
+    return defOrConstructor
+  } else if (typeof defOrConstructor === 'function') {
+    const defString = new (defOrConstructor as Constructor<Codec>)(registry).toRawType().toString()
+    let obj: any
+
+    try {
+      obj = JSON.parse(defString)
+    } catch (e) {
+      // def if just a type name:
+      return defString
+    }
+
+    // def is an object:
+    const normalizedObj: any = {}
+    if (obj._enum && Array.isArray(obj._enum)) {
+      // Enum as array - No need to normalize
+      return obj
+    } else if (obj._enum && !Array.isArray(obj._enum)) {
+      // Enum as object - normalize properties
+      normalizedObj._enum = {}
+      Object.entries(obj._enum).forEach(([key, value]) => {
+        const normalizedValue = normalizeDef(registry, value, `${typeName}[${key}]`)
+        if (typeof normalizedValue !== 'string') {
+          throw new Error(
+            `Too many nested definitions in ${typeName} enum. Did you forget to expose some types in the registry?`
+          )
+        }
+        normalizedObj._enum[key] = normalizedValue
+      })
+    } else if (obj._set) {
+      // Set - we don't need those now, but perhaps worth looking into at some point
+      throw new Error('_set definitions are not supported yet!')
+    } else {
+      // Struct - normalize properties
+      const emptyStruct = new Struct(registry, {}) as any
+      for (const [key, value] of Object.entries(obj)) {
+        // Prevent interface clashes
+        // FIXME: Would be way better if this was actually done by @polkadot/typegen tool
+        if (emptyStruct[key] !== undefined) {
+          continue
+        }
+        const normalizedValue = normalizeDef(registry, value, `${typeName}[${key}]`)
+        if (typeof normalizedValue !== 'string') {
+          throw new Error(
+            `Too many nested definitions in ${typeName} struct. Did you forget to expose some types in the registry?`
+          )
+        }
+        normalizedObj[key] = normalizedValue
+      }
+    }
+
+    return normalizedObj
+  }
+
+  throw new Error(`Unkown type entry for ${typeName} found in registry!`)
+}
+
+function defsFromTypes(types: RegistryTypes) {
+  const registry = new TypeRegistry()
+  registry.setKnownTypes({ types })
+  registry.register(types)
+  const defs: RegistryTypes = {}
+  Object.entries(registry.knownTypes.types as any).forEach(([typeName, defOrConstructor]) => {
+    const def = normalizeDef(registry, defOrConstructor, typeName)
+    defs[typeName] = def
+  })
+
+  return defs
+}
+
+const defs = defsFromTypes(types)
+fs.writeFileSync(OUTPUT_PATH, JSON.stringify(defs, undefined, 4))

+ 1 - 1
types/src/stake/index.ts

@@ -80,7 +80,7 @@ export class Stake
       return this.staking_status.asType('Staked').staked_amount
     }
 
-    return new u128(this.registry, 0)
+    return this.registry.createType('Balance', 0)
   }
 }
 

+ 3 - 3
types/src/versioned-store/EntityCodec.ts

@@ -1,5 +1,5 @@
 import BN from 'bn.js'
-import { Text, bool, Vec, u16 } from '@polkadot/types'
+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'
@@ -12,7 +12,7 @@ import ChannelId from '../content-working-group/ChannelId'
  * like string, number, boolean, etc.
  */
 function substrateToPlain<T>(x: Codec): T | undefined {
-  let res: any = undefined
+  let res: any
 
   if (x instanceof PV.None) {
     res = undefined
@@ -262,7 +262,7 @@ export abstract class EntityCodec<T extends PlainEntity> {
             new ClassPropertyValue(
               this.registry, // FIXME: createType?
               {
-                in_class_index: new u16(this.registry, meta.index),
+                in_class_index: this.registry.createType('u16', meta.index),
                 value: codecValue,
               }
             )

+ 2 - 3
types/src/versioned-store/permissions/batching/parametrized-property-value.ts

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

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

@@ -7,6 +7,7 @@ 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,
@@ -20,6 +21,7 @@ export {
   ParametrizedEntity,
   ParametrizedClassPropertyValue,
   ParametrizedPropertyValue,
+  PropertyOfClass,
 }
 
 export const versionedStorePermissionsTypes: RegistryTypes = {
@@ -35,6 +37,7 @@ export const versionedStorePermissionsTypes: RegistryTypes = {
   ParametrizedEntity,
   ParametrizedClassPropertyValue,
   ParametrizedPropertyValue,
+  PropertyOfClass,
 }
 
 export default versionedStorePermissionsTypes

+ 0 - 2
types/src/working-group/index.ts

@@ -175,8 +175,6 @@ export const workingGroupTypes: RegistryTypes = {
   /// Alias used by the runtime working-group module
   HiringApplicationId: ApplicationId,
   RewardPolicy,
-  'working_group::OpeningId': OpeningId,
-  'working_group::WorkerId': WorkerId,
   // Expose in registry for api.createType purposes:
   WorkingGroupOpeningPolicyCommitment,
   RoleStakeProfile,

+ 12 - 0
types/tsconfig-augment-codec.json

@@ -0,0 +1,12 @@
+{
+  "extends": "./tsconfig-base.json",
+  "compilerOptions": {
+    "noEmit": true, // No need to actually create any output
+    "paths": {
+      "@polkadot/types/augment": ["augment-codec/augment-types.ts"]
+    }
+  },
+  "include": [
+    "augment-codec/**/*.ts"
+  ]
+}

+ 13 - 0
types/tsconfig-augment.json

@@ -0,0 +1,13 @@
+{
+  "extends": "./tsconfig-base.json",
+  "compilerOptions": {
+    "noEmit": true, // No need to actually create any output
+    "paths": {
+      "@polkadot/types/augment": ["augment/augment-types.ts"],
+      "@polkadot/api/augment": ["augment/augment-api.ts"]
+    }
+  },
+  "include": [
+    "augment/**/*.ts"
+  ]
+}

+ 1 - 4
types/tsconfig-base.json

@@ -16,10 +16,7 @@
       "node"
     ],
     "forceConsistentCasingInFileNames": true,
-    "baseUrl": ".",
-    "paths": {
-      "@polkadot/types/augment": ["src/definitions/augment-types.ts"]
-    }
+    "baseUrl": "."
   },
   "exclude": [
     "node_modules",

+ 0 - 6
types/tsconfig-scripts.json

@@ -1,6 +0,0 @@
-{
-  "extends": "./tsconfig-base.json",
-  "include": [
-    "src/**/*.ts" // Include all files to make sure they're always up-to-date when running scripts
-  ],
-}

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików