Socket
Socket
Sign inDemoInstall

5paisajs

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

5paisajs - npm Package Compare versions

Comparing version 0.0.20 to 0.0.21

106

index.js

@@ -131,6 +131,3 @@ 'use strict';

// let jwttoken = "";
// let requesttoken = "";
let jwttoken = '';

@@ -197,75 +194,2 @@

/**
* Logs in the client.
* @method login
* @memberOf FivePaisaClient
* @param {string} email - Client's email
* @param {string} password - Client's password
* @param {string} DOB - Client's DOB in YYYYMMDD format
* @example <caption> Logging in a user </caption>
* const conf = {
* "appSource": "",
* "appName": "",
* "userId": "",
* "password": "",
* "userKey": "",
* "encryptionKey": ""
* }
* const { FivePaisaClient} = require("5paisajs")
*
* var client = new FivePaisaClient(conf)
*
* // This client object can be used to login multiple users.
* client.login("random_email@xyz.com", "password", "YYYYMMDD").then((response) => {
* client.init(response).then(() => {
* // Fetch holdings, positions or place orders here.
* // See following examples.
* })
* }).catch((err) =>{
* // Oh no :/
* console.log(err)
* })
*/
this.login = function(email, password, DOB) {
const encryptionKey = conf.encryptionKey;
const encrypt = AES256Encrypt;
this.loginPayload.head.requestCode = LOGIN_REQUEST_CODE;
this.loginPayload.body.Email_id = encrypt(encryptionKey, email);
this.loginPayload.body.Password = encrypt(encryptionKey, password);
this.loginPayload.body.My2PIN = encrypt(encryptionKey, DOB);
const req = request_instance.post(LOGIN_ROUTE, loginPayload);
return req;
};
// function get_access_token(requesttoken)
// this.get_access_token = function (requesttoken) {
// try {
// // console.log(requesttoken, "++++++++");
// this.accessTokenPayload.body.RequestToken = requesttoken;
// // console.log(accessTokenPayload, "*****");
// var promise = new Promise(function (resolve, reject) {
// request_instance.post(ACCESS_TOKEN_ROUTE, accessTokenPayload).then(response => {
// // console.log('======================', response);
// if (response?.data?.body?.AccessToken || response.data.body.AccessToken === null || response.data.body.AccessToken === "") {
// reject(response.data.body.AccessToken);
// } else {
// accesstoken = response.data.body.AccessToken;
// resolve(response.data.body.AccessToken);
// }
// });
// });
// return promise;
// }
// catch (err) {
// console.error(err);
// }
// }
this.get_access_token = function(requesttoken) {

@@ -320,32 +244,3 @@ try {

// this.get_TOTP_Session('Your ClientCode','TOTP from authenticator app','Your MPin'){
// this.get_request_token = function (clientCode, totp, pin) {
// this.totpPayload.body.Email_ID = clientCode;
// this.totpPayload.body.TOTP = totp;
// this.totpPayload.body.PIN = pin;
// try {
// var promise = new Promise(function (resolve, reject) {
// request_instance.post(TOTP_ROUTE, totpPayload).then(response => {
// // console.log(response);
// if (response.data.body.RequestToken === null) {
// reject(response.data.body.RequestToken);
// } else {
// // console.log(requesttoken, "*****************");
// requesttoken = response.data.body.RequestToken;
// // console.log(requesttoken, "------------------");
// resolve(response.data.body.RequestToken);
// }
// });
// });
// return promise;
// }
// catch (err) {
// console.error(err);
// }
// };
this.get_request_token = function(clientCode, totp, pin) {

@@ -362,3 +257,2 @@ CLIENT_CODE = clientCode;

} else {
requesttoken = response.data.body.RequestToken;
resolve(response.data.body.RequestToken);

@@ -365,0 +259,0 @@ }

2

package.json

@@ -94,3 +94,3 @@ {

},
"version": "0.0.20"
"version": "0.0.21"
}

@@ -19,3 +19,3 @@ # 5paisajs

Get your API keys from https://www.5paisa.com/DeveloperAPI/APIKeys
Get your API keys from (https://tradestation.5paisa.com/apidoc)

@@ -101,3 +101,2 @@ ```js

atMarket: false,
isStopLossOrder: false,
stopLossPrice: 0,

@@ -104,0 +103,0 @@ isVTD: false,

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