Class CraftingProcess

Hierarchy

  • CraftingProcess

Implements

  • Account

Constructors

  • Parameters

    • _data: AnchorTypeDef<Object, AnchorDefined<CraftingIDL, Record<string, never>>>
    • _key: PublicKey

    Returns CraftingProcess

Properties

ACCOUNT_NAME: "craftableItem" | "craftingFacility" | "craftingProcess" | "domain" | "recipe" | "recipeCategory" = 'craftingProcess'
MIN_DATA_SIZE: number = ...

Accessors

  • get data(): Readonly<AnchorTypeDef<Object, AnchorDefined<CraftingIDL, Record<string, never>>>>
  • Returns Readonly<AnchorTypeDef<Object, AnchorDefined<CraftingIDL, Record<string, never>>>>

  • get key(): PublicKey
  • Returns PublicKey

Methods

  • Add an ingredient to a crafting process account

    Returns

    InstructionReturn

    Parameters

    • program: CraftingIDLProgram

      Crafting program

    • location: AsyncSigner<unknown>

      the crafting facility's location

    • authority: AsyncSigner<unknown>

      the authority for the crafting process account

    • craftingProcess: PublicKey

      the crafting process

    • recipe: PublicKey

      the crafting recipe

    • craftingFacility: PublicKey

      the crafting facility

    • tokenFrom: PublicKey

      the source token account

    • tokenTo: PublicKey

      the destination token account (must be owned by the crafting process account)

    • input: RecipeIngredientInput

      the input parameters

    Returns InstructionReturn

  • Burn a consumable ingredient from a crafting process account

    Returns

    InstructionReturn

    Parameters

    • program: CraftingIDLProgram

      Crafting program

    • craftingProcess: PublicKey

      the crafting process

    • recipe: PublicKey

      the crafting recipe

    • tokenFrom: PublicKey

      the source token account (owned by crafting process)

    • mint: PublicKey

      the token mint

    • input: IngredientInput

      the input parameters

    Returns InstructionReturn

  • Cancel the crafting process and close the crafting process account can only be done if the crafting process was not started

    Returns

    InstructionReturn

    Parameters

    • program: CraftingIDLProgram

      Crafting program

    • location: AsyncSigner<unknown>

      the crafting facility's location

    • authority: AsyncSigner<unknown>

      the authority for the crafting process account

    • fundsTo: PublicKey | "funder"

      receives rent refund

    • craftingProcess: PublicKey

      the crafting process

    • craftingFacility: PublicKey

      the crafting facility

    Returns InstructionReturn

  • Claim a non-consumable ingredient from a crafting process account

    Returns

    InstructionReturn

    Parameters

    • program: CraftingIDLProgram

      Crafting program

    • craftingProcess: PublicKey

      the crafting process

    • authority: PublicKey

      the authority for the crafting process account

    • recipe: PublicKey

      the crafting recipe

    • tokenFrom: PublicKey

      the source token account (owned by crafting process)

    • tokenTo: PublicKey

      the destination token account

    • mint: PublicKey

      the token mint

    • input: IngredientInput

      the input parameters

    Returns InstructionReturn

  • Claim an output from a crafting process account

    Returns

    InstructionReturn

    Parameters

    • program: CraftingIDLProgram

      Crafting program

    • craftingProcess: PublicKey

      the crafting process

    • authority: PublicKey

      the authority for the crafting process account

    • recipe: PublicKey

      the crafting recipe

    • tokenFrom: PublicKey

      the source token account (owned by the craftableItem)

    • tokenTo: PublicKey

      the destination token account

    • craftableItem: PublicKey

      the craftable item

    • input: IngredientInput

      the input parameters

    Returns InstructionReturn

  • Close the crafting process account

    Returns

    InstructionReturn

    Parameters

    • program: CraftingIDLProgram

      Crafting program

    • authority: AsyncSigner<unknown>

      the authority for the crafting process account

    • fundsTo: PublicKey | "funder"

      receives rent refund

    • craftingProcess: PublicKey

      the crafting process

    • recipe: PublicKey

      the crafting recipe

    • craftingFacility: PublicKey

      the crafting facility

    Returns InstructionReturn

  • Create or Initialize a CraftingProcess Account

    Returns

    InstructionReturn

    Parameters

    • program: CraftingIDLProgram

      Crafting program

    • location: AsyncSigner<unknown>

      the crafting facility's location

    • authority: AsyncSigner<unknown>

      the authority for the crafting process account

    • craftingFacility: PublicKey

      the crafting facility

    • recipe: PublicKey

      the crafting recipe

    • input: AnchorTypeDef<Object, Record<string, never>>

      the input parameters

    Returns InstructionReturn

  • Find the CraftingProcess address

    Returns

    PDA and bump

    Parameters

    • program: CraftingIDLProgram

      Crafting program

    • craftingFacility: PublicKey

      the crafting facility

    • recipe: PublicKey

      the crafting recipe

    • craftingId: BN

      the crafting process id

    Returns [PublicKey, number]

  • Returns Buffer

  • Legitimize an ingredient The token accounts that hold ingredients can receive tokens from anyone. However, only tokens received through the crafting program are recognized as valid ingredients. This instruction can be used in cases where one wants to "legitimize" such token account balances

    Returns

    InstructionReturn

    Parameters

    • program: CraftingIDLProgram

      Crafting program

    • location: AsyncSigner<unknown>

      the crafting facility's location

    • authority: AsyncSigner<unknown>

      the authority for the crafting process account

    • craftingProcess: PublicKey

      the crafting process

    • recipe: PublicKey

      the crafting recipe

    • craftingFacility: PublicKey

      the crafting facility

    • craftingTokenAccount: PublicKey

      the token account owned by the crafting process which holds the ingredient in escrow

    • input: RecipeIngredientInput

      the input parameters

    Returns InstructionReturn

  • Remove an ingredient from a crafting process account

    Returns

    InstructionReturn

    Parameters

    • program: CraftingIDLProgram

      Crafting program

    • location: AsyncSigner<unknown>

      the crafting facility's location

    • authority: AsyncSigner<unknown>

      the authority for the crafting process account

    • craftingProcess: PublicKey

      the crafting process

    • recipe: PublicKey

      the crafting recipe

    • craftingFacility: PublicKey

      the crafting facility

    • tokenFrom: PublicKey

      the source token account (must be owned by the crafting process)

    • tokenTo: PublicKey

      the destination token account

    • mint: PublicKey

      the token mint

    • input: RecipeIngredientInput

      the input parameters

    Returns InstructionReturn

  • Start the crafting process

    Returns

    InstructionReturn

    Parameters

    • program: CraftingIDLProgram

      Crafting program

    • location: AsyncSigner<unknown>

      the crafting facility's location

    • craftingProcess: PublicKey

      the crafting process

    • recipe: PublicKey

      the crafting recipe

    • craftingFacility: PublicKey

      the crafting facility

    • Optional recipeDurationOverride: BN

      the recipe duration (overrides the duration set on the recipe account)

    • Optional tokenFromAuthority: AsyncSigner<unknown>

      the transfer authority of tokenFrom

    • Optional tokenFrom: PublicKey

      the source token account for crafting fees

    • Optional tokenTo: PublicKey

      the destination token account for crafting fees, should be as defined in Recipe account

    Returns InstructionReturn

Generated using TypeDoc