Class CraftingInstance

Hierarchy

  • CraftingInstance

Implements

  • Account

Constructors

  • Parameters

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

    Returns CraftingInstance

Properties

ACCOUNT_NAME: "craftingInstance" | "disbandedFleet" | "fleet" | "fleetShips" | "game" | "gameState" | "mineItem" | "planet" | "resource" | "sagePlayerProfile" | "sector" | "ship" | "star" | "starbase" | "starbasePlayer" | "surveyDataUnitTracker" = 'craftingInstance'
MIN_DATA_SIZE: number = ...

Accessors

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

  • get key(): PublicKey
  • Returns PublicKey

Methods

  • Calculate the crafting duration

    Returns

    the crafting duration in seconds

    Parameters

    • durationPerUnit: BN

      the duration per unit of the crafting recipe

    • quantity: BN

      the quantity being crafted

    • numCrew: BN

      the number of crew taking part in the crafting

    Returns BN

  • Cancel Crafting Process

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • craftingProgram: CraftingIDLProgram

      crafting program

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • playerProfile: PublicKey

      the player's profile with the required permissions for the instruction

    • profileFaction: PublicKey

      the profile's faction

    • fundsTo: PublicKey | "funder"

      recipient of the rent refund

    • starbasePlayer: PublicKey

      the Starbase player

    • starbase: PublicKey

      the Starbase

    • craftingInstance: PublicKey

      the crafting instance

    • craftingProcess: PublicKey

      the crafting process

    • craftingFacility: PublicKey

      the crafting facility

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state account

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

      the instruction input params

    Returns InstructionReturn

  • Claim Crafting Process Non-consumable inputs

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • craftingProgram: CraftingIDLProgram

      crafting program

    • starbasePlayer: PublicKey

      the Starbase player

    • starbase: PublicKey

      the Starbase

    • craftingInstance: PublicKey

      the crafting instance

    • craftingProcess: PublicKey

      the crafting process

    • craftingRecipe: PublicKey

      the crafting recipe

    • cargoPodTo: PublicKey

      the destination cargo pod

    • cargoType: PublicKey

      the cargo type

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • tokenFrom: PublicKey

      the source token account - owner should be craftingProcess

    • tokenTo: PublicKey

      the destination token account - owner should be cargoPodTo

    • tokenMint: PublicKey

      the token mint

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

      the instruction input params

    Returns InstructionReturn

  • Claim Crafting Process Output

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • craftingProgram: CraftingIDLProgram

      crafting program

    • starbasePlayer: PublicKey

      the Starbase player

    • starbase: PublicKey

      the Starbase

    • craftingInstance: PublicKey

      the crafting instance

    • craftingProcess: PublicKey

      the crafting process

    • craftingRecipe: PublicKey

      the crafting recipe

    • craftableItem: PublicKey

      the craftable item for the output

    • cargoPodTo: PublicKey

      the destination cargo pod

    • cargoType: PublicKey

      the cargo type

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • tokenFrom: PublicKey

      the source token account - owner should be craftableItem

    • tokenTo: PublicKey

      the destination token account - owner should be cargoPodTo

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

      the instruction input params

    Returns InstructionReturn

  • Close Crafting Process

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • craftingProgram: CraftingIDLProgram

      crafting program

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • playerProfile: PublicKey

      the player's profile with the required permissions for the instruction

    • profileFaction: PublicKey

      the profile's faction

    • fundsTo: PublicKey | "funder"

      recipient of the rent refund

    • starbasePlayer: PublicKey

      the Starbase player

    • starbase: PublicKey

      the Starbase

    • craftingInstance: PublicKey

      the crafting instance

    • craftingProcess: PublicKey

      the crafting process

    • craftingFacility: PublicKey

      the crafting facility

    • craftingRecipe: PublicKey

      the crafting recipe

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state account

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

      the instruction input params

    Returns InstructionReturn

  • Create Crafting Process

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • craftingProgram: CraftingIDLProgram

      crafting program

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • playerProfile: PublicKey

      the player's profile with the required permissions for the instruction

    • profileFaction: PublicKey

      the profile's faction

    • starbasePlayer: PublicKey

      the Starbase player

    • starbase: PublicKey

      the Starbase

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state account

    • craftingFacility: PublicKey

      the crafting facility

    • craftingRecipe: PublicKey

      the crafting recipe

    • craftingDomain: PublicKey

      the crafting domain

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

      the instruction input params

    Returns InstructionReturn

  • Deposit Crafting Recipe Ingredient

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • craftingProgram: CraftingIDLProgram

      crafting program

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • playerProfile: PublicKey

      the player's profile with the required permissions for the instruction

    • profileFaction: PublicKey

      the profile's faction

    • starbasePlayer: PublicKey

      the Starbase player

    • starbase: PublicKey

      the Starbase

    • craftingInstance: PublicKey

      the crafting instance

    • craftingProcess: PublicKey

      the crafting process

    • craftingFacility: PublicKey

      the crafting facility

    • craftingRecipe: PublicKey

      the crafting recipe

    • cargoPodFrom: PublicKey

      the source cargo pod

    • cargoType: PublicKey

      the cargo type

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • tokenFrom: PublicKey

      the source account of the tokens - owner should be cargoPodFrom

    • tokenTo: PublicKey

      the destination account of the tokens - owner should be craftingProcess

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state account

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

      the instruction input params

    Returns InstructionReturn

  • Find the CraftingInstance account address

    Returns

    The PDA and bump respectively

    Parameters

    • program: SageIDLProgram

      SAGE program

    • starbasePlayer: PublicKey

      the Starbase player

    • craftingProcess: PublicKey

      the crafting process

    Returns [PublicKey, number]

  • Start Crafting Process

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • craftingProgram: CraftingIDLProgram

      crafting program

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • playerProfile: PublicKey

      the player's profile with the required permissions for the instruction

    • profileFaction: PublicKey

      the profile's faction

    • starbasePlayer: PublicKey

      the Starbase player

    • starbase: PublicKey

      the Starbase

    • craftingInstance: PublicKey

      the crafting instance

    • craftingProcess: PublicKey

      the crafting process

    • craftingFacility: PublicKey

      the crafting facility

    • craftingRecipe: PublicKey

      the crafting recipe

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state account

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

      the instruction input params

    • 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 craftingRecipe account

    Returns InstructionReturn

  • Withdraw Crafting Recipe Ingredient

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • craftingProgram: CraftingIDLProgram

      crafting program

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • playerProfile: PublicKey

      the player's profile with the required permissions for the instruction

    • profileFaction: PublicKey

      the profile's faction

    • starbasePlayer: PublicKey

      the Starbase player

    • starbase: PublicKey

      the Starbase

    • craftingInstance: PublicKey

      the crafting instance

    • craftingProcess: PublicKey

      the crafting process

    • craftingFacility: PublicKey

      the crafting facility

    • craftingRecipe: PublicKey

      the crafting recipe

    • cargoPodTo: PublicKey

      the destination cargo pod

    • cargoType: PublicKey

      the cargo type

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • tokenFrom: PublicKey

      the source token account - owner should be craftingProcess

    • tokenTo: PublicKey

      the destination token account - owner should be cargoPodTo

    • tokenMint: PublicKey

      the token mint

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state account

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

      the instruction input params

    Returns InstructionReturn

Generated using TypeDoc