ig-trading-api
Advanced tools
Comparing version 0.13.0 to 0.13.1
@@ -0,0 +0,0 @@ import { AxiosInstance } from 'axios'; |
@@ -0,0 +0,0 @@ "use strict"; |
export {}; |
@@ -21,3 +21,3 @@ "use strict"; | ||
it('returns all accounts', () => __awaiter(void 0, void 0, void 0, function* () { | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.get(AccountAPI_1.AccountAPI.URL.ACCOUNTS) | ||
@@ -56,3 +56,3 @@ .reply(200, JSON.stringify({ | ||
}; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.get(AccountAPI_1.AccountAPI.URL.HISTORY_TRANSACTIONS + '?maxSpanSeconds=' + transactionHistoryRequest.maxSpanSeconds) | ||
@@ -115,3 +115,3 @@ .reply(200, JSON.stringify({ | ||
}; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.get(AccountAPI_1.AccountAPI.URL.HISTORY_ACTIVITY + | ||
@@ -118,0 +118,0 @@ '?from=' + |
export * from './AccountAPI'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { Authorization, RESTClient } from './client/RESTClient'; |
@@ -0,0 +0,0 @@ "use strict"; |
export {}; |
@@ -0,0 +0,0 @@ "use strict"; |
export * from './RESTClient'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { AxiosInstance, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse } from 'axios'; |
@@ -35,3 +35,3 @@ "use strict"; | ||
} | ||
axios_retry_1.default(this.httpClient, { | ||
(0, axios_retry_1.default)(this.httpClient, { | ||
retries: Infinity, | ||
@@ -38,0 +38,0 @@ retryCondition: (error) => { |
export {}; |
@@ -32,3 +32,3 @@ "use strict"; | ||
beforeAll(() => { | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.persist() | ||
@@ -41,3 +41,3 @@ .defaultReplyHeaders({ | ||
.reply(200, JSON.stringify({})); | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.persist() | ||
@@ -44,0 +44,0 @@ .post(login_1.LoginAPI.URL.SESSION) |
@@ -0,0 +0,0 @@ import { AxiosInstance } from 'axios'; |
@@ -0,0 +0,0 @@ "use strict"; |
export {}; |
@@ -21,3 +21,3 @@ "use strict"; | ||
it('returns all open positions', () => __awaiter(void 0, void 0, void 0, function* () { | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.get(DealingAPI_1.DealingAPI.URL.POSITIONS) | ||
@@ -72,3 +72,3 @@ .reply(200, JSON.stringify({ | ||
it('returns an open position', () => __awaiter(void 0, void 0, void 0, function* () { | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.get(DealingAPI_1.DealingAPI.URL.POSITIONS + '12345') | ||
@@ -110,3 +110,3 @@ .reply(200, JSON.stringify({ | ||
}; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.post(DealingAPI_1.DealingAPI.URL.POSITIONS_OTC, { | ||
@@ -140,3 +140,3 @@ currencyCode: 'USD', | ||
}; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.post(DealingAPI_1.DealingAPI.URL.POSITIONS_OTC, { | ||
@@ -167,3 +167,3 @@ dealId: '12345', | ||
const dealId = '12345'; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.put(DealingAPI_1.DealingAPI.URL.POSITIONS_OTC + dealId, { | ||
@@ -184,3 +184,3 @@ limitLevel: 950.4, | ||
}; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.get(DealingAPI_1.DealingAPI.URL.CONFIRMS + dealReference.dealReference) | ||
@@ -224,3 +224,3 @@ .reply(200, JSON.stringify({ | ||
it('gets all orders', () => __awaiter(void 0, void 0, void 0, function* () { | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.get(DealingAPI_1.DealingAPI.URL.WORKINGORDERS) | ||
@@ -289,3 +289,3 @@ .reply(200, JSON.stringify({ | ||
}; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.post(DealingAPI_1.DealingAPI.URL.WORKINGORDERS_OTC, { | ||
@@ -313,3 +313,3 @@ currencyCode: 'USD', | ||
const dealId = '12345'; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.post(DealingAPI_1.DealingAPI.URL.WORKINGORDERS_OTC + dealId, {}, { | ||
@@ -328,3 +328,3 @@ reqheaders: { | ||
const dealId = '12345'; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.post(DealingAPI_1.DealingAPI.URL.WORKINGORDERS_OTC + dealId, {}, { | ||
@@ -343,3 +343,3 @@ reqheaders: { | ||
const dealId = '12345'; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.post(DealingAPI_1.DealingAPI.URL.WORKINGORDERS_OTC + dealId, {}, { | ||
@@ -362,4 +362,6 @@ reqheaders: { | ||
catch (error) { | ||
expect(error.isAxiosError).toBe(true); | ||
expect(error.config['axios-retry'].retryCount).toBe(amountOfRetries); | ||
const axiosError = error; | ||
expect(axiosError.isAxiosError).toBe(true); | ||
// Any typing because of: https://github.com/softonic/axios-retry/pull/174 | ||
expect(axiosError.config['axios-retry'].retryCount).toBe(amountOfRetries); | ||
} | ||
@@ -369,3 +371,3 @@ }), 10000); | ||
const dealId = '12345'; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.post(DealingAPI_1.DealingAPI.URL.WORKINGORDERS_OTC + dealId, {}, { | ||
@@ -399,3 +401,3 @@ reqheaders: { | ||
const dealId = '12345'; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.post(DealingAPI_1.DealingAPI.URL.WORKINGORDERS_OTC + dealId, {}, { | ||
@@ -422,4 +424,5 @@ reqheaders: { | ||
catch (error) { | ||
const expectedError = error; | ||
expect(createSession).not.toHaveBeenCalled(); | ||
expect(error.message).toBe('Cannot fulfill request because there is no active session and username & password have not been provided.'); | ||
expect(expectedError.message).toBe('Cannot fulfill request because there is no active session and username & password have not been provided.'); | ||
} | ||
@@ -436,3 +439,3 @@ })); | ||
}; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.put(DealingAPI_1.DealingAPI.URL.WORKINGORDERS_OTC + dealId, { | ||
@@ -439,0 +442,0 @@ level: 519.1, |
export * from './DealingAPI'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { APIClient } from './APIClient'; |
@@ -0,0 +0,0 @@ "use strict"; |
export * from './LightstreamerAPI'; | ||
export * from './interfaces'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ export declare enum ChartResolution { |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { LightstreamerClient, Subscription } from 'lightstreamer-client-node'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -22,3 +22,3 @@ "use strict"; | ||
it('can subscribe and re-subscribe to chart data', () => __awaiter(void 0, void 0, void 0, function* () { | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.post(LoginAPI_1.LoginAPI.URL.SESSION) | ||
@@ -39,3 +39,3 @@ .query(true) | ||
})); | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.get(LoginAPI_1.LoginAPI.URL.SESSION + '?fetchSessionTokens=true') | ||
@@ -42,0 +42,0 @@ .reply(200, JSON.stringify({ |
export * from './LoginAPI'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { AxiosInstance } from 'axios'; |
@@ -0,0 +0,0 @@ "use strict"; |
export {}; |
@@ -22,3 +22,3 @@ "use strict"; | ||
it('creates a trading session', () => __awaiter(void 0, void 0, void 0, function* () { | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.post(LoginAPI_1.LoginAPI.URL.SESSION) | ||
@@ -39,3 +39,3 @@ .query(true) | ||
})); | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.get(LoginAPI_1.LoginAPI.URL.SESSION + '?fetchSessionTokens=true') | ||
@@ -58,3 +58,3 @@ .reply(200, JSON.stringify({ | ||
const dealId = '12345'; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.post(DealingAPI_1.DealingAPI.URL.WORKINGORDERS_OTC + dealId, {}, { | ||
@@ -70,3 +70,3 @@ reqheaders: { | ||
expect(deleteOrder.dealReference).toBe('54321'); | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.put(LoginAPI_1.LoginAPI.URL.SESSION) | ||
@@ -89,3 +89,3 @@ .query(true) | ||
const password = 'secret'; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.post(LoginAPI_1.LoginAPI.URL.SESSION) | ||
@@ -131,3 +131,3 @@ .query(true) | ||
it('create a mobile session', () => __awaiter(void 0, void 0, void 0, function* () { | ||
nock_1.default('https://api.ig.com/') | ||
(0, nock_1.default)('https://api.ig.com/') | ||
.post('/clientsecurity/session') | ||
@@ -148,3 +148,3 @@ .reply(200, JSON.stringify({ | ||
it('returns the trading session', () => __awaiter(void 0, void 0, void 0, function* () { | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.get(LoginAPI_1.LoginAPI.URL.SESSION + '?fetchSessionTokens=true') | ||
@@ -168,3 +168,3 @@ .reply(200, JSON.stringify({ | ||
const dealId = '12345'; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.post(DealingAPI_1.DealingAPI.URL.WORKINGORDERS_OTC + dealId, {}, { | ||
@@ -178,3 +178,3 @@ reqheaders: { | ||
})); | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.post(LoginAPI_1.LoginAPI.URL.REFRESH_TOKEN) | ||
@@ -189,3 +189,3 @@ .query(true) | ||
})); | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.post(DealingAPI_1.DealingAPI.URL.WORKINGORDERS_OTC + dealId, {}, { | ||
@@ -205,3 +205,3 @@ reqheaders: { | ||
it('sends a DELETE HTTP request to destroy the current session', () => __awaiter(void 0, void 0, void 0, function* () { | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO).delete(LoginAPI_1.LoginAPI.URL.SESSION).reply(200); | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO).delete(LoginAPI_1.LoginAPI.URL.SESSION).reply(200); | ||
yield global.client.rest.login.logout(); | ||
@@ -208,0 +208,0 @@ })); |
export * from './MarketAPI'; | ||
export * from './prices'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { AxiosInstance } from 'axios'; |
@@ -0,0 +0,0 @@ "use strict"; |
export {}; |
@@ -21,3 +21,3 @@ "use strict"; | ||
it('returns all markets matching the search term', () => __awaiter(void 0, void 0, void 0, function* () { | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.get(MarketAPI_1.MarketAPI.URL.MARKETS) | ||
@@ -91,3 +91,3 @@ .query({ searchTerm: 'PFE' }) | ||
it('returns all top-level nodes (market categories) in the market navigation hierarchy', () => __awaiter(void 0, void 0, void 0, function* () { | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.get(MarketAPI_1.MarketAPI.URL.MARKETNAVIGATION) | ||
@@ -110,3 +110,3 @@ .reply(200, JSON.stringify({ | ||
const nodeId = '138425500'; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.get(`${MarketAPI_1.MarketAPI.URL.MARKETNAVIGATION}/${nodeId}`) | ||
@@ -146,3 +146,3 @@ .reply(200, JSON.stringify({ | ||
const epic = 'IX.D.FTSE.CFD.IP'; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.get(`${MarketAPI_1.MarketAPI.URL.MARKETS}/${epic}`) | ||
@@ -270,3 +270,3 @@ .reply(200, JSON.stringify({ | ||
const epics = ['IX.D.FTSE.CFD.IP', 'SE.D.PFE.CASH.IP']; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.get(`${MarketAPI_1.MarketAPI.URL.MARKETS}?epics=${encodeURIComponent(epics.join(','))}`) | ||
@@ -273,0 +273,0 @@ .reply(200, JSON.stringify({ |
export * from './PriceAPI'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { AxiosInstance } from 'axios'; |
@@ -0,0 +0,0 @@ "use strict"; |
export {}; |
@@ -69,3 +69,3 @@ "use strict"; | ||
]; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.get(`${PriceAPI_1.PriceAPI.URL.PRICES}/CS.D.GBPUSD.TODAY.IP?max=5&pageNumber=1&pageSize=0&resolution=HOUR_4`) | ||
@@ -144,3 +144,3 @@ .reply(200, JSON.stringify({ | ||
]; | ||
nock_1.default(APIClient_1.APIClient.URL_DEMO) | ||
(0, nock_1.default)(APIClient_1.APIClient.URL_DEMO) | ||
.get(`${PriceAPI_1.PriceAPI.URL.PRICES}/CS.D.GBPUSD.TODAY.IP?from=2021-01-15T00%3A00%3A00.000Z&pageNumber=1&pageSize=0&resolution=HOUR_4&to=2021-01-16T00%3A00%3A00.000Z`) | ||
@@ -147,0 +147,0 @@ .reply(200, JSON.stringify({ |
@@ -6,34 +6,34 @@ { | ||
"dependencies": { | ||
"@types/node": "15.0.2", | ||
"axios": "0.21.1", | ||
"@types/node": "15.12.4", | ||
"axios": "0.21.4", | ||
"axios-retry": "3.1.9", | ||
"lightstreamer-client-node": "8.0.3", | ||
"luxon": "1.26.0" | ||
"luxon": "2.0.2" | ||
}, | ||
"description": "IG Trading API for Node.js, written in TypeScript.", | ||
"devDependencies": { | ||
"@types/jasmine": "3.7.1", | ||
"@types/luxon": "1.26.5", | ||
"@typescript-eslint/eslint-plugin": "4.22.1", | ||
"@typescript-eslint/parser": "4.22.1", | ||
"@types/jasmine": "3.9.0", | ||
"@types/luxon": "2.0.3", | ||
"@typescript-eslint/eslint-plugin": "4.31.0", | ||
"@typescript-eslint/parser": "4.31.0", | ||
"cross-env": "7.0.3", | ||
"dotenv-defaults": "2.0.1", | ||
"eslint": "7.26.0", | ||
"dotenv-defaults": "2.0.2", | ||
"eslint": "7.32.0", | ||
"eslint-config-prettier": "8.3.0", | ||
"eslint-plugin-prettier": "3.4.0", | ||
"eslint-plugin-sort-keys-fix": "1.1.1", | ||
"eslint-plugin-typescript-sort-keys": "1.6.0", | ||
"eslint-plugin-prettier": "4.0.0", | ||
"eslint-plugin-sort-keys-fix": "1.1.2", | ||
"eslint-plugin-typescript-sort-keys": "1.8.0", | ||
"generate-changelog": "1.8.0", | ||
"husky": "4.3.8", | ||
"jasmine": "3.7.0", | ||
"lint-staged": "11.0.0", | ||
"nock": "13.0.11", | ||
"jasmine": "3.9.0", | ||
"lint-staged": "11.1.2", | ||
"nock": "13.1.3", | ||
"nyc": "15.1.0", | ||
"prettier": "2.3.0", | ||
"pretty-quick": "3.1.0", | ||
"prettier": "2.3.2", | ||
"pretty-quick": "3.1.1", | ||
"rimraf": "3.0.2", | ||
"ts-node": "9.1.1", | ||
"typedoc": "0.20.36", | ||
"typedoc-plugin-markdown": "3.8.0", | ||
"typescript": "4.2.4" | ||
"ts-node": "10.2.1", | ||
"typedoc": "0.21.9", | ||
"typedoc-plugin-markdown": "3.10.4", | ||
"typescript": "4.4.2" | ||
}, | ||
@@ -100,3 +100,3 @@ "engines": { | ||
}, | ||
"version": "0.13.0" | ||
"version": "0.13.1" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
3731
241647
78
+ Added@types/node@15.12.4(transitive)
+ Addedaxios@0.21.4(transitive)
+ Addedluxon@2.0.2(transitive)
- Removed@types/node@15.0.2(transitive)
- Removedaxios@0.21.1(transitive)
- Removedluxon@1.26.0(transitive)
Updated@types/node@15.12.4
Updatedaxios@0.21.4
Updatedluxon@2.0.2