Class StarbasePlayer

Hierarchy

  • StarbasePlayer

Implements

  • Account

Constructors

Properties

ACCOUNT_NAME: "craftingInstance" | "disbandedFleet" | "fleet" | "fleetShips" | "game" | "gameState" | "mineItem" | "planet" | "resource" | "sagePlayerProfile" | "sector" | "ship" | "star" | "starbase" | "starbasePlayer" | "surveyDataUnitTracker" = 'starbasePlayer'
MIN_DATA_SIZE: number = STAR_BASE_PLAYER_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(): Readonly<PublicKey>
  • Returns Readonly<PublicKey>

Methods

  • Closes a token account that is owned by the StarbasePlayer (burns any token balance)

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • starbasePlayer: PublicKey

      the Starbase player

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • fundsTo: PublicKey | "funder"

      recipient of the rent refund

    • playerProfile: PublicKey

      the profile with the required permissions for the instruction

    • profileFaction: PublicKey

      the profile's faction

    • starbase: PublicKey

      the Starbase

    • cargoPod: PublicKey

      the cargo pod - owned by starbasePlayer

    • cargoType: PublicKey

      the cargo type

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • token: PublicKey

      the token account - owned by the cargoPod

    • tokenMint: PublicKey

      the token mint

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state account

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

      the instruction input params

    Returns InstructionReturn

  • Creates a new cargo pod for the player at the Starbase

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • starbasePlayer: PublicKey

      the Starbase player

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • playerProfile: PublicKey

      the profile with the required permissions for the instruction

    • profileFaction: PublicKey

      the profile's faction

    • starbase: PublicKey

      the Starbase

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state account

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

      the instruction input params

    Returns InstructionReturn

  • Deposits cargo to the game

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • starbasePlayer: PublicKey

      the Starbase player

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • playerProfile: PublicKey

      the profile with the required permissions for the instruction

    • profileFaction: PublicKey

      the profile's faction

    • starbase: PublicKey

      the Starbase

    • cargoPod: PublicKey

      the cargo pod

    • cargoType: PublicKey

      the cargo type

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • tokenFrom: PublicKey

      the source token account - owned by the key

    • tokenTo: PublicKey

      the destination token account - owned by the cargoPod

    • 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 StarbasePlayer account address

    Returns

    The PDA and bump respectively

    Parameters

    • program: SageIDLProgram

      SAGE program

    • starbase: PublicKey

      the Starbase

    • sagePlayerProfile: PublicKey

      the SAGE player profile

    • starbaseSeqId: number

      the Starbase sequence id

    Returns [PublicKey, number]

  • Register a StarbasePlayer

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • profileFaction: PublicKey

      the faction of profile associated with the sagePlayerProfile

    • sagePlayerProfile: PublicKey

      the SAGE player profile

    • starbase: PublicKey

      the Starbase

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

    • starbaseSeqId: number

      the Starbase sequence id

    Returns InstructionReturn

  • Closes an empty cargo pod account owned by the player at a Starbase

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • starbasePlayer: PublicKey

      the Starbase player

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • playerProfile: PublicKey

      the profile with the required permissions for the instruction

    • profileFaction: PublicKey

      the profile's faction

    • fundsTo: PublicKey | "funder"

      recipient of the rent refund

    • starbase: PublicKey

      the Starbase

    • cargoPod: PublicKey

      the cargo pod

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state account

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

      the instruction input params

    Returns InstructionReturn

  • Sync the Starbase player account

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • starbasePlayer: PublicKey

      the Starbase player

    • starbase: PublicKey

      the Starbase tied to the starbasePlayer

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state account

    Returns InstructionReturn

  • Transfers cargo from one pod to another at the same Starbase owned by the same player

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • starbasePlayer: PublicKey

      the Starbase player

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • fundsTo: PublicKey | "funder"

      recipient of the rent refund

    • playerProfile: PublicKey

      the profile with the required permissions for the instruction

    • profileFaction: PublicKey

      the profile's faction

    • starbase: PublicKey

      the Starbase

    • cargoPodFrom: PublicKey

      the source cargo pod

    • cargoPodTo: PublicKey

      the destination cargo pod

    • cargoType: PublicKey

      the cargo type

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • tokenFrom: PublicKey

      the source token account - owned by the cargoPodFrom

    • tokenTo: PublicKey

      the destination token account - owned by the cargoPodTo

    • tokenMint: PublicKey

      the token mint

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state account

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

      the instruction input params

    Returns InstructionReturn

  • Withdraws cargo from the game

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • starbasePlayer: PublicKey

      the Starbase player

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • fundsTo: PublicKey | "funder"

      recipient of the rent refund

    • playerProfile: PublicKey

      the profile with the required permissions for the instruction

    • profileFaction: PublicKey

      the profile's faction

    • starbase: PublicKey

      the Starbase

    • cargoPod: PublicKey

      the cargo pod

    • cargoType: PublicKey

      the cargo type

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • tokenFrom: PublicKey

      the source token account - owned by the cargoPod

    • tokenTo: PublicKey

      the destination token account - owned by the key

    • tokenMint: PublicKey

      the token mint

    • 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