import { KeyedAccountInfo, PublicKey } from '@solana/web3.js'; import { Account, AsyncSigner, DecodedAccountData, InstructionReturn } from '@staratlas/data-source'; import { DeregisterResourceInput, ResourceAccount, SageIDL, SageIDLProgram } from './constants'; export declare enum LocationType { Planet = 1 } /** * Check if two `ResourceAccount` instances are equal * @param data1 - first ResourceAccount * @param data2 - second ResourceAccount * @returns boolean */ export declare function resourceDataEquals(data1: ResourceAccount, data2: ResourceAccount): boolean; export interface RegisterResourceInput { keyIndex: number; locationType: number; systemRichness: number; } export interface UpdateResourceInput { systemRichness?: number; keyIndex: number; } export declare class Resource implements Account { private _data; private _key; static readonly ACCOUNT_NAME: NonNullable[number]['name']; static readonly MIN_DATA_SIZE: number; static readonly SYSTEM_RICHNESS_DECIMALS = 100; constructor(_data: ResourceAccount, _key: PublicKey); get data(): Readonly; get key(): PublicKey; /** * Finds the Resource account address * @param program - SAGE program * @param mineItem - the `MineItem` associated with the resource * @param location - the location of the resource e.g. a planet * @returns - The PDA and bump respectively */ static findAddress(program: SageIDLProgram, mineItem: PublicKey, location: PublicKey): [PublicKey, number]; /** * Register a new Resource * @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 location - the location of the resource e.g. a planet * @param mineItem - the `MineItem` associated with the resource * @param gameId - the SAGE game id * @param input - input params * @returns - the new Resource address and InstructionReturn */ static registerResource(program: SageIDLProgram, key: AsyncSigner, profile: PublicKey, location: PublicKey, mineItem: PublicKey, gameId: PublicKey, input: RegisterResourceInput): { resourceKey: [PublicKey, number]; instructions: InstructionReturn; }; /** * Update a Resource * @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 resource - the resource being updated * @param mineItem - the `MineItem` associated with the resource * @param gameId - the SAGE game id * @param input - input params * @returns InstructionReturn */ static updateResource(program: SageIDLProgram, key: AsyncSigner, profile: PublicKey, resource: PublicKey, mineItem: PublicKey, gameId: PublicKey, input: UpdateResourceInput): InstructionReturn; /** * Remove/Delete a Resource * @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 resource - the resource * @param mineItem - the `MineItem` associated with the resource * @param location - the location of the resource e.g. a planet * @param gameId - the SAGE game id * @param input - input params * @returns InstructionReturn */ static deregisterResource(program: SageIDLProgram, key: AsyncSigner, profile: PublicKey, fundsTo: PublicKey | 'funder', resource: PublicKey, mineItem: PublicKey, location: PublicKey, gameId: PublicKey, input: DeregisterResourceInput): InstructionReturn; static decodeData(account: KeyedAccountInfo, program: SageIDLProgram): DecodedAccountData; } //# sourceMappingURL=resource.d.ts.map