/// import { KeyedAccountInfo, PublicKey } from '@solana/web3.js'; import * as anchor from '@staratlas/anchor'; import { Account, AsyncSigner, DecodedAccountData, InstructionReturn } from '@staratlas/data-source'; import { KeyIndexInput } from './common'; import { CraftingIDL, CraftingIDLProgram, RecipeAccount } from './constants'; export interface RecipeInputsOutputs extends KeyIndexInput { amount: anchor.BN; mint: PublicKey; } export declare enum RecipeStatus { Initializing = 1, Active = 2, Deactivated = 3 } export interface UpdateRecipeInput extends KeyIndexInput { duration?: anchor.BN; minDuration?: anchor.BN; status?: RecipeStatus; feeAmount?: anchor.BN; usageLimit?: anchor.BN; value?: anchor.BN; } export interface RegisterRecipeInput extends KeyIndexInput { duration: anchor.BN; minDuration: anchor.BN; namespace: number[]; feeAmount?: anchor.BN; usageLimit?: anchor.BN; value?: anchor.BN; } export interface RemoveRecipeIngredients extends KeyIndexInput { ingredientIndex: number; } export declare const RECIPE_MIN_DATA_SIZE: number; /** * Checks equality between 2 Recipe Accounts * @param data1 - First Recipe Account * @param data2 - Second Recipe Account * @returns boolean */ export declare function recipeDataEquals(data1: RecipeAccount, data2: RecipeAccount): boolean; export declare class Recipe implements Account { private _data; private _key; private _ingredientInputsOutputs; static readonly ACCOUNT_NAME: NonNullable[number]['name']; static readonly MIN_DATA_SIZE: number; constructor(_data: RecipeAccount, _key: PublicKey, _ingredientInputsOutputs: RecipeInputsOutputs[]); get data(): Readonly; get key(): Readonly; get ingredientInputsOutputs(): Readonly; /** * Register a Recipe * @param program - Crafting program * @param recipe - the new crafting recipe * @param key - Key authorized to use this instruction * @param profile - Profile Account with required Crafting Permissions * @param domain - the crafting domain * @param recipeCategory - the crafting recipe category * @param input - the input parameters * @param feeRecipient - The token account that receives the Recipe's `feeAmount` * @returns InstructionReturn */ static registerRecipe(program: CraftingIDLProgram, recipe: AsyncSigner, key: AsyncSigner, profile: PublicKey, domain: PublicKey, recipeCategory: PublicKey, input: RegisterRecipeInput, feeRecipient?: PublicKey): InstructionReturn; /** * Add a consumable input to a recipe * @param program - Crafting program * @param recipe - the crafting recipe * @param key - Key authorized to use this instruction * @param profile - Profile Account with required Crafting Permissions * @param domain - the crafting domain * @param mint - the ingredient's mint * @param recipeIngredient - the amount and mint for this ingredient * @returns InstructionReturn */ static addConsumableInputToRecipe(program: CraftingIDLProgram, recipe: PublicKey, key: AsyncSigner, profile: PublicKey, domain: PublicKey, mint: PublicKey, recipeIngredient: RecipeInputsOutputs): InstructionReturn; /** * Add a non-consumable input to a recipe * @param program - Crafting program * @param recipe - the crafting recipe * @param key - Key authorized to use this instruction * @param profile - Profile Account with required Crafting Permissions * @param domain - the crafting domain * @param mint - the ingredient's mint * @param recipeIngredient - the amount and mint for this ingredient- the amount and mint for this ingredient * @returns InstructionReturn */ static addNonConsumableInputToRecipe(program: CraftingIDLProgram, recipe: PublicKey, key: AsyncSigner, profile: PublicKey, domain: PublicKey, mint: PublicKey, recipeIngredient: RecipeInputsOutputs): InstructionReturn; /** * Add an output to a recipe * @param program - Crafting program * @param recipe - the crafting recipe * @param key - Key authorized to use this instruction * @param profile - Profile Account with required Crafting Permissions * @param domain - the crafting domain * @param craftableItem - the craftable item for this output * @param recipeIngredient - the amount and mint for this ingredient * @returns InstructionReturn */ static addOutputToRecipe(program: CraftingIDLProgram, recipe: PublicKey, key: AsyncSigner, profile: PublicKey, domain: PublicKey, craftableItem: PublicKey, recipeIngredient: RecipeInputsOutputs): InstructionReturn; /** * Remove a consumable input from a recipe * @param program - Crafting program * @param recipe - the crafting recipe * @param key - Key authorized to use this instruction * @param profile - Profile Account with required Crafting Permissions * @param domain - the crafting domain * @param input - the input parameters * @returns InstructionReturn */ static removeConsumableInputFromRecipe(program: CraftingIDLProgram, recipe: PublicKey, key: AsyncSigner, profile: PublicKey, domain: PublicKey, input: RemoveRecipeIngredients): InstructionReturn; /** * Remove a non-consumable input from a recipe * @param program - Crafting program * @param recipe - the crafting recipe * @param key - Key authorized to use this instruction * @param profile - Profile Account with required Crafting Permissions * @param domain - the crafting domain * @param input - the input parameters * @returns InstructionReturn */ static removeNonConsumableInputFromRecipe(program: CraftingIDLProgram, recipe: PublicKey, key: AsyncSigner, profile: PublicKey, domain: PublicKey, input: RemoveRecipeIngredients): InstructionReturn; /** * Remove an output from a recipe * @param program - Crafting program * @param recipe - the crafting recipe * @param key - Key authorized to use this instruction * @param profile - Profile Account with required Crafting Permissions * @param domain - the crafting domain * @param input - the input parameters * @returns InstructionReturn */ static removeOutputFromRecipe(program: CraftingIDLProgram, recipe: PublicKey, key: AsyncSigner, profile: PublicKey, domain: PublicKey, input: RemoveRecipeIngredients): InstructionReturn; /** * Update a recipe's category * @param program - Crafting program * @param recipe - the crafting recipe * @param key - Key authorized to use this instruction * @param profile - Profile Account with required Crafting Permissions * @param domain - the crafting domain * @param recipeCategoryOld - the old recipe category * @param recipeCategoryNew - the new recipe category * @param input - the input parameters * @returns InstructionReturn */ static updateRecipeCategory(program: CraftingIDLProgram, recipe: PublicKey, key: AsyncSigner, profile: PublicKey, domain: PublicKey, recipeCategoryOld: PublicKey, recipeCategoryNew: PublicKey, input: KeyIndexInput): InstructionReturn; /** * Update a recipe * @param program - Crafting program * @param recipe - the crafting recipe * @param key - Key authorized to use this instruction * @param profile - Profile Account with required Crafting Permissions * @param domain - the crafting domain * @param updateRecipeInput - input params * @param feeRecipient - The token account that receives the Recipe's `feeAmount` * @returns InstructionReturn */ static updateRecipe(program: CraftingIDLProgram, recipe: PublicKey, key: AsyncSigner, profile: PublicKey, domain: PublicKey, updateRecipeInput: UpdateRecipeInput, feeRecipient?: PublicKey): InstructionReturn; static decodeData(account: KeyedAccountInfo, program: CraftingIDLProgram): DecodedAccountData; } //# sourceMappingURL=recipe.d.ts.map