inves-broker
Advanced tools
Comparing version 0.3.0 to 0.3.1-beta.0
@@ -33,2 +33,3 @@ "use strict"; | ||
const DhanBroker_1 = require("./brokers/DhanBroker"); | ||
const SwastikaBroker_1 = require("./brokers/SwastikaBroker"); | ||
dotenv.config(); | ||
@@ -61,2 +62,10 @@ function IConnect(brokerName, config) { | ||
} | ||
case "SWASTIKA": { | ||
if (config.swastikaAPIKey && config.swastikaAPISecret && config.swastikaAESSecret && config.brokerEnvironment) { | ||
return new SwastikaBroker_1.SwastikaBroker(config.swastikaAPIKey, config.swastikaAPISecret, config.swastikaAESSecret, config.brokerEnvironment); | ||
} | ||
else { | ||
throw new Error('Swastika needs api key, api secret, AES key, and broker environment in the config.'); | ||
} | ||
} | ||
} | ||
@@ -63,0 +72,0 @@ throw new Error('Pass a valid broker name.'); |
{ | ||
"name": "inves-broker", | ||
"version": "0.3.0", | ||
"version": "0.3.1-beta.0", | ||
"description": "Interact with multiple broker APIs in the Indian stock market.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -5,2 +5,3 @@ import { Broker, KiteBroker, PaytmMoneyBroker } from "./brokers"; | ||
import { DhanBroker } from "./brokers/DhanBroker"; | ||
import { SwastikaBroker } from "./brokers/SwastikaBroker"; | ||
dotenv.config(); | ||
@@ -31,2 +32,9 @@ | ||
} | ||
case "SWASTIKA": { | ||
if (config.swastikaAPIKey && config.swastikaAPISecret && config.swastikaAESSecret && config.brokerEnvironment) { | ||
return new SwastikaBroker(config.swastikaAPIKey, config.swastikaAPISecret, config.swastikaAESSecret, config.brokerEnvironment); | ||
} else { | ||
throw new Error('Swastika needs api key, api secret, AES key, and broker environment in the config.'); | ||
} | ||
} | ||
} | ||
@@ -33,0 +41,0 @@ throw new Error('Pass a valid broker name.'); |
interface GetLoginURLParams { | ||
kiteRedirectList?: Record<string, string>, | ||
paytmStateKey?: string | ||
paytmStateKey?: string, | ||
swastikaStateKey?: string, | ||
} | ||
@@ -5,0 +6,0 @@ |
@@ -0,1 +1,3 @@ | ||
import { BrokerEnviroment } from "./enums"; | ||
export interface InvesBrokerConfig { | ||
@@ -8,2 +10,6 @@ kiteAPIKey?: string; | ||
dhanPartnerSecret?: string; | ||
swastikaAPIKey?: string; | ||
swastikaAPISecret?: string; | ||
swastikaAESSecret?: string; | ||
brokerEnvironment?: BrokerEnviroment; | ||
} |
@@ -5,6 +5,13 @@ enum BrokerName { | ||
DHAN = "DHAN", | ||
SWASTIKA = "SWASTIKA", | ||
} | ||
enum BrokerEnviroment { | ||
UAT = "UAT", | ||
PRODUCTION = "PRODUCTION", | ||
} | ||
export { | ||
BrokerName | ||
BrokerName, | ||
BrokerEnviroment, | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
70
248357
4549