@idosgames/core 0.21.2 → 0.21.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -14,6 +14,73 @@ and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.ht
14
14
 
15
15
  ## [Unreleased]
16
16
 
17
+ ## [0.21.4] - 2026-10-09
18
+
19
+ A 429 now waits exactly as long as the server says. Backwards-compatible: against an older server
20
+ nothing changes.
21
+
22
+ ### Changed
23
+
24
+ - **Server-named wait on 429.** The engine and the site backend (since 2026-10-09: token buckets
25
+ instead of "ban the address for 999 s") answer 429 with `RetryAfterMs` in the body (readable
26
+ cross-origin) and a `Retry-After` header. The transport sleeps exactly that (+ up to 250 ms jitter,
27
+ so players refused together do not return in the same millisecond) and retries — a quick second
28
+ tap on "upgrade" now goes through half a second later instead of failing.
29
+ - A named wait longer than 15 s (`MAX_RATE_LIMIT_WAIT_MS` — an address blocked for hammering) returns
30
+ at once as a `connection` failure "Too many requests — try again in N s", without retrying inside
31
+ the block (that only prolonged it).
32
+ - A 429 that names nothing (Cloudflare's edge, an older server) keeps the old 1.5 / 4 / 6 s schedule.
33
+
34
+ ## [0.21.3] - 2026-10-09
35
+
36
+ Crypto prices everywhere: a short crypto balance no longer just fails a purchase inside idosgames.com.
37
+ Additive — nothing that worked changes outside the site's frame.
38
+
39
+ ### Added
40
+
41
+ - **Top-up, then charge.** A charge the engine refuses for a crypto shortfall
42
+ (`CC {id}: insufficient balance (have …, need …)` — any module: store, lootbox, craft, marketplace,
43
+ PvP, …) goes to the top-up handler, and the transport sends the SAME request again, once, after the
44
+ deposit is credited. The refusal that was paid for raises no `error:global`; the request is not
45
+ "busy" while the player is in the payment window.
46
+ - Inside idosgames.com's frame the handler installs itself: the site's own deposit window opens on
47
+ the missing amount (`requestPlatformTopUp`, messages `IDOS_PLATFORM_TOPUP_REQUEST` / `_RESPONSE`),
48
+ then crypto balances are re-read and the purchase repeats. The site deposits only to its own
49
+ session's account, which must be the game's player.
50
+ - Outside the site the game's own wallet does it: `useWalletTopUp` + `LazyWalletPanel topUp`
51
+ in `@idosgames/wallet` 0.6.3, mounted by the base through `createBaseModule({ WalletTopUp })`
52
+ (`@idosgames/app-shell` 0.12.2); any other handler: `client.checkout.setTopUpHandler(fn)`.
53
+ - `client.checkout.topUpAvailable` — keep a "buy" button with a crypto price enabled when true;
54
+ `client.checkout.shortfallFromError(error)` / `cryptoShortfallFromError`; `CryptoShortfall.missingAmount`
55
+ (exact decimal string); event `checkout:topUpFailed`.
56
+ - `client.blockchain.getDefinitions(opts?)` goes through the central cache by the config version
57
+ (section `Blockchain:Definitions`, kept in storage like other sections): concurrent readers share
58
+ one request, a repeat read asks nothing; `{ forceRefresh: true }` before moving money.
59
+ - Re-reads after a top-up go by revision: `cache.ensureState(["InventoryV2"], { force: true })`.
60
+
61
+ ### Fixed
62
+
63
+ - Sections fetched outside the config projection survived a sign-in with a NEW config version in the
64
+ same page (stale until a reload): they are now cleared when the version changes.
65
+ - A collection trade (`sendTradeOffer` / `cancelTradeOffer` / `acceptTradeOffer` / `declineTradeOffer`)
66
+ froze the player's `Collection` in the cache: the reply carries the container's new revision but not
67
+ its data, so the old copy passed as fresh and a versioned read returned nothing. The container is now
68
+ marked for a full re-read (`cache.invalidateState`).
69
+
70
+ ### Changed
71
+
72
+ - More reads go through the central cache: `gameLoop.getBoardDefinition` by the config version (kept
73
+ under it in storage), `quest.getUserQuestState` as a view by the `Quest` / `EventToken` revisions
74
+ (expires at the nearest cycle end; `forceRefresh` asks anyway). Both take `ReadOptions`.
75
+ - `cache.invalidateState(containers)` — for an action that changed containers without bringing them.
76
+
77
+ ### Added (continued)
78
+
79
+ - `askPlatformPage` — the one game ↔ site request/answer bridge (moved here from `@idosgames/wallet`),
80
+ `PLATFORM_BRIDGE_ACK`, `PLATFORM_PAGE_UNAVAILABLE`, `canUsePlatformTopUp`.
81
+ - `CryptoCurrencyDefinition`: `PlayerTradeFeePercent` (developer fee on crypto moving between players),
82
+ `UsdPriceRefreshMinutes` (the title token's own USD price refresh rate, paid plans).
83
+
17
84
  ## [0.21.2] - 2026-10-05
18
85
 
19
86
  The model follows the backend rename (rolled out 05.10.2026). Patch, not minor: the server no longer