@barchart/portfolio-api-common 1.14.0 → 1.16.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.
@@ -450,29 +450,29 @@ module.exports = (() => {
450
450
  }
451
451
 
452
452
  /**
453
- * A merger opening.
453
+ * A closing transaction as a result of a merger (for the acquired company).
454
454
  *
455
455
  * @public
456
456
  * @static
457
457
  * @returns {TransactionType}
458
458
  */
459
- static get MERGER_OPEN() {
460
- return mergerOpen;
459
+ static get MERGER_CLOSE() {
460
+ return mergerClose;
461
461
  }
462
462
 
463
463
  /**
464
- * A merger closing.
464
+ * A opening transaction as a result of a merger (for the acquiring company).
465
465
  *
466
466
  * @public
467
467
  * @static
468
468
  * @returns {TransactionType}
469
469
  */
470
- static get MERGER_CLOSE() {
471
- return mergerClose;
470
+ static get MERGER_OPEN() {
471
+ return mergerOpen;
472
472
  }
473
473
 
474
474
  /**
475
- * A spin-off.
475
+ * A spin-off (transaction applies to the original company).
476
476
  *
477
477
  * @public
478
478
  * @static
@@ -483,7 +483,7 @@ module.exports = (() => {
483
483
  }
484
484
 
485
485
  /**
486
- * A spin-off opening.
486
+ * A spin-off (transaction opens a position in a new company).
487
487
  *
488
488
  * @public
489
489
  * @static
@@ -510,11 +510,11 @@ module.exports = (() => {
510
510
  const feeUnits = new TransactionType('FU', 'Fee Units', 'Fee', 0, false, false, false, false, true, false, false, false, false, false, false, false, false);
511
511
  const delist = new TransactionType('DL', 'Delist', 'Delist', 1, false, false, false, false, false, false, true, false, true, false, false, false, false);
512
512
 
513
- const mergerOpen = new TransactionType('MO', 'Merger Open', 'Merger Open', 1, false, false, false, true, false, false, true, true, false, true, false, true, true);
514
513
  const mergerClose = new TransactionType('MC', 'Merger Close', 'Merger Close', 1, false, false, false, false, true, false, true, false, true, false, true, false, false);
514
+ const mergerOpen = new TransactionType('MO', 'Merger Open', 'Merger Open', 1, false, false, false, true, false, false, true, true, false, true, false, true, true);
515
515
 
516
516
  const spinoff = new TransactionType('SPF', 'Spinoff', 'Spinoff', 1, false, false, false, false, false, false, true, false, false, false, true, false, false);
517
- const spinoffOpen = new TransactionType('SPFO', 'Spinoff Open', 'Spinoff Open', 1, false, false, false, true, false, false, true, true, false, true, false, false, false);
517
+ const spinoffOpen = new TransactionType('SPFO', 'Spinoff Open', 'Spinoff Open', 1, false, false, false, true, false, false, true, true, false, true, false, true, true);
518
518
 
519
519
  const distributionCash = new TransactionType('DC', 'Distribution (Cash)', 'Cash Distribution', 1, false, false, true, false, false, false, true, false, false, false, false, false, false);
520
520
  const distributionReinvest = new TransactionType('DY', 'Distribution (Reinvested)', 'Distribution Reinvest', 1, false, false, false, true, false, false, true, false, false, false, false, false, false);
@@ -495,10 +495,10 @@ module.exports = (() => {
495
495
  formatters.set(TransactionType.WITHDRAWAL, [ basicFormatter, cashFormatter ]);
496
496
  formatters.set(TransactionType.DEBIT, [ basicFormatter, cashFormatter, debitFormatter ]);
497
497
  formatters.set(TransactionType.CREDIT, [ basicFormatter, cashFormatter, creditFormatter ]);
498
- formatters.set(TransactionType.MERGER_OPEN, [ basicFormatter ]);
498
+ formatters.set(TransactionType.MERGER_OPEN, [ basicFormatter, averageCostFormatter ]);
499
499
  formatters.set(TransactionType.MERGER_CLOSE, [ basicFormatter, mergerFormatter ]);
500
- formatters.set(TransactionType.SPINOFF, [ basicFormatter, spinoffFormatter ]);
501
- formatters.set(TransactionType.SPINOFF_OPEN, [ basicFormatter ]);
500
+ formatters.set(TransactionType.SPINOFF, [ basicFormatter, spinoffFormatter, averageCostFormatter ]);
501
+ formatters.set(TransactionType.SPINOFF_OPEN, [ basicFormatter, averageCostFormatter ]);
502
502
 
503
503
  function getInstrumentTypePriority(type) {
504
504
  if (type === InstrumentType.CASH) {
@@ -28,6 +28,7 @@ module.exports = (() => {
28
28
  const REQUIRED_CURRENCIES = [
29
29
  Currency.CAD,
30
30
  Currency.EUR,
31
+ Currency.HKD,
31
32
  Currency.JPY,
32
33
  Currency.USD
33
34
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.14.0",
3
+ "version": "1.16.0",
4
4
  "description": "Common JavaScript code used by Barchart's Portfolio Service",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",
@@ -15,7 +15,7 @@
15
15
  "url": "git+ssh://git@github.com/barchart/portfolio-api-common.git"
16
16
  },
17
17
  "dependencies": {
18
- "@barchart/common-js": "^4.22.0",
18
+ "@barchart/common-js": "^4.23.0",
19
19
  "uuid": "^8.3.2"
20
20
  },
21
21
  "devDependencies": {