Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

inves-broker

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inves-broker - npm Package Compare versions

Comparing version 0.2.98 to 0.2.99

2

dist/brokers/DhanBroker.js

@@ -127,3 +127,3 @@ "use strict";

const isBracketOrder = (params.variety === 'bracket');
const orderObject = Object.assign(Object.assign(Object.assign({ dhanClientId: params === null || params === void 0 ? void 0 : params.userId, correlationId: (params === null || params === void 0 ? void 0 : params.tag) || null, transactionType: params === null || params === void 0 ? void 0 : params.transactionType, exchangeSegment: `${this.securityList[params.tradingSymbol].exchange}_${this.getSegmentForOrderPlacement(this.securityList[params.tradingSymbol].segment)}`, productType: this.transformKiteToDhanProduct(params), orderType: this.transformKiteToDhanOrderType(params === null || params === void 0 ? void 0 : params.orderType), validity: params === null || params === void 0 ? void 0 : params.validity, tradingSymbol: params === null || params === void 0 ? void 0 : params.tradingSymbol, securityId: this.securityList[params.tradingSymbol].securityId, quantity: params === null || params === void 0 ? void 0 : params.quantity, disclosedQuantity: (params === null || params === void 0 ? void 0 : params.disclosedQuantity) || null, price: params.price, afterMarketOrder: (params === null || params === void 0 ? void 0 : params.variety) === 'amo', amoTime: (params === null || params === void 0 ? void 0 : params.amoTime) || null }, (isSlOrder && { triggerPrice: params.triggerPrice })), (isBracketOrder && { boprofitValue: params === null || params === void 0 ? void 0 : params.profitValue })), (isBracketOrder && { bostoplossValue: params === null || params === void 0 ? void 0 : params.stoplossValue }));
const orderObject = Object.assign(Object.assign(Object.assign({ dhanClientId: params === null || params === void 0 ? void 0 : params.userId, correlationId: (params === null || params === void 0 ? void 0 : params.tag) || null, transactionType: params === null || params === void 0 ? void 0 : params.transactionType, exchangeSegment: `${this.securityList[params.tradingSymbol].exchange}_${this.getSegmentForOrderPlacement(this.securityList[params.tradingSymbol].segment)}`, productType: this.transformKiteToDhanProduct(params), orderType: this.transformKiteToDhanOrderType(params === null || params === void 0 ? void 0 : params.orderType), validity: params === null || params === void 0 ? void 0 : params.validity, tradingSymbol: params === null || params === void 0 ? void 0 : params.tradingSymbol, securityId: params.exchangeToken, quantity: params === null || params === void 0 ? void 0 : params.quantity, disclosedQuantity: (params === null || params === void 0 ? void 0 : params.disclosedQuantity) || null, price: params.price, afterMarketOrder: (params === null || params === void 0 ? void 0 : params.variety) === 'amo', amoTime: (params === null || params === void 0 ? void 0 : params.amoTime) || null }, (isSlOrder && { triggerPrice: params.triggerPrice })), (isBracketOrder && { boprofitValue: params === null || params === void 0 ? void 0 : params.profitValue })), (isBracketOrder && { bostoplossValue: params === null || params === void 0 ? void 0 : params.stoplossValue }));
const response = yield axios_1.default.post(`${this.baseApiUrl}/orders`, orderObject, {

@@ -130,0 +130,0 @@ headers: {

@@ -299,3 +299,3 @@ "use strict";

const isBracketOrder = (params.variety === 'bracket');
const response = yield this.post(endpoint, Object.assign(Object.assign({ source: 'W', txn_type: this.transformKiteToPaytmTransactionType(params === null || params === void 0 ? void 0 : params.transactionType), exchange: params === null || params === void 0 ? void 0 : params.exchange, security_id: this.securityList[params === null || params === void 0 ? void 0 : params.tradingSymbol].securityId, segment: this.securityList[params === null || params === void 0 ? void 0 : params.tradingSymbol].segment, order_type: this.transformKiteToPaytmOrderType(params === null || params === void 0 ? void 0 : params.orderType), price: (params === null || params === void 0 ? void 0 : params.price) || 0, trigger_price: (params === null || params === void 0 ? void 0 : params.triggerPrice) || null, quantity: params === null || params === void 0 ? void 0 : params.quantity, validity: params === null || params === void 0 ? void 0 : params.validity, product: this.transformKiteToPaytmProduct(params), off_mkt_flag: params.variety === 'amo' }, (isBracketOrder && { profit_value: params === null || params === void 0 ? void 0 : params.profitValue })), (isBracketOrder && { stoploss_value: params === null || params === void 0 ? void 0 : params.stoplossValue })), accessToken);
const response = yield this.post(endpoint, Object.assign(Object.assign({ source: 'W', txn_type: this.transformKiteToPaytmTransactionType(params === null || params === void 0 ? void 0 : params.transactionType), exchange: params === null || params === void 0 ? void 0 : params.exchange, security_id: params.exchangeToken, segment: this.securityList[params === null || params === void 0 ? void 0 : params.tradingSymbol].segment, order_type: this.transformKiteToPaytmOrderType(params === null || params === void 0 ? void 0 : params.orderType), price: (params === null || params === void 0 ? void 0 : params.price) || 0, trigger_price: (params === null || params === void 0 ? void 0 : params.triggerPrice) || null, quantity: params === null || params === void 0 ? void 0 : params.quantity, validity: params === null || params === void 0 ? void 0 : params.validity, product: this.transformKiteToPaytmProduct(params), off_mkt_flag: params.variety === 'amo' }, (isBracketOrder && { profit_value: params === null || params === void 0 ? void 0 : params.profitValue })), (isBracketOrder && { stoploss_value: params === null || params === void 0 ? void 0 : params.stoplossValue })), accessToken);
return {

@@ -302,0 +302,0 @@ status: this.transformPaytmToKiteStatus(response.data.status),

@@ -94,2 +94,3 @@ interface GetLoginURLParams {

amoTime?: 'OPEN' | 'OPEN_30' | 'OPEN_60' | string;
exchangeToken: number;
}

@@ -96,0 +97,0 @@ interface CancelOrderParams extends PlaceOrderParams {

{
"name": "inves-broker",
"version": "0.2.98",
"version": "0.2.99",
"description": "Interact with multiple broker APIs in the Indian stock market.",

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

@@ -153,3 +153,3 @@ import axios from "axios";

tradingSymbol: params?.tradingSymbol,
securityId: this.securityList[params.tradingSymbol].securityId,
securityId: params.exchangeToken,
quantity: params?.quantity,

@@ -156,0 +156,0 @@ disclosedQuantity: params?.disclosedQuantity || null,

@@ -306,3 +306,3 @@ import {

exchange: params?.exchange,
security_id: this.securityList[params?.tradingSymbol].securityId,
security_id: params.exchangeToken,
segment: this.securityList[params?.tradingSymbol].segment,

@@ -309,0 +309,0 @@ order_type: this.transformKiteToPaytmOrderType(params?.orderType),

@@ -110,2 +110,3 @@ interface GetLoginURLParams {

amoTime?: 'OPEN' | 'OPEN_30' | 'OPEN_60' | string, // Dhan's optional parameter for AMO
exchangeToken: number, // Supply this for accurate mapping on Dhan and Paytm
}

@@ -112,0 +113,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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