@barchart/portfolio-api-common 1.22.0 → 1.23.0

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.
@@ -343,10 +343,10 @@ module.exports = (() => {
343
343
 
344
344
  const cash = new InstrumentType('CASH', 'cash', 'Cash', true, false, false, true, false, false, true, false, false, false, instrument => `BARCHART-${instrument.type.code}-${instrument.currency.code}`);
345
345
  const equity = new InstrumentType('EQUITY', 'equity', 'Equities', false, true, true, false, true, true, true, true, true, true, instrument => `BARCHART-${instrument.type.code}-${instrument.symbol.barchart}`);
346
- const equityOption = new InstrumentType('EQUITY_OPTION', 'equity option', 'Equity Option', false, false, true, false, true, false, false, false, false, true, instrument => `BARCHART-${instrument.type.code}-${instrument.symbol.barchart}`);
346
+ const equityOption = new InstrumentType('EQUITY_OPTION', 'equity option', 'Equity Options', false, false, true, false, true, false, false, false, false, true, instrument => `BARCHART-${instrument.type.code}-${instrument.symbol.barchart}`);
347
347
  const fund = new InstrumentType('FUND', 'mutual fund', 'Funds', false, true, false, false, true, true, true,false, true, true, instrument => `BARCHART-${instrument.type.code}-${instrument.symbol.barchart}`);
348
348
  const future = new InstrumentType('FUTURE', 'futures contract', 'Futures', false, false, true, false, true, false, false, false, false, true, instrument => `BARCHART-${instrument.type.code}-${instrument.symbol.barchart}`);
349
- const futureOption = new InstrumentType('FUTURE_OPTION', 'futures option', 'Futures Option', false, false, true, false, true, false, false, false, false, true, instrument => `BARCHART-${instrument.type.code}-${instrument.symbol.barchart}`);
349
+ const futureOption = new InstrumentType('FUTURE_OPTION', 'futures option', 'Futures Options', false, false, true, false, true, false, false, false, false, true, instrument => `BARCHART-${instrument.type.code}-${instrument.symbol.barchart}`);
350
350
  const other = new InstrumentType('OTHER', 'other', 'Other', false, false, false, false, false, false, true,false, true, true, instrument => `BARCHART-${instrument.type.code}-${uuid.v4()}`);
351
351
 
352
352
  return InstrumentType;
@@ -25,7 +25,7 @@ module.exports = (() => {
25
25
  *
26
26
  * @public
27
27
  * @param {PositionContainer} container
28
- * @param {LevelDefinition} definition
28
+ * @param {PositionLevelDefinition} definition
29
29
  * @param {PositionItem[]} items
30
30
  * @param {Currency} currency
31
31
  * @param {String} key
@@ -4,6 +4,8 @@ const Currency = require('@barchart/common-js/lang/Currency'),
4
4
  Schema = require('@barchart/common-js/serialization/json/Schema'),
5
5
  SchemaBuilder = require('@barchart/common-js/serialization/json/builders/SchemaBuilder');
6
6
 
7
+ const UnitCode = require('@barchart/marketdata-api-js/lib/utilities/data/UnitCode');
8
+
7
9
  const InstrumentType = require('./../data/InstrumentType'),
8
10
  OptionSide = require('./../data/OptionSide'),
9
11
  PositionDirection = require('./../data/PositionDirection'),
@@ -90,6 +92,7 @@ module.exports = (() => {
90
92
  .withField('instrument.id', DataType.STRING)
91
93
  .withField('instrument.name', DataType.STRING)
92
94
  .withField('instrument.type', DataType.forEnum(InstrumentType, 'InstrumentType'))
95
+ .withField('instrument.code', DataType.forEnum(UnitCode, 'UnitCode'), true)
93
96
  .withField('instrument.currency', DataType.forEnum(Currency, 'Currency'))
94
97
  .withField('instrument.delist', DataType.DAY, true)
95
98
  .withField('instrument.future.expiration', DataType.DAY, true)
@@ -135,6 +138,7 @@ module.exports = (() => {
135
138
  .withField('instrument.id', DataType.STRING)
136
139
  .withField('instrument.name', DataType.STRING)
137
140
  .withField('instrument.type', DataType.forEnum(InstrumentType, 'InstrumentType'))
141
+ .withField('instrument.code', DataType.forEnum(UnitCode, 'UnitCode'), true)
138
142
  .withField('instrument.currency', DataType.forEnum(Currency, 'Currency'))
139
143
  .withField('instrument.delist', DataType.DAY, true)
140
144
  .withField('instrument.future.expiration', DataType.DAY, true)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.22.0",
3
+ "version": "1.23.0",
4
4
  "description": "Common JavaScript code used by Barchart's Portfolio Service",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@barchart/common-js": "^4.27.0",
19
- "@barchart/marketdata-api-js": "^6.1.1",
19
+ "@barchart/marketdata-api-js": "^6.2.0",
20
20
  "uuid": "^8.3.2"
21
21
  },
22
22
  "devDependencies": {