Class Ship

Hierarchy

  • Ship

Implements

  • Account

Constructors

  • Parameters

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

    Returns Ship

Properties

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

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

  • Parameters

    Returns DecodedAccountData<Ship>

  • Makes a Ship unusable; effectively removes it from use

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • profile: PublicKey

      the profile with the required permissions for the instruction

    • ship: PublicKey

      the ship

    • gameId: PublicKey

      the SAGE game id

    • keyIndex: number

      the index of the key in the profile permissions

    Returns InstructionReturn

  • Register a new Ship

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • profile: PublicKey

      the profile with the required permissions for the instruction

    • ship: AsyncSigner<unknown>

      the ship

    • mint: PublicKey

      the ship's mint

    • gameId: PublicKey

      the SAGE game id

    • input: RegisterShipInput

      input params

    Returns InstructionReturn

  • Set the next Ship Essentially this invalidates the current Ship account and updates it to the next Ship

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • profile: PublicKey

      the profile with the required permissions for the instruction

    • ship: PublicKey

      the current ship

    • nextShip: PublicKey

      the ship that will be replacing the current ship

    • gameId: PublicKey

      the SAGE game id

    • keyIndex: number

      the index of the key in the profile permissions

    Returns InstructionReturn

  • Update a Ship

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • profile: PublicKey

      the profile with the required permissions for the instruction

    • ship: PublicKey

      the ship

    • gameId: PublicKey

      the SAGE game id

    • input: UpdateShipInput

      input params

    Returns InstructionReturn

Generated using TypeDoc