Class Sector

Hierarchy

  • Sector

Implements

  • Account

Constructors

  • Parameters

    • _data: AnchorTypeDef<Object, AnchorDefined<SageIDL, Record<string, never>>>
    • _key: PublicKey
    • _connections: SectorConnection[]

    Returns Sector

Properties

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

  • Add connection between 2 sectors for warping

    See

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      The SAGE IDL program

    • key: AsyncSigner<unknown>

      The key authorized to use this instruction

    • profile: PublicKey

      The Profile with permissions required

    • sector1: PublicKey

      The first sector

    • sector2: PublicKey

      The second sector

    • gameId: PublicKey

      The Game PublicKey

    • subCoordinates1: [BN, BN]

      The sub coordinate for warp gate within sector 1

    • flags1: ConnectionFlags

      The flags for warp gate 1.

    • subCoordinates2: [BN, BN]

      The sub coordinate for warp gate within sector 2

    • flags2: ConnectionFlags

      The flags for warp gate 2

    • keyIndex: number

      The Index of the key in the permission list

    Returns InstructionReturn

  • Finds the Sector PDA

    Returns

    • The PDA address and bump respectively

    Parameters

    • program: SageIDLProgram

      The SAGE Program IDL

    • gameId: PublicKey

      The Game PublicKey

    • coordinates: [BN, BN]

      The Sector Coordinates

    Returns [PublicKey, number]

  • Register a Sector with SAGE

    Returns

    Returns an object with 2 fields: sectorKey and instructions. sectorKey is the PDA for the registered Sector.

    Parameters

    • program: SageIDLProgram

      The SAGE program IDL

    • key: AsyncSigner<unknown>

      The key authorized for this instruction

    • profile: PublicKey

      The Profile with required Permissions

    • discoverer: PublicKey

      The discoverer of this sector

    • gameId: PublicKey

      The Game PublicKey

    • coordinates: [BN, BN]

      The coordinates for the sector

    • name: string

      Name of the sector

    • keyIndex: number

      The Index of the key in the permission list

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

    • instructions: InstructionReturn
    • sectorKey: [PublicKey, number]
  • Remove an existing connection between 2 sectors for warping

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      The SAGE IDL program

    • key: AsyncSigner<unknown>

      The key authorized to use this instruction

    • profile: PublicKey

      The Profile with permissions required

    • fundsTo: PublicKey | "funder"

      Account where rent fees go

    • sector1: Sector

      The first sector

    • sector2: Sector

      The second sector

    • keyIndex: number

      The Index of the key in the permission list

    • gameId: PublicKey

      The Game PublicKey

    Returns InstructionReturn

Generated using TypeDoc