import { AccountMeta, KeyedAccountInfo, PublicKey } from '@solana/web3.js'; import { Account, AsyncSigner, DecodedAccountData, InstructionReturn } from '@staratlas/data-source'; import { AddShipEscrowInput, RemoveShipEscrowInput, SageIDL, SageIDLProgram, SagePlayerProfileAccount, UpdateShipEscrowInput } from './constants'; /** * Check if two `SagePlayerProfileAccount` instances are equal * @param sppData1 - first SagePlayerProfileAccount * @param sppData2 - second SagePlayerProfileAccount * @returns boolean */ export declare function sppDataEquals(sppData1: SagePlayerProfileAccount, sppData2: SagePlayerProfileAccount): boolean; export interface CrewTransferInput { merkleTree: PublicKey; creatorHash: number[] | PublicKey; root: number[] | PublicKey; dataHash: number[] | PublicKey; leafIndex: number; proof: PublicKey[]; } export interface AddCrewToGameInput { items: CrewTransferInput[]; } /** * Gets the transfer ix data from the CrewTransferInput object * @param input - CrewTransferInput * @returns Returns the data hash, leaf index, and proof count */ export declare function crewTransferIxData(input: CrewTransferInput): { dataHash: number[]; leafIndex: number; proofCount: number; }; /** * Gets the remaining accounts from the CrewTransferInput object * @param input - CrewTransferInput * @returns The list of remaining accounts */ export declare function crewTransferRemainingAccounts(input: CrewTransferInput): AccountMeta[]; export interface RemoveCrewFromGameInput extends AddCrewToGameInput { keyIndex: number; } export declare class SagePlayerProfile implements Account { private _data; private _key; static readonly ACCOUNT_NAME: NonNullable[number]['name']; static readonly MIN_DATA_SIZE: number; constructor(_data: SagePlayerProfileAccount, _key: PublicKey); get data(): Readonly; get key(): PublicKey; /** * Find the SagePlayerProfile account address * @param program - SAGE program * @param playerProfile - the player's profile * @param gameId - the SAGE game id * @returns The PDA and bump respectively */ static findAddress(program: SageIDLProgram, playerProfile: PublicKey, gameId: PublicKey): [PublicKey, number]; /** * Register the SAGE player profile * @param program - SAGE program * @param profile - the profile with the required permissions for the instruction * @param gameId - the SAGE game id * @param gameState - the game state account * @returns InstructionReturn */ static registerSagePlayerProfile(program: SageIDLProgram, profile: PublicKey, gameId: PublicKey, gameState: PublicKey): InstructionReturn; /** * Add a `Ship` to the game by transferring it to escrow PDA * @param program - SAGE program * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param sagePlayerProfile - the SAGE player profile * @param signerShipOrigin - the owner of the ship token account * @param originTokenAccount - the source ship token account, owned by `signerShipOrigin` * @param ship - the ship * @param shipEscrowTokenAccount - the ship escrow token account (destination), owned by `sagePlayerProfile` * @param starbasePlayer - the Starbase player * @param starbase - the Starbase * @param gameId - the SAGE game id * @param gameState - the game state account * @param input - the instruction input params * @returns InstructionReturn */ static addShipEscrow(program: SageIDLProgram, playerProfile: PublicKey, profileFaction: PublicKey, sagePlayerProfile: PublicKey, signerShipOrigin: AsyncSigner, originTokenAccount: PublicKey, ship: PublicKey, shipEscrowTokenAccount: PublicKey, starbasePlayer: PublicKey, starbase: PublicKey, gameId: PublicKey, gameState: PublicKey, input: AddShipEscrowInput): InstructionReturn; /** * Update `Ship` in escrow * @param program - SAGE program * @param oldShip - the ship that is being replaced * @param next - the value of the `next` field on `oldShip` * @param starbasePlayer - the Starbase player * @param starbase - the Starbase * @param gameId - the SAGE game id * @param gameState - the game state account * @param input - the instruction input params * @returns InstructionReturn */ static updateShipEscrow(program: SageIDLProgram, oldShip: PublicKey, next: PublicKey, starbasePlayer: PublicKey, starbase: PublicKey, gameId: PublicKey, gameState: PublicKey, input: UpdateShipEscrowInput): InstructionReturn; /** * Remove a ship from the game * @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 sagePlayerProfile - the SAGE player profile * @param destinationTokenAccount - the destination token account, any owner is valid * @param ship - the ship * @param shipEscrowTokenAccount - the ship escrow token account (source), owned by `sagePlayerProfile` * @param starbasePlayer - the Starbase player * @param starbase - the Starbase * @param gameId - the SAGE game id * @param gameState - the game state account * @param input - the instruction input params * @returns InstructionReturn */ static removeShipEscrow(program: SageIDLProgram, key: AsyncSigner, profile: PublicKey, profileFaction: PublicKey, sagePlayerProfile: PublicKey, destinationTokenAccount: PublicKey, ship: PublicKey, shipEscrowTokenAccount: PublicKey, starbasePlayer: PublicKey, starbase: PublicKey, gameId: PublicKey, gameState: PublicKey, input: RemoveShipEscrowInput): InstructionReturn; /** * Remove an invalid ship from the game * @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 sagePlayerProfile - the SAGE player profile * @param destinationTokenAccount - the destination token account, any owner is valid * @param ship - the ship * @param shipEscrowTokenAccount - the ship escrow token account (destination), owned by `sagePlayerProfile` * @param starbasePlayer - the Starbase player * @param starbase - the Starbase * @param gameId - the SAGE game id * @param gameState - the game state account * @param input - the instruction input params * @returns InstructionReturn */ static removeInvalidShipEscrow(program: SageIDLProgram, key: AsyncSigner, profile: PublicKey, profileFaction: PublicKey, sagePlayerProfile: PublicKey, destinationTokenAccount: PublicKey, ship: PublicKey, shipEscrowTokenAccount: PublicKey, starbasePlayer: PublicKey, starbase: PublicKey, gameId: PublicKey, gameState: PublicKey, input: RemoveShipEscrowInput): InstructionReturn; /** * Add a crew member to the game after the "pre add" period * @param program - SAGE program * @param playerProfile - the profile with the required permissions for the instruction * @param profileFaction - the profile's faction * @param crewOwner - the account that owns the crew cNFT * @param starbasePlayer - the Starbase player * @param starbase - the Starbase * @param crewProgramConfig - the crew program config account * @param gameId - the SAGE game id * @param input - the instruction input params * @param crewDelegate - the delegate as defined in the crew cNFT * @returns InstructionReturn */ static addCrewToGame(program: SageIDLProgram, playerProfile: PublicKey, profileFaction: PublicKey, crewOwner: AsyncSigner, starbasePlayer: PublicKey, starbase: PublicKey, crewProgramConfig: PublicKey, gameId: PublicKey, input: AddCrewToGameInput, crewDelegate?: PublicKey): InstructionReturn; /** * Remove a crew member from the game after the "pre add" period * @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 newCrewOwner - the account that should own the withdrawn crew cNFT * @param starbasePlayer - the Starbase player * @param starbase - the Starbase * @param crewProgramConfig - the crew program config account * @param gameId - the SAGE game id * @param input - the instruction input params * @param crewDelegate - the delegate as defined in the crew cNFT * @returns InstructionReturn */ static removeCrewFromGame(program: SageIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, newCrewOwner: PublicKey, starbasePlayer: PublicKey, starbase: PublicKey, crewProgramConfig: PublicKey, gameId: PublicKey, input: RemoveCrewFromGameInput, crewDelegate?: PublicKey): InstructionReturn; static decodeData(account: KeyedAccountInfo, program: SageIDLProgram): DecodedAccountData; } //# sourceMappingURL=sagePlayerProfile.d.ts.map