123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686 |
- import { createTypeUnsafe } from "@polkadot/types/create";
- import { SubstrateEvent, SubstrateExtrinsic } from "@dzlzv/hydra-common";
- import { Codec } from "@polkadot/types/types";
- import { typeRegistry } from ".";
- import { EntryMethod, MemberId, PaidTermId } from "@joystream/types/augment";
- import { AccountId, BalanceOf } from "@polkadot/types/interfaces";
- import { Bytes, Option } from "@polkadot/types";
- export namespace Members {
- export class MemberRegisteredEvent {
- public readonly expectedParamTypes = [
- "MemberId",
- "AccountId",
- "EntryMethod<PaidTermId, AccountId>"
- ];
- constructor(public readonly ctx: SubstrateEvent) {}
- get data(): MemberRegistered_Params {
- return new MemberRegistered_Params(this.ctx);
- }
- validateParams(): boolean {
- if (this.expectedParamTypes.length !== this.ctx.params.length) {
- return false;
- }
- let valid = true;
- this.expectedParamTypes.forEach((type, i) => {
- if (type !== this.ctx.params[i].type) {
- valid = false;
- }
- });
- return valid;
- }
- }
- class MemberRegistered_Params {
- constructor(public readonly ctx: SubstrateEvent) {}
- get memberId(): MemberId {
- return createTypeUnsafe<MemberId & Codec>(typeRegistry, "MemberId", [
- this.ctx.params[0].value
- ]);
- }
- get accountId(): AccountId {
- return createTypeUnsafe<AccountId & Codec>(typeRegistry, "AccountId", [
- this.ctx.params[1].value
- ]);
- }
- get entryMethod(): EntryMethod {
- return createTypeUnsafe<EntryMethod & Codec>(
- typeRegistry,
- "EntryMethod",
- [this.ctx.params[2].value]
- );
- }
- }
- export class MemberUpdatedAboutTextEvent {
- public readonly expectedParamTypes = ["MemberId"];
- constructor(public readonly ctx: SubstrateEvent) {}
- get data(): MemberUpdatedAboutText_Params {
- return new MemberUpdatedAboutText_Params(this.ctx);
- }
- validateParams(): boolean {
- if (this.expectedParamTypes.length !== this.ctx.params.length) {
- return false;
- }
- let valid = true;
- this.expectedParamTypes.forEach((type, i) => {
- if (type !== this.ctx.params[i].type) {
- valid = false;
- }
- });
- return valid;
- }
- }
- class MemberUpdatedAboutText_Params {
- constructor(public readonly ctx: SubstrateEvent) {}
- get memberId(): MemberId {
- return createTypeUnsafe<MemberId & Codec>(typeRegistry, "MemberId", [
- this.ctx.params[0].value
- ]);
- }
- }
- export class MemberUpdatedAvatarEvent {
- public readonly expectedParamTypes = ["MemberId"];
- constructor(public readonly ctx: SubstrateEvent) {}
- get data(): MemberUpdatedAvatar_Params {
- return new MemberUpdatedAvatar_Params(this.ctx);
- }
- validateParams(): boolean {
- if (this.expectedParamTypes.length !== this.ctx.params.length) {
- return false;
- }
- let valid = true;
- this.expectedParamTypes.forEach((type, i) => {
- if (type !== this.ctx.params[i].type) {
- valid = false;
- }
- });
- return valid;
- }
- }
- class MemberUpdatedAvatar_Params {
- constructor(public readonly ctx: SubstrateEvent) {}
- get memberId(): MemberId {
- return createTypeUnsafe<MemberId & Codec>(typeRegistry, "MemberId", [
- this.ctx.params[0].value
- ]);
- }
- }
- export class MemberUpdatedHandleEvent {
- public readonly expectedParamTypes = ["MemberId"];
- constructor(public readonly ctx: SubstrateEvent) {}
- get data(): MemberUpdatedHandle_Params {
- return new MemberUpdatedHandle_Params(this.ctx);
- }
- validateParams(): boolean {
- if (this.expectedParamTypes.length !== this.ctx.params.length) {
- return false;
- }
- let valid = true;
- this.expectedParamTypes.forEach((type, i) => {
- if (type !== this.ctx.params[i].type) {
- valid = false;
- }
- });
- return valid;
- }
- }
- class MemberUpdatedHandle_Params {
- constructor(public readonly ctx: SubstrateEvent) {}
- get memberId(): MemberId {
- return createTypeUnsafe<MemberId & Codec>(typeRegistry, "MemberId", [
- this.ctx.params[0].value
- ]);
- }
- }
- export class MemberSetRootAccountEvent {
- public readonly expectedParamTypes = ["MemberId", "AccountId"];
- constructor(public readonly ctx: SubstrateEvent) {}
- get data(): MemberSetRootAccount_Params {
- return new MemberSetRootAccount_Params(this.ctx);
- }
- validateParams(): boolean {
- if (this.expectedParamTypes.length !== this.ctx.params.length) {
- return false;
- }
- let valid = true;
- this.expectedParamTypes.forEach((type, i) => {
- if (type !== this.ctx.params[i].type) {
- valid = false;
- }
- });
- return valid;
- }
- }
- class MemberSetRootAccount_Params {
- constructor(public readonly ctx: SubstrateEvent) {}
- get memberId(): MemberId {
- return createTypeUnsafe<MemberId & Codec>(typeRegistry, "MemberId", [
- this.ctx.params[0].value
- ]);
- }
- get accountId(): AccountId {
- return createTypeUnsafe<AccountId & Codec>(typeRegistry, "AccountId", [
- this.ctx.params[1].value
- ]);
- }
- }
- export class MemberSetControllerAccountEvent {
- public readonly expectedParamTypes = ["MemberId", "AccountId"];
- constructor(public readonly ctx: SubstrateEvent) {}
- get data(): MemberSetControllerAccount_Params {
- return new MemberSetControllerAccount_Params(this.ctx);
- }
- validateParams(): boolean {
- if (this.expectedParamTypes.length !== this.ctx.params.length) {
- return false;
- }
- let valid = true;
- this.expectedParamTypes.forEach((type, i) => {
- if (type !== this.ctx.params[i].type) {
- valid = false;
- }
- });
- return valid;
- }
- }
- class MemberSetControllerAccount_Params {
- constructor(public readonly ctx: SubstrateEvent) {}
- get memberId(): MemberId {
- return createTypeUnsafe<MemberId & Codec>(typeRegistry, "MemberId", [
- this.ctx.params[0].value
- ]);
- }
- get accountId(): AccountId {
- return createTypeUnsafe<AccountId & Codec>(typeRegistry, "AccountId", [
- this.ctx.params[1].value
- ]);
- }
- }
- /**
- * Non-members can buy membership
- */
- export class BuyMembershipCall {
- public readonly extrinsic: SubstrateExtrinsic;
- public readonly expectedArgTypes = [
- "PaidTermId",
- "Option<Bytes>",
- "Option<Bytes>",
- "Option<Bytes>"
- ];
- constructor(public readonly ctx: SubstrateEvent) {
- if (ctx.extrinsic === undefined) {
- throw new Error(`No call data has been provided`);
- }
- this.extrinsic = ctx.extrinsic;
- }
- get args(): BuyMembership_Args {
- return new BuyMembership_Args(this.extrinsic);
- }
- validateArgs(): boolean {
- if (this.expectedArgTypes.length !== this.extrinsic.args.length) {
- return false;
- }
- let valid = true;
- this.expectedArgTypes.forEach((type, i) => {
- if (type !== this.extrinsic.args[i].type) {
- valid = false;
- }
- });
- return valid;
- }
- }
- class BuyMembership_Args {
- constructor(public readonly extrinsic: SubstrateExtrinsic) {}
- get paidTermsId(): PaidTermId {
- return createTypeUnsafe<PaidTermId & Codec>(typeRegistry, "PaidTermId", [
- this.extrinsic.args[0].value
- ]);
- }
- get handle(): Option<Bytes> {
- return createTypeUnsafe<Option<Bytes> & Codec>(
- typeRegistry,
- "Option<Bytes>",
- [this.extrinsic.args[1].value]
- );
- }
- get avatarUri(): Option<Bytes> {
- return createTypeUnsafe<Option<Bytes> & Codec>(
- typeRegistry,
- "Option<Bytes>",
- [this.extrinsic.args[2].value]
- );
- }
- get about(): Option<Bytes> {
- return createTypeUnsafe<Option<Bytes> & Codec>(
- typeRegistry,
- "Option<Bytes>",
- [this.extrinsic.args[3].value]
- );
- }
- }
- /**
- * Screened members are awarded a initial locked balance that can only be slashed or used
- * for fees, and is not transferable. The screening authority must ensure that the provided
- * new_member_account was verified to avoid applying locks arbitrarily to accounts not controlled
- * by the member.
- */
- export class AddScreenedMemberCall {
- public readonly extrinsic: SubstrateExtrinsic;
- public readonly expectedArgTypes = [
- "AccountId",
- "Option<Bytes>",
- "Option<Bytes>",
- "Option<Bytes>",
- "Option<BalanceOf>"
- ];
- constructor(public readonly ctx: SubstrateEvent) {
- if (ctx.extrinsic === undefined) {
- throw new Error(`No call data has been provided`);
- }
- this.extrinsic = ctx.extrinsic;
- }
- get args(): AddScreenedMember_Args {
- return new AddScreenedMember_Args(this.extrinsic);
- }
- validateArgs(): boolean {
- if (this.expectedArgTypes.length !== this.extrinsic.args.length) {
- return false;
- }
- let valid = true;
- this.expectedArgTypes.forEach((type, i) => {
- if (type !== this.extrinsic.args[i].type) {
- valid = false;
- }
- });
- return valid;
- }
- }
- class AddScreenedMember_Args {
- constructor(public readonly extrinsic: SubstrateExtrinsic) {}
- get newMemberAccount(): AccountId {
- return createTypeUnsafe<AccountId & Codec>(typeRegistry, "AccountId", [
- this.extrinsic.args[0].value
- ]);
- }
- get handle(): Option<Bytes> {
- return createTypeUnsafe<Option<Bytes> & Codec>(
- typeRegistry,
- "Option<Bytes>",
- [this.extrinsic.args[1].value]
- );
- }
- get avatarUri(): Option<Bytes> {
- return createTypeUnsafe<Option<Bytes> & Codec>(
- typeRegistry,
- "Option<Bytes>",
- [this.extrinsic.args[2].value]
- );
- }
- get about(): Option<Bytes> {
- return createTypeUnsafe<Option<Bytes> & Codec>(
- typeRegistry,
- "Option<Bytes>",
- [this.extrinsic.args[3].value]
- );
- }
- get initialBalance(): Option<BalanceOf> {
- return createTypeUnsafe<Option<BalanceOf> & Codec>(
- typeRegistry,
- "Option<BalanceOf>",
- [this.extrinsic.args[4].value]
- );
- }
- }
- /**
- * Change member's about text
- */
- export class ChangeMemberAboutTextCall {
- public readonly extrinsic: SubstrateExtrinsic;
- public readonly expectedArgTypes = ["MemberId", "Bytes"];
- constructor(public readonly ctx: SubstrateEvent) {
- if (ctx.extrinsic === undefined) {
- throw new Error(`No call data has been provided`);
- }
- this.extrinsic = ctx.extrinsic;
- }
- get args(): ChangeMemberAboutText_Args {
- return new ChangeMemberAboutText_Args(this.extrinsic);
- }
- validateArgs(): boolean {
- if (this.expectedArgTypes.length !== this.extrinsic.args.length) {
- return false;
- }
- let valid = true;
- this.expectedArgTypes.forEach((type, i) => {
- if (type !== this.extrinsic.args[i].type) {
- valid = false;
- }
- });
- return valid;
- }
- }
- class ChangeMemberAboutText_Args {
- constructor(public readonly extrinsic: SubstrateExtrinsic) {}
- get memberId(): MemberId {
- return createTypeUnsafe<MemberId & Codec>(typeRegistry, "MemberId", [
- this.extrinsic.args[0].value
- ]);
- }
- get text(): Bytes {
- return createTypeUnsafe<Bytes & Codec>(typeRegistry, "Bytes", [
- this.extrinsic.args[1].value
- ]);
- }
- }
- /**
- * Change member's avatar
- */
- export class ChangeMemberAvatarCall {
- public readonly extrinsic: SubstrateExtrinsic;
- public readonly expectedArgTypes = ["MemberId", "Bytes"];
- constructor(public readonly ctx: SubstrateEvent) {
- if (ctx.extrinsic === undefined) {
- throw new Error(`No call data has been provided`);
- }
- this.extrinsic = ctx.extrinsic;
- }
- get args(): ChangeMemberAvatar_Args {
- return new ChangeMemberAvatar_Args(this.extrinsic);
- }
- validateArgs(): boolean {
- if (this.expectedArgTypes.length !== this.extrinsic.args.length) {
- return false;
- }
- let valid = true;
- this.expectedArgTypes.forEach((type, i) => {
- if (type !== this.extrinsic.args[i].type) {
- valid = false;
- }
- });
- return valid;
- }
- }
- class ChangeMemberAvatar_Args {
- constructor(public readonly extrinsic: SubstrateExtrinsic) {}
- get memberId(): MemberId {
- return createTypeUnsafe<MemberId & Codec>(typeRegistry, "MemberId", [
- this.extrinsic.args[0].value
- ]);
- }
- get uri(): Bytes {
- return createTypeUnsafe<Bytes & Codec>(typeRegistry, "Bytes", [
- this.extrinsic.args[1].value
- ]);
- }
- }
- /**
- * Change member's handle. Will ensure new handle is unique and old one will be available
- * for other members to use.
- */
- export class ChangeMemberHandleCall {
- public readonly extrinsic: SubstrateExtrinsic;
- public readonly expectedArgTypes = ["MemberId", "Bytes"];
- constructor(public readonly ctx: SubstrateEvent) {
- if (ctx.extrinsic === undefined) {
- throw new Error(`No call data has been provided`);
- }
- this.extrinsic = ctx.extrinsic;
- }
- get args(): ChangeMemberHandle_Args {
- return new ChangeMemberHandle_Args(this.extrinsic);
- }
- validateArgs(): boolean {
- if (this.expectedArgTypes.length !== this.extrinsic.args.length) {
- return false;
- }
- let valid = true;
- this.expectedArgTypes.forEach((type, i) => {
- if (type !== this.extrinsic.args[i].type) {
- valid = false;
- }
- });
- return valid;
- }
- }
- class ChangeMemberHandle_Args {
- constructor(public readonly extrinsic: SubstrateExtrinsic) {}
- get memberId(): MemberId {
- return createTypeUnsafe<MemberId & Codec>(typeRegistry, "MemberId", [
- this.extrinsic.args[0].value
- ]);
- }
- get handle(): Bytes {
- return createTypeUnsafe<Bytes & Codec>(typeRegistry, "Bytes", [
- this.extrinsic.args[1].value
- ]);
- }
- }
- export class SetRootAccountCall {
- public readonly extrinsic: SubstrateExtrinsic;
- public readonly expectedArgTypes = ["MemberId", "AccountId"];
- constructor(public readonly ctx: SubstrateEvent) {
- if (ctx.extrinsic === undefined) {
- throw new Error(`No call data has been provided`);
- }
- this.extrinsic = ctx.extrinsic;
- }
- get args(): SetRootAccount_Args {
- return new SetRootAccount_Args(this.extrinsic);
- }
- validateArgs(): boolean {
- if (this.expectedArgTypes.length !== this.extrinsic.args.length) {
- return false;
- }
- let valid = true;
- this.expectedArgTypes.forEach((type, i) => {
- if (type !== this.extrinsic.args[i].type) {
- valid = false;
- }
- });
- return valid;
- }
- }
- class SetRootAccount_Args {
- constructor(public readonly extrinsic: SubstrateExtrinsic) {}
- get memberId(): MemberId {
- return createTypeUnsafe<MemberId & Codec>(typeRegistry, "MemberId", [
- this.extrinsic.args[0].value
- ]);
- }
- get newRootAccount(): AccountId {
- return createTypeUnsafe<AccountId & Codec>(typeRegistry, "AccountId", [
- this.extrinsic.args[1].value
- ]);
- }
- }
- export class SetControllerAccountCall {
- public readonly extrinsic: SubstrateExtrinsic;
- public readonly expectedArgTypes = ["MemberId", "AccountId"];
- constructor(public readonly ctx: SubstrateEvent) {
- if (ctx.extrinsic === undefined) {
- throw new Error(`No call data has been provided`);
- }
- this.extrinsic = ctx.extrinsic;
- }
- get args(): SetControllerAccount_Args {
- return new SetControllerAccount_Args(this.extrinsic);
- }
- validateArgs(): boolean {
- if (this.expectedArgTypes.length !== this.extrinsic.args.length) {
- return false;
- }
- let valid = true;
- this.expectedArgTypes.forEach((type, i) => {
- if (type !== this.extrinsic.args[i].type) {
- valid = false;
- }
- });
- return valid;
- }
- }
- class SetControllerAccount_Args {
- constructor(public readonly extrinsic: SubstrateExtrinsic) {}
- get memberId(): MemberId {
- return createTypeUnsafe<MemberId & Codec>(typeRegistry, "MemberId", [
- this.extrinsic.args[0].value
- ]);
- }
- get newControllerAccount(): AccountId {
- return createTypeUnsafe<AccountId & Codec>(typeRegistry, "AccountId", [
- this.extrinsic.args[1].value
- ]);
- }
- }
- /**
- * Update member's all or some of handle, avatar and about text.
- */
- export class UpdateMembershipCall {
- public readonly extrinsic: SubstrateExtrinsic;
- public readonly expectedArgTypes = [
- "MemberId",
- "Option<Bytes>",
- "Option<Bytes>",
- "Option<Bytes>",
- ];
- constructor(public readonly ctx: SubstrateEvent) {
- if (ctx.extrinsic === undefined) {
- throw new Error(`No call data has been provided`);
- }
- this.extrinsic = ctx.extrinsic;
- }
- get args(): UpdateMembership_Args {
- return new UpdateMembership_Args(this.extrinsic);
- }
- validateArgs(): boolean {
- if (this.expectedArgTypes.length !== this.extrinsic.args.length) {
- return false;
- }
- let valid = true;
- this.expectedArgTypes.forEach((type, i) => {
- if (type !== this.extrinsic.args[i].type) {
- valid = false;
- }
- });
- return valid;
- }
- }
- class UpdateMembership_Args {
- constructor(public readonly extrinsic: SubstrateExtrinsic) {}
- get memberId(): MemberId {
- return createTypeUnsafe<MemberId & Codec>(typeRegistry, "MemberId", [
- this.extrinsic.args[0].value,
- ]);
- }
- get handle(): Option<Bytes> {
- return createTypeUnsafe<Option<Bytes> & Codec>(
- typeRegistry,
- "Option<Bytes>",
- [this.extrinsic.args[1].value]
- );
- }
- get avatarUri(): Option<Bytes> {
- return createTypeUnsafe<Option<Bytes> & Codec>(
- typeRegistry,
- "Option<Bytes>",
- [this.extrinsic.args[2].value]
- );
- }
- get about(): Option<Bytes> {
- return createTypeUnsafe<Option<Bytes> & Codec>(
- typeRegistry,
- "Option<Bytes>",
- [this.extrinsic.args[3].value]
- );
- }
- }
- }
|