firstock 1.0.0

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.
@@ -0,0 +1,371 @@
1
+ interface Response {
2
+ data: {
3
+ [key: string]: any;
4
+ };
5
+ }
6
+
7
+ interface LoginParams {
8
+ userId: string;
9
+ password: string;
10
+ TOTP: string;
11
+ vendorCode: string;
12
+ apiKey: string;
13
+ [key: string]: any;
14
+ }
15
+
16
+ interface ConfigData {
17
+ [key: string]: {
18
+ jKey: string;
19
+ };
20
+ }
21
+
22
+ interface PlaceOrderParams {
23
+ userId: string;
24
+ exchange: string;
25
+ tradingSymbol: string;
26
+ quantity: string | number;
27
+ price: string | number;
28
+ product: string;
29
+ transactionType: string;
30
+ priceType: string;
31
+ retention: string;
32
+ remarks: string;
33
+ triggerPrice: string;
34
+ [key: string]: any;
35
+ }
36
+
37
+ interface CancelOrderParams {
38
+ userId: string;
39
+ orderNumber: string;
40
+ [key: string]: any;
41
+ }
42
+
43
+ interface ModifyOrderParams {
44
+ userId: string;
45
+ orderNumber: string;
46
+ price: string | number;
47
+ quantity: string | number;
48
+ triggerPrice: string | number;
49
+ tradingSymbol: string;
50
+ exchange: string;
51
+ priceType: string;
52
+ product: string;
53
+ retention: string;
54
+ [key: string]: any;
55
+ }
56
+
57
+ interface BasketItem {
58
+ exchange: string;
59
+ transactionType: string;
60
+ product: string;
61
+ tradingSymbol: string;
62
+ quantity: string | number;
63
+ priceType: string;
64
+ price: string | number;
65
+ [key: string]: any;
66
+ }
67
+
68
+ interface BasketMarginParams {
69
+ userId: string;
70
+ BasketList_Params: BasketItem[];
71
+ [key: string]: any;
72
+ }
73
+
74
+ interface SingleOrderHistoryParams {
75
+ userId: string;
76
+ orderNumber: string;
77
+ [key: string]: any;
78
+ }
79
+
80
+ interface UserDetailsParams {
81
+ userId: string;
82
+ [key: string]: any;
83
+ }
84
+
85
+ interface OrderMarginParams {
86
+ userId: string;
87
+ exchange: string;
88
+ tradingSymbol: string;
89
+ quantity: string | number;
90
+ price: string | number;
91
+ product: string;
92
+ transactionType: string;
93
+ priceType: string;
94
+ [key: string]: any;
95
+ }
96
+
97
+ interface ProductConversionParams {
98
+ userId: string;
99
+ exchange: string;
100
+ tradingSymbol: string;
101
+ quantity: string | number;
102
+ product: string;
103
+ previousProduct: string;
104
+ transactionType?: string;
105
+ positionType?: string;
106
+ [key: string]: any;
107
+ }
108
+
109
+ interface OrderBookParams {
110
+ userId: string;
111
+ [key: string]: any;
112
+ }
113
+
114
+ interface TradeBookParams {
115
+ userId: string;
116
+ [key: string]: any;
117
+ }
118
+
119
+ interface PositionsBookParams {
120
+ userId: string;
121
+ [key: string]: any;
122
+ }
123
+
124
+ interface MultiQuoteItem {
125
+ exchange: string;
126
+ tradingSymbol: string;
127
+ [key: string]: any;
128
+ }
129
+
130
+ interface GetMultiQuotesParams {
131
+ userId: string;
132
+ data: MultiQuoteItem[];
133
+ [key: string]: any;
134
+ }
135
+
136
+ interface GetQuoteLTPParams {
137
+ userId: string;
138
+ exchange: string;
139
+ tradingSymbol: string;
140
+ [key: string]: any;
141
+ }
142
+
143
+ interface GetMultiQuotesLTPParams {
144
+ userId: string;
145
+ data: MultiQuoteItem[];
146
+ [key: string]: any;
147
+ }
148
+
149
+ interface SearchScriptsParams {
150
+ userId: string;
151
+ stext: string;
152
+ [key: string]: any;
153
+ }
154
+
155
+ interface GetSecurityInfoParams {
156
+ userId: string;
157
+ exchange: string;
158
+ tradingSymbol: string;
159
+ [key: string]: any;
160
+ }
161
+
162
+ interface HoldingsParams {
163
+ userId: string;
164
+ product?: string;
165
+ [key: string]: any;
166
+ }
167
+
168
+ interface LimitsParams {
169
+ userId: string;
170
+ [key: string]: any;
171
+ }
172
+
173
+ interface GetQuotesParams {
174
+ userId: string;
175
+ exchange: string;
176
+ tradingSymbol: string;
177
+ [key: string]: any;
178
+ }
179
+
180
+ interface GetIndexListParams {
181
+ userId: string;
182
+ exchange: string;
183
+ [key: string]: any;
184
+ }
185
+
186
+ interface GetOptionChainParams {
187
+ userId: string;
188
+ exchange: string;
189
+ symbol: string;
190
+ strikePrice: string | number;
191
+ count: string | number;
192
+ expiry?: string;
193
+ [key: string]: any;
194
+ }
195
+
196
+ interface TimePriceSeriesParams {
197
+ userId: string;
198
+ exchange: string;
199
+ tradingSymbol: string;
200
+ endTime: string;
201
+ startTime: string;
202
+ interval: string | number;
203
+ [key: string]: any;
204
+ }
205
+
206
+ interface BrokerageCalculatorParams {
207
+ userId: string;
208
+ exchange: string;
209
+ tradingSymbol: string;
210
+ transactionType: string;
211
+ Product: string;
212
+ quantity: string | number;
213
+ price: string | number;
214
+ strike_price: string | number;
215
+ inst_name: string;
216
+ lot_size: string | number;
217
+ [key: string]: any;
218
+ }
219
+
220
+ interface GetExpiryParams {
221
+ userId: string;
222
+ exchange: string;
223
+ tradingSymbol: string;
224
+ [key: string]: any;
225
+ }
226
+
227
+
228
+ abstract class AFirstock {
229
+ constructor() {
230
+ if (this.constructor === AFirstock) {
231
+ throw new Error("Abstract classes can't be instantiated.");
232
+ }
233
+ }
234
+
235
+ abstract getPosts(): Promise<any>;
236
+
237
+ abstract getUsers(): any;
238
+
239
+ abstract getPostByUserId(): any;
240
+
241
+ abstract login(
242
+ params: LoginParams,
243
+ callBack: (error: Error | null, result: Response | null) => void
244
+ ): void;
245
+
246
+ abstract logout(
247
+ params: { userId: string },
248
+ callBack: (error: Error | string | null, result: Response | null) => void
249
+ ): void;
250
+
251
+ abstract userDetails(
252
+ params: UserDetailsParams,
253
+ callBack: (error: Error | string | null, result: Response | null) => void
254
+ ): void;
255
+
256
+ abstract placeOrder(
257
+ params: PlaceOrderParams,
258
+ callBack: (error: Error | string | null, result: Response | null) => void
259
+ ): void;
260
+
261
+ abstract orderMargin(
262
+ params: OrderMarginParams,
263
+ callBack: (error: Error | string | null, result: Response | null) => void
264
+ ): void;
265
+
266
+ abstract cancelOrder(
267
+ params: CancelOrderParams,
268
+ callBack: (error: Error | string | null, result: Response | null) => void
269
+ ): void;
270
+
271
+ abstract modifyOrder(
272
+ params: ModifyOrderParams,
273
+ callBack: (error: Error | string | null, result: Response | null) => void
274
+ ): void;
275
+
276
+ abstract singleOrderHistory(
277
+ params: SingleOrderHistoryParams,
278
+ callBack: (error: Error | string | null, result: Response | null) => void
279
+ ): void;
280
+ abstract orderBook(
281
+ params: OrderBookParams,
282
+ callBack: (error: Error | string | null, result: Response | null) => void
283
+ ): void;
284
+
285
+ abstract tradeBook(
286
+ params: TradeBookParams,
287
+ callBack: (error: Error | string | null, result: Response | null) => void
288
+ ): void;
289
+
290
+ abstract positionBook(
291
+ params: PositionsBookParams,
292
+ callBack: (error: Error | string | null, result: Response | null) => void
293
+ ): void;
294
+
295
+ abstract productConversion(
296
+ params: ProductConversionParams,
297
+ callBack: (error: Error | string | null, result: Response | null) => void
298
+ ): void;
299
+
300
+ abstract holdings(
301
+ params: HoldingsParams,
302
+ callBack: (error: Error | string | null, result: Response | null) => void
303
+ ): void;
304
+
305
+ abstract limit(
306
+ params: LimitsParams,
307
+ callBack: (error: Error | string | null, result: Response | null) => void
308
+ ): void;
309
+
310
+ abstract basketMargin(
311
+ params: BasketMarginParams,
312
+ callBack: (error: Error | string | null, result: Response | null) => void
313
+ ): void;
314
+
315
+ abstract getQuote(
316
+ params: GetQuotesParams,
317
+ callBack: (error: Error | string | null, result: Response | null) => void
318
+ ): void;
319
+
320
+ abstract getQuoteltp(
321
+ params: GetQuoteLTPParams,
322
+ callBack: (error: Error | string | null, result: Response | null) => void
323
+ ): void;
324
+
325
+ abstract getMultiQuotesltp(
326
+ params: GetMultiQuotesLTPParams,
327
+ callBack: (error: Error | string | null, result: Response | null) => void
328
+ ): void;
329
+
330
+ abstract getMultiQuotes(
331
+ params: GetMultiQuotesParams,
332
+ callBack: (error: Error | string | null, result: Response | null) => void
333
+ ): void;
334
+
335
+ abstract searchScrips(
336
+ params: SearchScriptsParams,
337
+ callBack: (error: Error | string | null, result: Response | null) => void
338
+ ): void;
339
+
340
+ abstract securityInfo(
341
+ params: GetSecurityInfoParams,
342
+ callBack: (error: Error | string | null, result: Response | null) => void
343
+ ): void;
344
+
345
+ abstract indexList(
346
+ params: GetIndexListParams,
347
+ callBack: (error: Error | string | null, result: Response | null) => void
348
+ ): void;
349
+
350
+ abstract optionChain(
351
+ params: GetOptionChainParams,
352
+ callBack: (error: Error | string | null, result: Response | null) => void
353
+ ): void;
354
+
355
+ abstract timePriceSeries(
356
+ params: TimePriceSeriesParams,
357
+ callBack: (error: Error | string | null, result: Response | null) => void
358
+ ): void;
359
+
360
+ abstract getExpiry(
361
+ params: GetExpiryParams,
362
+ callBack: (error: Error | string | null, result: Response | null) => void
363
+ ): void;
364
+
365
+ abstract brokerageCalculator(
366
+ params: BrokerageCalculatorParams,
367
+ callBack: (error: Error | string | null, result: Response | null) => void
368
+ ): void;
369
+ }
370
+
371
+ export default AFirstock;