Class SurveyDataUnitTracker

Hierarchy

  • SurveyDataUnitTracker

Implements

  • Account

Constructors

  • Parameters

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

    Returns SurveyDataUnitTracker

Properties

ACCOUNT_NAME: "craftingInstance" | "disbandedFleet" | "fleet" | "fleetShips" | "game" | "gameState" | "mineItem" | "planet" | "resource" | "sagePlayerProfile" | "sector" | "ship" | "star" | "starbase" | "starbasePlayer" | "surveyDataUnitTracker" = 'surveyDataUnitTracker'
GRID_WIDTH: 100 = 100
MAX_COORDINATE: 50 = 50
MAX_SECONDS: 60 = 60
MIN_DATA_SIZE: number = ...
NUM_SECTORS: number = ...
SECTOR_SIZE: 8 = 8

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

  • get sectors(): readonly BN[]
  • Returns readonly BN[]

Methods

  • Deregister a Survey Data Unit Tracker

    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

    • surveyDataUnitTracker: PublicKey

      the new survey data unit tracker

    • fundsTo: PublicKey | "funder"

      the entity that should receive rent refunds

    • gameId: PublicKey

      the SAGE game id

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

      instruction input params

    Returns InstructionReturn

  • Drain a Survey Data Units 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

    • surveyDataUnitTracker: PublicKey

      the survey data unit tracker

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

      instruction input params

    Returns InstructionReturn

  • Calculate index from Sector coordinates

    Returns

    the index of the sector in the sector array

    Parameters

    • coordinates: [BN, BN]

      the sector's coordinates

    Returns number

  • Finds the address of a SurveyDataUnitTracker signer

    Returns

    • The PDA and bump respectively

    Parameters

    • program: SageIDLProgram

      the SAGE program

    • tracker: PublicKey

      the survey data units tracker

    Returns [PublicKey, number]

  • Finds the address of the SDU token account owned by the SurveyDataUnitTracker signer

    Returns

    • The associated token account address

    Parameters

    • trackerAccount: AnchorTypeDef<Object, AnchorDefined<SageIDL, Record<string, never>>>

      the survey data units tracker account

    Returns PublicKey

  • Fund a SurveyDataUnitTracker SDU bank The bank token account must already exist

    Returns

    InstructionReturn

    Parameters

    • trackerAccount: AnchorTypeDef<Object, AnchorDefined<SageIDL, Record<string, never>>>

      the survey data units tracker account

    • 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 a Survey Data Unit Tracker Only use this if the empty surveyDataUnitTracker account has already been created on-chain

    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

    • surveyDataUnitTracker: AsyncSigner<unknown>

      the new survey data unit tracker

    • mint: PublicKey

      the mint for the survey data units

    • gameId: PublicKey

      the SAGE game id

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

      instruction input params

    Returns InstructionReturn

  • Register a Survey Data Unit Tracker with Solana connection Takes a connection to create an empty surveyDataUnitTracker account, which is necessary

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • connection: Connection

      Solana connection object

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • profile: PublicKey

      the profile with the required permissions for the instruction

    • surveyDataUnitTracker: AsyncSigner<unknown>

      the new survey data unit tracker

    • mint: PublicKey

      the mint for the survey data units

    • gameId: PublicKey

      the SAGE game id

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

      instruction input params

    Returns Promise<InstructionReturn[]>

  • Scan For Survey Data Units

    Returns

    InstructionReturn

    Parameters

    • program: SageIDLProgram

      SAGE program

    • cargoProgram: CargoIDLProgram

      cargo program

    • key: AsyncSigner<unknown>

      the key authorized to run this instruction

    • playerProfile: PublicKey

      the profile with the required permissions for the instruction

    • profileFaction: PublicKey

      the profile's faction

    • fleet: PublicKey

      the fleet

    • surveyDataUnitTracker: PublicKey

      the new survey data unit tracker

    • cargoHold: PublicKey

      the fleet's cargo hold cargo pod

    • sduCargoType: PublicKey

      the SDU cargo type

    • repairKitCargoType: PublicKey

      the repairKit cargo type

    • cargoStatsDefinition: PublicKey

      the cargo stats definition

    • sduTokenFrom: PublicKey

      the source token SDU account, owned by the survey data unit tracker's signer (must match SDU mint in surveyDataUnitTracker)

    • sduTokenTo: PublicKey

      the destination SDU token account, owned by cargoHold (must match SDU mint in surveyDataUnitTracker)

    • repairKitTokenFrom: PublicKey

      the source repairKit token account, owned by cargoHold

    • repairKitMint: PublicKey

      the repairKit token mint

    • gameId: PublicKey

      the SAGE game id

    • gameState: PublicKey

      the game state

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

      instruction input params

    Returns InstructionReturn

  • Update a Survey Data Unit Tracker

    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

    • surveyDataUnitTracker: PublicKey

      the survey data unit tracker

    • gameId: PublicKey

      the SAGE game id

    • input: UpdateSurveyDataUnitTrackerParams

      instruction input params

    • Optional mint: PublicKey

      the mint for the survey data units

    Returns InstructionReturn

Generated using TypeDoc