api_connect_nodejs 1.0.1 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -31
- package/conf/settings.ini +19 -20
- package/enums/actionType.js +10 -10
- package/enums/assetType.js +25 -25
- package/enums/chartExchangeType.js +15 -15
- package/enums/chartType.js +13 -13
- package/enums/eodIntervalType.js +11 -11
- package/enums/exchangeType.js +14 -14
- package/enums/intradayIntervalType.js +14 -14
- package/enums/marketCapType.js +12 -12
- package/enums/orderType.js +21 -21
- package/enums/productType.js +24 -24
- package/enums/segementsType.js +13 -13
- package/enums/streamingConstants.js +11 -0
- package/enums/termsType.js +12 -12
- package/enums/validity.js +22 -22
- package/index.js +3 -3
- package/package.json +25 -37
- package/src/{edelconnect.js → apiConnect.js} +2424 -2211
- package/src/{edelweissApiUtils.js → apiUtils.js} +129 -129
- package/src/chart.js +258 -258
- package/src/config.js +326 -326
- package/src/feed/feed.js +139 -0
- package/src/feed/liveNewsFeed.js +112 -0
- package/src/feed/ordersFeed.js +124 -0
- package/src/feed/quotesFeed.js +121 -0
- package/src/http.js +197 -196
- package/src/iniparser.js +42 -41
- package/src/liveNews.js +362 -362
- package/src/logger.js +16 -16
- package/src/order.js +48 -48
- package/src/researchCalls.js +175 -175
- package/src/watchlist.js +378 -378
- package/validations/{edelconnectValidator.js → apiConnectValidator.js} +508 -619
- package/validations/chartValidator.js +85 -85
- package/validations/feedStreamerValidator.js +68 -0
- package/validations/liveNewsValidator.js +60 -60
- package/validations/researchCallsValidator.js +86 -86
- package/validations/watchlistValidator.js +60 -60
- package/.prettierrc.json +0 -19
- package/gitignore +0 -23
- package/src/feed.js +0 -166
- package/validations/feedValidator.js +0 -31
package/README.md
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
<h1 align="center">Welcome to APIConnect 👋</h1>
|
|
2
|
-
<p>
|
|
3
|
-
<img alt="Version" src="https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000" />
|
|
4
|
-
<img src="https://img.shields.io/badge/node-%3E%3D14.17.6-blue.svg" />
|
|
5
|
-
<img src="https://img.shields.io/badge/npm-%3E%3D6.14.15-blue.svg" />
|
|
6
|
-
<a href="#" target="_blank">
|
|
7
|
-
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
|
|
8
|
-
</a>
|
|
9
|
-
</p>
|
|
10
|
-
|
|
11
|
-
>
|
|
12
|
-
|
|
13
|
-
## Prerequisites
|
|
14
|
-
|
|
15
|
-
- node >=14.17.6
|
|
16
|
-
- npm >=6.14.15
|
|
17
|
-
|
|
18
|
-
## Install
|
|
19
|
-
|
|
20
|
-
```sh
|
|
21
|
-
npm install api_connect_nodejs
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Documentation
|
|
25
|
-
|
|
26
|
-
https://
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
## Author
|
|
30
|
-
|
|
31
|
-
👤 **
|
|
1
|
+
<h1 align="center">Welcome to APIConnect 👋</h1>
|
|
2
|
+
<p>
|
|
3
|
+
<img alt="Version" src="https://img.shields.io/badge/version-1.0.0-blue.svg?cacheSeconds=2592000" />
|
|
4
|
+
<img src="https://img.shields.io/badge/node-%3E%3D14.17.6-blue.svg" />
|
|
5
|
+
<img src="https://img.shields.io/badge/npm-%3E%3D6.14.15-blue.svg" />
|
|
6
|
+
<a href="#" target="_blank">
|
|
7
|
+
<img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
|
|
8
|
+
</a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
> API's to trade from Nuvama
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
- node >=14.17.6
|
|
16
|
+
- npm >=6.14.15
|
|
17
|
+
|
|
18
|
+
## Install
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npm install api_connect_nodejs
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Documentation
|
|
25
|
+
|
|
26
|
+
https://nuvamawealth.com/api-connect/
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## Author
|
|
30
|
+
|
|
31
|
+
👤 **Nuvama**
|
package/conf/settings.ini
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
[GLOBAL]
|
|
2
|
-
|
|
3
|
-
UserAgent =
|
|
4
|
-
BasePathLogin = https://
|
|
5
|
-
BasePathEq = https://
|
|
6
|
-
BasePathComm = https://
|
|
7
|
-
BasePathMf = https://
|
|
8
|
-
BasePathContent = https://
|
|
9
|
-
EquityContractURL = https://
|
|
10
|
-
MFContractURL = https://
|
|
11
|
-
|
|
12
|
-
ApiIdKey = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
13
|
-
TlsVersion = 1.2
|
|
14
|
-
LogLevel = All
|
|
15
|
-
|
|
16
|
-
[STREAM]
|
|
17
|
-
hostName =
|
|
18
|
-
port = 9443
|
|
19
|
-
|
|
20
|
-
formFactor = N
|
|
1
|
+
[GLOBAL]
|
|
2
|
+
|
|
3
|
+
UserAgent =
|
|
4
|
+
BasePathLogin = https://nc.nuvamawealth.com/edelmw-login/login/
|
|
5
|
+
BasePathEq = https://nc.nuvamawealth.com/edelmw-eq/eq/
|
|
6
|
+
BasePathComm = https://nc.nuvamawealth.com/edelmw-comm/comm/
|
|
7
|
+
BasePathMf = https://nc.nuvamawealth.com/edelmw-mf/mf/
|
|
8
|
+
BasePathContent = https://nc.nuvamawealth.com/edelmw-content/content/
|
|
9
|
+
EquityContractURL = https://nc.nuvamawealth.com/app/toccontracts/instruments.zip
|
|
10
|
+
MFContractURL = https://nc.nuvamawealth.com/app/toccontracts/mfInstruments.zip
|
|
11
|
+
|
|
12
|
+
ApiIdKey = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHAiOjAsImZmIjoiVyIsImJkIjoid2ViLXBjIiwibmJmIjoxNjcxMTcwMzEzLCJzcmMiOiJlbXRtdyIsImF2IjoiMi4wLjAiLCJhcHBpZCI6ImE5YmIyMTZkMDI3ZThjYzY4NzQwYjU2ZmUzYTgwMjMwIiwiaXNzIjoiZW10IiwiZXhwIjoxNjcxMjE1NDAwLCJpYXQiOjE2NzExNzA2MTN9.0NQuOb5nztUELDRgYjKThG-D_dNxwMnlsCxrUTGcLMc
|
|
13
|
+
TlsVersion = 1.2
|
|
14
|
+
LogLevel = All
|
|
15
|
+
|
|
16
|
+
[STREAM]
|
|
17
|
+
hostName = ncst.nuvamawealth.com
|
|
18
|
+
port = 9443
|
|
19
|
+
|
package/enums/actionType.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Define actionType as enum
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const actionType = Object.freeze({
|
|
6
|
-
BUY: "BUY",
|
|
7
|
-
SELL: "SELL",
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
module.exports = actionType;
|
|
1
|
+
/**
|
|
2
|
+
* Define actionType as enum
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const actionType = Object.freeze({
|
|
6
|
+
BUY: "BUY",
|
|
7
|
+
SELL: "SELL",
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
module.exports = actionType;
|
package/enums/assetType.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Define assetType as enum
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const assetType = Object.freeze({
|
|
6
|
-
FUTSTK: "FUTSTK",
|
|
7
|
-
FUTIDX: "FUTIDX",
|
|
8
|
-
FUTCUR: "FUTCUR",
|
|
9
|
-
FUTCOM: "FUTCOM",
|
|
10
|
-
OPTIDX: "OPTIDX",
|
|
11
|
-
OPTSTK: "OPTSTK",
|
|
12
|
-
OPTCUR: "OPTCUR",
|
|
13
|
-
OPTFUT: "OPTFUT",
|
|
14
|
-
EQUITY: "EQUITY",
|
|
15
|
-
INDEX: "INDEX",
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const futureAssetType = Object.freeze({
|
|
19
|
-
FUTSTK: "FUTSTK",
|
|
20
|
-
FUTIDX: "FUTIDX",
|
|
21
|
-
FUTCUR: "FUTCUR",
|
|
22
|
-
FUTCOM: "FUTCOM",
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
module.exports = { assetType, futureAssetType };
|
|
1
|
+
/**
|
|
2
|
+
* Define assetType as enum
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const assetType = Object.freeze({
|
|
6
|
+
FUTSTK: "FUTSTK",
|
|
7
|
+
FUTIDX: "FUTIDX",
|
|
8
|
+
FUTCUR: "FUTCUR",
|
|
9
|
+
FUTCOM: "FUTCOM",
|
|
10
|
+
OPTIDX: "OPTIDX",
|
|
11
|
+
OPTSTK: "OPTSTK",
|
|
12
|
+
OPTCUR: "OPTCUR",
|
|
13
|
+
OPTFUT: "OPTFUT",
|
|
14
|
+
EQUITY: "EQUITY",
|
|
15
|
+
INDEX: "INDEX",
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const futureAssetType = Object.freeze({
|
|
19
|
+
FUTSTK: "FUTSTK",
|
|
20
|
+
FUTIDX: "FUTIDX",
|
|
21
|
+
FUTCUR: "FUTCUR",
|
|
22
|
+
FUTCOM: "FUTCOM",
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
module.exports = { assetType, futureAssetType };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Define chart ExchangeType as enum
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const chartExchangeType = Object.freeze({
|
|
6
|
-
NSE: "NSE",
|
|
7
|
-
BSE: "BSE",
|
|
8
|
-
NFO: "NFO",
|
|
9
|
-
CDS: "CDS",
|
|
10
|
-
MCX: "MCX",
|
|
11
|
-
NCDEX: "NCDEX",
|
|
12
|
-
INDEX: "INDEX",
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
module.exports = chartExchangeType;
|
|
1
|
+
/**
|
|
2
|
+
* Define chart ExchangeType as enum
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const chartExchangeType = Object.freeze({
|
|
6
|
+
NSE: "NSE",
|
|
7
|
+
BSE: "BSE",
|
|
8
|
+
NFO: "NFO",
|
|
9
|
+
CDS: "CDS",
|
|
10
|
+
MCX: "MCX",
|
|
11
|
+
NCDEX: "NCDEX",
|
|
12
|
+
INDEX: "INDEX",
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
module.exports = chartExchangeType;
|
package/enums/chartType.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Define chartType as enum
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const chartType = Object.freeze({
|
|
6
|
-
Interval: "Interval",
|
|
7
|
-
HA: "HA",
|
|
8
|
-
Renko: "Renko",
|
|
9
|
-
PAF: "PAF",
|
|
10
|
-
Kagi: "Kagi",
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
module.exports = chartType;
|
|
1
|
+
/**
|
|
2
|
+
* Define chartType as enum
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const chartType = Object.freeze({
|
|
6
|
+
Interval: "Interval",
|
|
7
|
+
HA: "HA",
|
|
8
|
+
Renko: "Renko",
|
|
9
|
+
PAF: "PAF",
|
|
10
|
+
Kagi: "Kagi",
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
module.exports = chartType;
|
package/enums/eodIntervalType.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Define eodIntervalType as enum
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const eodIntervalType = Object.freeze({
|
|
6
|
-
D1: "D1",
|
|
7
|
-
W1: "W1",
|
|
8
|
-
MN1: "MN1",
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
module.exports = eodIntervalType;
|
|
1
|
+
/**
|
|
2
|
+
* Define eodIntervalType as enum
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const eodIntervalType = Object.freeze({
|
|
6
|
+
D1: "D1",
|
|
7
|
+
W1: "W1",
|
|
8
|
+
MN1: "MN1",
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = eodIntervalType;
|
package/enums/exchangeType.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Define exchangeType as enum
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const exchangeType = Object.freeze({
|
|
6
|
-
NSE: "NSE",
|
|
7
|
-
BSE: "BSE",
|
|
8
|
-
NFO: "NFO",
|
|
9
|
-
CDS: "CDS",
|
|
10
|
-
MCX: "MCX",
|
|
11
|
-
NCDEX: "NCDEX",
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
module.exports = exchangeType;
|
|
1
|
+
/**
|
|
2
|
+
* Define exchangeType as enum
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const exchangeType = Object.freeze({
|
|
6
|
+
NSE: "NSE",
|
|
7
|
+
BSE: "BSE",
|
|
8
|
+
NFO: "NFO",
|
|
9
|
+
CDS: "CDS",
|
|
10
|
+
MCX: "MCX",
|
|
11
|
+
NCDEX: "NCDEX",
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
module.exports = exchangeType;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Define intradayIntervalType as enum
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const intradayIntervalType = Object.freeze({
|
|
6
|
-
M1: "M1",
|
|
7
|
-
M3: "M3",
|
|
8
|
-
M5: "M5",
|
|
9
|
-
M15: "M15",
|
|
10
|
-
M30: "M30",
|
|
11
|
-
H1: "H1",
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
module.exports = intradayIntervalType;
|
|
1
|
+
/**
|
|
2
|
+
* Define intradayIntervalType as enum
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const intradayIntervalType = Object.freeze({
|
|
6
|
+
M1: "M1",
|
|
7
|
+
M3: "M3",
|
|
8
|
+
M5: "M5",
|
|
9
|
+
M15: "M15",
|
|
10
|
+
M30: "M30",
|
|
11
|
+
H1: "H1",
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
module.exports = intradayIntervalType;
|
package/enums/marketCapType.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enum class for all the allowed types of Market Caps in Research Calls.
|
|
3
|
-
* @readonly
|
|
4
|
-
* @enum
|
|
5
|
-
*/
|
|
6
|
-
const marketCap = Object.freeze({
|
|
7
|
-
Large: "Large",
|
|
8
|
-
Medium: "Medium",
|
|
9
|
-
Small: "Small",
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
module.exports = marketCap;
|
|
1
|
+
/**
|
|
2
|
+
* Enum class for all the allowed types of Market Caps in Research Calls.
|
|
3
|
+
* @readonly
|
|
4
|
+
* @enum
|
|
5
|
+
*/
|
|
6
|
+
const marketCap = Object.freeze({
|
|
7
|
+
Large: "Large",
|
|
8
|
+
Medium: "Medium",
|
|
9
|
+
Small: "Small",
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
module.exports = marketCap;
|
package/enums/orderType.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Define orderType as enum
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Several instruments exist between multiple exchanges and segments that trade. Any trading application has to have a master list of these instruments. The instruments API provides a consolidated, import-ready CSV list of instruments available for trading.
|
|
7
|
-
*
|
|
8
|
-
* Order Types:
|
|
9
|
-
* - **LIMIT** - Limit orders are orders where you strictly define the purchase or sell price. Whenever there is available quantity for the given limit price the order will get executed at that price. There is a chance that your limit price order may not get executed at all or may get executed partially in case adequate quantity is not available at the specified Limit price.
|
|
10
|
-
* - **MARKET** - Market orders will place an order which is nearly guaranteed to get executed at the best available price in market. What this means is that if you are trying to buy then you will get whatever quantity is available in the market at the lowest available sell price. If you are trying to sell you will get the quantity at the highest available buy price.
|
|
11
|
-
* - **STOP_LIMIT** - This is a stop loss limit order. It mainly contains of 2 parts to consider there is a limit price and there is a trigger price. The trigger price is the price which needs to be breached (either on high side in case of Stop Loss Sell orders, or on lower side in case of Stop Loss Buy orders). Once the trigger price is breached then an order is placed for your required action (i.e. buy or sell) at the Limit price similar to a Limit order.
|
|
12
|
-
* - **STOP_MARKET** - This is a stop loss market order. Think of it as a stop loss limit order without requiring to set a limit price. Whenever the trigger price is breached then the system will place a market order which is almost guaranteed to get executed.
|
|
13
|
-
*/
|
|
14
|
-
const orderType = Object.freeze({
|
|
15
|
-
LIMIT: "LIMIT",
|
|
16
|
-
MARKET: "MARKET",
|
|
17
|
-
STOP_LIMIT: "STOP_LIMIT",
|
|
18
|
-
STOP_MARKET: "STOP_MARKET",
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
module.exports = orderType;
|
|
1
|
+
/**
|
|
2
|
+
* Define orderType as enum
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Several instruments exist between multiple exchanges and segments that trade. Any trading application has to have a master list of these instruments. The instruments API provides a consolidated, import-ready CSV list of instruments available for trading.
|
|
7
|
+
*
|
|
8
|
+
* Order Types:
|
|
9
|
+
* - **LIMIT** - Limit orders are orders where you strictly define the purchase or sell price. Whenever there is available quantity for the given limit price the order will get executed at that price. There is a chance that your limit price order may not get executed at all or may get executed partially in case adequate quantity is not available at the specified Limit price.
|
|
10
|
+
* - **MARKET** - Market orders will place an order which is nearly guaranteed to get executed at the best available price in market. What this means is that if you are trying to buy then you will get whatever quantity is available in the market at the lowest available sell price. If you are trying to sell you will get the quantity at the highest available buy price.
|
|
11
|
+
* - **STOP_LIMIT** - This is a stop loss limit order. It mainly contains of 2 parts to consider there is a limit price and there is a trigger price. The trigger price is the price which needs to be breached (either on high side in case of Stop Loss Sell orders, or on lower side in case of Stop Loss Buy orders). Once the trigger price is breached then an order is placed for your required action (i.e. buy or sell) at the Limit price similar to a Limit order.
|
|
12
|
+
* - **STOP_MARKET** - This is a stop loss market order. Think of it as a stop loss limit order without requiring to set a limit price. Whenever the trigger price is breached then the system will place a market order which is almost guaranteed to get executed.
|
|
13
|
+
*/
|
|
14
|
+
const orderType = Object.freeze({
|
|
15
|
+
LIMIT: "LIMIT",
|
|
16
|
+
MARKET: "MARKET",
|
|
17
|
+
STOP_LIMIT: "STOP_LIMIT",
|
|
18
|
+
STOP_MARKET: "STOP_MARKET",
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
module.exports = orderType;
|
package/enums/productType.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Define productType as enum
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Product Types:
|
|
7
|
-
* - **BO** - This is a 3 leg order where you can specify your original order, a profit booking order and a stop loss order all at one go. Here the main functionality will involve placing a limit order (either buy or sell) and then specifying the trigger prices at which you will look to book profit and limit your loss, these will be specified in the form of trigger prices and will end up placing market orders squaring off whenever a particular trigger is breached. In case of one of the trigger orders getting placed the pending trigger order will get auto cancelled. So in case you placed a bracket order for reliance industries with 1000 as limit and 100 as trigger for profit and 50 as trigger for stop loss, it means that in case the LTP goes above 1100 or goes below 950 the respective profit or stop loss trigger will get invoked and close out the entire position. Please note that bracket orders are intraday orders.
|
|
8
|
-
* - **CO** - Pay a fraction of total order amount (10% or Rs. 20) to own the shares. In case it falls below the following price, sell it off to prevent me losing money from sharp price drops.
|
|
9
|
-
* - **CNC** - Pay total order amount to own the shares.
|
|
10
|
-
* - **MIS** - Pay a fraction of total order amount (10% or Rs. 20) to own the shares. You can hold the stocks till market closes today (3:15pm) or sell it off anytime before. The positions taken in MIS, will be sqaured off on the same day by the client or till the exchange squared off.
|
|
11
|
-
* - **NRML** - Pay a fraction of total order amount now and pay the remaining amount in 5 days to own the shares.
|
|
12
|
-
* - **MTF** - Pay a fraction of total order amount now and pay the remaining at a later date at a fixed interest rate.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
const productType = Object.freeze({
|
|
16
|
-
BO: "BO",
|
|
17
|
-
CO: "CO",
|
|
18
|
-
CNC: "CNC",
|
|
19
|
-
MIS: "MIS",
|
|
20
|
-
NRML: "NRML",
|
|
21
|
-
MTF: "MTF",
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
module.exports = productType;
|
|
1
|
+
/**
|
|
2
|
+
* Define productType as enum
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Product Types:
|
|
7
|
+
* - **BO** - This is a 3 leg order where you can specify your original order, a profit booking order and a stop loss order all at one go. Here the main functionality will involve placing a limit order (either buy or sell) and then specifying the trigger prices at which you will look to book profit and limit your loss, these will be specified in the form of trigger prices and will end up placing market orders squaring off whenever a particular trigger is breached. In case of one of the trigger orders getting placed the pending trigger order will get auto cancelled. So in case you placed a bracket order for reliance industries with 1000 as limit and 100 as trigger for profit and 50 as trigger for stop loss, it means that in case the LTP goes above 1100 or goes below 950 the respective profit or stop loss trigger will get invoked and close out the entire position. Please note that bracket orders are intraday orders.
|
|
8
|
+
* - **CO** - Pay a fraction of total order amount (10% or Rs. 20) to own the shares. In case it falls below the following price, sell it off to prevent me losing money from sharp price drops.
|
|
9
|
+
* - **CNC** - Pay total order amount to own the shares.
|
|
10
|
+
* - **MIS** - Pay a fraction of total order amount (10% or Rs. 20) to own the shares. You can hold the stocks till market closes today (3:15pm) or sell it off anytime before. The positions taken in MIS, will be sqaured off on the same day by the client or till the exchange squared off.
|
|
11
|
+
* - **NRML** - Pay a fraction of total order amount now and pay the remaining amount in 5 days to own the shares.
|
|
12
|
+
* - **MTF** - Pay a fraction of total order amount now and pay the remaining at a later date at a fixed interest rate.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const productType = Object.freeze({
|
|
16
|
+
BO: "BO",
|
|
17
|
+
CO: "CO",
|
|
18
|
+
CNC: "CNC",
|
|
19
|
+
MIS: "MIS",
|
|
20
|
+
NRML: "NRML",
|
|
21
|
+
MTF: "MTF",
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
module.exports = productType;
|
package/enums/segementsType.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enum for segments values.
|
|
3
|
-
* @readonly
|
|
4
|
-
* @enum
|
|
5
|
-
*/
|
|
6
|
-
const segments = Object.freeze({
|
|
7
|
-
EQ: "EQ",
|
|
8
|
-
FNO: "FNO",
|
|
9
|
-
CUR: "CUR",
|
|
10
|
-
COM: "COM",
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
module.exports = segments;
|
|
1
|
+
/**
|
|
2
|
+
* Enum for segments values.
|
|
3
|
+
* @readonly
|
|
4
|
+
* @enum
|
|
5
|
+
*/
|
|
6
|
+
const segments = Object.freeze({
|
|
7
|
+
EQ: "EQ",
|
|
8
|
+
FNO: "FNO",
|
|
9
|
+
CUR: "CUR",
|
|
10
|
+
COM: "COM",
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
module.exports = segments;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Define streaming Constants as enum for Quote, Order and LiveNews
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const streamingConstants = Object.freeze({
|
|
6
|
+
QUOTE_SREAM_REQ_CODE: 1,
|
|
7
|
+
ORDER_STREAM_REQ_CODE: 2,
|
|
8
|
+
LIVENEWS_STREAM_REQ_CODE: 3,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = streamingConstants;
|
package/enums/termsType.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enum for terms values.
|
|
3
|
-
* @readonly
|
|
4
|
-
* @enum
|
|
5
|
-
*/
|
|
6
|
-
const terms = Object.freeze({
|
|
7
|
-
LONGTERM: "LONGTERM",
|
|
8
|
-
SHORTTERM: "SHORTTERM",
|
|
9
|
-
MIDTERM: "MIDTERM",
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
module.exports = terms;
|
|
1
|
+
/**
|
|
2
|
+
* Enum for terms values.
|
|
3
|
+
* @readonly
|
|
4
|
+
* @enum
|
|
5
|
+
*/
|
|
6
|
+
const terms = Object.freeze({
|
|
7
|
+
LONGTERM: "LONGTERM",
|
|
8
|
+
SHORTTERM: "SHORTTERM",
|
|
9
|
+
MIDTERM: "MIDTERM",
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
module.exports = terms;
|
package/enums/validity.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Define validity as enum
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Validity:
|
|
7
|
-
* - **DAY** - Order will be placed and valid throughout the market hours including the post closing session (9AM to 4PM).
|
|
8
|
-
* - **IOC** - Order will be placed to exchange and executed if matching price and quantity is found at the time of order placement: true, if not executed: true, the order will be immediately cancelled.
|
|
9
|
-
* - **EOS** - Order will be placed and valid throughout the market hours (9.15AM to 3.30PM). Order will not be valid for the post closing session.
|
|
10
|
-
* - **GTC** - GTC order is active until the trade is executed or trader cancels the order.
|
|
11
|
-
* - **GTD** - GTD orders remains active until a user specified date/7 days whichever is earlier or it has been filled or cancelled.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
const validity = Object.freeze({
|
|
15
|
-
DAY: "DAY",
|
|
16
|
-
IOC: "IOC",
|
|
17
|
-
EOS: "EOS",
|
|
18
|
-
GTC: "GTC",
|
|
19
|
-
GTD: "GTD",
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
module.exports = validity;
|
|
1
|
+
/**
|
|
2
|
+
* Define validity as enum
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Validity:
|
|
7
|
+
* - **DAY** - Order will be placed and valid throughout the market hours including the post closing session (9AM to 4PM).
|
|
8
|
+
* - **IOC** - Order will be placed to exchange and executed if matching price and quantity is found at the time of order placement: true, if not executed: true, the order will be immediately cancelled.
|
|
9
|
+
* - **EOS** - Order will be placed and valid throughout the market hours (9.15AM to 3.30PM). Order will not be valid for the post closing session.
|
|
10
|
+
* - **GTC** - GTC order is active until the trade is executed or trader cancels the order.
|
|
11
|
+
* - **GTD** - GTD orders remains active until a user specified date/7 days whichever is earlier or it has been filled or cancelled.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const validity = Object.freeze({
|
|
15
|
+
DAY: "DAY",
|
|
16
|
+
IOC: "IOC",
|
|
17
|
+
EOS: "EOS",
|
|
18
|
+
GTC: "GTC",
|
|
19
|
+
GTD: "GTD",
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
module.exports = validity;
|
package/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
module.exports =
|
|
1
|
+
const apiConnect = require("./src/apiConnect");
|
|
2
|
+
|
|
3
|
+
module.exports = apiConnect;
|
package/package.json
CHANGED
|
@@ -1,37 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "api_connect_nodejs",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Command to run :",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"directories": {
|
|
7
|
-
"test": "test"
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@joi/date": "^2.1.0",
|
|
11
|
-
"chai": "^4.3.6",
|
|
12
|
-
"csv-parser": "^3.0.0",
|
|
13
|
-
"csv-writer": "^1.6.0",
|
|
14
|
-
"fast-csv": "^4.3.6",
|
|
15
|
-
"ini": "^2.0.0",
|
|
16
|
-
"joi": "^17.6.0",
|
|
17
|
-
"jszip": "^3.7.1",
|
|
18
|
-
"log4js": "^6.4.1",
|
|
19
|
-
"mocha": "^9.2.1",
|
|
20
|
-
"winston": "^3.6.0"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {},
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"testCommodity": "mocha test/unitTests/commodity/*.js",
|
|
27
|
-
"testMF": "mocha test/unitTests/mf/*.js",
|
|
28
|
-
"testCharts": "mocha test/unitTests/charts/chartsTest.test.js --timeout 10000",
|
|
29
|
-
"testGetNewsCategories": "mocha test/unitTests/liveNews/getNewsCategoriesTest.test.js"
|
|
30
|
-
},
|
|
31
|
-
"repository": {
|
|
32
|
-
"type": "git",
|
|
33
|
-
"url": "https://rishabh.kumar@bitbucket.edelweissfin.com/scm/platformmw/client-lib-nodejs.git"
|
|
34
|
-
},
|
|
35
|
-
"author": "",
|
|
36
|
-
"license": "ISC"
|
|
37
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "api_connect_nodejs",
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "Command to run :",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"directories": {
|
|
7
|
+
"test": "test"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@joi/date": "^2.1.0",
|
|
11
|
+
"chai": "^4.3.6",
|
|
12
|
+
"csv-parser": "^3.0.0",
|
|
13
|
+
"csv-writer": "^1.6.0",
|
|
14
|
+
"fast-csv": "^4.3.6",
|
|
15
|
+
"ini": "^2.0.0",
|
|
16
|
+
"joi": "^17.6.0",
|
|
17
|
+
"jszip": "^3.7.1",
|
|
18
|
+
"log4js": "^6.4.1",
|
|
19
|
+
"mocha": "^9.2.1",
|
|
20
|
+
"winston": "^3.6.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {},
|
|
23
|
+
"author": "Nuvama",
|
|
24
|
+
"license": "ISC"
|
|
25
|
+
}
|