inves-broker
Advanced tools
Comparing version 0.2.7 to 0.2.8
@@ -38,4 +38,5 @@ import { CancelOrderInformation, CancelOrderParams, GenerateSessionParams, GetGTTParams, GetGTTsParams, GetHistoricalDataParams, GetHoldingsParams, GetInstrumentsParams, GetLoginURLParams, GetLTPParams, GetMarginsParams, GetOrderHistoryParams, GetOrdersParams, GetOrderTradesParams, GetPositionsParams, GetProfileParams, GetQuoteParams, GetTradesParams, HistoricalInformation, HoldingInformation, MarginInformation, OrderInformation, PlaceOrderInformation, PlaceOrderParams, PositionInformation, ProfileInformation, SessionInformation, TradeInformation } from "../types"; | ||
getSegmentForOrderPlacement(segment: string): string; | ||
private transformDhanToKiteStatus; | ||
triggerMemoizationOfSecurityList(): Promise<void>; | ||
cancelOrder(params: CancelOrderParams, accessToken: string): Promise<CancelOrderInformation>; | ||
} |
@@ -136,3 +136,3 @@ "use strict"; | ||
orderId: response.data.orderId, | ||
status: response.data.orderStatus, | ||
status: this.transformDhanToKiteStatus(response.data.orderStatus), | ||
message: '', | ||
@@ -168,3 +168,3 @@ }; | ||
parentOrderId: order.parent_order_no || null, | ||
status: order.orderStatus, | ||
status: this.transformDhanToKiteStatus(order.orderStatus), | ||
transactionType: order.transactionType, | ||
@@ -219,3 +219,3 @@ exchange: order.exchangeSegment.split('_')[0], | ||
parentOrderId: order.parent_order_no || null, | ||
status: order.orderStatus, | ||
status: this.transformDhanToKiteStatus(order.orderStatus), | ||
transactionType: order.transactionType, | ||
@@ -513,2 +513,25 @@ exchange: order.exchangeSegment.split('_')[0], | ||
} | ||
transformDhanToKiteStatus(status) { | ||
switch (status) { | ||
case "TRANSIT": { | ||
return "OPEN"; | ||
} | ||
case "PENDING": { | ||
return "TRIGGER PENDING"; | ||
} | ||
case "REJECTED": { | ||
return "REJECTED"; | ||
} | ||
case "CANCELLED": { | ||
return "CANCELLED"; | ||
} | ||
case "TRADED": { | ||
return "COMPLETE"; | ||
} | ||
case "EXPIRED": { | ||
return "EXPIRED"; | ||
} | ||
} | ||
return status; | ||
} | ||
triggerMemoizationOfSecurityList() { | ||
@@ -530,3 +553,3 @@ return __awaiter(this, void 0, void 0, function* () { | ||
orderId: response.data.orderId, | ||
status: response.data.orderStatus, | ||
status: this.transformDhanToKiteStatus(response.data.orderStatus), | ||
message: '', | ||
@@ -533,0 +556,0 @@ }; |
@@ -46,2 +46,3 @@ import { CancelOrderInformation, CancelOrderParams, GenerateSessionParams, GetGTTParams, GetGTTsParams, GetHistoricalDataParams, GetHoldingsParams, GetInstrumentsParams, GetLoginURLParams, GetLTPParams, GetMarginsParams, GetOrderHistoryParams, GetOrdersParams, GetOrderTradesParams, GetPositionsParams, GetProfileParams, GetQuoteParams, GetTradesParams, HistoricalInformation, HoldingInformation, MarginInformation, OrderInformation, PlaceOrderInformation, PlaceOrderParams, PositionInformation, ProfileInformation, SessionInformation, TradeInformation } from "../types"; | ||
cancelOrder(params: CancelOrderParams, accessToken: string): Promise<CancelOrderInformation>; | ||
private transformPaytmToKiteStatus; | ||
} |
@@ -146,3 +146,3 @@ "use strict"; | ||
parentOrderId: order.parent_order_no || null, | ||
status: order.status, | ||
status: this.transformPaytmToKiteStatus(order.status), | ||
statusMessage: order.reason_description || null, | ||
@@ -308,3 +308,3 @@ statusMessageRaw: order.status_message_raw || null, | ||
return { | ||
status: response.data.status, | ||
status: this.transformPaytmToKiteStatus(response.data.status), | ||
message: response.data.message, | ||
@@ -481,3 +481,3 @@ orderId: response.data.data[0].order_no, | ||
orderId: response.data.orderId, | ||
status: response.data.status, | ||
status: this.transformPaytmToKiteStatus(response.data.status), | ||
message: '', | ||
@@ -491,4 +491,27 @@ }; | ||
} | ||
transformPaytmToKiteStatus(status) { | ||
switch (status) { | ||
case "TRANSIT": { | ||
return "OPEN"; | ||
} | ||
case "O-Pending": { | ||
return "TRIGGER PENDING"; | ||
} | ||
case "failure": { | ||
return "REJECTED"; | ||
} | ||
case "Cancelled": { | ||
return "CANCELLED"; | ||
} | ||
case "success": { | ||
return "COMPLETE"; | ||
} | ||
case "EXPIRED": { | ||
return "EXPIRED"; | ||
} | ||
} | ||
return status; | ||
} | ||
} | ||
exports.PaytmMoneyBroker = PaytmMoneyBroker; | ||
//# sourceMappingURL=PaytmMoney.js.map |
{ | ||
"name": "inves-broker", | ||
"version": "0.2.7", | ||
"version": "0.2.8", | ||
"description": "Interact with multiple broker APIs in the Indian stock market.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -175,3 +175,3 @@ import axios from "axios"; | ||
orderId: response.data.orderId, | ||
status: response.data.orderStatus, | ||
status: this.transformDhanToKiteStatus(response.data.orderStatus), | ||
message: '', | ||
@@ -204,3 +204,3 @@ } | ||
parentOrderId: order.parent_order_no || null, | ||
status: order.orderStatus, | ||
status: this.transformDhanToKiteStatus(order.orderStatus), | ||
transactionType: order.transactionType, | ||
@@ -253,3 +253,3 @@ exchange: order.exchangeSegment.split('_')[0], | ||
parentOrderId: order.parent_order_no || null, | ||
status: order.orderStatus, | ||
status: this.transformDhanToKiteStatus(order.orderStatus), | ||
transactionType: order.transactionType, | ||
@@ -535,2 +535,26 @@ exchange: order.exchangeSegment.split('_')[0], | ||
private transformDhanToKiteStatus(status: string) { | ||
switch (status) { | ||
case "TRANSIT": { | ||
return "OPEN"; | ||
} | ||
case "PENDING": { | ||
return "TRIGGER PENDING"; | ||
} | ||
case "REJECTED": { | ||
return "REJECTED"; | ||
} | ||
case "CANCELLED": { | ||
return "CANCELLED"; | ||
} | ||
case "TRADED": { | ||
return "COMPLETE"; | ||
} | ||
case "EXPIRED": { | ||
return "EXPIRED"; | ||
} | ||
} | ||
return status; | ||
} | ||
public async triggerMemoizationOfSecurityList() { | ||
@@ -551,3 +575,3 @@ await this.getSecurityListMemoized(); | ||
orderId: response.data.orderId, | ||
status: response.data.orderStatus, | ||
status: this.transformDhanToKiteStatus(response.data.orderStatus), | ||
message: '', | ||
@@ -554,0 +578,0 @@ } |
@@ -170,3 +170,3 @@ import { | ||
parentOrderId: order.parent_order_no || null, | ||
status: order.status, | ||
status: this.transformPaytmToKiteStatus(order.status), | ||
statusMessage: order.reason_description || null, | ||
@@ -329,3 +329,3 @@ statusMessageRaw: order.status_message_raw || null, | ||
return { | ||
status: response.data.status, | ||
status: this.transformPaytmToKiteStatus(response.data.status), | ||
message: response.data.message, | ||
@@ -508,3 +508,3 @@ orderId: response.data.data[0].order_no, | ||
orderId: response.data.orderId, | ||
status: response.data.status, | ||
status: this.transformPaytmToKiteStatus(response.data.status), | ||
message: '', | ||
@@ -516,2 +516,26 @@ } | ||
} | ||
private transformPaytmToKiteStatus(status: string) { | ||
switch (status) { | ||
case "TRANSIT": { | ||
return "OPEN"; | ||
} | ||
case "O-Pending": { | ||
return "TRIGGER PENDING"; | ||
} | ||
case "failure": { | ||
return "REJECTED"; | ||
} | ||
case "Cancelled": { | ||
return "CANCELLED"; | ||
} | ||
case "success": { | ||
return "COMPLETE"; | ||
} | ||
case "EXPIRED": { | ||
return "EXPIRED"; | ||
} | ||
} | ||
return status; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
225593
4128