Class CraftableItem

Hierarchy

  • CraftableItem

Implements

  • Account

Constructors

  • Parameters

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

    Returns CraftableItem

Properties

ACCOUNT_NAME: "craftableItem" | "craftingFacility" | "craftingProcess" | "domain" | "recipe" | "recipeCategory" = 'craftableItem'
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

  • Drains the CraftableItem token bank and closes it

    Returns

    InstructionReturn

    Parameters

    • program: CraftingIDLProgram

      Crafting IDL program

    • craftableItem: PublicKey

      Craftable Item Account key

    • key: AsyncSigner<unknown>

      Key authorized to use this instruction

    • profile: PublicKey

      Profile Account with required Crafting Permissions

    • fundsTo: PublicKey | "funder"

      Account to which the rent fees are debited

    • domain: PublicKey

      Domain Account key

    • tokenFrom: PublicKey

      The craftable item token bank to drain

    • tokenTo: PublicKey

      Where to send tokens from the bank

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

      Input struct for deregisterCraftableItem instruction

    Returns InstructionReturn

  • Finds PDA for Craftable Item Account

    Returns

    PDA key & bump

    Parameters

    • program: CraftingIDLProgram

      Crafting IDL program

    • domain: PublicKey

      Domain Account key

    • mint: PublicKey

      Mint key

    Returns [PublicKey, number]

  • Funds Token Account owned by Craftable Item Account

    Returns

    InstructionReturn

    Parameters

    • craftableItem: PublicKey

      Craftable Item Account key

    • mint: PublicKey

      Mint key,

    • tokenFromOwner: AsyncSigner<unknown>

      Owner of Token Account being credited

    • tokenFrom: PublicKey

      Token Account being credited

    • amount: number

      Amount of token being debited to Craftable Item Token Account

    Returns InstructionReturn

  • Register a new Craftable Item Account

    Returns

    InstructionReturn

    Parameters

    • program: CraftingIDLProgram

      Crafting IDL program

    • key: AsyncSigner<unknown>

      Key authorized for this instruction

    • profile: PublicKey

      Profile Account key with the required Crafting Permissions

    • domain: PublicKey

      Domain Account key

    • mint: PublicKey

      Mint key

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

      Input struct for registerCraftableItem instruction

    Returns InstructionReturn

Generated using TypeDoc