# @latticexyz/std-client

# Enumerations

# Type Aliases

# ActionSystem

Ƭ ActionSystem: ReturnType<typeof createActionSystem>

# Defined in

std-client/src/systems/ActionSystem/createActionSystem.ts:23


# ContractComponent

Ƭ ContractComponent: Component<Schema, { contractId: string ; tableId?: string }>

# Defined in

std-client/src/setup/types.ts:29


# ContractComponents

Ƭ ContractComponents: Object

# Index signature

▪ [key: string]: ContractComponent

# Defined in

std-client/src/setup/types.ts:31


# DecodedNetworkComponentUpdate

Ƭ DecodedNetworkComponentUpdate: Omit<Omit<NetworkComponentUpdate, "entity">, "component"> & { component: Component<Schema> ; entity: EntityIndex }

# Defined in

std-client/src/setup/types.ts:15


# DecodedSystemCall

Ƭ DecodedSystemCall<T, C>: Omit<SystemCall<C>, "updates"> & { args: Record<string, unknown> ; systemId: keyof T ; updates: DecodedNetworkComponentUpdate[] }

# Type parameters

Name Type
T extends Object = { [key: string]: Contract; }
C extends Components = Components

# Defined in

std-client/src/setup/types.ts:20


# NetworkComponents

Ƭ NetworkComponents<C>: C & { ComponentsRegistry: Component<{ value: Type.String }> ; LoadingState: Component<{ msg: Type.String ; percentage: Type.Number ; state: Type.Number }> ; SystemsRegistry: Component<{ value: Type.String }> }

# Type parameters

Name Type
C extends ContractComponents

# Defined in

std-client/src/setup/types.ts:35


# SetupContractConfig

Ƭ SetupContractConfig: NetworkConfig & Omit<SyncWorkerConfig, "worldContract" | "mappings"> & { devMode?: boolean ; disableCache?: boolean ; worldAddress: string }

# Defined in

std-client/src/setup/types.ts:5

# Variables

# ActionStateString

Const ActionStateString: Object

# Type declaration

Name Type
0 string
1 string
2 string
3 string
4 string
5 string
6 string

# Defined in

std-client/src/systems/ActionSystem/constants.ts:11

# Functions

# applyNetworkUpdates

applyNetworkUpdates<C>(world, components, ecsEvents$, mappings, ack$, decodeAndEmitSystemCall?): Object

Sets up synchronization between contract components and client components

# Type parameters

Name Type
C extends Components

# Parameters

Name Type
world World
components C
ecsEvents$ Observable<NetworkEvent<C>[]>
mappings Mappings<C>
ack$ Subject<Ack>
decodeAndEmitSystemCall? (event: SystemCall<C>) => void

# Returns

Object

Name Type
txReduced$ Observable<string>

# Defined in

std-client/src/setup/utils.ts:136


# createActionSystem

createActionSystem<M>(world, txReduced$): Object

# Type parameters

Name Type
M undefined

# Parameters

Name Type
world World
txReduced$ Observable<string>

# Returns

Object

Name Type
Action Component<{ metadata: OptionalT = Type.OptionalT; on: OptionalEntity = Type.OptionalEntity; overrides: OptionalStringArray = Type.OptionalStringArray; state: Number = Type.Number; txHash: OptionalString = Type.OptionalString }, Metadata, M>
add <C, T>(actionRequest: ActionRequest<C, T, M>) => EntityIndex
cancel (actionId: EntityID) => boolean
withOptimisticUpdates <S, M, T>(component: Component<S, M, T>) => OverridableComponent<S, M, T>

# Defined in

std-client/src/systems/ActionSystem/createActionSystem.ts:25


# createDecodeNetworkComponentUpdate

createDecodeNetworkComponentUpdate<C>(world, components, mappings): (update: NetworkComponentUpdate) => DecodedNetworkComponentUpdate | undefined

# Type parameters

Name Type
C extends Components

# Parameters

Name Type
world World
components C
mappings Mappings<C>

# Returns

fn

▸ (update): DecodedNetworkComponentUpdate | undefined

# Parameters
Name Type
update NetworkComponentUpdate
# Returns

DecodedNetworkComponentUpdate | undefined

# Defined in

std-client/src/setup/utils.ts:38


# createEncoders

createEncoders(world, components, signerOrProvider): Promise<Record<string, (value: { [key: string]: unknown; }) => string>>

# Parameters

Name Type
world World
components Component<{ value: String }, Metadata, undefined>
signerOrProvider IComputedValue<JsonRpcProvider | Signer>

# Returns

Promise<Record<string, (value: { [key: string]: unknown; }) => string>>

# Defined in

std-client/src/setup/utils.ts:103


# createSystemCallStreams

createSystemCallStreams<C, SystemTypes>(world, systemNames, systemsRegistry, getSystemContract, decodeNetworkComponentUpdate): Object

# Type parameters

Name Type
C extends Components
SystemTypes extends Object

# Parameters

Name Type
world World
systemNames string[]
systemsRegistry Component<{ value: String }, Metadata, undefined>
getSystemContract (systemId: string) => { contract: Contract ; name: string }
decodeNetworkComponentUpdate (update: NetworkComponentUpdate<Components>) => undefined | DecodedNetworkComponentUpdate

# Returns

Object

Name Type
decodeAndEmitSystemCall (systemCall: SystemCall<C>) => void
systemCallStreams Record<string, Subject<DecodedSystemCall<SystemTypes, C>>>

# Defined in

std-client/src/setup/utils.ts:61


# defineActionComponent

defineActionComponent<T>(world): Component<{ metadata: OptionalT = Type.OptionalT; on: OptionalEntity = Type.OptionalEntity; overrides: OptionalStringArray = Type.OptionalStringArray; state: Number = Type.Number; txHash: OptionalString = Type.OptionalString }, Metadata, T>

# Type parameters

Name Type
T undefined

# Parameters

Name Type
world World

# Returns

Component<{ metadata: OptionalT = Type.OptionalT; on: OptionalEntity = Type.OptionalEntity; overrides: OptionalStringArray = Type.OptionalStringArray; state: Number = Type.Number; txHash: OptionalString = Type.OptionalString }, Metadata, T>

# Defined in

std-client/src/components/ActionComponent.ts:3


# defineBoolComponent

defineBoolComponent<M>(world, options?): Component<{ value: Boolean }, M, undefined>

# Type parameters

Name Type
M extends Metadata

# Parameters

Name Type
world World
options? Object
options.id? string
options.indexed? boolean
options.metadata? M

# Returns

Component<{ value: Boolean }, M, undefined>

# Defined in

std-client/src/components/BoolComponent.ts:3


# defineCoordComponent

defineCoordComponent<M>(world, options?): Component<{ x: Number ; y: Number }, M, undefined>

# Type parameters

Name Type
M extends Metadata

# Parameters

Name Type
world World
options? Object
options.id? string
options.indexed? boolean
options.metadata? M

# Returns

Component<{ x: Number ; y: Number }, M, undefined>

# Defined in

std-client/src/components/CoordComponent.ts:3


# defineDevHighlightComponent

defineDevHighlightComponent(world): Component<{ value: OptionalNumber = Type.OptionalNumber }, Metadata, undefined>

DevHighlight is for use during development to highlight the positions of entities that you are interacting with. Example: Highlight the Entities that you are currently editing in the ComponentBrowser.

# Parameters

Name Type
world World

# Returns

Component<{ value: OptionalNumber = Type.OptionalNumber }, Metadata, undefined>

# Defined in

std-client/src/components/DevHighlight.ts:8


# defineNumberComponent

defineNumberComponent<M>(world, options?): Component<{ value: Number }, M, undefined>

# Type parameters

Name Type
M extends Metadata

# Parameters

Name Type
world World
options? Object
options.id? string
options.indexed? boolean
options.metadata? M

# Returns

Component<{ value: Number }, M, undefined>

# Defined in

std-client/src/components/NumberComponent.ts:3


# defineStringComponent

defineStringComponent<M>(world, options?): Component<{ value: String }, M, undefined>

# Type parameters

Name Type
M extends Metadata

# Parameters

Name Type
world World
options? Object
options.id? string
options.indexed? boolean
options.metadata? M

# Returns

Component<{ value: String }, M, undefined>

# Defined in

std-client/src/components/StringComponent.ts:3


# defineVoxelCoordComponent

defineVoxelCoordComponent<M>(world, options?): Component<{ x: Number ; y: Number ; z: Number }, M, undefined>

# Type parameters

Name Type
M extends Metadata

# Parameters

Name Type
world World
options? Object
options.id? string
options.indexed? boolean
options.metadata? M

# Returns

Component<{ x: Number ; y: Number ; z: Number }, M, undefined>

# Defined in

std-client/src/components/VoxelCoordComponent.ts:3


# findEntityWithComponentInRelationshipChain

findEntityWithComponentInRelationshipChain(relationshipComponent, entity, searchComponent): EntityIndex | undefined

Starting with the given entity, traverse the relationship chain until you find an entity that has the given component.

# Parameters

Name Type Description
relationshipComponent Component<{ value: Entity }, Metadata, undefined> The component that will be used to traverse the relationship chain.
entity EntityIndex Starting entity
searchComponent Component<Schema, Metadata, undefined> The component to search for.

# Returns

EntityIndex | undefined

The first entity in the relationship chain that has the given component or undefined if the relationship chain is broken.

# Defined in

std-client/src/utils.ts:116


# findInRelationshipChain

findInRelationshipChain(relationshipComponent, entity, searchEntity): boolean

Find a specific entity in a relationship chain.

# Parameters

Name Type Description
relationshipComponent Component<{ value: Entity }, Metadata, undefined> The component that will be used to traverse the relationship chain.
entity EntityIndex Starting entity
searchEntity EntityIndex Entity to search for

# Returns

boolean

True if the entity is found in the relationship chain, false otherwise.

# Defined in

std-client/src/utils.ts:143


# getBurnerWallet

getBurnerWallet(cacheKey?): BehaviorSubject<Hex>

# Parameters

Name Type Default value
cacheKey string "mud:burnerWallet"

# Returns

BehaviorSubject<Hex>

# Defined in

std-client/src/getBurnerWallet.ts:15


# getCurrentTurn

getCurrentTurn(world, gameConfigComponent, clock): number

# Parameters

Name Type
world World
gameConfigComponent Component<{ actionCooldownLength: String ; startTime: String ; turnLength: String }, Metadata, undefined>
clock Clock

# Returns

number

# Defined in

std-client/src/utils.ts:24


# getGameConfig

getGameConfig(world, gameConfigComponent): undefined | ComponentValue<{ actionCooldownLength: String ; startTime: String ; turnLength: String }, undefined>

# Parameters

Name Type
world World
gameConfigComponent Component<{ actionCooldownLength: String ; startTime: String ; turnLength: String }, Metadata, undefined>

# Returns

undefined | ComponentValue<{ actionCooldownLength: String ; startTime: String ; turnLength: String }, undefined>

# Defined in

std-client/src/utils.ts:54


# getPlayerEntity

getPlayerEntity(address, world, Player): EntityIndex | undefined

# Parameters

Name Type
address undefined | string
world World
Player Component<{ value: Boolean }, Metadata, undefined>

# Returns

EntityIndex | undefined

# Defined in

std-client/src/utils.ts:76


# getStringColor

getStringColor(address): number

# Parameters

Name Type
address string

# Returns

number

# Defined in

std-client/src/utils.ts:239


# getTurnAtTime

getTurnAtTime(world, gameConfigComponent, time): number

# Parameters

Name Type
world World
gameConfigComponent Component<{ actionCooldownLength: String ; startTime: String ; turnLength: String }, Metadata, undefined>
time number

# Returns

number

# Defined in

std-client/src/utils.ts:36


# isUntraversable

isUntraversable(untraversableComponent, positionComponent, targetPosition): boolean

# Parameters

Name Type
untraversableComponent Component<{ value: Boolean }, Metadata, undefined>
positionComponent Component<{ x: Number ; y: Number }, Metadata, undefined>
targetPosition Coord

# Returns

boolean

# Defined in

std-client/src/utils.ts:64


# randomColor

randomColor(id): number

Generate a random color based on the given id.

# Parameters

Name Type Description
id string Any string

# Returns

number

A color in the range 0x000000 - 0xFFFFFF

# Defined in

std-client/src/utils.ts:168


# resolveRelationshipChain

resolveRelationshipChain(relationshipComponent, entity): EntityIndex | undefined

Starting with the given entity, traverse the relationship chain until the end is reached.

# Parameters

Name Type Description
relationshipComponent Component<{ value: Entity }, Metadata, undefined> The component that will be used to traverse the relationship chain.
entity EntityIndex Starting entity

# Returns

EntityIndex | undefined

The last entity in the relationship chain or undefined if the relationship chain is broken.

# Defined in

std-client/src/utils.ts:95


# setupMUDNetwork

setupMUDNetwork<C, SystemTypes>(networkConfig, world, contractComponents, SystemAbis, options?): Promise<{ components: NetworkComponents<C> ; ecsEvent$: Observable<NetworkEvent<C>> ; encoders: Promise<unknown> ; gasPriceInput$: BehaviorSubject<number> ; mappings: Mappings<C> ; network: { blockNumber$: Observable<number> ; clock: Clock ; config: NetworkConfig ; connected: IComputedValue<ConnectionState> ; connectedAddress: IComputedValue<undefined | string> ; connectedAddressChecksummed: IComputedValue<undefined | string> ; dispose: () => void ; providers: IComputedValue<{ json: MUDJsonRpcProvider | MUDJsonRpcBatchProvider ; ws: undefined | WebSocketProvider }> ; signer: IComputedValue<undefined | Signer> } ; playerEntity: undefined | EntityIndex ; playerEntityId: undefined | EntityID ; registerComponent: (key: string, component: ContractComponent) => void ; registerSystem: (system: { contract: Contract ; id: string }) => Promise<void> ; singletonEntity: EntityIndex ; singletonEntityId: EntityID = SingletonID; startSync: () => void ; systemCallStreams: Record<string, Subject<DecodedSystemCall<{ [key: string]: Contract; }, Components>>> ; systems: TxQueue<SystemTypes> ; txQueue: TxQueue<{ World: World }> ; txReduced$: Observable<string> }>

# Type parameters

Name Type
C extends ContractComponents
SystemTypes extends Object

# Parameters

Name Type
networkConfig SetupContractConfig
world World
contractComponents C
SystemAbis { [key in string | number | symbol]: ContractInterface }
options? Object
options.fetchSystemCalls? boolean
options.initialGasPrice? number
options.syncThread? "worker" | "main"

# Returns

Promise<{ components: NetworkComponents<C> ; ecsEvent$: Observable<NetworkEvent<C>> ; encoders: Promise<unknown> ; gasPriceInput$: BehaviorSubject<number> ; mappings: Mappings<C> ; network: { blockNumber$: Observable<number> ; clock: Clock ; config: NetworkConfig ; connected: IComputedValue<ConnectionState> ; connectedAddress: IComputedValue<undefined | string> ; connectedAddressChecksummed: IComputedValue<undefined | string> ; dispose: () => void ; providers: IComputedValue<{ json: MUDJsonRpcProvider | MUDJsonRpcBatchProvider ; ws: undefined | WebSocketProvider }> ; signer: IComputedValue<undefined | Signer> } ; playerEntity: undefined | EntityIndex ; playerEntityId: undefined | EntityID ; registerComponent: (key: string, component: ContractComponent) => void ; registerSystem: (system: { contract: Contract ; id: string }) => Promise<void> ; singletonEntity: EntityIndex ; singletonEntityId: EntityID = SingletonID; startSync: () => void ; systemCallStreams: Record<string, Subject<DecodedSystemCall<{ [key: string]: Contract; }, Components>>> ; systems: TxQueue<SystemTypes> ; txQueue: TxQueue<{ World: World }> ; txReduced$: Observable<string> }>

# Defined in

std-client/src/setup/setupMUDNetwork.ts:29


# setupMUDV2Network

setupMUDV2Network<C>(__namedParameters): Promise<{ components: { Callbacks: Component<{ value: BigIntArray = RecsType.BigIntArray }, { contractId: `0x$` ; tableId: string }, undefined> ; FunctionSelectors: Component<{ name: String = RecsType.String; namespace: String = RecsType.String; systemFunctionSelector: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Hooks: Component<{ value: StringArray = RecsType.StringArray }, { contractId: `0x$` ; tableId: string }, undefined> ; InstalledModules: Component<{ moduleAddress: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Mixed: Component<{ a32: NumberArray = RecsType.NumberArray; s: String = RecsType.String; u128: BigInt = RecsType.BigInt; u32: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; NamespaceOwner: Component<{ owner: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; ResourceAccess: Component<{ access: Boolean = RecsType.Boolean }, { contractId: `0x$` ; tableId: string }, undefined> ; ResourceType: Component<{ resourceType: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; StoreMetadata: Component<{ abiEncodedFieldNames: String = RecsType.String; tableName: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; SystemRegistry: Component<{ resourceSelector: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Systems: Component<{ publicAccess: Boolean = RecsType.Boolean; system: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Vector2: Component<{ x: Number = RecsType.Number; y: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; storeSchemaComponent: Component<{ keySchema: String = Type.String; valueSchema: String = Type.String }, { contractId: `0x$` ; tableId: string }, undefined> } & C & { ComponentsRegistry: Component<{ value: String }, { contractId: string = "world.component.components" }, undefined> ; LoadingState: Component<{ msg: String = Type.String; percentage: Number = Type.Number; state: Number = Type.Number }, { contractId: string = "component.LoadingState" }, undefined> ; SystemsRegistry: Component<{ value: String }, { contractId: string = "world.component.systems" }, undefined> } ; ecsEvent$: Observable<NetworkEvent<{ Callbacks: Component<{ value: BigIntArray = RecsType.BigIntArray }, { contractId: `0x$` ; tableId: string }, undefined> ; FunctionSelectors: Component<{ name: String = RecsType.String; namespace: String = RecsType.String; systemFunctionSelector: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Hooks: Component<{ value: StringArray = RecsType.StringArray }, { contractId: `0x$` ; tableId: string }, undefined> ; InstalledModules: Component<{ moduleAddress: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Mixed: Component<{ a32: NumberArray = RecsType.NumberArray; s: String = RecsType.String; u128: BigInt = RecsType.BigInt; u32: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; NamespaceOwner: Component<{ owner: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; ResourceAccess: Component<{ access: Boolean = RecsType.Boolean }, { contractId: `0x$` ; tableId: string }, undefined> ; ResourceType: Component<{ resourceType: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; StoreMetadata: Component<{ abiEncodedFieldNames: String = RecsType.String; tableName: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; SystemRegistry: Component<{ resourceSelector: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Systems: Component<{ publicAccess: Boolean = RecsType.Boolean; system: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Vector2: Component<{ x: Number = RecsType.Number; y: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; storeSchemaComponent: Component<{ keySchema: String = Type.String; valueSchema: String = Type.String }, { contractId: `0x$` ; tableId: string }, undefined> } & C & { ComponentsRegistry: Component<{ value: String }, { contractId: string = "world.component.components" }, undefined> ; LoadingState: Component<{ msg: String = Type.String; percentage: Number = Type.Number; state: Number = Type.Number }, { contractId: string = "component.LoadingState" }, undefined> ; SystemsRegistry: Component<{ value: String }, { contractId: string = "world.component.systems" }, undefined> }>> ; encoders: Promise<unknown> ; gasPriceInput$: BehaviorSubject<number> ; mappings: Mappings<{ Callbacks: Component<{ value: BigIntArray = RecsType.BigIntArray }, { contractId: `0x$` ; tableId: string }, undefined> ; FunctionSelectors: Component<{ name: String = RecsType.String; namespace: String = RecsType.String; systemFunctionSelector: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Hooks: Component<{ value: StringArray = RecsType.StringArray }, { contractId: `0x$` ; tableId: string }, undefined> ; InstalledModules: Component<{ moduleAddress: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Mixed: Component<{ a32: NumberArray = RecsType.NumberArray; s: String = RecsType.String; u128: BigInt = RecsType.BigInt; u32: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; NamespaceOwner: Component<{ owner: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; ResourceAccess: Component<{ access: Boolean = RecsType.Boolean }, { contractId: `0x$` ; tableId: string }, undefined> ; ResourceType: Component<{ resourceType: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; StoreMetadata: Component<{ abiEncodedFieldNames: String = RecsType.String; tableName: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; SystemRegistry: Component<{ resourceSelector: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Systems: Component<{ publicAccess: Boolean = RecsType.Boolean; system: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Vector2: Component<{ x: Number = RecsType.Number; y: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; storeSchemaComponent: Component<{ keySchema: String = Type.String; valueSchema: String = Type.String }, { contractId: `0x$` ; tableId: string }, undefined> } & C & { ComponentsRegistry: Component<{ value: String }, { contractId: string = "world.component.components" }, undefined> ; LoadingState: Component<{ msg: String = Type.String; percentage: Number = Type.Number; state: Number = Type.Number }, { contractId: string = "component.LoadingState" }, undefined> ; SystemsRegistry: Component<{ value: String }, { contractId: string = "world.component.systems" }, undefined> }> ; network: { blockNumber$: Observable<number> ; clock: Clock ; config: NetworkConfig ; connected: IComputedValue<ConnectionState> ; connectedAddress: IComputedValue<undefined | string> ; connectedAddressChecksummed: IComputedValue<undefined | string> ; dispose: () => void ; providers: IComputedValue<{ json: MUDJsonRpcProvider | MUDJsonRpcBatchProvider ; ws: undefined | WebSocketProvider }> ; signer: IComputedValue<undefined | Signer> } ; networkConfig: SetupContractConfig ; playerEntity: undefined | EntityIndex ; playerEntityId: undefined | EntityID ; registerComponent: (key: string, component: ContractComponent) => void ; singletonEntity: EntityIndex ; singletonEntityId: EntityID = SingletonID; startSync: () => void ; txQueue: TxQueue<{ World: World }> ; txReduced$: Observable<string> ; world: World }>

# Type parameters

Name Type
C extends ContractComponents

# Parameters

Name Type
__namedParameters SetupMUDV2NetworkOptions<C>

# Returns

Promise<{ components: { Callbacks: Component<{ value: BigIntArray = RecsType.BigIntArray }, { contractId: `0x$` ; tableId: string }, undefined> ; FunctionSelectors: Component<{ name: String = RecsType.String; namespace: String = RecsType.String; systemFunctionSelector: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Hooks: Component<{ value: StringArray = RecsType.StringArray }, { contractId: `0x$` ; tableId: string }, undefined> ; InstalledModules: Component<{ moduleAddress: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Mixed: Component<{ a32: NumberArray = RecsType.NumberArray; s: String = RecsType.String; u128: BigInt = RecsType.BigInt; u32: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; NamespaceOwner: Component<{ owner: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; ResourceAccess: Component<{ access: Boolean = RecsType.Boolean }, { contractId: `0x$` ; tableId: string }, undefined> ; ResourceType: Component<{ resourceType: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; StoreMetadata: Component<{ abiEncodedFieldNames: String = RecsType.String; tableName: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; SystemRegistry: Component<{ resourceSelector: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Systems: Component<{ publicAccess: Boolean = RecsType.Boolean; system: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Vector2: Component<{ x: Number = RecsType.Number; y: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; storeSchemaComponent: Component<{ keySchema: String = Type.String; valueSchema: String = Type.String }, { contractId: `0x$` ; tableId: string }, undefined> } & C & { ComponentsRegistry: Component<{ value: String }, { contractId: string = "world.component.components" }, undefined> ; LoadingState: Component<{ msg: String = Type.String; percentage: Number = Type.Number; state: Number = Type.Number }, { contractId: string = "component.LoadingState" }, undefined> ; SystemsRegistry: Component<{ value: String }, { contractId: string = "world.component.systems" }, undefined> } ; ecsEvent$: Observable<NetworkEvent<{ Callbacks: Component<{ value: BigIntArray = RecsType.BigIntArray }, { contractId: `0x$` ; tableId: string }, undefined> ; FunctionSelectors: Component<{ name: String = RecsType.String; namespace: String = RecsType.String; systemFunctionSelector: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Hooks: Component<{ value: StringArray = RecsType.StringArray }, { contractId: `0x$` ; tableId: string }, undefined> ; InstalledModules: Component<{ moduleAddress: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Mixed: Component<{ a32: NumberArray = RecsType.NumberArray; s: String = RecsType.String; u128: BigInt = RecsType.BigInt; u32: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; NamespaceOwner: Component<{ owner: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; ResourceAccess: Component<{ access: Boolean = RecsType.Boolean }, { contractId: `0x$` ; tableId: string }, undefined> ; ResourceType: Component<{ resourceType: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; StoreMetadata: Component<{ abiEncodedFieldNames: String = RecsType.String; tableName: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; SystemRegistry: Component<{ resourceSelector: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Systems: Component<{ publicAccess: Boolean = RecsType.Boolean; system: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Vector2: Component<{ x: Number = RecsType.Number; y: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; storeSchemaComponent: Component<{ keySchema: String = Type.String; valueSchema: String = Type.String }, { contractId: `0x$` ; tableId: string }, undefined> } & C & { ComponentsRegistry: Component<{ value: String }, { contractId: string = "world.component.components" }, undefined> ; LoadingState: Component<{ msg: String = Type.String; percentage: Number = Type.Number; state: Number = Type.Number }, { contractId: string = "component.LoadingState" }, undefined> ; SystemsRegistry: Component<{ value: String }, { contractId: string = "world.component.systems" }, undefined> }>> ; encoders: Promise<unknown> ; gasPriceInput$: BehaviorSubject<number> ; mappings: Mappings<{ Callbacks: Component<{ value: BigIntArray = RecsType.BigIntArray }, { contractId: `0x$` ; tableId: string }, undefined> ; FunctionSelectors: Component<{ name: String = RecsType.String; namespace: String = RecsType.String; systemFunctionSelector: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Hooks: Component<{ value: StringArray = RecsType.StringArray }, { contractId: `0x$` ; tableId: string }, undefined> ; InstalledModules: Component<{ moduleAddress: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Mixed: Component<{ a32: NumberArray = RecsType.NumberArray; s: String = RecsType.String; u128: BigInt = RecsType.BigInt; u32: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; NamespaceOwner: Component<{ owner: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; ResourceAccess: Component<{ access: Boolean = RecsType.Boolean }, { contractId: `0x$` ; tableId: string }, undefined> ; ResourceType: Component<{ resourceType: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; StoreMetadata: Component<{ abiEncodedFieldNames: String = RecsType.String; tableName: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; SystemRegistry: Component<{ resourceSelector: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Systems: Component<{ publicAccess: Boolean = RecsType.Boolean; system: String = RecsType.String }, { contractId: `0x$` ; tableId: string }, undefined> ; Vector2: Component<{ x: Number = RecsType.Number; y: Number = RecsType.Number }, { contractId: `0x$` ; tableId: string }, undefined> ; storeSchemaComponent: Component<{ keySchema: String = Type.String; valueSchema: String = Type.String }, { contractId: `0x$` ; tableId: string }, undefined> } & C & { ComponentsRegistry: Component<{ value: String }, { contractId: string = "world.component.components" }, undefined> ; LoadingState: Component<{ msg: String = Type.String; percentage: Number = Type.Number; state: Number = Type.Number }, { contractId: string = "component.LoadingState" }, undefined> ; SystemsRegistry: Component<{ value: String }, { contractId: string = "world.component.systems" }, undefined> }> ; network: { blockNumber$: Observable<number> ; clock: Clock ; config: NetworkConfig ; connected: IComputedValue<ConnectionState> ; connectedAddress: IComputedValue<undefined | string> ; connectedAddressChecksummed: IComputedValue<undefined | string> ; dispose: () => void ; providers: IComputedValue<{ json: MUDJsonRpcProvider | MUDJsonRpcBatchProvider ; ws: undefined | WebSocketProvider }> ; signer: IComputedValue<undefined | Signer> } ; networkConfig: SetupContractConfig ; playerEntity: undefined | EntityIndex ; playerEntityId: undefined | EntityID ; registerComponent: (key: string, component: ContractComponent) => void ; singletonEntity: EntityIndex ; singletonEntityId: EntityID = SingletonID; startSync: () => void ; txQueue: TxQueue<{ World: World }> ; txReduced$: Observable<string> ; world: World }>

# Defined in

std-client/src/setup/setupMUDV2Network.ts:33


# useComponentValueStream

useComponentValueStream<T>(component, entity?): undefined | null | ComponentValue<T, undefined>

Deprecated

Use hooks exported from @latticexyz/react package instead.

# Type parameters

Name Type
T extends Schema

# Parameters

Name Type
component Component<T, Metadata, undefined>
entity? EntityIndex

# Returns

undefined | null | ComponentValue<T, undefined>

# Defined in

std-client/src/hooks.ts:19


# useQuery

useQuery(queryFragments): undefined | ObservableSet<EntityIndex>

Handles subscribing and unsubscribing to a queries update stream to keep the matching set up to date

Deprecated

Use hooks exported from @latticexyz/react package instead.

# Parameters

Name Type Description
queryFragments EntityQueryFragment<Schema>[] Query fragments

# Returns

undefined | ObservableSet<EntityIndex>

Mobx ObservablesSet with entities currently matching the query

# Defined in

std-client/src/hooks.ts:36


# useStream

useStream<T>(stream, defaultValue?): undefined | T

Deprecated

Use hooks exported from @latticexyz/react package instead.

# Type parameters

Name
T

# Parameters

Name Type
stream Observable<T>
defaultValue? T

# Returns

undefined | T

# Defined in

std-client/src/hooks.ts:7


# waitForActionCompletion

waitForActionCompletion(Action, entity): Promise<void>

# Parameters

Name Type
Action Component<{ metadata: OptionalT = Type.OptionalT; on: OptionalEntity = Type.OptionalEntity; overrides: OptionalStringArray = Type.OptionalStringArray; state: Number = Type.Number; txHash: OptionalString = Type.OptionalString }, Metadata, unknown>
entity EntityIndex

# Returns

Promise<void>

# Defined in

std-client/src/systems/ActionSystem/utils/waitForActionCompletion.ts:6


# waitForComponentValue

waitForComponentValue<S>(component, entity, value): Promise<void>

# Type parameters

Name Type
S extends Schema

# Parameters

Name Type
component Component<S, Metadata, undefined>
entity EntityIndex
value Partial<ComponentValue<S, undefined>>

# Returns

Promise<void>

# Defined in

std-client/src/utils.ts:265


# waitForComponentValueIn

waitForComponentValueIn<S, T>(component, entity, values): Promise<void>

# Type parameters

Name Type
S extends Schema
T T

# Parameters

Name Type
component Component<S, Metadata, T>
entity EntityIndex
values Partial<ComponentValue<S, undefined>>[]

# Returns

Promise<void>

# Defined in

std-client/src/utils.ts:243