robinhood-node
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -35,3 +35,24 @@ const Request = require('./Request'); | ||
} | ||
get watchlists() { | ||
return Request.getPersonal('watchlists'); | ||
} | ||
get defaultWatchlist() { | ||
return Request.getPersonal('watchlists/Default'); | ||
} | ||
get portfolios() { | ||
return Request.getPersonal('portfolios'); | ||
} | ||
async defaultPortfolio() { | ||
if (!this.defaultPortfolioId) { | ||
const portfolios = await this.portfolios; | ||
this.defaultPortfolioId = portfolios.results[0].url.split('/').slice(-2)[0]; | ||
} | ||
return Request.getPersonal(`portfolios/${this.defaultPortfolioId}`); | ||
} | ||
} | ||
const instrumetSymbols = {}; |
@@ -19,10 +19,2 @@ const Order = require('./Order'); | ||
async instrument(symbol) { | ||
symbol = symbol || this.symbols.split(',')[0]; | ||
if (!this.instruments[symbol]) { | ||
this.instruments[symbol] = await Request.get('instruments', { symbol }); | ||
} | ||
return this.instruments[symbol]; | ||
} | ||
async makeOrder(params) { | ||
@@ -29,0 +21,0 @@ const orderParams = await this.getOrderParams(); |
@@ -6,2 +6,3 @@ const Request = require('./core/Request'); | ||
const Order = require('./core/Order'); | ||
const Instrument = require('./core/Instrument'); | ||
@@ -13,2 +14,3 @@ module.exports = class RobinhoodNode { | ||
get Order() { return Order }; | ||
get Instrument() { return Instrument }; | ||
@@ -15,0 +17,0 @@ constructor(params) { |
{ | ||
"name": "robinhood-node", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -70,2 +70,7 @@ # Robinhood node ![robinhood-node](https://i.imgur.com/ev0Xv9d.jpg) | ||
### Instrument | ||
[`static all`](https://github.com/sanko/Robinhood/blob/master/Instrument.md#grab-a-list-of-all-instruments) | ||
[`static valueById(id)`](https://github.com/sanko/Robinhood/blob/master/Instrument.md#gather-basic-instrument-info-by-id) | ||
[`static valueBySymbol(symbol)`](https://github.com/sanko/Robinhood/blob/master/Instrument.md#gather-basic-instrument-info-by-symbol) | ||
### Account | ||
@@ -78,2 +83,5 @@ `constructor()` | ||
[`investment`](https://github.com/sanko/Robinhood/blob/master/Account.md#gather-investment-profile-data-about-the-account-holder) | ||
[`watchlists`](https://github.com/sanko/Robinhood/blob/master/Watchlist.md) | ||
[`defaultWatchlist`](https://github.com/sanko/Robinhood/blob/master/Watchlist.md) | ||
`portfolios` | ||
@@ -80,0 +88,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12722
9
288
89