@barchart/portfolio-client-js 10.3.1 → 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.
@@ -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
@@ -7,6 +7,6 @@ module.exports = (() => {
7
7
  return {
8
8
  JwtProvider: JwtProvider,
9
9
  PortfolioGateway: PortfolioGateway,
10
- version: '10.3.1'
10
+ version: '10.4.0'
11
11
  };
12
12
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-client-js",
3
- "version": "10.3.1",
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": {