import { KeyedAccountInfo, PublicKey } from '@solana/web3.js'; import { BN } from '@staratlas/anchor'; import { CargoIDLProgram } from '@staratlas/cargo'; import { Account, AsyncSigner, DecodedAccountData, InstructionReturn } from '@staratlas/data-source'; import { PointsIDLProgram } from '@staratlas/points'; import { DeregisterSurveyDataUnitTrackerInput, DrainSurveyDataUnitsBankInput, RegisterSurveyDataUnitTrackerInput, SageIDL, SageIDLProgram, ScanForSurveyDataUnitsInput, SurveyDataUnitTrackerAccount } from './constants'; export interface RegisterSurveyDataUnitTrackerParams extends RegisterSurveyDataUnitTrackerInput { cssCoordinates: BN[][]; } export interface UpdateSurveyDataUnitTrackerParams extends Partial { keyIndex: number; } /** * Check if two `SurveyDataUnitTrackerAccount` instances are equal * @param data1 - first SurveyDataUnitTrackerAccount * @param data2 - second SurveyDataUnitTrackerAccount * @returns a boolean */ export declare function surveyDataUnitTrackerDataEquals(data1: SurveyDataUnitTrackerAccount, data2: SurveyDataUnitTrackerAccount): boolean; export declare class SurveyDataUnitTracker implements Account { private _data; private _key; static readonly ACCOUNT_NAME: NonNullable[number]['name']; static readonly MIN_DATA_SIZE: number; constructor(_data: SurveyDataUnitTrackerAccount, _key: PublicKey); get data(): Readonly; get key(): PublicKey; /** * Finds the address of a `SurveyDataUnitTracker` signer * @param program - the SAGE program * @param tracker - the survey data units tracker * @returns - The PDA and bump respectively */ static findSignerAddress(program: SageIDLProgram, tracker: PublicKey): [PublicKey, number]; /** * Finds the address of the SDU token account owned by the `SurveyDataUnitTracker` signer * @param trackerAccount - the survey data units tracker account * @returns - The associated token account address */ static findSignerTokenAccountAddress(trackerAccount: SurveyDataUnitTrackerAccount): PublicKey; /** * Fund a `SurveyDataUnitTracker` `SDU` bank * The bank token account must already exist * @param trackerAccount - the survey data units tracker account * @param tokenFromOwner - the owner of the source token account * @param tokenFrom - the source token account * @param amount - the amount of tokens * @returns InstructionReturn */ static fundSurveyDataUnitTrackerBank(trackerAccount: SurveyDataUnitTrackerAccount, tokenFromOwner: AsyncSigner, tokenFrom: PublicKey, amount: number): InstructionReturn; /** * Register a Survey Data Unit Tracker * Only use this if the empty surveyDataUnitTracker account has already been created on-chain * @param program - SAGE program * @param key - the key authorized to run this instruction * @param profile - the profile with the required permissions for the instruction * @param surveyDataUnitTracker - the new survey data unit tracker * @param sduMint - the mint for the survey data units * @param resourceMint - the mint for the resource that is consumed when scanning for survey data units * @param gameId - the SAGE game id * @param input - instruction input params * @returns InstructionReturn */ static registerSurveyDataUnitTracker(program: SageIDLProgram, key: AsyncSigner, profile: PublicKey, surveyDataUnitTracker: AsyncSigner, sduMint: PublicKey, resourceMint: PublicKey, gameId: PublicKey, input: RegisterSurveyDataUnitTrackerParams): InstructionReturn; /** * Update a Survey Data Unit Tracker * @param program - SAGE program * @param key - the key authorized to run this instruction * @param profile - the profile with the required permissions for the instruction * @param surveyDataUnitTracker - the survey data unit tracker * @param gameId - the SAGE game id * @param input - instruction input params * @param mints - the mints for the survey data units and the resource consumed when scanning * @param mints.sduMint - the mint for the survey data units * @param mints.resourceMint - the mint for the resource consumed when scanning for survey data units * @returns InstructionReturn */ static updateSurveyDataUnitTracker(program: SageIDLProgram, key: AsyncSigner, profile: PublicKey, surveyDataUnitTracker: PublicKey, gameId: PublicKey, input: UpdateSurveyDataUnitTrackerParams, mints?: { sduMint: PublicKey; resourceMint: PublicKey; }): InstructionReturn; /** * Drain a Survey Data Units token account * @param program - SAGE program * @param key - the key authorized to run this instruction * @param profile - the profile with the required permissions for the instruction * @param fundsTo - the entity that should receive rent refunds * @param surveyDataUnitTracker - the survey data unit tracker * @param gameId - the SAGE game id * @param tokenFrom - The mine item token bank to drain * @param tokenTo - Where to send tokens from the bank * @param input - instruction input params * @returns InstructionReturn */ static drainSurveyDataUnitsBank(program: SageIDLProgram, key: AsyncSigner, profile: PublicKey, fundsTo: PublicKey | 'funder', surveyDataUnitTracker: PublicKey, gameId: PublicKey, tokenFrom: PublicKey, tokenTo: PublicKey, input: DrainSurveyDataUnitsBankInput): InstructionReturn; /** * Deregister a Survey Data Unit Tracker * @param program - SAGE program * @param key - the key authorized to run this instruction * @param profile - the profile with the required permissions for the instruction * @param surveyDataUnitTracker - the new survey data unit tracker * @param fundsTo - the entity that should receive rent refunds * @param gameId - the SAGE game id * @param input - instruction input params * @returns InstructionReturn */ static deregisterSurveyDataUnitTracker(program: SageIDLProgram, key: AsyncSigner, profile: PublicKey, surveyDataUnitTracker: PublicKey, fundsTo: PublicKey | 'funder', gameId: PublicKey, input: DeregisterSurveyDataUnitTrackerInput): InstructionReturn; /** * Scan For Survey Data Units * @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 sector - the sector in which the fleet is located * @param surveyDataUnitTracker - the new survey data unit tracker * @param cargoHold - the fleet's cargo hold cargo pod * @param sduCargoType - the SDU cargo type * @param resourceCargoType - the cargo type of the resource consumed when scanning * @param cargoStatsDefinition - the cargo stats definition * @param sduTokenFrom - the source token SDU account, owned by the survey data unit tracker's signer (must match SDU mint in surveyDataUnitTracker) * @param sduTokenTo - the destination SDU token account, owned by `cargoHold` (must match SDU mint in surveyDataUnitTracker) * @param resourceTokenFrom - the token account, owned by `cargoHold`, of the resource consumed when scanning * @param resourceMint - the token mint of the resource consumed when scanning * @param dataRunningXpUserAccount - the user account for Data Running XP * @param dataRunningXpCategory - the Data Running XP Points Category Account * @param dataRunningXpModifier - the Data Running 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 - instruction input params * @returns InstructionReturn */ static scanForSurveyDataUnits(program: SageIDLProgram, cargoProgram: CargoIDLProgram, pointsProgram: PointsIDLProgram, key: AsyncSigner, playerProfile: PublicKey, profileFaction: PublicKey, fleet: PublicKey, sector: PublicKey, surveyDataUnitTracker: PublicKey, cargoHold: PublicKey, sduCargoType: PublicKey, resourceCargoType: PublicKey, cargoStatsDefinition: PublicKey, sduTokenFrom: PublicKey, sduTokenTo: PublicKey, resourceTokenFrom: PublicKey, resourceMint: PublicKey, dataRunningXpUserAccount: PublicKey, dataRunningXpCategory: PublicKey, dataRunningXpModifier: PublicKey, councilRankXpUserAccount: PublicKey, councilRankXpCategory: PublicKey, councilRankXpModifier: PublicKey, gameId: PublicKey, gameState: PublicKey, input: ScanForSurveyDataUnitsInput): InstructionReturn; static decodeData(account: KeyedAccountInfo, program: SageIDLProgram): DecodedAccountData; } //# sourceMappingURL=surveyDataUnitTracker.d.ts.map