robinhood-api
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -93,2 +93,22 @@ module.exports = { | ||
}, | ||
getPortfolio: { | ||
desription: 'Get the user\'s portfolio by account ID', | ||
path: '/portfolios/%account_number%', | ||
fields: { | ||
account_number: { | ||
required: true | ||
} | ||
}, | ||
method: 'GET' | ||
}, | ||
getHistoricals: { | ||
description: 'Get the user\'s portfolio historicals', | ||
path: '/portfolios/historicals/%account_number%', | ||
fields: { | ||
account_number: { | ||
required: true | ||
} | ||
}, | ||
method: 'GET' | ||
}, | ||
'getOrder': { | ||
@@ -95,0 +115,0 @@ description: 'Get an order via the order_id parameter.', |
@@ -28,2 +28,4 @@ "use strict"; | ||
let path = null; | ||
try{ | ||
@@ -41,3 +43,3 @@ _.each(call.fields, function(options, field){ | ||
if(call.path.includes('%' + field + '%')){ | ||
call.path = call.path.replace('%' + field + '%', opts[field]); | ||
path = call.path.replace('%' + field + '%', opts[field]); | ||
delete opts[field]; | ||
@@ -47,3 +49,3 @@ } | ||
let res = await self.request(call.method, call.path, opts); | ||
let res = await self.request(call.method, (path != null) ? path : call.path, opts); | ||
@@ -50,0 +52,0 @@ return res; |
{ | ||
"name": "robinhood-api", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Robinhood API Wrapper", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -84,2 +84,10 @@ # Overview | ||
* nonzero - Required: false (Valid Values: true,false) | ||
## robinhood.getPortfolio(opts) | ||
undefined | ||
### Options | ||
* account_number - Required: true | ||
## robinhood.getHistoricals(opts) | ||
Get the user's portfolio historicals | ||
### Options | ||
* account_number - Required: true | ||
## robinhood.getOrder(opts) | ||
@@ -86,0 +94,0 @@ Get an order via the order_id parameter. |
@@ -9,2 +9,7 @@ const RobinHood = require('./index.js'); | ||
//let test = await rh.getAccounts(); | ||
test = await rh.getQuote({symbol: 'HRL'}); | ||
console.log(test); | ||
test = await rh.getQuote({symbol: 'JNJ'}); | ||
console.log(test); | ||
console.log('Logged in!'); | ||
@@ -11,0 +16,0 @@ }catch(e){ |
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
17447
386
129