Class MineItem

Hierarchy

  • MineItem

Implements

  • Account

Constructors

  • Parameters

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

    Returns MineItem

Properties

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

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

  • Delete or remove a MineItem

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • profile: PublicKey

      the profile with the required permissions for the instruction

    • fundsTo: PublicKey | "funder"

      the entity that should receive rent refunds

    • mineItem: PublicKey

      the MineItem

    • gameId: PublicKey

      the SAGE game id

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

      input params

    Returns InstructionReturn

  • Drain a MineItem token account

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • profile: PublicKey

      the profile with the required permissions for the instruction

    • fundsTo: PublicKey | "funder"

      the entity that should receive rent refunds

    • mineItem: PublicKey

      the MineItem

    • gameId: PublicKey

      the SAGE game id

    • tokenFrom: PublicKey

      The mine item token bank to drain

    • tokenTo: PublicKey

      Where to send tokens from the bank

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

      input params

    Returns InstructionReturn

  • Finds the MineItem account address

    Returns

    • The PDA and bump respectively

    Parameters

    • program: SageIDLProgram

      SAGE program

    • gameId: PublicKey

      the SAGE game id

    • mint: PublicKey

      the MineItem mint

    Returns [PublicKey, number]

  • Fund a MineItem bank

    Returns

    InstructionReturn

    Parameters

    • mineItem: PublicKey

      the MineItem

    • mint: PublicKey

      the MineItem mint

    • tokenFromOwner: AsyncSigner<unknown>

      the owner of the source token account

    • tokenFrom: PublicKey

      the source token account

    • amount: number

      the amount of tokens

    Returns InstructionReturn

  • Register MineItem

    Returns

    • the new MineItem address and InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • profile: PublicKey

      the profile with the required permissions for the instruction

    • mint: PublicKey

      the MineItem mint

    • gameId: PublicKey

      the SAGE game id

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

      input params

    Returns {
        instructions: InstructionReturn;
        mineItemKey: [PublicKey, number];
    }

    • instructions: InstructionReturn
    • mineItemKey: [PublicKey, number]
  • Update a MineItem

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • profile: PublicKey

      the profile with the required permissions for the instruction

    • mineItem: PublicKey

      the MineItem

    • gameId: PublicKey

      the SAGE game id

    • input: CustomUpdateMineItemInput

      input params

    Returns InstructionReturn

Generated using TypeDoc