Skip to content

Commit

Permalink
Merge pull request #25 from upstox/feature/including-case-changes
Browse files Browse the repository at this point in the history
feat: including alternate fields for soon to be deprecated items
  • Loading branch information
Rahulzz committed Dec 27, 2023
2 parents 6560778 + 7114efd commit f9333f9
Show file tree
Hide file tree
Showing 9 changed files with 211 additions and 42 deletions.
198 changes: 158 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "upstox-js-sdk",
"version": "2.1.0",
"version": "2.2.0",
"description": "The official Node Js client for communicating with the Upstox API",
"license": "MIT",
"main": "dist/index.js",
Expand Down Expand Up @@ -28,6 +28,9 @@
},
"dependencies": {
"@babel/cli": "^7.0.0",
"@babel/traverse": "^7.23.2",
"minimatch": "^3.0.5",
"nanoid": "^3.1.31",
"superagent": "^5.3.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/ApiClient.js
Expand Up @@ -34,7 +34,7 @@ export class ApiClient {
* @type {String}
* @default https://api-v2.upstox.com
*/
this.basePath = 'https://api-v2.upstox.com'.replace(/\/+$/, '');
this.basePath = 'https://api.upstox.com/v2'.replace(/\/+$/, '');

/**
* The authentication methods to be included for all API calls.
Expand Down
8 changes: 8 additions & 0 deletions src/model/HoldingsData.js
Expand Up @@ -55,6 +55,8 @@ export class HoldingsData {
obj.quantity = ApiClient.convertToType(data['quantity'], 'Number');
if (data.hasOwnProperty('tradingsymbol'))
obj.tradingsymbol = ApiClient.convertToType(data['tradingsymbol'], 'String');
if (data.hasOwnProperty('trading_symbol'))
obj.tradingSymbol = ApiClient.convertToType(data['trading_symbol'], 'String');
if (data.hasOwnProperty('last_price'))
obj.lastPrice = ApiClient.convertToType(data['last_price'], 'Number');
if (data.hasOwnProperty('close_price'))
Expand Down Expand Up @@ -130,6 +132,12 @@ HoldingsData.prototype.quantity = undefined;
*/
HoldingsData.prototype.tradingsymbol = undefined;

/**
* Shows the trading symbol of the instrument
* @member {String} tradingSymbol
*/
HoldingsData.prototype.tradingSymbol = undefined;

/**
* The last traded price of the instrument
* @member {Number} lastPrice
Expand Down

0 comments on commit f9333f9

Please sign in to comment.