@barchart/portfolio-api-common 1.0.110 → 1.0.111
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.
|
@@ -122,6 +122,8 @@ module.exports = (() => {
|
|
|
122
122
|
|
|
123
123
|
return map;
|
|
124
124
|
}, { });
|
|
125
|
+
|
|
126
|
+
this._forex = { };
|
|
125
127
|
|
|
126
128
|
this._trees = definitions.reduce((map, treeDefinition) => {
|
|
127
129
|
const tree = new Tree();
|
|
@@ -238,7 +240,7 @@ module.exports = (() => {
|
|
|
238
240
|
assert.argumentIsRequired(symbol, 'symbol', String);
|
|
239
241
|
assert.argumentIsRequired(quote, 'quote', Object);
|
|
240
242
|
|
|
241
|
-
|
|
243
|
+
this._forex[symbol] = quote;
|
|
242
244
|
}
|
|
243
245
|
|
|
244
246
|
getGroup(name, keys) {
|
|
@@ -85,10 +85,13 @@ module.exports = (() => {
|
|
|
85
85
|
assert.argumentIsRequired(quote, 'quote', Object);
|
|
86
86
|
|
|
87
87
|
if (this._previousQuote === null || this._previousQuote.lastPrice !== quote.lastPrice) {
|
|
88
|
+
calculatePriceData(this, quote.lastPrice);
|
|
89
|
+
|
|
88
90
|
this._previousQuote = this._currentQuote;
|
|
89
91
|
this._currentQuote = quote;
|
|
90
92
|
|
|
91
|
-
|
|
93
|
+
this._data.previousPrice = this._data.currentPrice;
|
|
94
|
+
this._data.currentPrice = price;
|
|
92
95
|
|
|
93
96
|
this._quoteChangedEvent.fire(this._data, this._currentQuote);
|
|
94
97
|
}
|
package/package.json
CHANGED
package/test/SpecRunner.js
CHANGED
|
@@ -838,6 +838,8 @@ module.exports = (() => {
|
|
|
838
838
|
|
|
839
839
|
return map;
|
|
840
840
|
}, { });
|
|
841
|
+
|
|
842
|
+
this._forex = { };
|
|
841
843
|
|
|
842
844
|
this._trees = definitions.reduce((map, treeDefinition) => {
|
|
843
845
|
const tree = new Tree();
|
|
@@ -954,7 +956,7 @@ module.exports = (() => {
|
|
|
954
956
|
assert.argumentIsRequired(symbol, 'symbol', String);
|
|
955
957
|
assert.argumentIsRequired(quote, 'quote', Object);
|
|
956
958
|
|
|
957
|
-
|
|
959
|
+
this._forex[symbol] = quote;
|
|
958
960
|
}
|
|
959
961
|
|
|
960
962
|
getGroup(name, keys) {
|
|
@@ -1465,10 +1467,13 @@ module.exports = (() => {
|
|
|
1465
1467
|
assert.argumentIsRequired(quote, 'quote', Object);
|
|
1466
1468
|
|
|
1467
1469
|
if (this._previousQuote === null || this._previousQuote.lastPrice !== quote.lastPrice) {
|
|
1470
|
+
calculatePriceData(this, quote.lastPrice);
|
|
1471
|
+
|
|
1468
1472
|
this._previousQuote = this._currentQuote;
|
|
1469
1473
|
this._currentQuote = quote;
|
|
1470
1474
|
|
|
1471
|
-
|
|
1475
|
+
this._data.previousPrice = this._data.currentPrice;
|
|
1476
|
+
this._data.currentPrice = price;
|
|
1472
1477
|
|
|
1473
1478
|
this._quoteChangedEvent.fire(this._data, this._currentQuote);
|
|
1474
1479
|
}
|