import { KeyedAccountInfo, PublicKey } from '@solana/web3.js'; import { CargoIDLProgram } from '@staratlas/cargo'; import { Account, AsyncSigner, DecodedAccountData, InstructionReturn } from '@staratlas/data-source'; import { CloseStarbaseCargoTokenAccountInput, SageIDL, SageIDLProgram, StarbaseCreateCargoPodInput, StarbaseDepositCargoToGameInput, StarbasePlayerAccount, StarbaseRemoveCargoPodInput, StarbaseWithdrawCargoFromGameInput, TransferCargoAtStarbaseInput, TransferCargoWithinFleetInput, WrappedShipEscrow } from './constants'; export type MintOrRedeemCertificateInput = TransferCargoWithinFleetInput; export declare const STAR_BASE_PLAYER_MIN_DATA_SIZE: number; /** * Check if two `StarbasePlayerAccount` instances are equal * @param data1 - first StarbasePlayerAccount * @param data2 - second StarbasePlayerAccount * @returns boolean */ export declare function starbasePlayerDataEquals(data1: StarbasePlayerAccount, data2: StarbasePlayerAccount): boolean; export declare class StarbasePlayer implements Account { private _data; private _key; private _wrappedShipEscrows; static readonly ACCOUNT_NAME: NonNullable[number]['name']; static readonly MIN_DATA_SIZE: number; constructor(_data: StarbasePlayerAccount, _key: PublicKey, _wrappedShipEscrows: WrappedShipEscrow[]); get data(): Readonly; get key(): Readonly; get wrappedShipEscrows(): Readonly; /** * Get the total crew at the StarbasePlayer * * The StarbasePlayer account now has two fields for total crew: * - oldTotalCrew: used before crew program features are enabled * - newTotalCrew: used after crew program features are enabled * * This function returns the correct field based on whether crew program features are enabled * @param crewFeaturesEnabled - whether crew program features are enabled * @returns total crew at the StarbasePlayer */ totalCrew(crewFeaturesEnabled?: boolean): Readonly; /** * Find the StarbasePlayer account address * @param program - SAGE program * @param starbase - the Starbase * @param sagePlayerProfile - the SAGE player profile * @param starbaseSeqId - the Starbase sequence id * @returns The PDA and bump respectively */ static findAddress(program: SageIDLProgram, starbase: PublicKey, sagePlayerProfile: PublicKey, starbaseSeqId: number): [PublicKey, number]; /** * Register a `StarbasePlayer` * @param program - SAGE program * @param profileFaction - the faction of profile associated with the `sagePlayerProfile` * @param sagePlayerProfile - the SAGE player profile * @param starbase - the Starbase * @param gameId - the SAGE game id * @param gameState - the game state * @param starbaseSeqId - the Starbase sequence id * @returns InstructionReturn */ static registerStarbasePlayer(program: SageIDLProgram, profileFaction: PublicKey, sagePlayerProfile: PublicKey, starbase: PublicKey, gameId: PublicKey, gameState: PublicKey, starbaseSeqId: number): InstructionReturn; /** * Sync the Starbase player account * @param program - SAGE program * @param starbasePlayer - the Starbase player * @param starbase - the Starbase tied to the `starbasePlayer` * @param gameId - the SAGE game id * @param gameState - the game state account * @returns InstructionReturn */ static syncStarbasePlayer(program: SageIDLProgram, starbasePlayer: PublicKey, starbase: PublicKey, gameId: PublicKey, gameState: PublicKey): InstructionReturn; /** * Creates a new cargo pod for the player at the `Starbase` * @param program - SAGE program * @param cargoProgram - cargo program * @param starbasePlayer - the Starbase player * @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 cargoStatsDefinition - the cargo stats definition * @param gameId - the SAGE game id * @param gameState - the game state account * @param input - the instruction input params * @returns InstructionReturn */ static createCargoPod(program: SageIDLProgram, cargoProgram: CargoIDLProgram, starbasePlayer: PublicKey, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, starbase: PublicKey, cargoStatsDefinition: PublicKey, gameId: PublicKey, gameState: PublicKey, input: StarbaseCreateCargoPodInput): InstructionReturn; /** * Deposits cargo to the game * @param program - SAGE program * @param cargoProgram - cargo program * @param starbasePlayer - the Starbase player * @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 cargoPod - the cargo pod * @param cargoType - the cargo type * @param cargoStatsDefinition - the cargo stats definition * @param tokenFrom - the source token account - owned by the `key` * @param tokenTo - the destination token account - owned by the `cargoPod` * @param gameId - the SAGE game id * @param gameState - the game state account * @param input - the instruction input params * @returns InstructionReturn */ static depositCargoToGame(program: SageIDLProgram, cargoProgram: CargoIDLProgram, starbasePlayer: PublicKey, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, starbase: PublicKey, cargoPod: PublicKey, cargoType: PublicKey, cargoStatsDefinition: PublicKey, tokenFrom: PublicKey, tokenTo: PublicKey, gameId: PublicKey, gameState: PublicKey, input: StarbaseDepositCargoToGameInput): InstructionReturn; /** * Withdraws cargo from the game * @param program - SAGE program * @param cargoProgram - cargo program * @param starbasePlayer - the Starbase player * @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 cargoPod - the cargo pod * @param cargoType - the cargo type * @param cargoStatsDefinition - the cargo stats definition * @param tokenFrom - the source token account - owned by the `cargoPod` * @param tokenTo - the destination token account - owned by the `key` * @param tokenMint - the token mint * @param gameId - the SAGE game id * @param gameState - the game state account * @param input - the instruction input params * @returns InstructionReturn */ static withdrawCargoFromGame(program: SageIDLProgram, cargoProgram: CargoIDLProgram, starbasePlayer: PublicKey, key: AsyncSigner, fundsTo: PublicKey | 'funder', playerProfile: PublicKey, profileFaction: PublicKey, starbase: PublicKey, cargoPod: PublicKey, cargoType: PublicKey, cargoStatsDefinition: PublicKey, tokenFrom: PublicKey, tokenTo: PublicKey, tokenMint: PublicKey, gameId: PublicKey, gameState: PublicKey, input: StarbaseWithdrawCargoFromGameInput): InstructionReturn; /** * Transfers cargo from one pod to another at the same `Starbase` owned by the same player * @param program - SAGE program * @param cargoProgram - cargo program * @param starbasePlayer - the Starbase player * @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 cargoPodFrom - the source cargo pod * @param cargoPodTo - the destination cargo pod * @param cargoType - the cargo type * @param cargoStatsDefinition - the cargo stats definition * @param tokenFrom - the source token account - owned by the `cargoPodFrom` * @param tokenTo - the destination token account - owned by the `cargoPodTo` * @param tokenMint - the token mint * @param gameId - the SAGE game id * @param gameState - the game state account * @param input - the instruction input params * @returns InstructionReturn */ static transferCargoAtStarbase(program: SageIDLProgram, cargoProgram: CargoIDLProgram, starbasePlayer: PublicKey, key: AsyncSigner, fundsTo: PublicKey | 'funder', playerProfile: PublicKey, profileFaction: PublicKey, starbase: PublicKey, cargoPodFrom: PublicKey, cargoPodTo: PublicKey, cargoType: PublicKey, cargoStatsDefinition: PublicKey, tokenFrom: PublicKey, tokenTo: PublicKey, tokenMint: PublicKey, gameId: PublicKey, gameState: PublicKey, input: TransferCargoAtStarbaseInput): InstructionReturn; /** * Closes a token account that is owned by the StarbasePlayer (burns any token balance) * @param program - SAGE program * @param cargoProgram - cargo program * @param starbasePlayer - the Starbase player * @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 cargoPod - the cargo pod - owned by `starbasePlayer` * @param cargoType - the cargo type * @param cargoStatsDefinition - the cargo stats definition * @param token - the token account - owned by the `cargoPod` * @param tokenMint - the token mint * @param gameId - the SAGE game id * @param gameState - the game state account * @param input - the instruction input params * @returns InstructionReturn */ static closeStarbaseCargoTokenAccount(program: SageIDLProgram, cargoProgram: CargoIDLProgram, starbasePlayer: PublicKey, key: AsyncSigner, fundsTo: PublicKey | 'funder', playerProfile: PublicKey, profileFaction: PublicKey, starbase: PublicKey, cargoPod: PublicKey, cargoType: PublicKey, cargoStatsDefinition: PublicKey, token: PublicKey, tokenMint: PublicKey, gameId: PublicKey, gameState: PublicKey, input: CloseStarbaseCargoTokenAccountInput): InstructionReturn; /** * Closes an empty cargo pod account owned by the player at a `Starbase` * @param program - SAGE program * @param cargoProgram - cargo program * @param starbasePlayer - the Starbase player * @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 cargoPod - the cargo pod * @param gameId - the SAGE game id * @param gameState - the game state account * @param input - the instruction input params * @returns InstructionReturn */ static removeCargoPod(program: SageIDLProgram, cargoProgram: CargoIDLProgram, starbasePlayer: PublicKey, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fundsTo: PublicKey | 'funder', starbase: PublicKey, cargoPod: PublicKey, gameId: PublicKey, gameState: PublicKey, input: StarbaseRemoveCargoPodInput): InstructionReturn; /** * Mints a certificate for a given cargo type * @param program - SAGE program * @param cargoProgram - cargo program * @param starbasePlayer - the Starbase player * @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 cargoPod - the cargo pod, owned by the `starbasePlayer` * @param cargoType - the cargo type in question & associated with the `cargoMint` * @param cargoStatsDefinition - the cargo stats definition * @param certificateTokenTo - the token account where certificates are minted to * @param certificateMint - the cargo certificate mint * @param cargoTokenFrom - the source token account for the cargo - owned by the `cargo_pod` * @param cargoTokenTo - the destination token account for the cargo - owned by the Starbase * @param cargoMint - the mint of the cargo in question * @param gameId - the SAGE game id * @param gameState - the game state account * @param input - the instruction input params * @returns InstructionReturn */ static mintCertificate(program: SageIDLProgram, cargoProgram: CargoIDLProgram, starbasePlayer: PublicKey, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, starbase: PublicKey, cargoPod: PublicKey, cargoType: PublicKey, cargoStatsDefinition: PublicKey, certificateTokenTo: PublicKey, certificateMint: PublicKey, cargoTokenFrom: PublicKey, cargoTokenTo: PublicKey, cargoMint: PublicKey, gameId: PublicKey, gameState: PublicKey, input: MintOrRedeemCertificateInput): InstructionReturn; /** * Redeems a certificate for a given cargo type * @param program - SAGE program * @param cargoProgram - cargo program * @param starbasePlayer - the Starbase player * @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 cargoPod - the cargo pod, owned by the `starbasePlayer` * @param cargoType - the cargo type in question & associated with the `cargoMint` * @param cargoStatsDefinition - the cargo stats definition * @param certificateTokenFrom - the source token account for the cargo certificate - owned by the `certificateOwnerAuthority` * @param certificateOwnerAuthority - the owner of the certificates being redeemed; should be either the starbase player or a signer * @param certificateMint - the cargo certificate mint * @param cargoTokenFrom - the source token account for the cargo - owned by the Starbase * @param cargoTokenTo - the destination token account for the cargo - owned by the `cargo_pod` * @param cargoMint - the mint of the cargo in question * @param gameId - the SAGE game id * @param gameState - the game state account * @param input - the instruction input params * @returns InstructionReturn */ static redeemCertificate(program: SageIDLProgram, cargoProgram: CargoIDLProgram, starbasePlayer: PublicKey, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fundsTo: PublicKey | 'funder', starbase: PublicKey, cargoPod: PublicKey, cargoType: PublicKey, cargoStatsDefinition: PublicKey, certificateTokenFrom: PublicKey, certificateOwnerAuthority: AsyncSigner | PublicKey, certificateMint: PublicKey, cargoTokenFrom: PublicKey, cargoTokenTo: PublicKey, cargoMint: PublicKey, gameId: PublicKey, gameState: PublicKey, input: MintOrRedeemCertificateInput): InstructionReturn; static decodeData(account: KeyedAccountInfo, program: SageIDLProgram): DecodedAccountData; } //# sourceMappingURL=starbasePlayer.d.ts.map