feat(payments): wallet screen with balances, benefits and storefront #218
Reference in New Issue
Block a user
Delete Branch "feature/payments-wallet-ui"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Add the Кошелёк (Wallet) section to the settings hub for durable players: the
context-visible chip balances, the active benefits (no-ads term / forever, hint count) and a
storefront of chip-priced values and money-priced chip packs. Guests have no wallet; the Google
Play build hides the money purchases behind a RuStore stub (spending earned chips still works); a
web purchase that would draw VK/Telegram chips warns the player first — the benefit becomes
web/native-only, by the store-compliance rules.
How
context-projected
GET /api/v1/user/wallet/catalog— backendpayments.Catalog+ store loader,gateway
wallet.catalogop + encoder,backendclient.Catalog, FBSCatalog/CatalogProduct/
CatalogAtom, clientdecodeCatalog. A value carries a chip price shown in every context; achip pack carries the money price for the running context's payment method (Votes / Stars /
roubles).
wallet.get/wallet.buyops (fetch + screen + mock seed).Wallet.svelte+ a'wallet'tab between Friends and About (guest-hidden,offline-disabled), logic extracted to
lib/{wallet,distribution}.ts.Notes / caveats
catalog editor lands, and durable accounts hold 0 chips until payment intake / rewarded ads land.
The populated UI is proven by the mock e2e; the empty states are what is reviewable on the
contour today. (Interviewed and agreed: build the whole surface now, later work lights up its
inputs.)
payment intake; value spends work now via the existing spend path (a durable account has no chips
yet, so a real spend returns insufficient-funds until funding exists).
spend (fail-closed), so no wallet wire change was needed.
VITE_GP_BUILD); off for web / VK / Telegram /RuStore.
Tests
/wallet/catalogover Postgres;soft-deleted excluded).
decodeCatalogand gatewayencodeCataloground-trips.Chromium + WebKit.
Local full verification green:
go build/vet ./backend/... ./gateway/...,gofmt -lclean,backend unit + full integration suite,
pnpm check(0 errors), 540 vitest, 12 e2e.ce990a0c03to4aa6174968