Hierarchy

  • ProfileFactionAccount

Implements

  • Account

Constructors

  • Parameters

    • _data: AnchorTypeDef<{
          docs: ["Stores a profile's enlisted faction on-chain."];
          name: "profileFactionAccount";
          type: {
              fields: [{
                  docs: ["The data version of this account."];
                  name: "version";
                  type: "u8";
              }, {
                  docs: ["The profile this faction enlistment is for."];
                  name: "profile";
                  type: "publicKey";
              }, {
                  docs: ["The faction of the profile."];
                  name: "faction";
                  type: "u8";
              }, {
                  docs: ["The bump for this account."];
                  name: "bump";
                  type: "u8";
              }];
              kind: "struct";
          };
      } & {
          name: "profileFactionAccount";
      }, AnchorDefined<ProfileFactionIDL, Record<string, never>>>
    • _key: PublicKey

    Returns ProfileFactionAccount

Properties

ACCOUNT_NAME: "profileFactionAccount" = 'profileFactionAccount'
MIN_DATA_SIZE: number = ...

Accessors

  • get data(): Readonly<AnchorTypeDef<{
        docs: ["Stores a profile's enlisted faction on-chain."];
        name: "profileFactionAccount";
        type: {
            fields: [{
                docs: ["The data version of this account."];
                name: "version";
                type: "u8";
            }, {
                docs: ["The profile this faction enlistment is for."];
                name: "profile";
                type: "publicKey";
            }, {
                docs: ["The faction of the profile."];
                name: "faction";
                type: "u8";
            }, {
                docs: ["The bump for this account."];
                name: "bump";
                type: "u8";
            }];
            kind: "struct";
        };
    } & {
        name: "profileFactionAccount";
    }, AnchorDefined<ProfileFactionIDL, Record<string, never>>>>
  • Returns Readonly<AnchorTypeDef<{
        docs: ["Stores a profile's enlisted faction on-chain."];
        name: "profileFactionAccount";
        type: {
            fields: [{
                docs: ["The data version of this account."];
                name: "version";
                type: "u8";
            }, {
                docs: ["The profile this faction enlistment is for."];
                name: "profile";
                type: "publicKey";
            }, {
                docs: ["The faction of the profile."];
                name: "faction";
                type: "u8";
            }, {
                docs: ["The bump for this account."];
                name: "bump";
                type: "u8";
            }];
            kind: "struct";
        };
    } & {
        name: "profileFactionAccount";
    }, AnchorDefined<ProfileFactionIDL, Record<string, never>>>>

  • get key(): Readonly<PublicKey>
  • Returns Readonly<PublicKey>

Methods

  • Chose a faction for a player profile (Will only work if the profile is unaligned).

    Parameters

    • program: ProfileFactionIDLProgram

      The profile faction profile program.

    • keyInput: ProfileKeyInput<FactionPermissions, AsyncSigner<unknown>>

      The key to use to sign the transaction.

    • faction: MUD | ONI | Ustur

      The faction to change to. Must not be unaligned.

    • Optional optionalProfilesOrRoles: OptionalProfileOrRoleInput[]

      Optional profiles or roles to authorize transaction.

    Returns {
        faction: [PublicKey, number];
        instructions: InstructionReturn;
    }

    the instruction(s) to choose the new faction and the profileFactionAccount account address

    • faction: [PublicKey, number]
    • instructions: InstructionReturn
  • A bare-bones implementation of chooseFaction

    Parameters

    • program: ProfileFactionIDLProgram

      The profile faction profile program.

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction.

    • profile: PublicKey

      The profile whose faction is being chosen.

    • faction: MUD | ONI | Ustur

      The faction to change to. Must not be unaligned.

    • keyIndex: number

      The Index of the key in the profile's permission list

    • Optional optionalProfilesOrRoles: OptionalProfileOrRoleInput[]

      Optional profiles or roles to authorize transaction.

    Returns {
        faction: [PublicKey, number];
        instructions: InstructionReturn;
    }

    the instruction(s) to choose the new faction and the profileFactionAccount account address

    • faction: [PublicKey, number]
    • instructions: InstructionReturn
  • Parameters

    Returns [PublicKey, number]

Generated using TypeDoc