@barchart/portfolio-client-js 10.3.0 → 10.4.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.
- package/lib/gateway/PortfolioGateway.js +20 -1
- package/lib/index.js +1 -1
- package/package.json +2 -2
|
@@ -119,7 +119,8 @@ module.exports = (() => {
|
|
|
119
119
|
.withVariableParameter('symbol', 'symbol', 'symbol', false);
|
|
120
120
|
})
|
|
121
121
|
.withQueryBuilder((qb) => {
|
|
122
|
-
qb.withVariableParameter('day', 'day', 'day', true, x => x.format())
|
|
122
|
+
qb.withVariableParameter('day', 'day', 'day', true, x => x.format())
|
|
123
|
+
.withVariableParameter('closing', 'closing', 'closing', true, x => is.boolean(x) && x ? 'true' : x);
|
|
123
124
|
})
|
|
124
125
|
.withRequestInterceptor(RequestInterceptor.PLAIN_TEXT_RESPONSE)
|
|
125
126
|
.withRequestInterceptor(requestInterceptor)
|
|
@@ -755,6 +756,24 @@ module.exports = (() => {
|
|
|
755
756
|
return Gateway.invoke(this._readInstrumentEndpoint, payload);
|
|
756
757
|
}
|
|
757
758
|
|
|
759
|
+
/**
|
|
760
|
+
* Resolves an instrument closing price.
|
|
761
|
+
*
|
|
762
|
+
* @public
|
|
763
|
+
* @async
|
|
764
|
+
* @param {String} symbol - The instrument symbol.
|
|
765
|
+
* @param {Day=} day - The date the closing price is requested.
|
|
766
|
+
* @returns {Promise<Object>}
|
|
767
|
+
*/
|
|
768
|
+
async readInstrumentClosing(symbol, day) {
|
|
769
|
+
checkStart.call(this);
|
|
770
|
+
|
|
771
|
+
assert.argumentIsRequired(symbol, 'symbol', String);
|
|
772
|
+
assert.argumentIsRequired(day, 'day', Day, 'Day');
|
|
773
|
+
|
|
774
|
+
return Gateway.invoke(this._readInstrumentEndpoint, { symbol, day, closing: true });
|
|
775
|
+
}
|
|
776
|
+
|
|
758
777
|
/**
|
|
759
778
|
* Creates a new portfolio for the current user.
|
|
760
779
|
*
|
package/lib/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barchart/portfolio-client-js",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.4.0",
|
|
4
4
|
"description": "JavaScript SDK for Barchart's Portfolio Service",
|
|
5
5
|
"homepage": "https://docs.barchart.com/portfolio/#/",
|
|
6
6
|
"author": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@barchart/common-js": "^4.70.0",
|
|
32
|
-
"@barchart/portfolio-api-common": "^7.0
|
|
32
|
+
"@barchart/portfolio-api-common": "^7.4.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@babel/core": "^7.11.1",
|