@vuu-ui/vuu-data-test 4.0.1 → 4.1.1

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/package.json CHANGED
@@ -1,21 +1,20 @@
1
1
  {
2
- "version": "4.0.1",
2
+ "version": "4.1.1",
3
3
  "main": "./src/index.js",
4
4
  "author": "heswell",
5
5
  "license": "Apache-2.0",
6
6
  "scripts": {
7
- "build:dev": "node ../../scripts/run-build.mjs",
8
7
  "build": "node ../../scripts/run-build-rslib.ts",
9
8
  "type-defs": "node ../../scripts/build-type-defs.mjs"
10
9
  },
11
10
  "dependencies": {
12
- "@vuu-ui/vuu-data-local": "4.0.1",
13
- "@vuu-ui/vuu-utils": "4.0.1"
11
+ "@vuu-ui/vuu-data-local": "4.1.1",
12
+ "@vuu-ui/vuu-utils": "4.1.1"
14
13
  },
15
14
  "devDependencies": {
16
- "@vuu-ui/vuu-protocol-types": "4.0.1",
17
- "@vuu-ui/vuu-data-types": "4.0.1",
18
- "@vuu-ui/vuu-table-types": "4.0.1"
15
+ "@vuu-ui/vuu-protocol-types": "4.1.1",
16
+ "@vuu-ui/vuu-data-types": "4.1.1",
17
+ "@vuu-ui/vuu-table-types": "4.1.1"
19
18
  },
20
19
  "sideEffects": false,
21
20
  "files": [
@@ -72,5 +72,5 @@ for (const row of sp500){
72
72
  weighting
73
73
  ]);
74
74
  }
75
- var constituents = basketConstituentData;
75
+ const constituents = basketConstituentData;
76
76
  export default constituents;
@@ -1,4 +1,4 @@
1
- var ftse100 = [
1
+ const ftse100 = [
2
2
  [
3
3
  "AAL.L",
4
4
  "Anglo American PLC",
@@ -1,4 +1,4 @@
1
- var hsi = [
1
+ const hsi = [
2
2
  [
3
3
  "CKH HOLDINGS",
4
4
  "00001.HK",
@@ -1,4 +1,4 @@
1
- var nasdaq100 = [
1
+ const nasdaq100 = [
2
2
  [
3
3
  "Apple Inc",
4
4
  "AAPL",
@@ -39,5 +39,5 @@ for (const [, , , lastTrade, ric] of constituents){
39
39
  }
40
40
  }
41
41
  const pricesTable = TableContainer.createTable(schemas.prices, prices, buildDataColumnMap(schemas, "prices"), pricesUpdateGenerator);
42
- var reference_data_prices = pricesTable;
42
+ const reference_data_prices = pricesTable;
43
43
  export default reference_data_prices;
@@ -1,4 +1,4 @@
1
- var sp500 = [
1
+ const sp500 = [
2
2
  [
3
3
  "Apple Inc",
4
4
  "AAPL",
@@ -17,5 +17,5 @@ class ModuleContainer {
17
17
  return this.#modules.keys();
18
18
  }
19
19
  }
20
- var module_ModuleContainer = ModuleContainer.instance;
20
+ const module_ModuleContainer = ModuleContainer.instance;
21
21
  export default module_ModuleContainer;
@@ -89,7 +89,7 @@ class TableContainer {
89
89
  throw Error(`[TableContainer] no table ${tableName}`);
90
90
  }
91
91
  }
92
- var table_TableContainer = TableContainer.instance;
92
+ const table_TableContainer = TableContainer.instance;
93
93
  const getServerDataType = (columnName, { columns: cols1, table: t1 }, { columns: cols2, table: t2 })=>{
94
94
  const col1 = cols1.find((col)=>col.name === columnName);
95
95
  const col2 = cols2.find((col)=>col.name === columnName);
@@ -29,6 +29,10 @@ const nextClosePrice = scaledDecimalColumn(4, 4, 0, 5000);
29
29
  const nextFxRate = scaledDecimalColumn(6, 6, 0.5, 2);
30
30
  const nextWeight = scaledDecimalColumn(8, 8, 0, 0.05);
31
31
  const nextRandom = createRandom(1);
32
+ const FIRST_TRADE_ID = 4000000000000;
33
+ const nextTradeIdGap = createRandom(3);
34
+ let tradeId = FIRST_TRADE_ID;
35
+ const nextTradeId = ()=>tradeId += randomInt(nextTradeIdGap, 1, 1000);
32
36
  const ONE_DAY = 86400000;
33
37
  const today = new Date();
34
38
  today.setHours(0, 0, 0, 0);
@@ -47,6 +51,7 @@ const instrumentsExtendedData = instrumentsData.map((instrument, rowIndex)=>{
47
51
  supported: nextRandom() < 0.5,
48
52
  wishlist: nextRandom() < 0.5,
49
53
  lastUpdated: instrument[InstrumentColumnMap.vuuUpdatedTimestamp],
54
+ tradeId: nextTradeId(),
50
55
  price: Math.round(100000 * nextRandom()) / 100,
51
56
  notional: nextNotional(rowIndex),
52
57
  closePrice: nextClosePrice(rowIndex),
@@ -89,6 +89,10 @@ const schemas = {
89
89
  name: "lastUpdated",
90
90
  serverDataType: "long"
91
91
  },
92
+ {
93
+ name: "tradeId",
94
+ serverDataType: "long"
95
+ },
92
96
  {
93
97
  name: "price",
94
98
  serverDataType: "double"
@@ -1,4 +1,4 @@
1
1
  import { ReactNode } from "react";
2
2
  export declare const LocalDataSourceProvider: ({ children, }: {
3
3
  children: ReactNode;
4
- }) => import("react/jsx-runtime").JSX.Element;
4
+ }) => import("react").JSX.Element;