Class Resource

Hierarchy

  • Resource

Implements

  • Account

Constructors

  • Parameters

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

    Returns Resource

Properties

ACCOUNT_NAME: "craftingInstance" | "disbandedFleet" | "fleet" | "fleetShips" | "game" | "gameState" | "mineItem" | "planet" | "resource" | "sagePlayerProfile" | "sector" | "ship" | "star" | "starbase" | "starbasePlayer" | "surveyDataUnitTracker" = 'resource'
MIN_DATA_SIZE: number = ...
SYSTEM_RICHNESS_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

  • Remove/Delete a Resource

    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

    • resource: PublicKey

      the resource

    • mineItem: PublicKey

      the MineItem associated with the resource

    • location: PublicKey

      the location of the resource e.g. a planet

    • gameId: PublicKey

      the SAGE game id

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

      input params

    Returns InstructionReturn

  • Finds the Resource account address

    Returns

    • The PDA and bump respectively

    Parameters

    • program: SageIDLProgram

      SAGE program

    • mineItem: PublicKey

      the MineItem associated with the resource

    • location: PublicKey

      the location of the resource e.g. a planet

    Returns [PublicKey, number]

  • Register a new Resource

    Returns

    • the new Resource 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

    • location: PublicKey

      the location of the resource e.g. a planet

    • mineItem: PublicKey

      the MineItem associated with the resource

    • gameId: PublicKey

      the SAGE game id

    • input: RegisterResourceInput

      input params

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

    • instructions: InstructionReturn
    • resourceKey: [PublicKey, number]
  • Sync a Resource with a MineItem

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • resource: PublicKey

      the resource

    • mineItem: PublicKey

      the MineItem associated with the resource

    Returns InstructionReturn

  • Update a Resource

    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

    • resource: PublicKey

      the resource being updated

    • mineItem: PublicKey

      the MineItem associated with the resource

    • gameId: PublicKey

      the SAGE game id

    • input: UpdateResourceInput

      input params

    Returns InstructionReturn

Generated using TypeDoc