From d96324e53bb42cf6ca645a71d242ee2d6d49e0b4 Mon Sep 17 00:00:00 2001 From: Lucas Werey Date: Mon, 3 Aug 2026 13:54:06 +0200 Subject: [PATCH] chore(aggregated-assets): scaffold the DDD target packages Create the packages that libs/ledger-live-common/src/dada-client will move into (LIVE-35225, epic LIVE-35223). Scaffolding only: no code moved, no behaviour change, nothing imports them yet. @domain/entity-aggregated-asset the network-grouped meta-currency @domain/entity-interest-rate interest rate shape and its APY type @domain/api-aggregated-assets DADA wire contract, RTK Query, transforms @features/platform-aggregated-assets hooks, cache selectors, discovery Named for the domain concept, not the vendor service: DADA will later back other domains (dynamic currencies, app search), so it appears in no package name. 'aggregated-asset' rather than 'asset' because the latter is indistinguishable from entity-currency*, libs/asset-aggregation and libs/asset-detail. The React layer sits in features/platform rather than features/flow because Market, Portfolio, Global Search and the asset selectors all consume it. READMEs carry the decisions instead of a docs/ page, since the repo has no ADR convention: why wire types belong to the api package, why markets stays loosely typed with no domain/entity/market, the copied dadaIdToMarketId debt, and the invariants that break with no type error. NetworkInfo and CurrenciesOrder are explicitly not entities -- a network is a chain already modelled by entity-currency-crypto, and CurrenciesOrder is server sort metadata. Registered in knip.json per the born-migrated rule for new packages. The jsdom package loads @testing-library/jest-dom via jest.setup.js, matching features/platform/{style,currencies,feature-flags}. Ref: WXP page 'DADA DDD compliant'. --- .changeset/tidy-pandas-gather.md | 8 + domain/api/aggregated-assets/README.md | 67 +++++++ domain/api/aggregated-assets/jest.config.js | 20 ++ domain/api/aggregated-assets/package.json | 29 +++ domain/api/aggregated-assets/project.json | 8 + domain/api/aggregated-assets/src/index.ts | 1 + domain/api/aggregated-assets/tsconfig.json | 13 ++ domain/entity/aggregated-asset/README.md | 31 +++ domain/entity/aggregated-asset/jest.config.js | 20 ++ domain/entity/aggregated-asset/package.json | 28 +++ domain/entity/aggregated-asset/project.json | 8 + domain/entity/aggregated-asset/src/index.ts | 1 + domain/entity/aggregated-asset/tsconfig.json | 13 ++ domain/entity/interest-rate/README.md | 24 +++ domain/entity/interest-rate/jest.config.js | 20 ++ domain/entity/interest-rate/package.json | 28 +++ domain/entity/interest-rate/project.json | 8 + domain/entity/interest-rate/src/index.ts | 1 + domain/entity/interest-rate/tsconfig.json | 13 ++ features/platform/aggregated-assets/README.md | 45 +++++ .../platform/aggregated-assets/jest.config.js | 23 +++ .../platform/aggregated-assets/jest.setup.js | 1 + .../platform/aggregated-assets/package.json | 39 ++++ .../platform/aggregated-assets/project.json | 8 + .../platform/aggregated-assets/src/index.ts | 1 + .../platform/aggregated-assets/tsconfig.json | 15 ++ knip.json | 12 ++ pnpm-lock.yaml | 180 ++++++++++++++---- 28 files changed, 629 insertions(+), 36 deletions(-) create mode 100644 .changeset/tidy-pandas-gather.md create mode 100644 domain/api/aggregated-assets/README.md create mode 100644 domain/api/aggregated-assets/jest.config.js create mode 100644 domain/api/aggregated-assets/package.json create mode 100644 domain/api/aggregated-assets/project.json create mode 100644 domain/api/aggregated-assets/src/index.ts create mode 100644 domain/api/aggregated-assets/tsconfig.json create mode 100644 domain/entity/aggregated-asset/README.md create mode 100644 domain/entity/aggregated-asset/jest.config.js create mode 100644 domain/entity/aggregated-asset/package.json create mode 100644 domain/entity/aggregated-asset/project.json create mode 100644 domain/entity/aggregated-asset/src/index.ts create mode 100644 domain/entity/aggregated-asset/tsconfig.json create mode 100644 domain/entity/interest-rate/README.md create mode 100644 domain/entity/interest-rate/jest.config.js create mode 100644 domain/entity/interest-rate/package.json create mode 100644 domain/entity/interest-rate/project.json create mode 100644 domain/entity/interest-rate/src/index.ts create mode 100644 domain/entity/interest-rate/tsconfig.json create mode 100644 features/platform/aggregated-assets/README.md create mode 100644 features/platform/aggregated-assets/jest.config.js create mode 100644 features/platform/aggregated-assets/jest.setup.js create mode 100644 features/platform/aggregated-assets/package.json create mode 100644 features/platform/aggregated-assets/project.json create mode 100644 features/platform/aggregated-assets/src/index.ts create mode 100644 features/platform/aggregated-assets/tsconfig.json diff --git a/.changeset/tidy-pandas-gather.md b/.changeset/tidy-pandas-gather.md new file mode 100644 index 000000000000..ec8a3c7967ed --- /dev/null +++ b/.changeset/tidy-pandas-gather.md @@ -0,0 +1,8 @@ +--- +"@domain/entity-aggregated-asset": minor +"@domain/entity-interest-rate": minor +"@domain/api-aggregated-assets": minor +"@features/platform-aggregated-assets": minor +--- + +Scaffold the DDD packages that will receive the dada-client code: the aggregated-asset and interest-rate entities, the aggregated-assets API client and its app-facing platform layer diff --git a/domain/api/aggregated-assets/README.md b/domain/api/aggregated-assets/README.md new file mode 100644 index 000000000000..4c7aaffd050a --- /dev/null +++ b/domain/api/aggregated-assets/README.md @@ -0,0 +1,67 @@ +# @domain/api-aggregated-assets + +> [!CAUTION] +> **Status: UNSTABLE** — Being migrated out of `live-common`; the API is still being assembled. + +Domain API client for **DADA** — Dynamic Assets Data Aggregator — the service that returns +aggregated crypto asset metadata, market data and interest rates. + +One DADA response carries six collections in a single payload: + +| Collection | Owned by | +| --- | --- | +| `cryptoAssets` | `@domain/entity-aggregated-asset` | +| `interestRates` | `@domain/entity-interest-rate` | +| `cryptoOrTokenCurrencies` | `@domain/entity-currency` (via `@domain/api-currency-token`) | +| `networks` | **this package**, as a wire type — resolves to `@domain/entity-currency-crypto`, since a network *is* a chain | +| `currenciesOrder` | **this package**, as response metadata — a sort key and ordered ids, not a business object | +| `markets` | nobody yet — see below | + +This package owns the cross-entity response contract, the requests, the transformations and the +RTK Query endpoints. It does not own UI or app composition. + +## Why the wire types live here + +`ApiAsset`, `ApiTokenCurrency`, `ApiCryptoCurrency` and `RawApiResponse` describe DADA's +**transport format**, so they belong to the API package. The entity packages own only canonical +shapes. `AssetsData` — the transformed aggregate — is this package's return contract, composed of +those entities. + +This mirrors `domain/api/market-sentiment` + `domain/entity/market-sentiment`, where the entity +owns the canonical schema and the API owns the wire schema plus `transforms.ts`. + +## `markets` is deliberately loosely typed + +There is no `domain/entity/market`, and the `markets` collection keeps its existing type, +`PartialMarketItemResponse` = `Partial`. + +Creating a real market entity would roughly double the migration and pull in a large surface owned +by another team. Because every field of a `Partial<>` is optional there is also nothing meaningful +to validate, so `markets` is excluded from the response-validation work. + +### Accepted debt + +`dadaIdToMarketId()` and the market item type are **copied** from +`libs/ledger-live-common/src/market`, not imported: a `domain/*` package must not import legacy +`libs/*`. Since every field is optional, future divergence from the original will **never** produce +a type error. Revisit when a real market entity exists. + +## Invariants owned here + +Both are load-bearing and neither can produce a type error, so do not "clean them up": + +1. **`convertApiAssets` is lenient by design.** It silently drops tokens whose parent chain is + unknown, and *synthesises* a currency (placeholder `color`, empty `explorerViews`) for cryptos + missing from the local registry rather than dropping them. Assets DADA knows about but the local + CAL does not still render. +2. **`getChunkedAssetsData` succeeds if _any_ chunk resolves.** Requests are chunked by currency id; + partial results are returned rather than failing the whole query. + +When response validation is added, it must use per-item `safeParse`-and-drop, never a top-level +`parse()`. DADA is a live aggregator whose shape evolves, and one unmodelled field failing the whole +response would blank out Market, Portfolio and the asset selector. + +## Status + +Scaffolded and empty. Code arrives from `libs/ledger-live-common/src/dada-client` in `LIVE-35226`. +Tracking epic: `LIVE-35223`. diff --git a/domain/api/aggregated-assets/jest.config.js b/domain/api/aggregated-assets/jest.config.js new file mode 100644 index 000000000000..a2e52447f29b --- /dev/null +++ b/domain/api/aggregated-assets/jest.config.js @@ -0,0 +1,20 @@ +module.exports = { + testEnvironment: "node", + roots: ["/src"], + testMatch: ["**/*.test.ts"], + transform: { + "^.+\\.(t|j)sx?$": [ + "@swc/jest", + { + jsc: { + target: "esnext", + }, + }, + ], + }, + coverageReporters: ["json", ["lcov", { file: "lcov.info", projectRoot: "../../../" }], "text"], + reporters: [ + "default", + ["jest-sonar", { outputName: "sonar-executionTests-report.xml", reportedFilePath: "absolute" }], + ], +}; diff --git a/domain/api/aggregated-assets/package.json b/domain/api/aggregated-assets/package.json new file mode 100644 index 000000000000..826aeef0898f --- /dev/null +++ b/domain/api/aggregated-assets/package.json @@ -0,0 +1,29 @@ +{ + "name": "@domain/api-aggregated-assets", + "version": "0.1.0", + "private": true, + "description": "Domain API client for DADA (Dynamic Assets Data Aggregator): wire contract, RTK Query endpoints and response transforms", + "main": "src/index.ts", + "types": "src/index.ts", + "exports": { + ".": "./src/index.ts", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "typecheck": "tsc --noEmit", + "test": "jest --passWithNoTests", + "test:watch": "jest --watch", + "coverage": "jest --coverage --passWithNoTests", + "unimported": "pnpm knip --directory ../../.. -W domain/api/aggregated-assets" + }, + "devDependencies": { + "@jest/globals": "catalog:", + "@swc/core": "catalog:", + "@swc/jest": "catalog:", + "@types/jest": "catalog:", + "@types/node": "catalog:", + "jest": "catalog:", + "typescript": "catalog:" + } +} diff --git a/domain/api/aggregated-assets/project.json b/domain/api/aggregated-assets/project.json new file mode 100644 index 000000000000..4b140a305653 --- /dev/null +++ b/domain/api/aggregated-assets/project.json @@ -0,0 +1,8 @@ +{ + "name": "@domain/api-aggregated-assets", + "targets": { + "build": { + "executor": "nx:noop" + } + } +} diff --git a/domain/api/aggregated-assets/src/index.ts b/domain/api/aggregated-assets/src/index.ts new file mode 100644 index 000000000000..cb0ff5c3b541 --- /dev/null +++ b/domain/api/aggregated-assets/src/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/domain/api/aggregated-assets/tsconfig.json b/domain/api/aggregated-assets/tsconfig.json new file mode 100644 index 000000000000..840231572032 --- /dev/null +++ b/domain/api/aggregated-assets/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "lib": ["ES2022"], + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "bundler", + "noEmit": true, + "types": ["jest"] + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "lib"] +} diff --git a/domain/entity/aggregated-asset/README.md b/domain/entity/aggregated-asset/README.md new file mode 100644 index 000000000000..b166d013b5d3 --- /dev/null +++ b/domain/entity/aggregated-asset/README.md @@ -0,0 +1,31 @@ +# @domain/entity-aggregated-asset + +> [!CAUTION] +> **Status: UNSTABLE** — Being migrated out of `live-common`; the API is still being assembled. + +Domain entity for the **aggregated asset** — a meta-currency that groups several per-network +currencies under one logical asset. + +| Type | Describes | +| --- | --- | +| `CryptoAssetMeta` | The aggregated asset: id, ticker, name, and `assetsIds` mapping each network to its currency id | + +This resolves more than the lower-level currency / token / fiat types, which is what earns it its +own entity: it is grouped by network rather than being a single currency. + +Deliberately **not** here: + +| Type | Lives in | Why | +| --- | --- | --- | +| `NetworkInfo` | `@domain/api-aggregated-assets` as a wire type | `{ id, name }`; a network *is* a chain, already modelled by `@domain/entity-currency-crypto`. Resolve to that rather than duplicating the concept. | +| `CurrenciesOrder` | `@domain/api-aggregated-assets` response contract | `{ key, order, metaCurrencyIds }` is server sort metadata, not a business object. | + +Pure entity package: runtime schemas, inferred types, defaults and mocks. **No network calls, no +feature state.** Requests, transformations and RTK Query endpoints belong to +`@domain/api-aggregated-assets`; the wire-format types belong there too, since they describe DADA's +transport shape rather than a canonical one. + +## Status + +Scaffolded and empty. Types arrive from `libs/ledger-live-common/src/dada-client/entities` in +`LIVE-35226`. Tracking epic: `LIVE-35223`. diff --git a/domain/entity/aggregated-asset/jest.config.js b/domain/entity/aggregated-asset/jest.config.js new file mode 100644 index 000000000000..a2e52447f29b --- /dev/null +++ b/domain/entity/aggregated-asset/jest.config.js @@ -0,0 +1,20 @@ +module.exports = { + testEnvironment: "node", + roots: ["/src"], + testMatch: ["**/*.test.ts"], + transform: { + "^.+\\.(t|j)sx?$": [ + "@swc/jest", + { + jsc: { + target: "esnext", + }, + }, + ], + }, + coverageReporters: ["json", ["lcov", { file: "lcov.info", projectRoot: "../../../" }], "text"], + reporters: [ + "default", + ["jest-sonar", { outputName: "sonar-executionTests-report.xml", reportedFilePath: "absolute" }], + ], +}; diff --git a/domain/entity/aggregated-asset/package.json b/domain/entity/aggregated-asset/package.json new file mode 100644 index 000000000000..937cbd3332f7 --- /dev/null +++ b/domain/entity/aggregated-asset/package.json @@ -0,0 +1,28 @@ +{ + "name": "@domain/entity-aggregated-asset", + "version": "0.1.0", + "private": true, + "description": "Domain entity for aggregated assets: crypto-asset metadata, network info and currency ordering", + "main": "src/index.ts", + "types": "src/index.ts", + "exports": { + ".": "./src/index.ts", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "typecheck": "tsc --noEmit", + "test": "jest --passWithNoTests", + "test:watch": "jest --watch", + "coverage": "jest --coverage --passWithNoTests", + "unimported": "pnpm knip --directory ../../.. -W domain/entity/aggregated-asset" + }, + "devDependencies": { + "@jest/globals": "catalog:", + "@swc/core": "catalog:", + "@swc/jest": "catalog:", + "@types/jest": "catalog:", + "jest": "catalog:", + "typescript": "catalog:" + } +} diff --git a/domain/entity/aggregated-asset/project.json b/domain/entity/aggregated-asset/project.json new file mode 100644 index 000000000000..3a5d9a2aefcc --- /dev/null +++ b/domain/entity/aggregated-asset/project.json @@ -0,0 +1,8 @@ +{ + "name": "@domain/entity-aggregated-asset", + "targets": { + "build": { + "executor": "nx:noop" + } + } +} diff --git a/domain/entity/aggregated-asset/src/index.ts b/domain/entity/aggregated-asset/src/index.ts new file mode 100644 index 000000000000..cb0ff5c3b541 --- /dev/null +++ b/domain/entity/aggregated-asset/src/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/domain/entity/aggregated-asset/tsconfig.json b/domain/entity/aggregated-asset/tsconfig.json new file mode 100644 index 000000000000..840231572032 --- /dev/null +++ b/domain/entity/aggregated-asset/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "lib": ["ES2022"], + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "bundler", + "noEmit": true, + "types": ["jest"] + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "lib"] +} diff --git a/domain/entity/interest-rate/README.md b/domain/entity/interest-rate/README.md new file mode 100644 index 000000000000..db22f8b33121 --- /dev/null +++ b/domain/entity/interest-rate/README.md @@ -0,0 +1,24 @@ +# @domain/entity-interest-rate + +> [!CAUTION] +> **Status: UNSTABLE** — Being migrated out of `live-common`; the API is still being assembled. + +Domain entity for asset interest rates. Owns the canonical rate shape and the set of rate types the +apps understand: + +| Type | Describes | +| --- | --- | +| `InterestRate` | A rate for one currency: `currencyId`, `rate`, `type` and `fetchAt` | +| `ApyType` | The recognised rate kinds — `NRR`, `APY`, `APR` | + +`ApyType` is an allowlist, and it is enforced at the consumer boundary: a rate arriving with any +other `type` is dropped rather than displayed. That filtering behaviour is characterized in the +consuming hook's tests. + +Pure entity package: runtime schemas, inferred types, defaults and mocks. **No network calls, no +feature state.** + +## Status + +Scaffolded and empty. Types arrive from `libs/ledger-live-common/src/dada-client` in `LIVE-35226`. +Tracking epic: `LIVE-35223`. diff --git a/domain/entity/interest-rate/jest.config.js b/domain/entity/interest-rate/jest.config.js new file mode 100644 index 000000000000..a2e52447f29b --- /dev/null +++ b/domain/entity/interest-rate/jest.config.js @@ -0,0 +1,20 @@ +module.exports = { + testEnvironment: "node", + roots: ["/src"], + testMatch: ["**/*.test.ts"], + transform: { + "^.+\\.(t|j)sx?$": [ + "@swc/jest", + { + jsc: { + target: "esnext", + }, + }, + ], + }, + coverageReporters: ["json", ["lcov", { file: "lcov.info", projectRoot: "../../../" }], "text"], + reporters: [ + "default", + ["jest-sonar", { outputName: "sonar-executionTests-report.xml", reportedFilePath: "absolute" }], + ], +}; diff --git a/domain/entity/interest-rate/package.json b/domain/entity/interest-rate/package.json new file mode 100644 index 000000000000..c6e839fd83ae --- /dev/null +++ b/domain/entity/interest-rate/package.json @@ -0,0 +1,28 @@ +{ + "name": "@domain/entity-interest-rate", + "version": "0.1.0", + "private": true, + "description": "Domain entity for asset interest rates: the canonical rate shape and its APY type", + "main": "src/index.ts", + "types": "src/index.ts", + "exports": { + ".": "./src/index.ts", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "typecheck": "tsc --noEmit", + "test": "jest --passWithNoTests", + "test:watch": "jest --watch", + "coverage": "jest --coverage --passWithNoTests", + "unimported": "pnpm knip --directory ../../.. -W domain/entity/interest-rate" + }, + "devDependencies": { + "@jest/globals": "catalog:", + "@swc/core": "catalog:", + "@swc/jest": "catalog:", + "@types/jest": "catalog:", + "jest": "catalog:", + "typescript": "catalog:" + } +} diff --git a/domain/entity/interest-rate/project.json b/domain/entity/interest-rate/project.json new file mode 100644 index 000000000000..38964957ecf2 --- /dev/null +++ b/domain/entity/interest-rate/project.json @@ -0,0 +1,8 @@ +{ + "name": "@domain/entity-interest-rate", + "targets": { + "build": { + "executor": "nx:noop" + } + } +} diff --git a/domain/entity/interest-rate/src/index.ts b/domain/entity/interest-rate/src/index.ts new file mode 100644 index 000000000000..cb0ff5c3b541 --- /dev/null +++ b/domain/entity/interest-rate/src/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/domain/entity/interest-rate/tsconfig.json b/domain/entity/interest-rate/tsconfig.json new file mode 100644 index 000000000000..840231572032 --- /dev/null +++ b/domain/entity/interest-rate/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "lib": ["ES2022"], + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "bundler", + "noEmit": true, + "types": ["jest"] + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "lib"] +} diff --git a/features/platform/aggregated-assets/README.md b/features/platform/aggregated-assets/README.md new file mode 100644 index 000000000000..0171d78849d3 --- /dev/null +++ b/features/platform/aggregated-assets/README.md @@ -0,0 +1,45 @@ +# @features/platform-aggregated-assets + +> [!CAUTION] +> **Status: UNSTABLE** — Being migrated out of `live-common`; the API is still being assembled. + +App-facing runtime for aggregated assets data. Wraps `@domain/api-aggregated-assets` in React hooks and +owns the cache selectors, asset-discovery helpers and currency-selection logic. + +This lives in `features/platform` rather than `features/flow` because several unrelated flows consume +it — Market, Portfolio, Global Search and the asset/network selectors — so it is a capability shared +across flows, not one journey's internals. + +## Public API is hooks-only + +Consumers get hooks plus the types those hooks return. The RTK Query endpoint objects, the cache +selectors and the `assetsDataApi` instance stay internal. + +The one exception is the app composition root, which must register the API's reducer and middleware +in the store. + +## `reducerPath` must stay `"assetsDataApi"` + +The cache selectors read `state.assetsDataApi?.queries` **by string**, and Storybook stories preload +that same key directly. Renaming `reducerPath` produces **no type error** and silently returns +`undefined` for every market and interest-rate lookup. + +## Cache selectors scan every cache entry + +`createCurrencyDataSelector` walks RTK Query's internal cache layout: + +```text +state.assetsDataApi.queries → entry.data.pages → page[collection][currencyId] +``` + +Two consequences, both characterized in the test suite and **described, not endorsed**: + +- It has no access to the query args of the entries it walks, so a value cached by one query is + served to callers of any other. +- `pages` is typed `Array>`, so nothing in this traversal can produce a type + error. Tests are the only safety net here. + +## Status + +Scaffolded and empty. Code arrives from `libs/ledger-live-common/src/dada-client` in `LIVE-35227`. +Tracking epic: `LIVE-35223`. diff --git a/features/platform/aggregated-assets/jest.config.js b/features/platform/aggregated-assets/jest.config.js new file mode 100644 index 000000000000..d8019afa7c01 --- /dev/null +++ b/features/platform/aggregated-assets/jest.config.js @@ -0,0 +1,23 @@ +module.exports = { + testEnvironment: "jsdom", + roots: ["/src"], + testMatch: ["**/*.test.ts?(x)"], + setupFilesAfterEnv: ["/jest.setup.js"], + transform: { + "^.+\\.(t|j)sx?$": [ + "@swc/jest", + { + jsc: { + target: "esnext", + parser: { syntax: "typescript", tsx: true }, + transform: { react: { runtime: "automatic" } }, + }, + }, + ], + }, + coverageReporters: ["json", ["lcov", { file: "lcov.info", projectRoot: "../../../" }], "text"], + reporters: [ + "default", + ["jest-sonar", { outputName: "sonar-executionTests-report.xml", reportedFilePath: "absolute" }], + ], +}; diff --git a/features/platform/aggregated-assets/jest.setup.js b/features/platform/aggregated-assets/jest.setup.js new file mode 100644 index 000000000000..9e785813a959 --- /dev/null +++ b/features/platform/aggregated-assets/jest.setup.js @@ -0,0 +1 @@ +require("@testing-library/jest-dom"); diff --git a/features/platform/aggregated-assets/package.json b/features/platform/aggregated-assets/package.json new file mode 100644 index 000000000000..469684e0b831 --- /dev/null +++ b/features/platform/aggregated-assets/package.json @@ -0,0 +1,39 @@ +{ + "name": "@features/platform-aggregated-assets", + "version": "0.1.0", + "private": true, + "description": "App-facing assets-data runtime: hooks over the DADA API, cache selectors, asset discovery and currency selection", + "main": "src/index.ts", + "types": "src/index.ts", + "exports": { + ".": "./src/index.ts", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "typecheck": "tsc --noEmit", + "test": "jest --passWithNoTests", + "test:watch": "jest --watch", + "coverage": "jest --coverage --passWithNoTests", + "unimported": "pnpm knip --directory ../../.. -W features/platform/aggregated-assets" + }, + "peerDependencies": { + "react": ">=19.0.0", + "react-redux": ">=9.0.0" + }, + "devDependencies": { + "@swc/core": "catalog:", + "@swc/jest": "catalog:", + "@testing-library/dom": "catalog:", + "@testing-library/jest-dom": "catalog:", + "@testing-library/react": "catalog:", + "@types/jest": "catalog:", + "@types/react": "catalog:", + "jest": "catalog:", + "jest-environment-jsdom": "catalog:", + "react": "catalog:", + "react-dom": "catalog:", + "react-redux": "catalog:", + "typescript": "catalog:" + } +} diff --git a/features/platform/aggregated-assets/project.json b/features/platform/aggregated-assets/project.json new file mode 100644 index 000000000000..ce262c97bb09 --- /dev/null +++ b/features/platform/aggregated-assets/project.json @@ -0,0 +1,8 @@ +{ + "name": "@features/platform-aggregated-assets", + "targets": { + "build": { + "executor": "nx:noop" + } + } +} diff --git a/features/platform/aggregated-assets/src/index.ts b/features/platform/aggregated-assets/src/index.ts new file mode 100644 index 000000000000..cb0ff5c3b541 --- /dev/null +++ b/features/platform/aggregated-assets/src/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/features/platform/aggregated-assets/tsconfig.json b/features/platform/aggregated-assets/tsconfig.json new file mode 100644 index 000000000000..e9fc264672ff --- /dev/null +++ b/features/platform/aggregated-assets/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "jsx": "react-jsx", + "lib": ["ES2022", "DOM"], + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "bundler", + "paths": { "*": ["./*"] }, + "noEmit": true, + "types": ["jest", "@testing-library/jest-dom"] + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "lib"] +} diff --git a/knip.json b/knip.json index 5d925181a3f6..dcc23747bac2 100644 --- a/knip.json +++ b/knip.json @@ -205,6 +205,12 @@ "./domain/entity/starred-account": { "entry": ["src/index.ts"] }, + "./domain/entity/aggregated-asset": { + "entry": ["src/index.ts"] + }, + "./domain/entity/interest-rate": { + "entry": ["src/index.ts"] + }, "./domain/api/pay-card": { "entry": ["src/index.ts"] }, @@ -220,6 +226,9 @@ "./domain/api/altcoins-sentiment": { "entry": ["src/index.ts"] }, + "./domain/api/aggregated-assets": { + "entry": ["src/index.ts"] + }, "./shared/schema-primitives": { "entry": ["src/index.ts"] }, @@ -259,6 +268,9 @@ "./features/platform/style": { "entry": ["src/index.ts"] }, + "./features/platform/aggregated-assets": { + "entry": ["src/index.ts"] + }, "./libs/coin-tester-modules/coin-tester-multiversx": { "entry": ["src/scenarii/multiversx.ts"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9630a0ee3166..5b9d9d354923 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3465,6 +3465,30 @@ importers: specifier: 'catalog:' version: '@typescript/typescript6@6.0.2' + domain/api/aggregated-assets: + devDependencies: + '@jest/globals': + specifier: 'catalog:' + version: 30.2.0 + '@swc/core': + specifier: 'catalog:' + version: 1.15.11 + '@swc/jest': + specifier: 'catalog:' + version: 0.2.39(@swc/core@1.15.11) + '@types/jest': + specifier: 'catalog:' + version: 30.0.0 + '@types/node': + specifier: 'catalog:' + version: 24.12.0 + jest: + specifier: 'catalog:' + version: 30.2.0(@types/node@24.12.0) + typescript: + specifier: 'catalog:' + version: '@typescript/typescript6@6.0.2' + domain/api/altcoins-sentiment: dependencies: '@domain/entity-altcoins-sentiment': @@ -3717,6 +3741,27 @@ importers: specifier: 'catalog:' version: '@typescript/typescript6@6.0.2' + domain/entity/aggregated-asset: + devDependencies: + '@jest/globals': + specifier: 'catalog:' + version: 30.2.0 + '@swc/core': + specifier: 'catalog:' + version: 1.15.11 + '@swc/jest': + specifier: 'catalog:' + version: 0.2.39(@swc/core@1.15.11) + '@types/jest': + specifier: 'catalog:' + version: 30.0.0 + jest: + specifier: 'catalog:' + version: 30.2.0 + typescript: + specifier: 'catalog:' + version: '@typescript/typescript6@6.0.2' + domain/entity/altcoins-sentiment: dependencies: zod: @@ -3978,6 +4023,27 @@ importers: specifier: 'catalog:' version: '@typescript/typescript6@6.0.2' + domain/entity/interest-rate: + devDependencies: + '@jest/globals': + specifier: 'catalog:' + version: 30.2.0 + '@swc/core': + specifier: 'catalog:' + version: 1.15.11 + '@swc/jest': + specifier: 'catalog:' + version: 0.2.39(@swc/core@1.15.11) + '@types/jest': + specifier: 'catalog:' + version: 30.0.0 + jest: + specifier: 'catalog:' + version: 30.2.0 + typescript: + specifier: 'catalog:' + version: '@typescript/typescript6@6.0.2' + domain/entity/large-screen-upsell-modal: dependencies: '@reduxjs/toolkit': @@ -4056,11 +4122,14 @@ importers: specifier: 'catalog:' version: '@typescript/typescript6@6.0.2' - domain/entity/wallet-sync: + domain/entity/starred-account: dependencies: '@reduxjs/toolkit': specifier: 'catalog:' version: 2.11.2 + immer: + specifier: ^11.0.0 + version: 11.1.3 devDependencies: '@swc/core': specifier: 'catalog:' @@ -4078,14 +4147,11 @@ importers: specifier: 'catalog:' version: '@typescript/typescript6@6.0.2' - domain/entity/starred-account: + domain/entity/wallet-sync: dependencies: '@reduxjs/toolkit': specifier: 'catalog:' version: 2.11.2 - immer: - specifier: ^11.0.0 - version: 11.1.3 devDependencies: '@swc/core': specifier: 'catalog:' @@ -4808,6 +4874,48 @@ importers: specifier: 1.51.0 version: 1.51.0 + features/platform/aggregated-assets: + devDependencies: + '@swc/core': + specifier: 'catalog:' + version: 1.15.11 + '@swc/jest': + specifier: 'catalog:' + version: 0.2.39(@swc/core@1.15.11) + '@testing-library/dom': + specifier: 'catalog:' + version: 10.4.1 + '@testing-library/jest-dom': + specifier: 'catalog:' + version: 6.9.1 + '@testing-library/react': + specifier: 'catalog:' + version: 16.3.1(@testing-library/dom@10.4.1)(@types/react@19.0.14)(react-dom@19.1.4(react@19.1.4))(react@19.1.4) + '@types/jest': + specifier: 'catalog:' + version: 30.0.0 + '@types/react': + specifier: 'catalog:' + version: 19.0.14 + jest: + specifier: 'catalog:' + version: 30.2.0 + jest-environment-jsdom: + specifier: 'catalog:' + version: 30.2.0 + react: + specifier: 19.1.4 + version: 19.1.4 + react-dom: + specifier: 19.1.4 + version: 19.1.4(react@19.1.4) + react-redux: + specifier: 'catalog:' + version: 9.2.0(@types/react@19.0.14)(react@19.1.4) + typescript: + specifier: 'catalog:' + version: '@typescript/typescript6@6.0.2' + features/platform/currencies: dependencies: '@domain/api-currency-token': @@ -13850,6 +13958,31 @@ importers: specifier: 'catalog:' version: '@typescript/typescript6@6.0.2' + shared/cloud-sync-module: + dependencies: + zod: + specifier: 'catalog:' + version: 4.3.6 + devDependencies: + '@swc/core': + specifier: 'catalog:' + version: 1.15.11 + '@swc/jest': + specifier: 'catalog:' + version: 0.2.39(@swc/core@1.15.11) + '@types/jest': + specifier: 'catalog:' + version: 30.0.0 + '@types/node': + specifier: 'catalog:' + version: 24.12.0 + jest: + specifier: 'catalog:' + version: 30.2.0(@types/node@24.12.0) + typescript: + specifier: 'catalog:' + version: '@typescript/typescript6@6.0.2' + shared/env: dependencies: '@ledgerhq/live-env': @@ -13976,31 +14109,6 @@ importers: specifier: 'catalog:' version: '@typescript/typescript6@6.0.2' - shared/cloud-sync-module: - dependencies: - zod: - specifier: 'catalog:' - version: 4.3.6 - devDependencies: - '@swc/core': - specifier: 'catalog:' - version: 1.15.11 - '@swc/jest': - specifier: 'catalog:' - version: 0.2.39(@swc/core@1.15.11) - '@types/jest': - specifier: 'catalog:' - version: 30.0.0 - '@types/node': - specifier: 'catalog:' - version: 24.12.0 - jest: - specifier: 'catalog:' - version: 30.2.0(@types/node@24.12.0) - typescript: - specifier: 'catalog:' - version: '@typescript/typescript6@6.0.2' - tests/dummy-live-app: dependencies: '@ledgerhq/live-app-sdk': @@ -14357,7 +14465,7 @@ packages: '@apollo/server@4.12.2': resolution: {integrity: sha512-jKRlf+sBMMdKYrjMoiWKne42Eb6paBfDOr08KJnUaeaiyWFj+/040FjVPQI7YGLfdwnYIsl1NUUqS2UdgezJDg==} engines: {node: '>=14.16.0'} - deprecated: Apollo Server v4 is deprecated and will transition to end-of-life on January 26, 2026. As long as you are already using a non-EOL version of Node.js, upgrading to v5 should take only a few minutes. See https://www.apollographql.com/docs/apollo-server/previous-versions for details. + deprecated: Apollo Server v4 is end-of-life since January 26, 2026. As long as you are already using a non-EOL version of Node.js, upgrading to v5 should take only a few minutes. See https://www.apollographql.com/docs/apollo-server/previous-versions for details. peerDependencies: graphql: ^16.6.0 @@ -22942,7 +23050,7 @@ packages: metro-react-native-babel-preset: '*' react: 19.1.4 react-dom: 19.1.4 - webpack: '*' + webpack: ^5.89.0 peerDependenciesMeta: '@react-native/babel-preset': optional: true @@ -25286,7 +25394,7 @@ packages: resolution: {integrity: sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog==} engines: {node: '>=6'} peerDependencies: - rxjs: '*' + rxjs: ^5.5.10 zenObservable: '*' peerDependenciesMeta: rxjs: @@ -29436,7 +29544,7 @@ packages: git-raw-commits@2.0.11: resolution: {integrity: sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A==} engines: {node: '>=10'} - deprecated: This package is no longer maintained. For the JavaScript API, please use @conventional-changelog/git-client instead. + deprecated: Deprecated and no longer maintained. Use @conventional-changelog/git-client instead. hasBin: true git-up@7.0.0: @@ -69303,7 +69411,7 @@ snapshots: react-native-qrcode-svg@6.1.1(react-native-svg@15.15.1(react-native@0.81.6(patch_hash=fbb22f6ab81c7336a446f504c4aef2f23fc558838854399c868c5590e29ac9f1)(@babel/core@7.28.5)(@react-native-community/cli@18.0.1(@typescript/typescript6@6.0.2))(@types/react@19.0.14)(react@19.1.4))(react@19.1.4))(react-native@0.81.6(patch_hash=fbb22f6ab81c7336a446f504c4aef2f23fc558838854399c868c5590e29ac9f1)(@babel/core@7.28.5)(@react-native-community/cli@18.0.1(@typescript/typescript6@6.0.2))(@types/react@19.0.14)(react@19.1.4))(react@19.1.4): dependencies: prop-types: 15.8.1 - qrcode: 1.5.4 + qrcode: 1.5.3 react: 19.1.4 react-native: 0.81.6(patch_hash=fbb22f6ab81c7336a446f504c4aef2f23fc558838854399c868c5590e29ac9f1)(@babel/core@7.28.5)(@react-native-community/cli@18.0.1(@typescript/typescript6@6.0.2))(@types/react@19.0.14)(react@19.1.4) react-native-svg: 15.15.1(react-native@0.81.6(patch_hash=fbb22f6ab81c7336a446f504c4aef2f23fc558838854399c868c5590e29ac9f1)(@babel/core@7.28.5)(@react-native-community/cli@18.0.1(@typescript/typescript6@6.0.2))(@types/react@19.0.14)(react@19.1.4))(react@19.1.4) @@ -69311,7 +69419,7 @@ snapshots: react-native-qrcode-svg@6.1.1(react-native-svg@15.15.1(react-native@0.81.6(patch_hash=fbb22f6ab81c7336a446f504c4aef2f23fc558838854399c868c5590e29ac9f1)(@react-native-community/cli@15.1.0(@typescript/typescript6@6.0.2))(@types/react@19.0.14)(react@19.1.4))(react@19.1.4))(react-native@0.81.6(patch_hash=fbb22f6ab81c7336a446f504c4aef2f23fc558838854399c868c5590e29ac9f1)(@react-native-community/cli@15.1.0(@typescript/typescript6@6.0.2))(@types/react@19.0.14)(react@19.1.4))(react@19.1.4): dependencies: prop-types: 15.8.1 - qrcode: 1.5.4 + qrcode: 1.5.3 react: 19.1.4 react-native: 0.81.6(patch_hash=fbb22f6ab81c7336a446f504c4aef2f23fc558838854399c868c5590e29ac9f1)(@react-native-community/cli@15.1.0(@typescript/typescript6@6.0.2))(@types/react@19.0.14)(react@19.1.4) react-native-svg: 15.15.1(react-native@0.81.6(patch_hash=fbb22f6ab81c7336a446f504c4aef2f23fc558838854399c868c5590e29ac9f1)(@react-native-community/cli@15.1.0(@typescript/typescript6@6.0.2))(@types/react@19.0.14)(react@19.1.4))(react@19.1.4)