Class Fleet

Hierarchy

  • Fleet

Implements

  • Account

Constructors

Properties

Accessors

Methods

Constructors

  • Parameters

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

    Returns Fleet

Properties

ACCOUNT_NAME: "craftingInstance" | "disbandedFleet" | "fleet" | "fleetShips" | "game" | "gameState" | "mineItem" | "planet" | "resource" | "sagePlayerProfile" | "sector" | "ship" | "star" | "starbase" | "starbasePlayer" | "surveyDataUnitTracker" = 'fleet'
MIN_DATA_SIZE: number = FLEET_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

  • Add a Ship to a Fleet

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • 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

    • fleet: PublicKey

      the fleet

    • ship: PublicKey

      the ship being added to the fleet

    • starbasePlayer: PublicKey

      the Starbase player

    • starbase: PublicKey

      the Starbase where the fleet is docked

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

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

      the instruction input params

    Returns InstructionReturn

  • Generic asteroid mining handler

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • profileFaction: PublicKey

      the faction of the profile that owns the fleet that is mining

    • fleet: PublicKey

      the fleet

    • starbase: PublicKey

      the Starbase

    • mineItem: PublicKey

      the mine item

    • resource: PublicKey

      the resource

    • planet: PublicKey

      the planet

    • cargoHold: PublicKey

      the fleet cargo hold cargo pod

    • ammoBank: PublicKey

      the fleet ammo bank cargo pod

    • foodCargoType: PublicKey

      the food cargo type

    • ammoCargoType: PublicKey

      the ammo cargo type

    • resourceCargoType: PublicKey

      the cargo type for the resource being mined

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • gameState: PublicKey

      the game state. No longer used, maintained for backwards compatibility

    • gameId: PublicKey

      the SAGE game id

    • foodTokenFrom: PublicKey

      the source token account for food

    • ammoTokenFrom: PublicKey

      the source token account for ammo

    • resourceTokenFrom: PublicKey

      the source token account for the resource

    • resourceTokenTo: PublicKey

      the destination token account for the resource

    • foodMint: PublicKey

      the food token mint

    • ammoMint: PublicKey

      the ammo token mint

    Returns InstructionReturn

  • Calculate the time it would take for ammo to run out during mining

    Returns

    time it would take for food to run out during mining

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • ammoAvailable: number

      the ammo available

    Returns number

  • Calculate the amount of ammo to consume

    Returns

    amount of ammo to consume

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • ammoAvailable: number

      the ammo available

    • duration: number

      the duration

    Returns number

  • Calculate the mining emission rate

    Returns

    the mining emission rate

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • mineItem: AnchorTypeDef<Object, AnchorDefined<SageIDL, Record<string, never>>>

      the mine item

    • resource: AnchorTypeDef<Object, AnchorDefined<SageIDL, Record<string, never>>>

      the resource associated with the mine item

    Returns number

  • Calculate the mining emission rate using raw numbers

    Returns

    the mining emission rate

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • resourceHardnessInput: number

      the resource hardness of the mine item

    • systemRichnessInput: number

      the system richness associated with the mine item

    Returns number

  • Calculate the time it would take for food to run out during mining

    Returns

    time it would take for food to run out during mining

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • foodAvailable: number

      the food available

    Returns number

  • Calculate the amount of food to consume

    Returns

    amount of food to consume

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • foodAvailable: number

      the food available

    • duration: number

      the duration

    Returns number

  • Calculate the time it would take to mine the resourceAmount

    Returns

    the time it would take to mine the resourceAmount

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • mineItem: AnchorTypeDef<Object, AnchorDefined<SageIDL, Record<string, never>>>

      the mine item

    • resource: AnchorTypeDef<Object, AnchorDefined<SageIDL, Record<string, never>>>

      the resource associated with the mine item

    • resourceAmount: number

      the amount of resource

    Returns number

  • Calculate the time it would take to mine the resourceAmount with raw numbers

    Returns

    the time it would take to mine the resourceAmount

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • resourceHardnessInput: number

      the resource hardness of the mine item

    • systemRichnessInput: number

      the system richness associated with the mine item

    • resourceAmount: number

      the amount of resource

    Returns number

  • Calculate the the amount of resource to extract

    Returns

    the amount of resource to extract

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • mineItem: AnchorTypeDef<Object, AnchorDefined<SageIDL, Record<string, never>>>

      the mine item

    • resource: AnchorTypeDef<Object, AnchorDefined<SageIDL, Record<string, never>>>

      the resource associated with the mine item

    • duration: number

      the time elapsed in seconds

    • maxResourceAmount: number

      the max amount of resource

    Returns number

  • Calculate the the amount of resource to extract with raw numbers

    Returns

    the amount of resource to extract

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • resourceHardnessInput: number

      the resource hardness of the mine item

    • systemRichnessInput: number

      the system richness associated with the mine item

    • duration: number

      the time elapsed in seconds

    • maxResourceAmount: number

      the max amount of resource

    Returns number

  • Calculate combined fleet stats

    Returns

    ShipStats

    Parameters

    • currentFleetStats: ShipStats

      previous fleet stats

    • shipStats: ShipStats

      ship stats

    • shipAmount: number

      the number of ships

    Returns ShipStats

  • Calculate the amount of fuel to burn for subwarp movement given the coordinates

    Returns

    the amount fo fuel spent for moving

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • coordinates1: [BN, BN]

      the 1st set of coordinates

    • coordinates2: [BN, BN]

      the 2nd set of coordinates

    Returns number

  • Calculate the amount of fuel to burn for subwarp movement given the distance

    Returns

    the amount fo fuel spent for moving

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • distance: number

      the distance

    Returns number

  • Calculate the time take to subwarp

    Returns

    the time taken to subwarp

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • distance: number

      the distance

    Returns number

  • Calculate the time take to subwarp given coordinates

    Returns

    the time taken to subwarp

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • coordinates1: [BN, BN]

      the 1st set of coordinates

    • coordinates2: [BN, BN]

      the 2nd set of coordinates

    Returns number

  • Calculate the amount of fuel to burn for warp movement given the coordinates

    Returns

    the amount fo fuel spent for moving

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • coordinates1: [BN, BN]

      the 1st set of coordinates

    • coordinates2: [BN, BN]

      the 2nd set of coordinates

    Returns number

  • Calculate the amount of fuel to burn for warp movement given the distance

    Returns

    the amount fo fuel spent for moving

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • distance: number

      the distance

    Returns number

  • Calculate the time take to warp

    Returns

    the time taken to warp

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • distance: number

      the distance

    Returns number

  • Calculate the time take to warp given coordinates

    Returns

    the time taken to warp

    Parameters

    • fleetStats: ShipStats

      the fleet's stats

    • coordinates1: [BN, BN]

      the 1st set of coordinates

    • coordinates2: [BN, BN]

      the 2nd set of coordinates

    Returns number

  • Closes a token account that is owned by the Fleet cargo pod (burns any token balance)

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • 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

    • fleet: PublicKey

      the fleet

    • cargoPod: PublicKey

      the cargo pod, owned by the fleet

    • cargoType: PublicKey

      the cargo type

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • token: PublicKey

      the token account, owned by cargoPod

    • tokenMint: PublicKey

      the token mint

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

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

      the instruction input params

    Returns InstructionReturn

  • Create a new Fleet

    Returns

    the fleet address, the addresses of fleet cargo pods & InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • 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

    • ship: PublicKey

      the first ship to add to the fleet

    • starbasePlayer: PublicKey

      the Starbase player

    • starbase: PublicKey

      the Starbase

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • input: CustomCreateFleetInput

      the instruction input params

    Returns {
        ammoBankKey: [PublicKey, number];
        cargoHoldKey: [PublicKey, number];
        fleetKey: [PublicKey, number];
        fuelTankKey: [PublicKey, number];
        instructions: InstructionReturn;
    }

    • ammoBankKey: [PublicKey, number]
    • cargoHoldKey: [PublicKey, number]
    • fleetKey: [PublicKey, number]
    • fuelTankKey: [PublicKey, number]
    • instructions: InstructionReturn
  • Deposits cargo to a Fleet from a Starbase

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • 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

    • starbasePlayer: PublicKey

      the Starbase player

    • fleet: PublicKey

      the fleet

    • cargoPodFrom: PublicKey

      the source cargo pod, owned by starbasePlayer

    • cargoPodTo: PublicKey

      the destination cargo pod, owned by fleet

    • cargoType: PublicKey

      the cargo type

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • tokenFrom: PublicKey

      the source token account, owned by cargoPodFrom

    • tokenTo: PublicKey

      the destination token account, owned by cargoPodTo

    • tokenMint: PublicKey

      the token mint

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

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

      the instruction input params

    Returns InstructionReturn

  • Disbands a Fleet

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • 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

    • fleet: Fleet

      the fleet

    • starbasePlayer: PublicKey

      the Starbase player

    • starbase: PublicKey

      the Starbase where the fleet is docked

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

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

      the instruction input params

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

    • disbandedFleetKey: [PublicKey, number]
    • instructions: InstructionReturn
  • Find the Fleet account address

    Returns

    The PDA and bump respectively

    Parameters

    • program: SageIDLProgram

      SAGE program

    • game: PublicKey

      the SAGE game id

    • playerProfile: PublicKey

      the profile with the required permissions for the instruction

    • fleetLabel: number[]

      the fleet label

    Returns [PublicKey, number]

  • Find the fleet PointsModifier account address

    Returns

    The PDA and bump respectively

    Parameters

    Returns [PublicKey, number]

  • Generic fleet state handler This is meant to be used when you want to run the fleet state handler and can provide your own remaining accounts

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • fleet: PublicKey

      the fleet

    • remainingAccounts: AccountMeta[] = []

      the remaining accounts (an array of AccountMeta)

    Returns InstructionReturn

  • Forcefully disbands a Fleet This is only necessary when - after a Ship that is part of the fleet is invalidated

    Returns

    the disbanded fleet address & InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • fleet: Fleet

      the fleet

    • starbasePlayer: PublicKey

      the Starbase player

    • starbase: PublicKey

      the Starbase

    • ship: PublicKey

      the ship

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

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

      the instruction input params

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

    • disbandedFleetKey: [PublicKey, number]
    • instructions: InstructionReturn
  • Drops cargo from a Fleet that is in the Respawn state

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • fleet: PublicKey

      the fleet

    • cargoPod: PublicKey

      the cargo pod

    • cargoType: PublicKey

      the cargo type

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • gameId: PublicKey

      the SAGE game id

    • tokenFrom: PublicKey

      the source token account

    • tokenMint: PublicKey

      the token mint

    Returns InstructionReturn

  • Get the fleet size

    Returns

    The ship counts

    Parameters

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

      ShipCounts

    Returns number

  • Transition a fleet from the Idle state to the Docked state

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • 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

    • fleet: PublicKey

      the fleet

    • starbase: PublicKey

      the Starbase to dock into

    • starbasePlayer: PublicKey

      the Starbase player

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

    • input: number

      the instruction input params

    Returns InstructionReturn

  • Transition a Fleets state from Idle to Respawn

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • 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

    • fleet: PublicKey

      the fleet

    • atlasTokenFrom: PublicKey

      ATLAS token account owned by player

    • atlasTokenTo: PublicKey

      the vault ATLAS token account (as defined in GameState)

    • gameState: PublicKey

      the game state

    • gameId: PublicKey

      the SAGE game id

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

      the instruction input params

    Returns InstructionReturn

  • Transition a fleet from the docked state to the idle state

    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

    • fleet: PublicKey

      the fleet

    • starbase: PublicKey

      the Starbase that the fleet is currently docked at

    • starbasePlayer: PublicKey

      the Starbase player

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

    • input: number

      the instruction input params

    Returns InstructionReturn

  • Get into the Respawn state from MineAsteroid

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • 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

    • fleet: PublicKey

      the fleet

    • resource: PublicKey

      the resource

    • planet: PublicKey

      the planet

    • fuelTank: PublicKey

      the fleet's fuel tank cargo pod

    • gameState: PublicKey

      the game state

    • gameId: PublicKey

      the SAGE game id

    • fuelTokenFrom: PublicKey

      the source token account for fuel

    • atlasTokenFrom: PublicKey

      ATLAS token account owned by player

    • atlasTokenTo: PublicKey

      the vault ATLAS token account (as defined in GameState)

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

      the instruction input params

    Returns InstructionReturn

  • Warp movement handler function

    Returns

    InstructionReturn

    Parameters

    Returns InstructionReturn

  • Generic movement handler function

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • profile: PublicKey

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

    • game: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

    • fleet: PublicKey

      the fleet

    • fleetData: AccountInfo<Buffer>

      the fleet account data

    • fromSector: PublicKey

      the sector that fleet is moving from

    • Optional toSector: PublicKey

      the sector that the fleet is moving to

    • Optional cargoPod: PublicKey

      the fuel tank cargo pod

    • Optional cargoType: PublicKey

      the fuel cargo type

    • Optional cargoStatsDefinition: PublicKey

      the cargo stats definition

    • Optional cargoTokenAccount: PublicKey

      the fuel token account

    • Optional tokenMint: PublicKey

      the fuel token mint

    • Optional cargoProgram: CargoIDLProgram

      cargo program

    Returns InstructionReturn

  • Subwarp movement handler function

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • profile: PublicKey

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

    • fleet: PublicKey

      the fleet

    • fuelTank: PublicKey

      the fuel tank cargo pod

    • fuelCargoType: PublicKey

      the fuel cargo type

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • fuelTokenAccount: PublicKey

      the fuel token account

    • fuelTokenMint: PublicKey

      the fuel token mint

    • game: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

    Returns InstructionReturn

  • Multiply Cargo Stats

    Returns

    CargoStats

    Parameters

    • shipStats: CargoStats

      ship CargoStats

    • shipAmount: number

      the number of ships

    Returns CargoStats

  • Multiply Misc Stats

    Returns

    MiscStats

    Parameters

    • miscStats: MiscStats

      ship MiscStats

    • shipAmount: number

      the number of ships

    Returns MiscStats

  • Multiply combined fleet stats

    Returns

    ShipStats

    Parameters

    • shipStats: ShipStats

      ship stats

    • shipAmount: number

      the number of ships

    Returns ShipStats

  • Register a points modifier for fleets

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • pointsProgram: PublicKey

      points program

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

      the key index input

    • pointsCategory: PublicKey

      the points category

    • gameState: PublicKey

      the game state

    • canIncrement: boolean

      whether the modifier can increment points

    • canDecrement: boolean

      whether the modifier can decrement points

    • pointsCategoryEnum: PointsCategoryEnum

      the PointsCategoryEnum

    • game: PublicKey

      the SAGE game id

    Returns InstructionReturn

  • Transition a fleet from Respawn to docked

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • 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

    • fleet: PublicKey

      the fleet

    • starbase: PublicKey

      the Starbase

    • starbasePlayer: PublicKey

      the Starbase player

    • cargoHold: PublicKey

      the fleet cargo hold cargo pod

    • fuelTank: PublicKey

      the fleet's fuel tank cargo pod

    • ammoBank: PublicKey

      the fleet ammo bank cargo pod

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

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

      the instruction input params

    Returns InstructionReturn

  • Start mining an asteroid

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • 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

    • fleet: PublicKey

      the fleet

    • starbase: PublicKey

      the Starbase

    • starbasePlayer: PublicKey

      the Starbase player

    • mineItem: PublicKey

      the mine item

    • resource: PublicKey

      the resource

    • planet: PublicKey

      the planet (Planet Type has to be asteroid)

    • gameState: PublicKey

      the game state

    • gameId: PublicKey

      the SAGE game id

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

      the instruction input params

    Returns InstructionReturn

  • Start subwarp movement

    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

    • fleet: PublicKey

      the fleet

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

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

      the instruction input params

    Returns InstructionReturn

  • Stop mining an asteroid

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • 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

    • fleet: PublicKey

      the fleet

    • resource: PublicKey

      the resource

    • planet: PublicKey

      the planet

    • fuelTank: PublicKey

      the fleet's fuel tank cargo pod

    • fuelCargoType: PublicKey

      the fuel cargo type

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • gameState: PublicKey

      the game state

    • gameId: PublicKey

      the SAGE game id

    • fuelTokenFrom: PublicKey

      the source token account for fuel

    • fuelMint: PublicKey

      the fuel token mint

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

      the instruction input params

    Returns InstructionReturn

  • Stop an Subwarp movement in progress

    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

    • fleet: PublicKey

      the fleet

    • cargoPod: PublicKey

      the fuel tank cargo pod

    • cargoType: PublicKey

      the fuel cargo type

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • cargoTokenAccount: PublicKey

      the fuel token account

    • tokenMint: PublicKey

      the fuel token mint

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

    • cargoProgram: CargoIDLProgram

      cargo program

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

      the instruction input params

    Returns InstructionReturn

  • Transfers cargo within a Fleet

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • 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

    • fleet: PublicKey

      the fleet

    • cargoPodFrom: PublicKey

      the source cargo pod, owned by fleet

    • cargoPodTo: PublicKey

      the destination cargo pod, owned by fleet

    • cargoType: PublicKey

      the cargo type

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • tokenFrom: PublicKey

      the source token account, owned by cargoPodFrom

    • tokenTo: PublicKey

      the destination token account, owned by cargoPodTo

    • tokenMint: PublicKey

      the token mint

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

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

      the instruction input params

    • Optional starbase: PublicKey

      the Starbase

    Returns InstructionReturn

  • Update a Ship in a Fleet

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • fleet: PublicKey

      the fleet

    • oldShip: PublicKey

      the old ship being updated

    • next: PublicKey

      the value of the next field on the old ship account

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

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

      the instruction input params

    Returns InstructionReturn

  • Warp to new Sector using the warp lane

    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

    • fleet: PublicKey

      the fleet

    • fromStarbase: PublicKey

      the Starbase that the fleet is moving from

    • toStarbase: PublicKey

      the Starbase that the fleet is moving to

    • fromSector: PublicKey

      the sector that fleet is moving from

    • toSector: PublicKey

      the sector that the fleet is moving to

    • fuelTank: PublicKey

      the fleet's fuel tank cargo pod

    • cargoType: PublicKey

      the cargo type

    • statsDefinition: PublicKey

      the cargo stats definition

    • fuelTokenFrom: PublicKey

      the source token account for fuel

    • fuelMint: PublicKey

      the fuel token mint

    • feeTokenFrom: PublicKey

      the source token account for the fee

    • feeTokenTo: PublicKey

      the destination token account for the fee

    • feeMint: PublicKey

      the fee token mint

    • gameState: PublicKey

      the game state

    • gameId: PublicKey

      the SAGE game id

    • cargoProgram: CargoIDLProgram

      cargo program

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

      the instruction input params

    Returns InstructionReturn

  • Warp to coordinate

    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

    • fleet: PublicKey

      the fleet

    • fuelTank: PublicKey

      the fleet's fuel tank cargo pod

    • cargoType: PublicKey

      the cargo type

    • statsDefinition: PublicKey

      the cargo stats definition

    • tokenFrom: PublicKey

      the fuel source token account, owned by fuelTank

    • tokenMint: PublicKey

      the fuel token mint

    • gameState: PublicKey

      the game state

    • gameId: PublicKey

      the SAGE game id

    • cargoProgram: CargoIDLProgram

      cargo program

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

      the instruction input params

    Returns InstructionReturn

  • Withdraws cargo from a Fleet to a Starbase

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • 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

    • starbasePlayer: PublicKey

      the Starbase player

    • fleet: PublicKey

      the fleet

    • cargoPodFrom: PublicKey

      the source cargo pod, owned by the fleet

    • cargoPodTo: PublicKey

      the destination cargo pod, owned by starbasePlayer

    • cargoType: PublicKey

      the cargo type

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • tokenFrom: PublicKey

      the source token account, owned by cargoPodFrom

    • tokenTo: PublicKey

      the destination token account, owned by cargoPodTo

    • tokenMint: PublicKey

      the token mint

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

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

      the instruction input params

    Returns InstructionReturn

Generated using TypeDoc