import { AccountMeta, KeyedAccountInfo, PublicKey } from '@solana/web3.js'; import { BN } from '@staratlas/anchor'; import { CargoIDLProgram } from '@staratlas/cargo'; import { Account, AsyncSigner, CUnion, DecodedAccountData, InstructionReturn } from '@staratlas/data-source'; import { PointsIDLProgram } from '@staratlas/points'; import { ProfileFactionIDLProgram } from '@staratlas/profile-faction'; import { AddShipToFleetInput, AdminCreateFleetInput, AdminRemoveFleetInput, AdminDepositCargoToFleetInput, AdminDepositCargoToStarbaseInput, BaseAttackFleetInput, BaseRepairDockedFleetInput, BaseRepairIdleFleetInput, CargoStats, CloseFleetCargoPodTokenAccountInput, CombatStats, DepositCargoToFleetInput, DisbandFleetInput, FleetAccount, ForceDisbandFleetInput, Idle, IdleToRespawnInput, LoadFleetCrewInput, LoadingBayToIdleInput, MineAsteroid, MineAsteroidToRespawnInput, MineItemAccount, MiscStats, MoveSubwarp, MoveWarp, MovementStats, ReloadFleetAbilityPowerInput, ResourceAccount, Respawn, BaseRetrieveLootInput, SageIDL, SageIDLProgram, ShipCounts, StarbaseLoadingBay, StartMiningAsteroidInput, StartSubwarpInput, StopMiningAsteroidInput, StopSubwarpInput, TransferCargoWithinFleetInput, UnloadFleetCrewInput, UpdateShipInFleetInput, WarpLaneInput, WarpToCoordinateInput, WithdrawCargoFromFleetInput } from './constants'; import { ShipStats } from './ship'; export declare const MIN_WARP_DISTANCE = 0; export declare const MAX_WARP_DISTANCE: number; export declare const MAX_CARGO_CAPACITY = 100000000; export declare const MAX_CONSUMPTION_CAPACITY = 50000000; export declare const MAX_AP = 100000000; export declare const MAX_HIT_POINTS = 500000000; export declare enum PointsCategoryEnum { XP = 1, LP = 2 } /** extends CreateFleetInput to remove cargo pod seeds */ export interface CustomCreateFleetInput { shipAmount: number; fleetLabel: number[]; shipEscrowIndex: number; keyIndex: number; } export type FleetStateData = CUnion<{ StarbaseLoadingBay: StarbaseLoadingBay; Idle: Idle; MineAsteroid: MineAsteroid; MoveWarp: MoveWarp; MoveSubwarp: MoveSubwarp; Respawn: Respawn; }>; export interface AttackFleetInput extends Omit { anyFleetDies?: boolean; asteroid?: PublicKey /** must only be provided if defending fleet is mining */; } export interface RepairIdleFleetInput extends Omit { amount?: number; } export interface RepairDockedFleetInput extends Omit { amount?: number; } export interface LootRetrievalAccounts { cargoType: PublicKey; tokenFrom: PublicKey; tokenTo: PublicKey; tokenMint: PublicKey; } export interface RetrieveLootInput extends BaseRetrieveLootInput { lootRetrieval: LootRetrievalAccounts[]; fundsTo?: PublicKey | 'funder' /** only required if loot account will be closed */; } export interface AttackStarbaseInput { keyIndex: number; } export interface RepairStarbaseInput { keyIndex: number; toolkitAmount: BN; } export declare const FLEET_MIN_DATA_SIZE: number; export declare const GLOBAL_SCALE_DECIMALS_2 = 100; export declare const GLOBAL_SCALE_DECIMALS_4 = 10000; export declare const GLOBAL_SCALE_DECIMALS_6 = 1000000; /** * Check if two `FleetAccount` instances are equal * @param data1 - first FleetAccount * @param data2 - second FleetAccount * @returns boolean */ export declare function fleetDataEquals(data1: FleetAccount, data2: FleetAccount): boolean; export declare class Fleet implements Account { private _data; private _key; private _state; static readonly ACCOUNT_NAME: NonNullable[number]['name']; static readonly MIN_DATA_SIZE: number; constructor(_data: FleetAccount, _key: PublicKey, _state: FleetStateData); get data(): Readonly; get key(): Readonly; get state(): Readonly; /** * Find the Fleet account address * @param program - SAGE program * @param game - the SAGE game id * @param playerProfile - the profile with the required permissions for the instruction * @param fleetLabel - the fleet label * @returns The PDA and bump respectively */ static findAddress(program: SageIDLProgram, game: PublicKey, playerProfile: PublicKey, fleetLabel: number[]): [PublicKey, number]; /** * Get the fleet size * @param counts - ShipCounts * @returns The ship counts */ static getFleetSize(counts: ShipCounts): number; /** * Calculate the time take to warp * @param fleetStats - the fleet's stats * @param distance - the distance * @returns the time taken to warp */ static calculateWarpTime(fleetStats: ShipStats, distance: number): number; /** * Calculate the time take to warp given coordinates * @param fleetStats - the fleet's stats * @param coordinates1 - the 1st set of coordinates * @param coordinates2 - the 2nd set of coordinates * @returns the time taken to warp */ static calculateWarpTimeWithCoords(fleetStats: ShipStats, coordinates1: [BN, BN], coordinates2: [BN, BN]): number; /** * Calculate the amount of fuel to burn for warp movement given the distance * @param fleetStats - the fleet's stats * @param distance - the distance * @returns the amount fo fuel spent for moving */ static calculateWarpFuelBurnWithDistance(fleetStats: ShipStats, distance: number): number; /** * Calculate the amount of fuel to burn for warp movement given the coordinates * @param fleetStats - the fleet's stats * @param coordinates1 - the 1st set of coordinates * @param coordinates2 - the 2nd set of coordinates * @returns the amount fo fuel spent for moving */ static calculateWarpFuelBurnWithCoords(fleetStats: ShipStats, coordinates1: [BN, BN], coordinates2: [BN, BN]): number; /** * Calculate the time take to subwarp * @param fleetStats - the fleet's stats * @param distance - the distance * @returns the time taken to subwarp */ static calculateSubwarpTime(fleetStats: ShipStats, distance: number): number; /** * Calculate the time take to subwarp given coordinates * @param fleetStats - the fleet's stats * @param coordinates1 - the 1st set of coordinates * @param coordinates2 - the 2nd set of coordinates * @returns the time taken to subwarp */ static calculateSubwarpTimeWithCoords(fleetStats: ShipStats, coordinates1: [BN, BN], coordinates2: [BN, BN]): number; /** * Calculate the amount of fuel to burn for subwarp movement given the distance * @param fleetStats - the fleet's stats * @param distance - the distance * @returns the amount fo fuel spent for moving */ static calculateSubwarpFuelBurnWithDistance(fleetStats: ShipStats, distance: number): number; /** * Calculate the amount of fuel to burn for subwarp movement given the coordinates * @param fleetStats - the fleet's stats * @param coordinates1 - the 1st set of coordinates * @param coordinates2 - the 2nd set of coordinates * @returns the amount fo fuel spent for moving */ static calculateSubwarpFuelBurnWithCoords(fleetStats: ShipStats, coordinates1: [BN, BN], coordinates2: [BN, BN]): number; /** * Calculate the time it would take for food to run out during mining * @param fleetStats - the fleet's stats * @param foodAvailable - the food available * @returns time it would take for food to run out during mining */ static calculateAsteroidMiningFoodDuration(fleetStats: ShipStats, foodAvailable: number): number; /** * Calculate the amount of food to consume * @param fleetStats - the fleet's stats * @param foodAvailable - the food available * @param duration - the duration * @returns amount of food to consume */ static calculateAsteroidMiningFoodToConsume(fleetStats: ShipStats, foodAvailable: number, duration: number): number; /** * Calculate the time it would take for ammo to run out during mining * @param fleetStats - the fleet's stats * @param ammoAvailable - the ammo available * @returns time it would take for food to run out during mining */ static calculateAsteroidMiningAmmoDuration(fleetStats: ShipStats, ammoAvailable: number): number; /** * Calculate the amount of ammo to consume * @param fleetStats - the fleet's stats * @param ammoAvailable - the ammo available * @param duration - the duration * @returns amount of ammo to consume */ static calculateAsteroidMiningAmmoToConsume(fleetStats: ShipStats, ammoAvailable: number, duration: number): number; /** * Apply the mining rate penalty * @param baseRate - the base mining emissions rate * @param penalty - the penalty as a percentage (.e.g 0.5 to mean 50%) * @returns the mining emission rate with penalty applied */ static applyAsteroidMiningRatePenalty(baseRate: number, penalty: number): number; /** * Calculate the mining emission rate using raw numbers * @param fleetStats - the fleet's stats * @param resourceHardnessInput - the resource hardness of the mine item * @param systemRichnessInput - the system richness associated with the mine item * @param penalty - the percentage by which to reduce the asteroid mining rate (e.g. 0.5 to represent 50%) * @returns the mining emission rate */ static calculateAsteroidMiningEmissionRateBareBones(fleetStats: ShipStats, resourceHardnessInput: number, systemRichnessInput: number, penalty?: number): number; /** * Calculate the mining emission rate * @param fleetStats - the fleet's stats * @param mineItem - the mine item * @param resource - the resource associated with the mine item * @param penalty - the percentage by which to reduce the asteroid mining rate (e.g. 0.5 to represent 50%) * @returns the mining emission rate */ static calculateAsteroidMiningEmissionRate(fleetStats: ShipStats, mineItem: MineItemAccount, resource: ResourceAccount, penalty?: number): number; /** * Calculate the time it would take to mine the resourceAmount with raw numbers * @param fleetStats - the fleet's stats * @param resourceHardnessInput - the resource hardness of the mine item * @param systemRichnessInput - the system richness associated with the mine item * @param resourceAmount - the amount of resource * @param penalty - the percentage by which to reduce the asteroid mining rate (e.g. 0.5 to represent 50%) * @returns the time it would take to mine the resourceAmount */ static calculateAsteroidMiningResourceExtractionDurationBareBones(fleetStats: ShipStats, resourceHardnessInput: number, systemRichnessInput: number, resourceAmount: number, penalty?: number): number; /** * Calculate the time it would take to mine the resourceAmount * @param fleetStats - the fleet's stats * @param mineItem - the mine item * @param resource - the resource associated with the mine item * @param resourceAmount - the amount of resource * @returns the time it would take to mine the resourceAmount */ static calculateAsteroidMiningResourceExtractionDuration(fleetStats: ShipStats, mineItem: MineItemAccount, resource: ResourceAccount, resourceAmount: number): number; /** * Calculate the the amount of resource to extract with raw numbers * @param fleetStats - the fleet's stats * @param resourceHardnessInput - the resource hardness of the mine item * @param systemRichnessInput - the system richness associated with the mine item * @param duration - the time elapsed in seconds * @param maxResourceAmount - the max amount of resource * @param penalty - the percentage by which to reduce the asteroid mining rate (e.g. 0.5 to represent 50%) * @returns the amount of resource to extract */ static calculateAsteroidMiningResourceToExtractBareBones(fleetStats: ShipStats, resourceHardnessInput: number, systemRichnessInput: number, duration: number, maxResourceAmount: number, penalty?: number): number; /** * Calculate the the amount of resource to extract * @param fleetStats - the fleet's stats * @param mineItem - the mine item * @param resource - the resource associated with the mine item * @param duration - the time elapsed in seconds * @param maxResourceAmount - the max amount of resource * @param penalty - the percentage by which to reduce the asteroid mining rate (e.g. 0.5 to represent 50%) * @returns the amount of resource to extract */ static calculateAsteroidMiningResourceToExtract(fleetStats: ShipStats, mineItem: MineItemAccount, resource: ResourceAccount, duration: number, maxResourceAmount: number, penalty?: number): number; /** * Check if the fleet's crew is normalized * @returns boolean representing whether or not the crew is normalized */ normalizedCrew(): boolean; /** * Create a new `Fleet` * @param program - SAGE program * @param cargoProgram - cargo program * @param key - the key authorized to run this instruction * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param ship - the first ship to add to the fleet * @param starbasePlayer - the Starbase player * @param starbase - the Starbase * @param gameId - the SAGE game id * @param gameState - the game state * @param cargoStatsDefinition - the cargo stats definition * @param input - the instruction input params * @returns the fleet address, the addresses of fleet cargo pods & InstructionReturn */ static createFleet(program: SageIDLProgram, cargoProgram: CargoIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, ship: PublicKey, starbasePlayer: PublicKey, starbase: PublicKey, gameId: PublicKey, gameState: PublicKey, cargoStatsDefinition: PublicKey, input: CustomCreateFleetInput): { fleetKey: [PublicKey, number]; cargoHoldKey: [PublicKey, number]; fuelTankKey: [PublicKey, number]; ammoBankKey: [PublicKey, number]; instructions: InstructionReturn; }; /** * Create a new `Fleet` (admin only) * * NOTE: This method returns multiple instructions that MUST be executed in order: * 1. Initialize 3 cargo pods (cargo_hold, fuel_tank, ammo_bank) * 2. Initialize Fleet account * 3. Initialize FleetShips account and add ships * 4. (Optional) Transfer cargo pod authority to fleet PDA * * Due to Solana restrictions, PDAs cannot be initialized with other PDAs in the same * instruction if they reference each other in their seeds. * * @param program - SAGE program * @param cargoProgram - cargo program * @param key - the key authorized to run this instruction (game admin) * @param playerProfile - the game's admin profile * @param profileFaction - the profile's faction * @param ship - the first ship to add to the fleet * @param gameId - the SAGE game id * @param gameState - the game state * @param cargoStatsDefinition - the cargo stats definition * @param input - the instruction input params * @param transferAuthority - whether to transfer cargo authority to fleet PDA (default: true) * @returns the fleet address, the addresses of fleet cargo pods & InstructionReturn */ static adminCreateFleet(program: SageIDLProgram, cargoProgram: CargoIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, ship: PublicKey, gameId: PublicKey, gameState: PublicKey, cargoStatsDefinition: PublicKey, input: AdminCreateFleetInput, transferAuthority?: boolean): { fleetKey: [PublicKey, number]; cargoHoldKey: [PublicKey, number]; fuelTankKey: [PublicKey, number]; ammoBankKey: [PublicKey, number]; instructions: InstructionReturn; }; /** * Remove a `Fleet` (admin only) * This instruction closes the fleet and all associated accounts * @param program - SAGE program * @param cargoProgram - cargo program * @param key - the key authorized to run this instruction (game admin) * @param playerProfile - the game's admin profile * @param profileFaction - the profile's faction * @param fleet - the fleet to remove * @param cargoHold - the fleet's cargo hold * @param fuelTank - the fleet's fuel tank * @param ammoBank - the fleet's ammo bank * @param gameId - the SAGE game id * @param gameState - the game state * @param cargoStatsDefinition - the cargo stats definition * @param input - the instruction input params * @param tokenAccountsToClose - Optional list of token accounts to close. Each entry requires { tokenAccount, cargoType, mint } * @returns InstructionReturn */ static adminRemoveFleet(program: SageIDLProgram, cargoProgram: CargoIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, cargoHold: PublicKey, fuelTank: PublicKey, ammoBank: PublicKey, gameId: PublicKey, gameState: PublicKey, cargoStatsDefinition: PublicKey, input: AdminRemoveFleetInput, tokenAccountsToClose?: { tokenAccount: PublicKey; cargoType: PublicKey; mint: PublicKey; }[]): { instructions: InstructionReturn; }; /** * Add a `Ship` to a `Fleet` * @param program - SAGE program * @param key - the key authorized to run this instruction * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param ship - the ship being added to the fleet * @param starbasePlayer - the Starbase player * @param starbase - the Starbase where the fleet is docked * @param gameId - the SAGE game id * @param gameState - the game state * @param input - the instruction input params * @returns InstructionReturn */ static addShipToFleet(program: SageIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, ship: PublicKey, starbasePlayer: PublicKey, starbase: PublicKey, gameId: PublicKey, gameState: PublicKey, input: AddShipToFleetInput): InstructionReturn; /** * Update a `Ship` in a `Fleet` * @param program - SAGE program * @param fleet - the fleet * @param oldShip - the old ship being updated * @param next - the value of the next field on the old ship account * @param gameId - the SAGE game id * @param gameState - the game state * @param input - the instruction input params * @returns InstructionReturn */ static updateShipInFleet(program: SageIDLProgram, fleet: PublicKey, oldShip: PublicKey, next: PublicKey, gameId: PublicKey, gameState: PublicKey, input: UpdateShipInFleetInput): InstructionReturn; /** * Disbands a `Fleet` * @param program - SAGE program * @param cargoProgram - cargo program * @param key - the key authorized to run this instruction * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param starbasePlayer - the Starbase player * @param starbase - the Starbase where the fleet is docked * @param gameId - the SAGE game id * @param gameState - the game state * @param input - the instruction input params * @returns InstructionReturn */ static disbandFleet(program: SageIDLProgram, cargoProgram: CargoIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fleet: Fleet, starbasePlayer: PublicKey, starbase: PublicKey, gameId: PublicKey, gameState: PublicKey, input: DisbandFleetInput): { disbandedFleetKey: [PublicKey, number]; instructions: InstructionReturn; }; /** * Disbands a `Fleet` without requiring a fleet account * @param program - SAGE program * @param cargoProgram - cargo program * @param key - the key authorized to run this instruction * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param fleetLabel - the fleet's label (name) * @param ammoBank - the fleet's ammo bank * @param cargoHold - the fleet's cargo hold * @param fuelTank - the fleet's fuel tank * @param starbasePlayer - the Starbase player * @param starbase - the Starbase where the fleet is docked * @param gameId - the SAGE game id * @param gameState - the game state * @param input - the instruction input params * @returns InstructionReturn */ static disbandFleetBareBones(program: SageIDLProgram, cargoProgram: CargoIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, fleetLabel: number[], ammoBank: PublicKey, cargoHold: PublicKey, fuelTank: PublicKey, starbasePlayer: PublicKey, starbase: PublicKey, gameId: PublicKey, gameState: PublicKey, input: DisbandFleetInput): { disbandedFleetKey: [PublicKey, number]; instructions: InstructionReturn; }; /** * Forcefully disbands a `Fleet` * This is only necessary after a `Ship` that is part of the fleet is invalidated * @param program - SAGE program * @param cargoProgram - cargo program * @param fleet - the fleet * @param starbasePlayer - the Starbase player * @param starbase - the Starbase * @param ship - the ship * @param gameId - the SAGE game id * @param gameState - the game state * @param input - the instruction input params * @param resource - if the fleet is mining, this is the resource being mined * @param planet - if the fleet is mining, this is the location being mined * @returns the disbanded fleet address & InstructionReturn */ static forceDisbandFleet(program: SageIDLProgram, cargoProgram: CargoIDLProgram, fleet: Fleet, starbasePlayer: PublicKey, starbase: PublicKey, ship: PublicKey, gameId: PublicKey, gameState: PublicKey, input: ForceDisbandFleetInput, resource?: PublicKey, planet?: PublicKey): { disbandedFleetKey: [PublicKey, number]; instructions: InstructionReturn; }; /** * Forcefully disbands a `Fleet` without requiring a fleet account * This is only necessary after a `Ship` that is part of the fleet is invalidated * @param program - SAGE program * @param cargoProgram - cargo program * @param fleet - the fleet * @param fleetOwnerProfile - the player profile that owns the fleet * @param fleetLabel - the fleet's label (name) * @param ammoBank - the fleet's ammo bank * @param cargoHold - the fleet's cargo hold * @param fuelTank - the fleet's fuel tank * @param starbasePlayer - the Starbase player * @param starbase - the Starbase * @param ship - the ship * @param gameId - the SAGE game id * @param gameState - the game state * @param input - the instruction input params * @param resource - if the fleet is mining, this is the resource being mined * @param planet - if the fleet is mining, this is the location being mined * @returns the disbanded fleet address & InstructionReturn */ static forceDisbandFleetBareBones(program: SageIDLProgram, cargoProgram: CargoIDLProgram, fleet: PublicKey, fleetOwnerProfile: PublicKey, fleetLabel: number[], ammoBank: PublicKey, cargoHold: PublicKey, fuelTank: PublicKey, starbasePlayer: PublicKey, starbase: PublicKey, ship: PublicKey, gameId: PublicKey, gameState: PublicKey, input: ForceDisbandFleetInput, resource?: PublicKey, planet?: PublicKey): { disbandedFleetKey: [PublicKey, number]; instructions: InstructionReturn; }; /** * Deposits cargo to a `Fleet` from a `Starbase` * @param program - SAGE program * @param cargoProgram - cargo program * @param key - the key authorized to run this instruction * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fundsTo - recipient of the rent refund * @param starbase - the Starbase * @param starbasePlayer - the Starbase player * @param fleet - the fleet * @param cargoPodFrom - the source cargo pod, owned by `starbasePlayer` * @param cargoPodTo - the destination cargo pod, owned by fleet * @param cargoType - the cargo type * @param cargoStatsDefinition - the cargo stats definition * @param tokenFrom - the source token account, owned by `cargoPodFrom` * @param tokenTo - the destination token account, owned by `cargoPodTo` * @param tokenMint - the token mint * @param gameId - the SAGE game id * @param gameState - the game state * @param input - the instruction input params * @returns InstructionReturn */ static depositCargoToFleet(program: SageIDLProgram, cargoProgram: CargoIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fundsTo: PublicKey | 'funder', starbase: PublicKey, starbasePlayer: PublicKey, fleet: PublicKey, cargoPodFrom: PublicKey, cargoPodTo: PublicKey, cargoType: PublicKey, cargoStatsDefinition: PublicKey, tokenFrom: PublicKey, tokenTo: PublicKey, tokenMint: PublicKey, gameId: PublicKey, gameState: PublicKey, input: DepositCargoToFleetInput): InstructionReturn; /** * Deposits cargo to a `Fleet` from any token account (admin only) * @param program - SAGE program * @param cargoProgram - cargo program * @param key - the key authorized to run this instruction (game admin) * @param playerProfile - the game's admin profile * @param profileFaction - the profile's faction * @param fleet - the fleet * @param cargoPodTo - the destination cargo pod, owned by fleet * @param cargoType - the cargo type * @param cargoStatsDefinition - the cargo stats definition * @param tokenFrom - the source token account * @param tokenTo - the destination token account, owned by `cargoPodTo` * @param tokenMint - the token mint * @param gameId - the SAGE game id * @param gameState - the game state * @param input - the instruction input params * @returns InstructionReturn */ static adminDepositCargoToFleet(program: SageIDLProgram, cargoProgram: CargoIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, cargoPodTo: PublicKey, cargoType: PublicKey, cargoStatsDefinition: PublicKey, tokenFrom: PublicKey, tokenTo: PublicKey, tokenMint: PublicKey, gameId: PublicKey, gameState: PublicKey, input: AdminDepositCargoToFleetInput): InstructionReturn; /** * Deposits cargo to a `Starbase` from any token account (admin only) * @param program - SAGE program * @param cargoProgram - cargo program * @param key - the key authorized to run this instruction (game admin) * @param playerProfile - the game's admin profile * @param starbase - the Starbase * @param starbasePlayer - the Starbase player * @param cargoPod - the destination cargo pod, owned by `starbasePlayer` * @param cargoType - the cargo type * @param cargoStatsDefinition - the cargo stats definition * @param tokenFrom - the source token account * @param tokenTo - the destination token account, owned by `cargoPod` * @param gameId - the SAGE game id * @param input - the instruction input params * @returns InstructionReturn */ static adminDepositCargoToStarbase(program: SageIDLProgram, cargoProgram: CargoIDLProgram, key: AsyncSigner, playerProfile: PublicKey, starbase: PublicKey, starbasePlayer: PublicKey, cargoPod: PublicKey, cargoType: PublicKey, cargoStatsDefinition: PublicKey, tokenFrom: PublicKey, tokenTo: PublicKey, gameId: PublicKey, input: AdminDepositCargoToStarbaseInput): InstructionReturn; /** * Transfers cargo within a `Fleet` * @param program - SAGE program * @param cargoProgram - cargo program * @param key - the key authorized to run this instruction * @param fundsTo - recipient of the rent refund * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param cargoPodFrom - the source cargo pod, owned by fleet * @param cargoPodTo - the destination cargo pod, owned by fleet * @param cargoType - the cargo type * @param cargoStatsDefinition - the cargo stats definition * @param tokenFrom - the source token account, owned by `cargoPodFrom` * @param tokenTo - the destination token account, owned by `cargoPodTo` * @param tokenMint - the token mint * @param gameId - the SAGE game id * @param gameState - the game state * @param input - the instruction input params * @param starbase - the Starbase * @returns InstructionReturn */ static transferCargoWithinFleet(program: SageIDLProgram, cargoProgram: CargoIDLProgram, key: AsyncSigner, fundsTo: PublicKey | 'funder', playerProfile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, cargoPodFrom: PublicKey, cargoPodTo: PublicKey, cargoType: PublicKey, cargoStatsDefinition: PublicKey, tokenFrom: PublicKey, tokenTo: PublicKey, tokenMint: PublicKey, gameId: PublicKey, gameState: PublicKey, input: TransferCargoWithinFleetInput, starbase?: PublicKey): InstructionReturn; /** * Withdraws cargo from a `Fleet` to a `Starbase` * @param program - SAGE program * @param cargoProgram - cargo program * @param key - the key authorized to run this instruction * @param fundsTo - recipient of the rent refund * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param starbase - the Starbase * @param starbasePlayer - the Starbase player * @param fleet - the fleet * @param cargoPodFrom - the source cargo pod, owned by the fleet * @param cargoPodTo - the destination cargo pod, owned by `starbasePlayer` * @param cargoType - the cargo type * @param cargoStatsDefinition - the cargo stats definition * @param tokenFrom - the source token account, owned by `cargoPodFrom` * @param tokenTo - the destination token account, owned by `cargoPodTo` * @param tokenMint - the token mint * @param gameId - the SAGE game id * @param gameState - the game state * @param input - the instruction input params * @returns InstructionReturn */ static withdrawCargoFromFleet(program: SageIDLProgram, cargoProgram: CargoIDLProgram, key: AsyncSigner, fundsTo: PublicKey | 'funder', playerProfile: PublicKey, profileFaction: PublicKey, starbase: PublicKey, starbasePlayer: PublicKey, fleet: PublicKey, cargoPodFrom: PublicKey, cargoPodTo: PublicKey, cargoType: PublicKey, cargoStatsDefinition: PublicKey, tokenFrom: PublicKey, tokenTo: PublicKey, tokenMint: PublicKey, gameId: PublicKey, gameState: PublicKey, input: WithdrawCargoFromFleetInput): InstructionReturn; /** * Closes a token account that is owned by the Fleet cargo pod (burns any token balance) * @param program - SAGE program * @param cargoProgram - cargo program * @param key - the key authorized to run this instruction * @param fundsTo - recipient of the rent refund * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param cargoPod - the cargo pod, owned by the fleet * @param cargoType - the cargo type * @param cargoStatsDefinition - the cargo stats definition * @param token - the token account, owned by `cargoPod` * @param tokenMint - the token mint * @param gameId - the SAGE game id * @param gameState - the game state * @param input - the instruction input params * @returns InstructionReturn */ static closeFleetCargoPodTokenAccount(program: SageIDLProgram, cargoProgram: CargoIDLProgram, key: AsyncSigner, fundsTo: PublicKey | 'funder', playerProfile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, cargoPod: PublicKey, cargoType: PublicKey, cargoStatsDefinition: PublicKey, token: PublicKey, tokenMint: PublicKey, gameId: PublicKey, gameState: PublicKey, input: CloseFleetCargoPodTokenAccountInput): InstructionReturn; /** * Transition a fleet from the Idle state to the Docked state * @param program - SAGE program * @param key - the key authorized to run this instruction * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param starbase - the Starbase to dock into * @param starbasePlayer - the Starbase player * @param gameId - the SAGE game id * @param gameState - the game state * @param input - the instruction input params * @returns InstructionReturn */ static idleToLoadingBay(program: SageIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, starbase: PublicKey, starbasePlayer: PublicKey, gameId: PublicKey, gameState: PublicKey, input: LoadingBayToIdleInput): InstructionReturn; /** * Transition a `Fleet`s state from `Idle` to `Respawn` * @param program - SAGE program * @param key - the key authorized to run this instruction * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param atlasTokenFrom - ATLAS token account owned by player * @param atlasTokenTo - the vault ATLAS token account (as defined in GameState) * @param gameState - the game state * @param gameId - the SAGE game id * @param input - the instruction input params * @returns InstructionReturn */ static idleToRespawn(program: SageIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, atlasTokenFrom: PublicKey, atlasTokenTo: PublicKey, gameState: PublicKey, gameId: PublicKey, input: IdleToRespawnInput): InstructionReturn; /** * Transition a fleet from the docked state to the idle state * @param program - SAGE program * @param key - the key authorized to run this instruction * @param profile - the player's profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param starbase - the Starbase that the fleet is currently docked at * @param starbasePlayer - the Starbase player * @param gameId - the SAGE game id * @param gameState - the game state * @param input - the instruction input params * @returns InstructionReturn */ static loadingBayToIdle(program: SageIDLProgram, key: AsyncSigner, profile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, starbase: PublicKey, starbasePlayer: PublicKey, gameId: PublicKey, gameState: PublicKey, input: LoadingBayToIdleInput): InstructionReturn; /** * Warp movement handler function * @param program - SAGE program * @param pointsProgram - points program * @param profile - the player's profile * @param fleet - the fleet * @param pilotXpUserAccount - the user account for Pilot XP * @param pilotXpCategory - the Pilot XP Points Category Account * @param pilotXpModifier - the Pilot XP modifier * @param councilRankXpUserAccount - the user account for Council Rank XP * @param councilRankXpCategory - the Council Rank XP Points Category Account * @param councilRankXpModifier - the Council Rank XP modifier * @param game - the SAGE game id * @returns InstructionReturn */ static moveWarpHandler(program: SageIDLProgram, pointsProgram: PointsIDLProgram, profile: PublicKey, fleet: PublicKey, pilotXpUserAccount: PublicKey, pilotXpCategory: PublicKey, pilotXpModifier: PublicKey, councilRankXpUserAccount: PublicKey, councilRankXpCategory: PublicKey, councilRankXpModifier: PublicKey, game: PublicKey): InstructionReturn; /** * Subwarp movement handler function * @param program - SAGE program * @param cargoProgram - cargo program * @param pointsProgram - points program * @param profile - the player's profile with the required permissions for the instruction * @param fleet - the fleet * @param fuelTank - the fuel tank cargo pod * @param fuelCargoType - the fuel cargo type * @param cargoStatsDefinition - the cargo stats definition * @param fuelTokenAccount - the fuel token account * @param fuelTokenMint - the fuel token mint * @param pilotXpUserAccount - the user account for Pilot XP * @param pilotXpCategory - the Pilot XP Points Category Account * @param pilotXpModifier - the Pilot XP modifier * @param councilRankXpUserAccount - the user account for Council Rank XP * @param councilRankXpCategory - the Council Rank XP Points Category Account * @param councilRankXpModifier - the Council Rank XP modifier * @param gameId - the SAGE game id * @returns InstructionReturn */ static movementSubwarpHandler(program: SageIDLProgram, cargoProgram: CargoIDLProgram, pointsProgram: PointsIDLProgram, profile: PublicKey, fleet: PublicKey, fuelTank: PublicKey, fuelCargoType: PublicKey, cargoStatsDefinition: PublicKey, fuelTokenAccount: PublicKey, fuelTokenMint: PublicKey, pilotXpUserAccount: PublicKey, pilotXpCategory: PublicKey, pilotXpModifier: PublicKey, councilRankXpUserAccount: PublicKey, councilRankXpCategory: PublicKey, councilRankXpModifier: PublicKey, gameId: PublicKey): InstructionReturn; /** * 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 * @param program - SAGE program * @param fleet - the fleet * @param remainingAccounts - the remaining accounts (an array of `AccountMeta`) * @returns InstructionReturn */ static fleetStateHandler(program: SageIDLProgram, fleet: PublicKey, remainingAccounts?: AccountMeta[]): InstructionReturn; /** * Warp to coordinate * @param program - SAGE program * @param key - the key authorized to run this instruction * @param profile - the player's profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param fuelTank - the fleet's fuel tank cargo pod * @param cargoType - the cargo type * @param statsDefinition - the cargo stats definition * @param tokenFrom - the fuel source token account, owned by `fuelTank` * @param tokenMint - the fuel token mint * @param gameState - the game state * @param gameId - the SAGE game id * @param cargoProgram - cargo program * @param input - the instruction input params * @returns InstructionReturn */ static warpToCoordinate(program: SageIDLProgram, key: AsyncSigner, profile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, fuelTank: PublicKey, cargoType: PublicKey, statsDefinition: PublicKey, tokenFrom: PublicKey, tokenMint: PublicKey, gameState: PublicKey, gameId: PublicKey, cargoProgram: CargoIDLProgram, input: WarpToCoordinateInput): InstructionReturn; /** * Warp to new `Sector` using the warp lane * @param program - SAGE program * @param key - the key authorized to run this instruction * @param profile - the player's profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param fromStarbase - the Starbase that the fleet is moving from * @param toStarbase - the Starbase that the fleet is moving to * @param fromSector - the sector that fleet is moving from * @param toSector - the sector that the fleet is moving to * @param fuelTank - the fleet's fuel tank cargo pod * @param cargoType - the cargo type * @param statsDefinition - the cargo stats definition * @param fuelTokenFrom - the source token account for fuel * @param fuelMint - the fuel token mint * @param feeTokenFrom - the source token account for the fee * @param feeTokenTo - the destination token account for the fee * @param feeMint - the fee token mint * @param gameState - the game state * @param gameId - the SAGE game id * @param cargoProgram - cargo program * @param input - the instruction input params * @returns InstructionReturn */ static warpLane(program: SageIDLProgram, key: AsyncSigner, profile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, fromStarbase: PublicKey, toStarbase: PublicKey, fromSector: PublicKey, toSector: PublicKey, fuelTank: PublicKey, cargoType: PublicKey, statsDefinition: PublicKey, fuelTokenFrom: PublicKey, fuelMint: PublicKey, feeTokenFrom: PublicKey, feeTokenTo: PublicKey, feeMint: PublicKey, gameState: PublicKey, gameId: PublicKey, cargoProgram: CargoIDLProgram, input: WarpLaneInput): InstructionReturn; /** * Start subwarp movement * @param program - SAGE program * @param key - the key authorized to run this instruction * @param profile - the player's profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param gameId - the SAGE game id * @param gameState - the game state * @param input - the instruction input params * @returns InstructionReturn */ static startSubwarp(program: SageIDLProgram, key: AsyncSigner, profile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, gameId: PublicKey, gameState: PublicKey, input: StartSubwarpInput): InstructionReturn; /** * Get remaining accounts for Subwarp movement * @param program - SAGE program * @param cargoProgram - cargo program * @param pointsProgram - points program * @param profile - the player's profile with the required permissions for the instruction * @param fuelTank - the fuel tank cargo pod * @param fuelCargoType - the fuel cargo type * @param cargoStatsDefinition - the cargo stats definition * @param fuelTokenAccount - the fuel token account * @param fuelTokenMint - the fuel token mint * @param pilotXpUserAccount - the user account for Pilot XP * @param pilotXpCategory - the Pilot XP Points Category Account * @param pilotXpModifier - the Pilot XP modifier * @param councilRankXpUserAccount - the user account for Council Rank XP * @param councilRankXpCategory - the Council Rank XP Points Category Account * @param councilRankXpModifier - the Council Rank XP modifier * @param gameId - the SAGE game id * @returns array of AccountMeta */ static getSubwarpRemainingAccounts: (program: SageIDLProgram, cargoProgram: CargoIDLProgram, pointsProgram: PointsIDLProgram, profile: PublicKey, fuelTank: PublicKey, fuelCargoType: PublicKey, cargoStatsDefinition: PublicKey, fuelTokenAccount: PublicKey, fuelTokenMint: PublicKey, pilotXpUserAccount: PublicKey, pilotXpCategory: PublicKey, pilotXpModifier: PublicKey, councilRankXpUserAccount: PublicKey, councilRankXpCategory: PublicKey, councilRankXpModifier: PublicKey, gameId: PublicKey) => AccountMeta[]; /** * Stop an Subwarp movement in progress * @param program - SAGE program * @param cargoProgram - cargo program * @param pointsProgram - points program * @param key - the key authorized to run this instruction * @param profile - the player's profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param fuelTank - the fuel tank cargo pod * @param fuelCargoType - the fuel cargo type * @param cargoStatsDefinition - the cargo stats definition * @param fuelTokenAccount - the fuel token account * @param fuelTokenMint - the fuel token mint * @param pilotXpUserAccount - the user account for Pilot XP * @param pilotXpCategory - the Pilot XP Points Category Account * @param pilotXpModifier - the Pilot XP modifier * @param councilRankXpUserAccount - the user account for Council Rank XP * @param councilRankXpCategory - the Council Rank XP Points Category Account * @param councilRankXpModifier - the Council Rank XP modifier * @param gameId - the SAGE game id * @param gameState - the game state * @param input - the instruction input params * @returns InstructionReturn */ static stopSubwarp(program: SageIDLProgram, cargoProgram: CargoIDLProgram, pointsProgram: PointsIDLProgram, key: AsyncSigner, profile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, fuelTank: PublicKey, fuelCargoType: PublicKey, cargoStatsDefinition: PublicKey, fuelTokenAccount: PublicKey, fuelTokenMint: PublicKey, pilotXpUserAccount: PublicKey, pilotXpCategory: PublicKey, pilotXpModifier: PublicKey, councilRankXpUserAccount: PublicKey, councilRankXpCategory: PublicKey, councilRankXpModifier: PublicKey, gameId: PublicKey, gameState: PublicKey, input: StopSubwarpInput): InstructionReturn; /** * Start mining an asteroid * @param program - SAGE program * @param key - the key authorized to run this instruction * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param starbase - the Starbase * @param starbasePlayer - the Starbase player * @param mineItem - the mine item * @param resource - the resource * @param planet - the planet (Planet Type has to be asteroid) * @param gameState - the game state * @param gameId - the SAGE game id * @param fleetFuelTokenAccount - the fleet's fuel token account * @param input - the instruction input params * @returns InstructionReturn */ static startMiningAsteroid(program: SageIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, starbase: PublicKey, starbasePlayer: PublicKey, mineItem: PublicKey, resource: PublicKey, planet: PublicKey, gameState: PublicKey, gameId: PublicKey, fleetFuelTokenAccount: PublicKey, input: StartMiningAsteroidInput): InstructionReturn; /** * Generic asteroid mining handler * @param program - SAGE program * @param cargoProgram - cargo program * @param fleet - the fleet * @param starbase - the Starbase * @param mineItem - the mine item * @param resource - the resource * @param planet - the planet * @param cargoHold - the fleet cargo hold cargo pod * @param ammoBank - the fleet ammo bank cargo pod * @param foodCargoType - the food cargo type * @param ammoCargoType - the ammo cargo type * @param resourceCargoType - the cargo type for the resource being mined * @param cargoStatsDefinition - the cargo stats definition * @param gameState - the game state * @param gameId - the SAGE game id * @param foodTokenFrom - the source token account for food * @param ammoTokenFrom - the source token account for ammo * @param resourceTokenFrom - the source token account for the resource * @param resourceTokenTo - the destination token account for the resource * @param foodMint - the food token mint * @param ammoMint - the ammo token mint * @returns InstructionReturn */ static asteroidMiningHandler(program: SageIDLProgram, cargoProgram: CargoIDLProgram, fleet: PublicKey, starbase: PublicKey, mineItem: PublicKey, resource: PublicKey, planet: PublicKey, cargoHold: PublicKey, ammoBank: PublicKey, foodCargoType: PublicKey, ammoCargoType: PublicKey, resourceCargoType: PublicKey, cargoStatsDefinition: PublicKey, gameState: PublicKey, gameId: PublicKey, foodTokenFrom: PublicKey, ammoTokenFrom: PublicKey, resourceTokenFrom: PublicKey, resourceTokenTo: PublicKey, foodMint: PublicKey, ammoMint: PublicKey): InstructionReturn; /** * Stop mining an asteroid * @param program - SAGE program * @param cargoProgram - cargo program * @param pointsProgram - points program * @param key - the key authorized to run this instruction * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param mineItem - the mine item * @param resource - the resource * @param planet - the planet * @param fuelTank - the fleet's fuel tank cargo pod * @param fuelCargoType - the fuel cargo type * @param cargoStatsDefinition - the cargo stats definition * @param miningXpUserAccount - the user account for Mining XP * @param miningXpCategory - the Mining XP Points Category Account * @param miningXpModifier - the Mining XP modifier * @param pilotXpUserAccount - the user account for Pilot XP * @param pilotXpCategory - the Pilot XP Points Category Account * @param pilotXpModifier - the Pilot XP modifier * @param councilRankXpUserAccount - the user account for Council Rank XP * @param councilRankXpCategory - the Council Rank XP Points Category Account * @param councilRankXpModifier - the Council Rank XP modifier * @param gameState - the game state * @param gameId - the SAGE game id * @param fuelTokenFrom - the source token account for fuel * @param fuelMint - the fuel token mint * @param input - the instruction input params * @returns InstructionReturn */ static stopMiningAsteroid(program: SageIDLProgram, cargoProgram: CargoIDLProgram, pointsProgram: PointsIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, mineItem: PublicKey, resource: PublicKey, planet: PublicKey, fuelTank: PublicKey, fuelCargoType: PublicKey, cargoStatsDefinition: PublicKey, miningXpUserAccount: PublicKey, miningXpCategory: PublicKey, miningXpModifier: PublicKey, pilotXpUserAccount: PublicKey, pilotXpCategory: PublicKey, pilotXpModifier: PublicKey, councilRankXpUserAccount: PublicKey, councilRankXpCategory: PublicKey, councilRankXpModifier: PublicKey, gameState: PublicKey, gameId: PublicKey, fuelTokenFrom: PublicKey, fuelMint: PublicKey, input: StopMiningAsteroidInput): InstructionReturn; /** * Get into the `Respawn` state from `MineAsteroid` * @param program - SAGE program * @param key - the key authorized to run this instruction * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param resource - the resource * @param planet - the planet * @param gameState - the game state * @param gameId - the SAGE game id * @param atlasTokenFrom - ATLAS token account owned by player * @param atlasTokenTo - the vault ATLAS token account (as defined in GameState) * @param input - the instruction input params * @returns InstructionReturn */ static mineAsteroidToRespawn(program: SageIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, resource: PublicKey, planet: PublicKey, gameState: PublicKey, gameId: PublicKey, atlasTokenFrom: PublicKey, atlasTokenTo: PublicKey, input: MineAsteroidToRespawnInput): InstructionReturn; /** * Drops cargo from a `Fleet` that is in the `Respawn` state * @param program - SAGE program * @param cargoProgram - cargo program * @param fleet - the fleet * @param cargoPod - the cargo pod * @param cargoType - the cargo type * @param cargoStatsDefinition - the cargo stats definition * @param gameId - the SAGE game id * @param tokenFrom - the source token account * @param tokenMint - the token mint * @returns InstructionReturn */ static forceDropFleetCargo(program: SageIDLProgram, cargoProgram: CargoIDLProgram, fleet: PublicKey, cargoPod: PublicKey, cargoType: PublicKey, cargoStatsDefinition: PublicKey, gameId: PublicKey, tokenFrom: PublicKey, tokenMint: PublicKey): InstructionReturn; /** * Transition a fleet from `Respawn` to docked * @param program - SAGE program * @param key - the key authorized to run this instruction * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param starbase - the Starbase * @param starbasePlayer - the Starbase player * @param cargoHold - the fleet cargo hold cargo pod * @param fuelTank - the fleet's fuel tank cargo pod * @param ammoBank - the fleet ammo bank cargo pod * @param gameId - the SAGE game id * @param gameState - the game state * @param input - the instruction input params * @returns InstructionReturn */ static respawnToLoadingBay(program: SageIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, starbase: PublicKey, starbasePlayer: PublicKey, cargoHold: PublicKey, fuelTank: PublicKey, ammoBank: PublicKey, gameId: PublicKey, gameState: PublicKey, input: MineAsteroidToRespawnInput): InstructionReturn; /** * Adds crew to a `Fleet` while docked at a `Starbase` * @param program - SAGE program * @param key - the key authorized to run this instruction * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param starbase - the Starbase * @param starbasePlayer - the Starbase player * @param gameId - the SAGE game id * @param input - the instruction input params * @returns InstructionReturn */ static loadFleetCrew(program: SageIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, starbase: PublicKey, starbasePlayer: PublicKey, gameId: PublicKey, input: LoadFleetCrewInput): InstructionReturn; /** * Removes crew from a `Fleet` while docked at a `Starbase` * @param program - SAGE program * @param key - the key authorized to run this instruction * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param starbase - the Starbase * @param starbasePlayer - the Starbase player * @param gameId - the SAGE game id * @param input - the instruction input params * @returns InstructionReturn */ static unloadFleetCrew(program: SageIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, starbase: PublicKey, starbasePlayer: PublicKey, gameId: PublicKey, input: UnloadFleetCrewInput): InstructionReturn; /** * Add a rental to a fleet. Sets the subprofile invalidator allowing a fleet * to be rented out with `changeRental` * @param program - SAGE program * @param key - the key authorized to run this instruction * @param invalidator - the key authorized to manage the fleet's rental * @param playerProfile - the profile that owns the fleet * @param fleet - the fleet * @param gameId - the SAGE game id * @param ownerKeyIndex - the index of the `key` in the `playerProfile` permissions * @returns InstructionReturn */ static addRental(program: SageIDLProgram, key: AsyncSigner, invalidator: AsyncSigner, playerProfile: PublicKey, fleet: PublicKey, gameId: PublicKey, ownerKeyIndex: number): InstructionReturn; /** * Change fleet rental - change the profile that is renting out a fleet * @param program - SAGE program * @param profileFactionProgram - Profile Faction program * @param invalidator - the key authorized to manage the fleet's rental * @param newSubProfile - the new profile that is renting the fleet * @param fleet - the fleet * @param gameId - the SAGE game id * @returns InstructionReturn */ static changeRental(program: SageIDLProgram, profileFactionProgram: ProfileFactionIDLProgram, invalidator: AsyncSigner, newSubProfile: PublicKey, fleet: PublicKey, gameId: PublicKey): InstructionReturn; /** * Invalidate the fleet rental. If `removeInvalidator` is false, the sub profile will be reset and the fleet is * available to be rented again immediately. If `removeInvalidator` is true, this resets rented crew, sub profile, * and the invalidator, returning the fleet to the owner's control * @param program - SAGE program * @param invalidator - the key authorized to manage the fleet's rental * @param fleet - the fleet * @param removeInvalidator - Boolean representing whether or not to remove the subprofile invalidator from the fleet * @param gameId - the SAGE game id; Only required if the fleet crew count is greater than number of rented crew * @param starbase - the starbase tied to the `starbasePlayer` (must be a central space station); Only required if the fleet crew count is greater than number of rented crew * @param starbasePlayer - the starbase player account belonging to the fleet sub-profile (renter); Only required if the fleet crew count is greater than number of rented crew * @returns InstructionReturn */ static invalidateRental(program: SageIDLProgram, invalidator: AsyncSigner, fleet: PublicKey, removeInvalidator: boolean, gameId?: PublicKey, starbase?: PublicKey, starbasePlayer?: PublicKey): InstructionReturn; static addCargoHoldAccounts(fleetCargoHold: PublicKey, seeds: number[], program: CargoIDLProgram): AccountMeta[]; static getLootPodSeeds(loot: PublicKey): number[][]; /** * Attack a fleet * @param program - SAGE program * @param cargoProgram - cargo program * @param pointsProgram - points program * @param key - the key authorized to run this instruction * @param profile - the player's profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param attackingFleet - the attacking fleet * @param defendingFleet - the defending fleet * @param attackingFleetAmmoBank - the attacking fleet's ammo bank * @param defendingFleetAmmoBank - the defending fleet's ammo bank * @param attackingFleetCargoHold - the attacking fleet's cargo hold * @param defendingFleetCargoHold - the defending fleet's cargo hold * @param attackingFleetAmmoToken - the attacking fleet's ammo token account; owned by `attackingFleetAmmoBank` * @param defendingFleetAmmoToken - the defending fleet's ammo token account; owned by `defendingFleetAmmoBank` * @param cargoType - the ammo cargo type * @param cargoStatsDefinition - the cargo stats definition * @param ammoMint - the ammo token mint * @param attackerCombatXpUserAccount - the attacker account for Combat XP * @param attackerCouncilRankXpUserAccount - the attacker account for Council Rank XP * @param defenderCombatXpUserAccount - the defender account for Combat XP * @param defenderCouncilRankXpUserAccount - the defender account for Council Rank XP * @param combatXpCategory - the Combat XP Points Category Account * @param combatXpModifier - the Combat XP modifier * @param councilRankXpCategory - the Council Rank XP Points Category Account * @param councilRankXpModifier - the Council Rank XP modifier * @param sector - the sector of the location of both fleets * @param gameId - the SAGE game id * @param input - the instruction input params * @returns InstructionReturn */ static attackFleet(program: SageIDLProgram, cargoProgram: CargoIDLProgram, pointsProgram: PointsIDLProgram, key: AsyncSigner, profile: PublicKey, profileFaction: PublicKey, attackingFleet: PublicKey, defendingFleet: PublicKey, attackingFleetAmmoBank: PublicKey, defendingFleetAmmoBank: PublicKey, attackingFleetCargoHold: PublicKey, defendingFleetCargoHold: PublicKey, attackingFleetAmmoToken: PublicKey, defendingFleetAmmoToken: PublicKey, cargoType: PublicKey, cargoStatsDefinition: PublicKey, ammoMint: PublicKey, attackerCombatXpUserAccount: PublicKey, attackerCouncilRankXpUserAccount: PublicKey, defenderCombatXpUserAccount: PublicKey, defenderCouncilRankXpUserAccount: PublicKey, combatXpCategory: PublicKey, combatXpModifier: PublicKey, councilRankXpCategory: PublicKey, councilRankXpModifier: PublicKey, sector: PublicKey, gameId: PublicKey, input: AttackFleetInput): { instructions: InstructionReturn; lootAccountKey: PublicKey | undefined; }; /** * Attack a starbase * @param program - SAGE program * @param cargoProgram - cargo program * @param pointsProgram - points program * @param key - the key authorized to run this instruction * @param profile - the player's profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param attackingFleet - the attacking fleet * @param starbase - the starbase being attacked * @param attackingFleetAmmoBank - the attacking fleet's ammo bank * @param attackingFleetAmmoToken - the attacking fleet's ammo token account; owned by `attackingFleetAmmoBank` * @param cargoType - the ammo cargo type * @param cargoStatsDefinition - the cargo stats definition * @param ammoMint - the ammo token mint * @param attackerCombatXpUserAccount - the attacker account for Combat XP * @param attackerCouncilRankXpUserAccount - the attacker account for Council Rank XP * @param combatXpCategory - the Combat XP Points Category Account * @param combatXpModifier - the Combat XP modifier * @param councilRankXpCategory - the Council Rank XP Points Category Account * @param councilRankXpModifier - the Council Rank XP modifier * @param sector - the sector of the starbase * @param gameId - the SAGE game id * @param gameState - the game state account * @param input - the instruction input params * @returns InstructionReturn */ static attackStarbase(program: SageIDLProgram, cargoProgram: CargoIDLProgram, pointsProgram: PointsIDLProgram, key: AsyncSigner, profile: PublicKey, profileFaction: PublicKey, attackingFleet: PublicKey, starbase: PublicKey, attackingFleetAmmoBank: PublicKey, attackingFleetAmmoToken: PublicKey, cargoType: PublicKey, cargoStatsDefinition: PublicKey, ammoMint: PublicKey, attackerCombatXpUserAccount: PublicKey, attackerCouncilRankXpUserAccount: PublicKey, combatXpCategory: PublicKey, combatXpModifier: PublicKey, councilRankXpCategory: PublicKey, councilRankXpModifier: PublicKey, sector: PublicKey, gameId: PublicKey, gameState: PublicKey, input: AttackStarbaseInput): InstructionReturn; /** * Repair a starbase using toolkits from the fleet's cargo hold * @param program - SAGE program * @param cargoProgram - cargo program * @param key - the key authorized to run this instruction * @param owningProfile - the profile that owns the fleet * @param owningProfileFaction - the faction that the profile belongs to * @param fleet - the fleet providing toolkits for repair * @param starbase - the starbase being repaired * @param sagePlayerProfile - the SAGE player profile * @param profileFaction - the profile's faction * @param cargoHold - the fleet's cargo hold containing toolkits * @param tokenFrom - the fleet's toolkit token account * @param cargoType - the toolkit cargo type * @param statsDefinition - the cargo stats definition * @param toolkitMint - the toolkit token mint * @param gameId - the SAGE game id * @param gameState - the game state account * @param input - the instruction input params * @returns InstructionReturn */ static repairStarbase(program: SageIDLProgram, cargoProgram: CargoIDLProgram, key: AsyncSigner, owningProfile: PublicKey, owningProfileFaction: PublicKey, fleet: PublicKey, starbase: PublicKey, sagePlayerProfile: PublicKey, profileFaction: PublicKey, cargoHold: PublicKey, tokenFrom: PublicKey, cargoType: PublicKey, statsDefinition: PublicKey, toolkitMint: PublicKey, gameId: PublicKey, gameState: PublicKey, input: RepairStarbaseInput): InstructionReturn; /** * Reloads ability power (AP) for a `Fleet` * @param program - SAGE program * @param key - the key authorized to run this instruction * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param gameId - the SAGE game id * @param input - the instruction input params * @returns InstructionReturn */ static reloadFleetAbilityPower(program: SageIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, gameId: PublicKey, input: ReloadFleetAbilityPowerInput): InstructionReturn; /** * Repairs a `Fleet` that is idle * @param program - SAGE program * @param cargoProgram - cargo program * @param key - the key authorized to run this instruction * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleetA - the fleet initiating the repairs * @param fleetB - the fleet being repaired * @param cargoHold - the fleet's cargo hold * @param cargoType - the repair kit cargo type * @param statsDefinition - the cargo stats definition * @param tokenFrom - the source token account, owned by `cargoHold` * @param tokenMint - the token mint for repair kits * @param gameId - the SAGE game id * @param input - the instruction input params * @returns InstructionReturn */ static repairIdleFleet(program: SageIDLProgram, cargoProgram: CargoIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fleetA: PublicKey, fleetB: PublicKey, cargoHold: PublicKey, cargoType: PublicKey, statsDefinition: PublicKey, tokenFrom: PublicKey, tokenMint: PublicKey, gameId: PublicKey, input: RepairIdleFleetInput): InstructionReturn; /** * Repairs a `Fleet` that is docked at a `Starbase` * @param program - SAGE program * @param cargoProgram - cargo program * @param key - the key authorized to run this instruction * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param starbase - the Starbase * @param starbasePlayer - the Starbase player * @param fleet - the fleet * @param cargoPodFrom - the source cargo pod, owned by `starbasePlayer` * @param cargoType - the repair kit cargo type * @param cargoStatsDefinition - the cargo stats definition * @param tokenFrom - the source token account, owned by `cargoPodFrom` * @param tokenMint - the repair kit token mint * @param feeTokenFrom - the source token account for the fee * @param feeTokenTo - the destination token account for the fee * @param feeMint - the fee token mint * @param gameId - the SAGE game id * @param gameState - the game state * @param input - the instruction input params * @returns InstructionReturn */ static repairDockedFleet(program: SageIDLProgram, cargoProgram: CargoIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, starbase: PublicKey, starbasePlayer: PublicKey, fleet: PublicKey, cargoPodFrom: PublicKey, cargoType: PublicKey, cargoStatsDefinition: PublicKey, tokenFrom: PublicKey, tokenMint: PublicKey, feeTokenFrom: PublicKey, feeTokenTo: PublicKey, feeMint: PublicKey, gameId: PublicKey, gameState: PublicKey, input: RepairDockedFleetInput): InstructionReturn; /** * Retrieve loot * @param program - SAGE program * @param cargoProgram - cargo program * @param key - the key authorized to run this instruction * @param profile - the player's profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param fleet - the fleet * @param loot - the loot account * @param cargoHold - the fleet's cargo hold * @param lootCargoPod - the loot account's cargo hold * @param cargoStatsDefinition - the cargo stats definition * @param sector - the sector of the location of both fleets * @param gameId - the SAGE game id * @param input - the instruction input params * @returns InstructionReturn */ static retrieveLoot(program: SageIDLProgram, cargoProgram: CargoIDLProgram, key: AsyncSigner, profile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, loot: PublicKey, cargoHold: PublicKey, lootCargoPod: PublicKey, cargoStatsDefinition: PublicKey, sector: PublicKey, gameId: PublicKey, input: RetrieveLootInput): InstructionReturn; static decodeData(account: KeyedAccountInfo, program: SageIDLProgram): DecodedAccountData; /** * Calculate combined fleet stats * @param currentFleetStats - previous fleet stats * @param shipStats - ship stats * @param shipAmount - the number of ships * @returns ShipStats */ static calculateCombinedStats(currentFleetStats: ShipStats, shipStats: ShipStats, shipAmount: number): ShipStats; /** * Multiply combined fleet stats * @param shipStats - ship stats * @param shipAmount - the number of ships * @returns ShipStats */ static multiplyShipStats(shipStats: ShipStats, shipAmount: number): ShipStats; /** * Calculate Combined Cargo Stats * @param fleetStats - current fleet CargoStats * @param shipStats - ship CargoStats * @returns CargoStats */ static calculateCombinedCargoStats(fleetStats: CargoStats, shipStats: CargoStats): CargoStats; /** * Multiply Cargo Stats * @param shipStats - ship CargoStats * @param shipAmount - the number of ships * @returns CargoStats */ static multiplyCargoStats(shipStats: CargoStats, shipAmount: number): CargoStats; /** * Calculate Combined Misc Stats * @param fleetStats - current fleet MiscStats * @param shipStats - ship MiscStats * @returns MiscStats */ static calculateCombinedMiscStats(fleetStats: MiscStats, shipStats: MiscStats): MiscStats; /** * Multiply Misc Stats * @param miscStats - ship MiscStats * @param shipAmount - the number of ships * @returns MiscStats */ static multiplyMiscStats(miscStats: MiscStats, shipAmount: number): MiscStats; /** * Calculate Combined Movement Stats * @param fleetStats - current fleet MovementStats * @param shipStats - ship MovementStats * @returns MovementStats */ static calculateCombinedMovementStats(fleetStats: MovementStats, shipStats: MovementStats): MovementStats; /** * Multiply Movement Stats * @param shipStats - ship MovementStats * @param shipAmount - the number of ships * @returns MovementStats */ static multiplyMovementStats(shipStats: MovementStats, shipAmount: number): MovementStats; /** * Calculate Combined Combat Stats * @param fleetStats - current fleet CombatStats * @param shipStats - ship CombatStats * @returns CombatStats */ static calculateCombinedCombatStats(fleetStats: CombatStats, shipStats: CombatStats): CombatStats; /** * Multiply Combat Stats * @param shipStats - ship CombatStats * @param shipAmount - the number of ships * @returns CombatStats */ static multiplyCombatStats(shipStats: CombatStats, shipAmount: number): CombatStats; } //# sourceMappingURL=fleet.d.ts.map