An exchange house that defines rates between two currencies, one-way or bidirectional.
currencyExchange#
Defines exchanges between currencies: 100 Gems → 5000 Gold, 10 Tickets → 1 Gem, etc. Supports one direction only or both sides.
Why it matters#
In games with multiple currencies (premium + soft + event), conversions need to be visible and auditable. If "100 Gems = 5000 Gold" lives only in the shop's code, the design team can't iterate on the economy without asking a programmer for a build. Here it becomes both a document and an exported JSON.
Where it usually lives#
- A page of type
💱 Exchange House. The wizard asks for the two currencies and the initial rate. - Blank pages when you want to group several related exchanges (e.g. "Premium Bank" with 5 different conversions).
Singleton — 1 addon per page, with N exchanges (entries[]).
Schema#
| Campo | Tipo | Padrão | Descrição |
|---|---|---|---|
idYes | string | Internal ID. | |
nameYes | string | Addon name. | |
entriesYes | CurrencyExchangeEntry[] | List of exchanges. |
CurrencyExchangeEntry#
| Campo | Tipo | Padrão | Descrição |
|---|---|---|---|
idYes | string | Internal ID. | |
fromCurrencyRef | string (sectionId) | Page of the currency the player spends. | |
fromAmountYes | number | How much of fromCurrency is spent per exchange. | |
toCurrencyRef | string (sectionId) | Page of the currency the player receives. | |
toAmountYes | number | How much of toCurrency is received per exchange. | |
directionYes | "oneWay" | "bidirectional" | oneWay: only from→to (Gems become Gold, but not the other way). bidirectional: can exchange in both directions at the same rate. | |
notes | string | Free notes (daily limits, conditions, flavor text). |
Example#
Premium Bank with 2 exchanges: Gems → Gold (oneWay) and Tickets ↔ Gems (bidirectional).
{
"id": "exchange-bank",
"name": "Premium Bank",
"entries": [
{
"id": "ex1",
"fromCurrencyRef": "section-gem",
"fromAmount": 100,
"toCurrencyRef": "section-gold",
"toAmount": 5000,
"direction": "oneWay",
"notes": "Fixed rate. Cannot be reversed."
},
{
"id": "ex2",
"fromCurrencyRef": "section-tickets",
"fromAmount": 10,
"toCurrencyRef": "section-gem",
"toAmount": 1,
"direction": "bidirectional",
"notes": "Only available during events."
}
]
}
Validation#
- Same currency on both sides: the panel blocks this (exchanging Gold for Gold makes no sense).
- Broken refs: if you delete one of the currencies, the panel shows the entry with a warning and it won't export until you fix it.
- Amounts ≤ 0: rejected; a free or negative exchange has no clear meaning.
Wizard#
The 💱 Exchange House page type has a more detailed wizard than usual:
- Dialog asks for the two currencies this house exchanges (cannot be the same).
- Asks for the direction (oneWay/bidirectional).
- Asks for the rate (
fromAmount↔toAmount). - The page is created with the initial entry already filled in.
Afterward you can add more entries (e.g. bundle tiers — 100 Gems → 5000 Gold, 500 Gems → 30000 Gold with a bonus).