Skip to content

exchangeItems

exchangeItems(generate, destroy, timeoutMs?): Promise<InventoryResultData>

Atomically destroys some items and creates others, following the exchange recipe set in Steamworks (for example crafting or opening a chest). Resolves with the result.

This changes the user’s real inventory and cannot be undone. Steam fails the whole exchange when the items do not match a recipe. Ask the user to confirm before calling it. Rejects when Steam refuses the exchange, reports an error or sends no answer in time.

ItemQuantity[]

The item definitions to create, with their quantities.

ItemInstanceQuantity[]

The owned items to use up, with their quantities.

number | null

How long to wait for Steam, in milliseconds. Defaults to 30000.

Promise<InventoryResultData>

the result of the exchange, which holds the created items.

Turn ideas into shipped software.

HagiCode is an agentic coding workspace. OpenSpec workflows plan the change, multi-agent execution carries it out, and Hero Scenario makes the long run visible, so ideas become shipped software.

Smart
OpenSpec workflows turn intent into a path from proposal to shipped change.
Efficient
Multi-agent execution runs research, build, and review in parallel.
Fun
Rich UI interactions make planning, agent work, and projects easier to follow.