import { KeyedAccountInfo, PublicKey } from '@solana/web3.js'; import { Account, AsyncSigner, DecodedAccountData, InstructionReturn } from '@staratlas/data-source'; import { DeregisterMineItemInput, MineItemAccount, RegisterMineItemInput, SageIDL, SageIDLProgram } from './constants'; /** * Check if two `MineItemAccount` instances are equal * @param data1 - first MineItemAccount * @param data2 - second MineItemAccount * @returns boolean */ export declare function mineItemDataEquals(data1: MineItemAccount, data2: MineItemAccount): boolean; export interface CustomUpdateMineItemInput { name?: number[]; resourceHardness?: number; keyIndex: number; } export declare class MineItem implements Account { private _data; private _key; static readonly ACCOUNT_NAME: NonNullable[number]['name']; static readonly MIN_DATA_SIZE: number; static readonly RESOURCE_HARDNESS_DECIMALS = 100; constructor(_data: MineItemAccount, _key: PublicKey); get data(): Readonly; get key(): PublicKey; /** * Finds the MineItem account address * @param program - SAGE program * @param gameId - the SAGE game id * @param mint - the `MineItem` mint * @returns - The PDA and bump respectively */ static findAddress(program: SageIDLProgram, gameId: PublicKey, mint: PublicKey): [PublicKey, number]; /** * Register `MineItem` * @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 mint - the `MineItem` mint * @param gameId - the SAGE game id * @param input - input params * @returns - the new MineItem address and InstructionReturn */ static registerMineItem(program: SageIDLProgram, key: AsyncSigner, profile: PublicKey, mint: PublicKey, gameId: PublicKey, input: RegisterMineItemInput): { mineItemKey: [PublicKey, number]; instructions: InstructionReturn; }; /** * Fund a `MineItem` bank * @param mineItem - the `MineItem` * @param mint - the `MineItem` mint * @param tokenFromOwner - the owner of the source token account * @param tokenFrom - the source token account * @param amount - the amount of tokens * @returns InstructionReturn */ static fundMineItemBank(mineItem: PublicKey, mint: PublicKey, tokenFromOwner: AsyncSigner, tokenFrom: PublicKey, amount: number): InstructionReturn; /** * Update a `MineItem` * @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 mineItem - the `MineItem` * @param gameId - the SAGE game id * @param input - input params * @returns InstructionReturn */ static updateMineItem(program: SageIDLProgram, key: AsyncSigner, profile: PublicKey, mineItem: PublicKey, gameId: PublicKey, input: CustomUpdateMineItemInput): InstructionReturn; /** * Drain a `MineItem` 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 mineItem - the `MineItem` * @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 - input params * @returns InstructionReturn */ static drainMineItemBank(program: SageIDLProgram, key: AsyncSigner, profile: PublicKey, fundsTo: PublicKey | 'funder', mineItem: PublicKey, gameId: PublicKey, tokenFrom: PublicKey, tokenTo: PublicKey, input: DeregisterMineItemInput): InstructionReturn; /** * Delete or remove a `MineItem` * @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 mineItem - the `MineItem` * @param gameId - the SAGE game id * @param input - input params * @returns InstructionReturn */ static deregisterMineItem(program: SageIDLProgram, key: AsyncSigner, profile: PublicKey, fundsTo: PublicKey | 'funder', mineItem: PublicKey, gameId: PublicKey, input: DeregisterMineItemInput): InstructionReturn; static decodeData(account: KeyedAccountInfo, program: SageIDLProgram): DecodedAccountData; } //# sourceMappingURL=mineItem.d.ts.map