6.7.32 • Published 2 years ago

@dfdao/types v6.7.32

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

@dfdao/types

This package contains commonly-used data types in the Dark Forest webclient, also accessible in node.js server environments.

Installation

You can install this package using npm or yarn by running:

npm install --save @dfdao/types
yarn add @dfdao/types

When using this in a plugin, you might want to load it with skypack

import * as types from 'http://cdn.skypack.dev/@dfdao/types';

Table of contents

Classes

Interfaces

Type aliases

Variables

Functions

Classes

DFAnimation

DFAnimation: Class DFAnimation


DFStatefulAnimation

DFStatefulAnimation: Class DFStatefulAnimation<T>

Type parameters

Name
T

Interfaces

ArenaLeaderboard

ArenaLeaderboard: Interface ArenaLeaderboard


ArenaLeaderboardEntry

ArenaLeaderboardEntry: Interface ArenaLeaderboardEntry


ArrivalWithTimer

ArrivalWithTimer: Interface ArrivalWithTimer

Convenience type for storing a voyage and a reference to a timeout that is triggered on voyage arrival (in case the timeout needs to be cancelled).


AsteroidRendererType

AsteroidRendererType: Interface AsteroidRendererType


BackgroundRendererType

BackgroundRendererType: Interface BackgroundRendererType


BaseRenderer

BaseRenderer: Interface BaseRenderer

The purpose of this interface is for type checking It make sures that the variable is a type of renderer


BeltRendererType

BeltRendererType: Interface BeltRendererType


BlackDomainRendererType

BlackDomainRendererType: Interface BlackDomainRendererType


CanvasCoords

CanvasCoords: Interface CanvasCoords


CaptureZoneRendererType

CaptureZoneRendererType: Interface CaptureZoneRendererType


Chunk

Chunk: Interface Chunk

Represents a fully mined aligned square.


CircleRendererType

CircleRendererType: Interface CircleRendererType


DeleteMessagesRequest

DeleteMessagesRequest: Interface DeleteMessagesRequest

Asks the webserver to delete some messages.


DiagnosticUpdater

DiagnosticUpdater: Interface DiagnosticUpdater

Various parts of our codebase need to be able to self-report diagnostics. To enable them to do so, you must provide them with an object that conforms to this interface. Currently, the only implementation of this function is GameManager. However, in the future, we might want to stream a sample of these diagnostic updates to our backend, so that we can analyze performance, catch bugs, etc.


Diagnostics

Diagnostics: Interface Diagnostics


EmojiFlagBody

EmojiFlagBody: Interface EmojiFlagBody

Owners of planets can post emojis on the planet.


ExtendedMatchEntry

ExtendedMatchEntry: Interface ExtendedMatchEntry


GameViewport

GameViewport: Interface GameViewport


GasPrices

GasPrices: Interface GasPrices

These are measured in gwei.


GraphArena

GraphArena: Interface GraphArena


GraphConfig

GraphConfig: Interface GraphConfig


GraphPlanet

GraphPlanet: Interface GraphPlanet


IRendererConfig

IRendererConfig: Interface IRendererConfig


Leaderboard

Leaderboard: Interface Leaderboard


LeaderboardEntry

LeaderboardEntry: Interface LeaderboardEntry


LineRendererType

LineRendererType: Interface LineRendererType


LiveMatch

LiveMatch: Interface LiveMatch


LiveMatchEntry

LiveMatchEntry: Interface LiveMatchEntry


MineBodyRendererType

MineBodyRendererType: Interface MineBodyRendererType


MineRendererType

MineRendererType: Interface MineRendererType


ModalPosition

ModalPosition: Interface ModalPosition

Contains metadata on modals in the game. Meant to store coordinates and state. Is uniquely identified by a ModalId, which typically either the modalId of a given modal pane, or plugin id.


NetworkEvent

NetworkEvent: Interface NetworkEvent

Each time a transaction either reverts or confirms we send an event to the webserver with this diagnostic info about the transaction, so that we can analyze the performance of the network in aggregate across our player-base.


PerlinConfig

PerlinConfig: Interface PerlinConfig

Various configuration used for calculating perlin. Always make sure these values match the contracts you are working with or else your transactions will be reverted.


PerlinRendererType

PerlinRendererType: Interface PerlinRendererType

Perlin Renderer is only used when disable fancy space effects is true


PersistedTransaction

PersistedTransaction: Interface PersistedTransaction<T>

Type parameters

NameType
Textends TxIntent | unknownTxIntent

PlanetCosmeticInfo

PlanetCosmeticInfo: Interface PlanetCosmeticInfo


PlanetDefaults

PlanetDefaults: Interface PlanetDefaults

A structure with default stats of planets in nebula at corresponding levels. For example, silverCap4 refers to the default silver capacity of a level 4 planet in nebula with no modifiers.


PlanetMessage

PlanetMessage: Interface PlanetMessage<T>

We can save these to and retrieve these from the database.

Type parameters

NameType
Textends PlanetMessageBody

PlanetMessageRequest

PlanetMessageRequest: Interface PlanetMessageRequest

Asks the webserver to get all the the messages posted to some set of planets.


PlanetMessageResponse

PlanetMessageResponse: Interface PlanetMessageResponse

Contains the answer to the above question.


PlanetRenderInfo

PlanetRenderInfo: Interface PlanetRenderInfo


PlanetRenderManagerType

PlanetRenderManagerType: Interface PlanetRenderManagerType


PlanetRendererType

PlanetRendererType: Interface PlanetRendererType


PostMessageRequest

PostMessageRequest: Interface PostMessageRequest<T>

Asks the webserver to post an emoji to a particular planet.

Type parameters

NameType
Textends PlanetMessageBody

QuasarBodyRendererType

QuasarBodyRendererType: Interface QuasarBodyRendererType


QuasarRayRendererType

QuasarRayRendererType: Interface QuasarRayRendererType


QuasarRendererType

QuasarRendererType: Interface QuasarRendererType


QueuedArrival

QueuedArrival: Interface QueuedArrival

Represents a voyage.


Radii

Radii: Interface Radii


RawAccount

RawAccount: Interface RawAccount


RectRendererType

RectRendererType: Interface RectRendererType


Rectangle

Rectangle: Interface Rectangle

Ok, this is gonna sound weird, but all rectangles are squares. Also, we only permit side lengths that are powers of two, and ALSO!! The side lengths must be between {@link MIN_CHUNK_SIZE} and {@link MAX_CHUNK_SIZE}.


RenderedArtifact

RenderedArtifact: Interface RenderedArtifact


RingRendererType

RingRendererType: Interface RingRendererType


RuinsRendererType

RuinsRendererType: Interface RuinsRendererType


SignedMessage

SignedMessage: Interface SignedMessage<T>

A signed message contains some sort of message, as well as its signature and the address that claims to have signed this message.

Type parameters

Name
T

SpaceRendererType

SpaceRendererType: Interface SpaceRendererType


SpacetimeRipRendererType

SpacetimeRipRendererType: Interface SpacetimeRipRendererType


SpriteRendererType

SpriteRendererType: Interface SpriteRendererType


TextRendererType

TextRendererType: Interface TextRendererType


Transaction

Transaction: Interface Transaction<T>

Represents a transaction that the game would like to submit to the blockchain.

Type parameters

NameType
Textends TxIntentTxIntent

TransactionCollection

TransactionCollection: Interface TransactionCollection


UIRendererType

UIRendererType: Interface UIRendererType


UnminedRendererType

UnminedRendererType: Interface UnminedRendererType


VoyageRendererType

VoyageRendererType: Interface VoyageRendererType


WormholeRendererType

WormholeRendererType: Interface WormholeRendererType

Type aliases

Abstract

Ƭ Abstract: Type & Tagged<Token>

An abstract type used to differentiate between common types, like number or string. The Token type parameter is the key to vary upon and should be unique unless being used to subtype.

Type parameters

NameType
TypeType
Tokenunknown

AdminPlanet

Ƭ AdminPlanet: Object

Type declaration

NameType
isSpawnPlanetboolean
isTargetPlanetboolean
levelnumber
planetTypenumber
requireValidLocationIdboolean
revealLocationboolean
xnumber
ynumber

ArrivalType

Ƭ ArrivalType: Abstract<number, "ArrivalType">

Abstract type representing an arrival type.


Artifact

Ƭ Artifact: Object

Represents data associated with a Dark Forest artifact NFT. Note that some Artifact fields store client-specific data that the blockchain is not aware of, such as unconfirmedDepositArtifact (tracks pending depositArtifact transaction that involves this artifact). If you're using a client that can't send transactions, these fields should be ignored.

Type declaration

NameType
activationsnumber
artifactTypeArtifactType
controllerEthAddress
currentOwnerEthAddress
discovererEthAddress
idArtifactId
isInititalizedboolean
lastActivatednumber
lastDeactivatednumber
mintedAtTimestampnumber
onPlanetId?LocationId
onVoyageId?VoyageId
planetBiomeBiome
planetDiscoveredOnLocationId
rarityArtifactRarity
timeDelayedUpgradeUpgrade
transactions?TransactionCollection
upgradeUpgrade
wormholeTo?LocationId

ArtifactId

Ƭ ArtifactId: Abstract<string, "ArtifactId">

A unique identifier for a Dark Forest NFT artifact. This is a 64-character lowercase hex string not prefixed with 0x. ArtifactIDs should only be instantiated through ArtifactIDs should only be instantiated through artifactIdFromHexStr, artifactIdFromDecStr, and artifactIdFromEthersBN in serde.


ArtifactPointValues

Ƭ ArtifactPointValues: Object

mapping from ArtifactRarity to points earned for finding this artifact.

Index signature

ArtifactRarity: number: number


ArtifactRarity

Ƭ ArtifactRarity: Abstract<number, "ArtifactRarity">

Abstract type representing an artifact rarity level.


ArtifactType

Ƭ ArtifactType: Abstract<number, "ArtifactType">

Abstract type representing an artifact type.


AttribProps

Ƭ AttribProps: Object

Type declaration

NameType
dimnumber
namestring
normalizeboolean
typeAttribType

AttribType

Ƭ AttribType: Abstract<number, "AttribType">


AutoGasSetting

Ƭ AutoGasSetting: Abstract<string, "AutoGasSetting">

The user can choose to have the client automatically choose a gas price for their transactions, depending on how much they are willing to pay and how fast they want their transactions to confirm.


Biome

Ƭ Biome: Abstract<number, "Biome">

Abstract type representing a biome.


BlocklistMap

Ƭ BlocklistMap: Map<LocationId, Map<LocationId, boolean>>

Blocks move from one planet to another


CaptureZone

Ƭ CaptureZone: Object

Type declaration

NameType
coordsWorldCoords
radiusnumber

ClaimedCoords

Ƭ ClaimedCoords: WorldCoords & Object

Represents a planet location that has been broadcast on-chain


ClaimedLocation

Ƭ ClaimedLocation: WorldLocation & Object


CursorState

Ƭ CursorState: Abstract<string, "CursorState">


DrawMode

Ƭ DrawMode: Abstract<number, "DrawMode">


EthAddress

Ƭ EthAddress: Abstract<string, "EthAddress">

This is expected to be a 40-character, lowercase hex string, prefixed with 0x (so 42 characters in total). EthAddress should only ever be instantiated through the address function in serde.


EthTxStatus

Ƭ EthTxStatus: "Init" | "Processing" | "Prioritized" | "Submit" | "Confirm" | "Fail" | "Cancel"


ExactArray10

Ƭ ExactArray10: A, A, A, A, A, A, A, A, A, A

Type parameters

Name
A

ExactArray4

Ƭ ExactArray4: A, A, A, A

Type parameters

Name
A

ExactArray5

Ƭ ExactArray5: A, A, A, A, A

Type parameters

Name
A

ExactArray8

Ƭ ExactArray8: A, A, A, A, A, A, A, A

Type parameters

Name
A

HSLVec

Ƭ HSLVec: readonly number, number, number


HatType

Ƭ HatType: Abstract<string, "HatType">


LocatablePlanet

Ƭ LocatablePlanet: Planet & Object

A planet whose coordinates are known to the client.


LocationId

Ƭ LocationId: Abstract<string, "LocationId">

a unique identifier for a location in the universe (corresponding to some underlying coordinates (x, y)). This is a 64-character lowercase hex string not prefixed with 0x. LocationIDs should only be instantiated through locationIdFromHexStr, locationIdFromDecStr, locationIdFromBigInt, and locationIdFromEthersBN in serde.


ModalId

Ƭ ModalId: ModalName | PluginId

Modals can either be built into the game, or spawned by a plugin.


ModalManagerEvent

Ƭ ModalManagerEvent: Abstract<string, "ModalManagerEvent">


ModalName

Ƭ ModalName: Abstract<string, "ModalName">

Modals built into the game have a human-readable name.


ModalPositions

Ƭ ModalPositions: Map<ModalId, ModalPosition>


ModifierType

Ƭ ModifierType: Abstract<number, "ModifierType">


NFTMetadata

Ƭ NFTMetadata: Object

Type declaration

NameType
attributesNFTAttribute[]
descriptionstring
imagestring
namestring

NetworkHealthSummary

Ƭ NetworkHealthSummary: AutoGasSetting, number

On the server we keep track of how fast each auto gas setting confirms in practice.


Planet

Ƭ Planet: Object

Represents a Dark Forest planet object (planets, asteroid fields, quasars, spacetime rips, and foundries). Note that some Planet fields (1) store client-specific data that the blockchain is not aware of, such as unconfirmedDepartures (tracks pending moves originating at this planet that have been submitted to the blockchain from a client), or (2) store derived data that is calculated separately client-side, such as silverSpent and bonus. So this object does not cleanly map to any single object in the DarkForest contract (or even any collection of objects).

Type declaration

NameType
blockedPlanetIdsLocationId[]
bonusPlanetBonus
capturer?EthAddress
claimer?EthAddress
coordsRevealedboolean
defensenumber
destroyedboolean
emojiBobAnimation?DFAnimation
emojiZoopAnimation?DFAnimation
emojiZoopOutAnimation?DFStatefulAnimation<string>
energynumber
energyCapnumber
energyGrowthnumber
hasTriedFindingArtifactboolean
hatLevelnumber
heldArtifactIdsArtifactId[]
invadeStartBlock?number
invader?EthAddress
isHomePlanetboolean
isInContractboolean
isSpawnPlanetboolean
isTargetPlanetboolean
lastLoadedServerState?number
lastUpdatednumber
loadingServerStateboolean
localPhotoidUpgrade?Upgrade
locationIdLocationId
messages?PlanetMessage<unknown>[]
needsServerRefreshboolean
ownerEthAddress
pausersnumber
perlinnumber
planetLevelPlanetLevel
planetTypePlanetType
prospectedBlockNumber?number
rangenumber
revealer?EthAddress
silvernumber
silverCapnumber
silverGrowthnumber
silverSpentnumber
spaceJunknumber
spaceTypeSpaceType
speednumber
syncedWithContractboolean
transactions?TransactionCollection
unconfirmedAddEmojiboolean
unconfirmedClearEmojiboolean
upgradeStateUpgradeState

PlanetBonus

Ƭ PlanetBonus: boolean, boolean, boolean, boolean, boolean, boolean

A list of five flags, indicating whether the planet has an attached comet doubling each of five stats: (in order) energyCap, energyGrowth, range, speed, defense


PlanetLevel

Ƭ PlanetLevel: Abstract<number, "PlanetLevel">

Abstract type representing a planet level.


PlanetMessageBody

Ƭ PlanetMessageBody: EmojiFlagBody | unknown

Thinking about future message types.


PlanetMessageType

Ƭ PlanetMessageType: Abstract<string, "PlanetMessageType">

Abstract type representing a type of planet message.


PlanetType

Ƭ PlanetType: Abstract<number, "PlanetType">

Abstract type representing a planet type.


Player

Ƭ Player: Object

Represents a player; corresponds fairly closely with the analogous contract struct

Type declaration

NameTypeDescription
addressEthAddress-
claimedShipsboolean-
homePlanetIdLocationId-
initTimestampnumberseconds (not millis)
lastClaimTimestampnumber-
lastRevealTimestampnumberseconds (not millis)
movesnumber-
readyboolean-
scorenumber-
spaceJunknumber-
spaceJunkLimitnumber-
teamnumber-
twitter?string-

PluginId

Ƭ PluginId: Abstract<string, "PluginId">


RGBAVec

Ƭ RGBAVec: number, number, number, number


RGBVec

Ƭ RGBVec: number, number, number


RegisterResponse

Ƭ RegisterResponse: Object

Type declaration

NameType
error?string
inProgressboolean
success?boolean

RenderZIndex

Ƭ RenderZIndex: Abstract<number, "RenderZIndex">


RendererProgram

Ƭ RendererProgram: Object

Type declaration

NameType
attribsObject
fragmentShaderstring
uniformsObject
vertexShaderstring

RendererType

Ƭ RendererType: Abstract<number, "RendererType">

Enum for determining the type of renderer Each renderer should contain a variable called 'rendererType' 'rendererType' should be a enum that corresponds with the type of renderer it is


RevealedCoords

Ƭ RevealedCoords: WorldCoords & Object

Represents a planet location that has been broadcast on-chain


RevealedLocation

Ƭ RevealedLocation: WorldLocation & Object


RuinsInfo

Ƭ RuinsInfo: Object

Index signature

PlanetLevel: number: Object


Scaling

Ƭ Scaling: Object

Type declaration

NameType
xnumber
ynumber

Setting

Ƭ Setting: Abstract<string, "Setting">


SpaceColorConfiguration

Ƭ SpaceColorConfiguration: Object

Type declaration

NameType
deadSpaceColor?string
deepSpaceColor?string
innerNebulaColor?string
nebulaColor?string
spaceColor?string

SpaceType

Ƭ SpaceType: Abstract<number, "SpaceType">

Abstract type representing a type of space.


SpaceshipType

Ƭ SpaceshipType: Abstract<number, "SpaceshipType">


TextAlign

Ƭ TextAlign: Abstract<number, "TextAlign">


TextAnchor

Ƭ TextAnchor: Abstract<number, "TextAnchor">


TooltipName

Ƭ TooltipName: Abstract<string, "TooltipName">


TransactionId

Ƭ TransactionId: number

A unique incrementing number that identifies a transaction.


Translation

Ƭ Translation: Object

Type declaration

NameType
xnumber
ynumber

Tuple6

Ƭ Tuple6: A, A, A, A, A, A

Type parameters

Name
A

UniformJSType

Ƭ UniformJSType: mat4 | mat3 | number | Vec3


UniformProps

Ƭ UniformProps: Object

Type declaration

NameType
namestring
typeUniformType

UniformType

Ƭ UniformType: Abstract<number, "UniformType">


Upgrade

Ƭ Upgrade: Object

The effects of an upgrade on the stats of a planet. Both upgrades purchased for silver as well as artifacts of certain types can modify stats of a planet.

Type declaration

NameType
defMultipliernumber
energyCapMultipliernumber
energyGroMultipliernumber
rangeMultipliernumber
speedMultipliernumber

UpgradeBranchName

Ƭ UpgradeBranchName: Abstract<number, "UpgradeBranchName">

Abstract type representing an upgrade branch.


UpgradeBranches

Ƭ UpgradeBranches: UpgradeLevels, UpgradeLevels, UpgradeLevels

Stores the stat effects of upgrades of all three branches: defense, range, speed.


UpgradeLevels

Ƭ UpgradeLevels: Upgrade, Upgrade, Upgrade, Upgrade

On a single upgrade branch, the stat effects of the four upgrades.


UpgradeState

Ƭ UpgradeState: number, number, number

How many times a planet has been upgraded along each of the three branches: defense, range, and speed


Vec3

Ƭ Vec3: number, number, number


VoyageId

Ƭ VoyageId: Abstract<string, "VoyageId">

a voyage UID. these start at 1 and auto-increment in the contract. this is immutable and the only place a VoyageId should ever be created is on initial deserialization of a QueuedArrival from contract data (see serde)


WhitelistStatusResponse

Ƭ WhitelistStatusResponse: Object

Type declaration

NameTypeDescription
failedAt?stringFailure timestamp.
position?stringThe address' position in the queue.
txHash?stringIf successful, the hash of the whitelist registration transaction.
whitelistedboolean-

WorldCoords

Ƭ WorldCoords: Object

Represents the coordinates of a location in the world.

Type declaration

NameType
xnumber
ynumber

WorldLocation

Ƭ WorldLocation: Object

A location in the world with relevant properties: the location's ID (deterministically generated from its coords), the spacetype perlin value at these coordinates, and the biomebase perlin value at these coordinates (combined with spacetype to derive the biome here)

Type declaration

NameType
biomebasenumber
coordsWorldCoords
hashLocationId
perlinnumber

Wormhole

Ƭ Wormhole: Object

Type declaration

NameType
fromLocationId
toLocationId

Variables

ArrivalType

ArrivalType: Object

Enumeration of arrival types.

Type declaration

NameType
NormalArrivalType
PhotoidArrivalType
UnknownArrivalType
WormholeArrivalType

ArtifactRarity

ArtifactRarity: Object

Enumeration of artifact rarity levels. Common = 1, Mythic = 5

Type declaration

NameType
CommonArtifactRarity
EpicArtifactRarity
LegendaryArtifactRarity
MythicArtifactRarity
RareArtifactRarity
UnknownArtifactRarity

ArtifactRarityNames

Const ArtifactRarityNames: Object

Mapping from ArtifactRarity to pretty-printed names.


ArtifactType

ArtifactType: Object

Enumeration of artifact types.

Type declaration

NameType
BlackDomainArtifactType
BloomFilterArtifactType
ColossusArtifactType
MonolithArtifactType
PhotoidCannonArtifactType
PlanetaryShieldArtifactType
PyramidArtifactType
ShipCrescentArtifactType
ShipGearArtifactType
ShipMothershipArtifactType
ShipTitanArtifactType
ShipWhaleArtifactType
SpaceshipArtifactType
UnknownArtifactType
WormholeArtifactType

ArtifactTypeNames

Const ArtifactTypeNames: Object

Mapping from ArtifactType to pretty-printed names.


AttribType

AttribType: Object

Type declaration

NameType
FloatAttribType
UByteAttribType

AutoGasSetting

AutoGasSetting: Object

Type declaration

NameType
AverageAutoGasSetting
FastAutoGasSetting
SlowAutoGasSetting

Biome

Biome: Object

Enumeration of the biomes in the game. OCEAN = 1, CORRUPTED = 10

Type declaration

NameType
CORRUPTEDBiome
DESERTBiome
FORESTBiome
GRASSLANDBiome
ICEBiome
LAVABiome
OCEANBiome
SWAMPBiome
TUNDRABiome
UNKNOWNBiome
WASTELANDBiome

BiomeNames

Const BiomeNames: Object

Mapping from Biome to pretty-printed names.


CursorState

CursorState: Object

Type declaration

NameType
NormalCursorState
TargetingExplorerCursorState
TargetingForcesCursorState

DrawMode

DrawMode: Object

Type declaration

NameType
LinesDrawMode
PointsDrawMode
TrianglesDrawMode

HatType

HatType: Object

Type declaration

NameType
ChefHatHatType
CowboyHatHatType
FezHatType
FishHatType
GraduationCapHatType
PartyHatHatType
PopeHatHatType
SantaHatHatType
SquidHatType
TopHatHatType

ModalManagerEvent

ModalManagerEvent: Object

Type declaration

NameType
MiningCoordsUpdatestring
StateChangedstring

ModalName

ModalName: Object

Type declaration

NameType
ArtifactConversationModalName
ArtifactDetailsModalName
BroadcastModalName
DiagnosticsModalName
HatsModalName
HelpModalName
LeaderboardModalName
ManageAccountModalName
ManageArtifactsModalName
MapShareModalName
OnboardingModalName
PlanetContextPaneModalName
PlanetDetailsModalName
PlanetDexModalName
PluginEditorModalName
PluginWarningModalName
PluginsModalName
PrivateModalName
SettingsModalName
SurveyModalName
TransactionLogModalName
TwitterVerifyModalName
UpgradeDetailsModalName
WaitingRoomModalName
WithdrawSilverModalName
YourArtifactsModalName

ModifierType

ModifierType: Object

Enumeration of artifact rarity levels. Common = 1, Mythic = 5

popCap, popGrowth, silverCap, silverGrowth, range, speed, defense

Type declaration

NameType
DefenseModifierType
PiratesModifierType
PopulationCapModifierType
PopulationGrowthModifierType
RangeModifierType
SilverCapModifierType
SilverGrowthModifierType
SpeedModifierType

ModifierTypeNames

Const ModifierTypeNames: Object

Mapping from ArtifactRarity to pretty-printed names.


PlanetLevel

PlanetLevel: Object

Enumeration of the possible planet levels.

Type declaration

NameType
EIGHTPlanetLevel
FIVEPlanetLevel
FOURPlanetLevel
NINEPlanetLevel
ONEPlanetLevel
SEVENPlanetLevel
SIXPlanetLevel
THREEPlanetLevel
TWOPlanetLevel
ZEROPlanetLevel

PlanetLevelNames

Const PlanetLevelNames: Object

Mapping from PlanetLevel to pretty-printed names.


PlanetMessageType

PlanetMessageType: Object

Each message type has a corresponding entry here.

Type declaration

NameType
EmojiFlagPlanetMessageType

PlanetType

PlanetType: Object

Enumeration of the planet types. (PLANET = 0, SILVER_BANK = 4)

Type declaration

NameType
PLANETPlanetType
RUINSPlanetType
SILVER_BANKPlanetType
SILVER_MINEPlanetType
TRADING_POSTPlanetType

PlanetTypeNames

Const PlanetTypeNames: Object

Mapping from PlanetType to pretty-printed names.


RenderZIndex

RenderZIndex: Object

Type declaration

NameType
BackgroundRenderZIndex
DEFAULTRenderZIndex
MAXRenderZIndex
PlanetsRenderZIndex
TextRenderZIndex
UIRenderZIndex
VoyagesRenderZIndex

RendererType

RendererType: Object

Type declaration

NameType
AsteroidRendererType
BackgroundRendererType
BeltRendererType
BlackDomainRendererType
CaptureZoneRendererType
CircleRendererType
LineRendererType
MineRendererType
MineBodyRendererType
PerlinRendererType
PlanetRendererType
PlanetManagerRendererType
QuasarRendererType
QuasarBodyRendererType
QuasarRayRendererType
RectRendererType
RingRendererType
RuinsRendererType
SpaceRendererType
SpacetimeRipRendererType
SpriteRendererType
TextRendererType
UIRendererType
UnminedRendererType
VoyagerRendererType
WormholeRendererType

Setting

Setting: Object

Each setting has a unique identifier. Each account gets to store its own local storage setting, per instance of the dark forest contract that it's connected to.

Type declaration

NameType
AutoApproveNonPurchaseTransactionsSetting
AutoClearConfirmedTransactionsAfterSecondsSetting
AutoClearRejectedTransactionsAfterSecondsSetting
DisableDefaultShortcutsSetting
DisableEmojiRenderingSetting
DisableFancySpaceEffectSetting
DisableHatRenderingSetting
DrawChunkBordersSetting
ExperimentalFeaturesSetting
ForceReloadEmbeddedPluginsSetting
FoundArtifactSetting
FoundCometSetting
FoundDeepSpaceSetting
FoundPiratesSetting
FoundSilverSetting
FoundSilverBankSetting
FoundSpaceSetting
FoundTradingPostSetting
GasFeeGweiSetting
HasAcceptedPluginRiskSetting
HighPerformanceRenderingSetting
IsMiningSetting
MiningCoresSetting
MoveNotificationsSetting
NewPlayerSetting
OptOutMetricsSetting
RendererColorDeadSpaceSetting
RendererColorDeepSpaceSetting
RendererColorInnerNebulaSetting
RendererColorNebulaSetting
RendererColorSpaceSetting
TerminalVisibleSetting
TutorialCompletedSetting
TutorialOpenSetting

SpaceType

SpaceType: Object

Enumeration of the types of space in the game. NEBULA = 0, DEAD_SPACE = 3

Type declaration

NameType
DEAD_SPACESpaceType
DEEP_SPACESpaceType
NEBULASpaceType
SPACESpaceType

SpaceTypeNames

Const SpaceTypeNames: Object

Mapping from SpaceType to pretty-printed names.


SpaceshipType

SpaceshipType: Object

Enumeration of spaceships

Type declaration

NameType
CrescentSpaceshipType
GearSpaceshipType
MothershipSpaceshipType
TitanSpaceshipType
WhaleSpaceshipType

SpaceshipTypeDesc

Const SpaceshipTypeDesc: Object

Mapping from Spaceships to pretty-printed descriptions.


SpaceshipTypeNames

Const SpaceshipTypeNames: Object

Mapping from Spaceships to pretty-printed names.


TextAlign

TextAlign: Object

Type declaration

NameType
CenterTextAlign
LeftTextAlign
RightTextAlign

TextAnchor

TextAnchor: Object

Type declaration

NameType
BottomTextAnchor
MiddleTextAnchor
TopTextAnchor

TooltipName

TooltipName: Object

Type declaration

NameTypeDescription
AbandonTooltipName-
ActivateArtifactTooltipName-
ArtifactBuffTooltipName-
ArtifactStoredTooltipName-
BlockedTooltipName-
BonusTooltipName-
BonusDefenseTooltipName-
BonusEnergyCapTooltipName-
BonusEnergyGroTooltipName-
BonusRangeTooltipName-
BonusSpaceJunkTooltipName-
BonusSpeedTooltipName-
CancelTransactionTooltipName-
CapturableTooltipName-
ClowntownTooltipName-
CurrentMiningTooltipName-
DeactivateArtifactTooltipName-
DefenseTooltipName-
DefenseMultiplierTooltipName-
DepositArtifactTooltipName-
EmptyTooltipNameSo that you can render a tooltip without anything, and control its contents entirely via the {@link TooltipTriggerProps#extraContent} prop field.
EnergyTooltipName-
EnergyCapMultiplierTooltipName-
EnergyGrowthTooltipName-
EnergyGrowthMultiplierTooltipName-
FindArtifactTooltipName-
HashesPerSecTooltipName-
HoverPlanetTooltipName-
InvadableTooltipName-
MaxLevelTooltipName-
MinEnergyTooltipName-
MiningPauseTooltipName-
MiningTargetTooltipName-
ModalFindArtifactTooltipName-
ModalHatsTooltipName-
ModalHelpTooltipName-
ModalLeaderboardTooltipName-
ModalPlanetDetailsTooltipName-
ModalPlanetDexTooltipName-
ModalPluginsTooltipName-
ModalSettingsTooltipName-
ModalTwitterBroadcastTooltipName-
ModalTwitterVerificationTooltipName-
ModalUpgradeDetailsTooltipName-
ModalWithdrawSilverTooltipName-
ModalYourArtifactsTooltipName-
NetworkHealthTooltipName-
PiratesTooltipName-
PlanetRankTooltipName-
PrioritizeTransactionTooltipName-
RangeTooltipName-
RangeMultiplierTooltipName-
RankTooltipName-
RetryTransactionTooltipName-
ScoreTooltipName-
SelectedSilverTooltipName-
SilverTooltipName-
SilverCapTooltipName-
SilverGrowthTooltipName-
SilverProdTooltipName-
SpaceJunkTooltipName-
SpawnPlanetTooltipName-
SpeedTooltipName-
SpeedMultiplierTooltipName-
TargetPlanetTooltipName-
Time50TooltipName-
Time90TooltipName-
TimeUntilActivationPossibleTooltipName-
TwitterHandleTooltipName-
UpgradesTooltipName-
WithdrawArtifactTooltipName-
WithdrawSilverButtonTooltipName-

UniformType

UniformType: Object

Type declaration

NameType
FloatUniformType
Mat3UniformType
Mat4UniformType
TextureUniformType
UByteUniformType
Vec3UniformType

UpgradeBranchName

UpgradeBranchName: Object

Enumeration of the three upgrade branches.

Type declaration

NameType
DefenseUpgradeBranchName
RangeUpgradeBranchName
SpeedUpgradeBranchName

Functions

array6

array6<A>(decoder): Decoder<Tuple6<A>, unknown>

Type parameters

Name
A

Parameters

NameType
decoderDecoder<A, unknown>

Returns

Decoder<Tuple6<A>, unknown>


artifactNameFromArtifact

artifactNameFromArtifact(artifact): string

Deterministically generates the name of the artifact from its ID.

Parameters

NameTypeDescription
artifactArtifactThe artifact to generate a name for

Returns

string


between

between(decoder, min, max): Decoder<number, unknown>

Parameters

NameType
decoderDecoder<number, unknown>
minnumber
maxnumber

Returns

Decoder<number, unknown>


exactArray10

exactArray10<A>(decoder): Decoder<ExactArray10<A>, unknown>

Type parameters

Name
A

Parameters

NameType
decoderDecoder<A, unknown>

Returns

Decoder<ExactArray10<A>, unknown>


exactArray4

exactArray4<A>(decoder): Decoder<ExactArray4<A>, unknown>

Type parameters

Name
A

Parameters

NameType
decoderDecoder<A, unknown>

Returns

Decoder<ExactArray4<A>, unknown>


exactArray5

exactArray5<A>(decoder): Decoder<ExactArray5<A>, unknown>

Type parameters

Name
A

Parameters

NameType
decoderDecoder<A, unknown>

Returns

Decoder<ExactArray5<A>, unknown>


exactArray8

exactArray8<A>(decoder): Decoder<ExactArray8<A>, unknown>

Type parameters

Name
A

Parameters

NameType
decoderDecoder<A, unknown>

Returns

Decoder<ExactArray8<A>, unknown>


withDefault

withDefault<A>(decoder, def): Decoder<A, unknown>

Type parameters

Name
A

Parameters

NameType
decoderDecoder<A, unknown>
defA

Returns

Decoder<A, unknown>