Class SagePlayerProfile

Hierarchy

  • SagePlayerProfile

Implements

  • Account

Constructors

  • Parameters

    • _data: AnchorTypeDef<Object, AnchorDefined<SageIDL, Record<string, never>>>
    • _key: PublicKey

    Returns SagePlayerProfile

Properties

ACCOUNT_NAME: "craftingInstance" | "disbandedFleet" | "fleet" | "fleetShips" | "game" | "gameState" | "mineItem" | "planet" | "resource" | "sagePlayerProfile" | "sector" | "ship" | "star" | "starbase" | "starbasePlayer" | "surveyDataUnitTracker" = 'sagePlayerProfile'
MIN_DATA_SIZE: number = ...

Accessors

  • get data(): Readonly<AnchorTypeDef<Object, AnchorDefined<SageIDL, Record<string, never>>>>
  • Returns Readonly<AnchorTypeDef<Object, AnchorDefined<SageIDL, Record<string, never>>>>

  • get key(): PublicKey
  • Returns PublicKey

Methods

  • Add a Ship to the game by transferring it to escrow PDA

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • playerProfile: PublicKey

      the profile with the required permissions for the instruction

    • profileFaction: PublicKey

      the profile's faction

    • sagePlayerProfile: PublicKey

      the SAGE player profile

    • signerShipOrigin: AsyncSigner<unknown>

      the owner of the ship token account

    • originTokenAccount: PublicKey

      the source ship token account, owned by signerShipOrigin

    • ship: PublicKey

      the ship

    • shipEscrowTokenAccount: PublicKey

      the ship escrow token account (destination), owned by sagePlayerProfile

    • starbasePlayer: PublicKey

      the Starbase player

    • starbase: PublicKey

      the Starbase

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state account

    • input: AnchorTypeDef<Object, Record<string, never>>

      the instruction input params

    Returns InstructionReturn

  • Find the SagePlayerProfile account address

    Returns

    The PDA and bump respectively

    Parameters

    • program: SageIDLProgram

      SAGE program

    • playerProfile: PublicKey

      the player's profile

    • gameId: PublicKey

      the SAGE game id

    Returns [PublicKey, number]

  • Register the SAGE player profile

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • profile: PublicKey

      the profile with the required permissions for the instruction

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state account

    Returns InstructionReturn

  • Remove an invalid ship from the game

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • profile: PublicKey

      the player's profile with the required permissions for the instruction

    • profileFaction: PublicKey

      the profile's faction

    • sagePlayerProfile: PublicKey

      the SAGE player profile

    • destinationTokenAccount: PublicKey

      the destination token account, any owner is valid

    • ship: PublicKey

      the ship

    • shipEscrowTokenAccount: PublicKey

      the ship escrow token account (destination), owned by sagePlayerProfile

    • starbasePlayer: PublicKey

      the Starbase player

    • starbase: PublicKey

      the Starbase

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state account

    • input: AnchorTypeDef<Object, Record<string, never>>

      the instruction input params

    Returns InstructionReturn

  • Remove a ship from the game

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • profile: PublicKey

      the player's profile with the required permissions for the instruction

    • profileFaction: PublicKey

      the profile's faction

    • sagePlayerProfile: PublicKey

      the SAGE player profile

    • destinationTokenAccount: PublicKey

      the destination token account, any owner is valid

    • ship: PublicKey

      the ship

    • shipEscrowTokenAccount: PublicKey

      the ship escrow token account (source), owned by sagePlayerProfile

    • starbasePlayer: PublicKey

      the Starbase player

    • starbase: PublicKey

      the Starbase

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state account

    • input: AnchorTypeDef<Object, Record<string, never>>

      the instruction input params

    Returns InstructionReturn

  • Update Ship in escrow

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • oldShip: PublicKey

      the ship that is being replaced

    • next: PublicKey

      the value of the next field on oldShip

    • starbasePlayer: PublicKey

      the Starbase player

    • starbase: PublicKey

      the Starbase

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state account

    • input: AnchorTypeDef<Object, Record<string, never>>

      the instruction input params

    Returns InstructionReturn

Generated using TypeDoc