New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

robinhood-typescript

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

robinhood-typescript - npm Package Compare versions

Comparing version 1.6.2 to 1.7.0

lib/models/markets.d.ts

2

lib/index.d.ts

@@ -8,2 +8,3 @@ import { AccountsLoaded } from './models/account';

import { OrdersLoaded } from './models/orders';
import { MarketsLoaded } from './models/markets';
declare class RobinhoodAPI {

@@ -22,3 +23,4 @@ private _authToken;

orders(): Promise<OrdersLoaded>;
markets(): Promise<MarketsLoaded>;
}
export default RobinhoodAPI;

@@ -137,3 +137,16 @@ "use strict";

}
// This code will pull information on markets.
async markets() {
const config = {
headers: { Authorization: `Bearer ${this._authToken}` },
};
try {
const response = await axios_1.default.get(`${defaults_1.apiUrl}${defaults_1.endpoints.markets}`, config);
return response.data;
}
catch (error) {
return error;
}
}
}
exports.default = RobinhoodAPI;

2

package.json
{
"name": "robinhood-typescript",
"version": "1.6.2",
"version": "1.7.0",
"description": "NodeJS Framework to make trades with the private Robinhood API. Using this API is not encouraged, since it's not officially available and it has been reverse engineered. See @Sanko's Unofficial Documentation for more information.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -393,1 +393,42 @@ import RobinhoodAPI from '../index';

});
describe('Markets', () => {
test('successfully retrieved markets info', async () => {
const api = new RobinhoodAPI('token');
const data = {
next: null,
previous: null,
results: [
{
url: 'https://api.robinhood.com/markets/IEXG/',
todays_hours: 'https://api.robinhood.com/markets/IEXG/hours/2020-06-29/',
mic: 'IEXG',
operating_mic: 'IEXG',
acronym: 'IEX',
name: 'IEX Market',
city: 'New York',
country: 'US - United States of America',
timezone: 'US/Eastern',
website: 'www.iextrading.com',
},
],
};
mockedAxios.get.mockResolvedValue({ data });
const marketsInfo = await api.markets();
expect(marketsInfo).toEqual(data);
});
test('failure to retrieve markets info', async () => {
const api = new RobinhoodAPI('token');
const errorMessage = 'unable to retrieve markets';
mockedAxios.get.mockRejectedValue({ errorMessage });
const marketsInfo = await api.markets();
expect(marketsInfo).toEqual({ errorMessage });
});
});

@@ -9,2 +9,3 @@ import { apiUrl, endpoints } from './models/defaults';

import { OrdersLoaded } from './models/orders';
import { MarketsLoaded } from './models/markets';

@@ -170,4 +171,19 @@ // Dependencies

}
// This code will pull information on markets.
async markets(): Promise<MarketsLoaded> {
const config = {
headers: { Authorization: `Bearer ${this._authToken}` },
};
try {
const response: AxiosResponse<MarketsLoaded> = await axios.get(`${apiUrl}${endpoints.markets}`, config);
return response.data;
} catch (error) {
return error;
}
}
}
export default RobinhoodAPI;

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc