import { KeyedAccountInfo, PublicKey } from '@solana/web3.js'; import { BN } from '@staratlas/anchor'; import { Account, AsyncSigner, DecodedAccountData, FixedSizeArray, InstructionReturn } from '@staratlas/data-source'; import { SageIDL, SageIDLProgram, StarAccount } from './constants'; export declare enum StarType { WhiteDwarf = 0, RedDwarf = 1, Solar = 2, HotBlue = 3, RedGiant = 4 } export interface RegisterStarInput { name: string; size: BN; subCoordinates: FixedSizeArray; starType: StarType; keyIndex: number; } export interface UpdateStarInput { name?: string; size?: BN; starType?: StarType; keyIndex: number; } /** * Check if two `StarAccount` instances are equal * @param data1 - first StarAccount * @param data2 - second StarAccount * @returns a boolean */ export declare function starDataEquals(data1: StarAccount, data2: StarAccount): boolean; export declare class Star implements Account { private _data; private _key; static readonly ACCOUNT_NAME: NonNullable[number]['name']; static readonly MIN_DATA_SIZE: number; constructor(_data: StarAccount, _key: PublicKey); get data(): Readonly; get key(): PublicKey; get prettyName(): string; /** * Register a Star * @param params - the params to this functions * @param params.program - SAGE program * @param params.key - the key authorized to run this instruction * @param params.profile - the profile with the required permissions for the instruction * @param params.star - the star * @param params.sector - the sector in which the new star will be located * @param params.gameId - the SAGE game id * @param params.input - instruction input params * @returns InstructionReturn */ static registerStar(params: { program: SageIDLProgram; key: AsyncSigner; profile: PublicKey; star: AsyncSigner; sector: PublicKey; gameId: PublicKey; input: RegisterStarInput; }): InstructionReturn; /** * Update a Star * @param params - the params to this functions * @param params.program - SAGE program * @param params.key - the key authorized to run this instruction * @param params.profile - the profile with the required permissions for the instruction * @param params.star - the star * @param params.gameId - the SAGE game id * @param params.input - instruction input params * @returns InstructionReturn */ static updateStar(params: { program: SageIDLProgram; key: AsyncSigner; profile: PublicKey; star: PublicKey; gameId: PublicKey; input: UpdateStarInput; }): InstructionReturn; static decodeData(account: KeyedAccountInfo, program: SageIDLProgram): DecodedAccountData; } //# sourceMappingURL=star.d.ts.map