From 386a8d50eb189d346f2e0452ad5141ceb761306d Mon Sep 17 00:00:00 2001 From: "smx.pusha" <139338836+smxpusha@users.noreply.github.com> Date: Tue, 18 Aug 2026 09:32:02 +0200 Subject: [PATCH] ADD - expand VaultX fictional markets Add 24 server-defined markets with unique symbols and broad price and supply ranges. Update the market DTO, UI, browser mocks, and contract coverage. --- frontend/src/types/crypto.ts | 1 + .../src/views/apps/CryptoApp.contract.test.ts | 15 + frontend/src/views/apps/CryptoApp.vue | 18 +- frontend/testserver/index.cjs | 285 ++++++++++++++++-- frontend/testserver/smoke.cjs | 10 +- sky_phone/config/config.lua | 276 +++++++++++++++++ sky_phone/source/server/crypto.lua | 1 + 7 files changed, 572 insertions(+), 34 deletions(-) diff --git a/frontend/src/types/crypto.ts b/frontend/src/types/crypto.ts index 2e2bcae..c919ea7 100644 --- a/frontend/src/types/crypto.ts +++ b/frontend/src/types/crypto.ts @@ -7,6 +7,7 @@ export type CryptoMarket = { high24h: string id: string issuedSupply: string + logo: string low24h: string name: string price: string diff --git a/frontend/src/views/apps/CryptoApp.contract.test.ts b/frontend/src/views/apps/CryptoApp.contract.test.ts index b3b508e..473d7eb 100644 --- a/frontend/src/views/apps/CryptoApp.contract.test.ts +++ b/frontend/src/views/apps/CryptoApp.contract.test.ts @@ -14,6 +14,10 @@ const passwordProvider = readFileSync( ), 'utf8', ) +const config = readFileSync( + new URL('../../../../sky_phone/config/config.lua', import.meta.url), + 'utf8', +) describe('VaultX crypto app contracts', () => { it('uses Sky UI without introducing Konsta components', () => { @@ -56,6 +60,17 @@ describe('VaultX crypto app contracts', () => { expect(source).not.toContain(':aria-label="t(\'refresh\')"') }) + it('exposes a broad fictional market with dedicated logo marks', () => { + const cryptoConfig = config.slice( + config.indexOf('Config.Crypto = {'), + config.indexOf('-- Server-only configuration'), + ) + expect(cryptoConfig.match(/\n\s+Id = "/g)).toHaveLength(24) + expect(cryptoConfig.match(/\n\s+Logo = "/g)).toHaveLength(24) + expect(server).toContain('logo = config.Logo') + expect(source).toContain('detail.logo') + }) + it('keeps all consequential calculations and state transitions on the server', () => { expect(server).toContain( 'Bridge.Callbacks.Register("sky_phone:crypto:quote"', diff --git a/frontend/src/views/apps/CryptoApp.vue b/frontend/src/views/apps/CryptoApp.vue index a4125d7..efc02c3 100644 --- a/frontend/src/views/apps/CryptoApp.vue +++ b/frontend/src/views/apps/CryptoApp.vue @@ -354,7 +354,7 @@ onMounted(() => void crypto.load())
{{ - detail.symbol[0] + detail.logo }}

{{ detail.symbol }} · {{ detail.name }}

{{ money(detail.price) }} void crypto.load()) >{{ privateMoney(detailHolding?.value ?? '0') }}
{{ - detail.symbol[0] + detail.logo }}{{ detail.name }} void crypto.load()) {{ market(holding.assetId)?.symbol[0] }}{{ market(holding.assetId)?.logo }}{{ market(holding.assetId)?.name }} void crypto.load()) >