fyers-web-sdk-v3 1.3.0 → 1.3.1

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.
@@ -256,7 +256,35 @@ class FyersApi {
256
256
  })
257
257
  }
258
258
 
259
-
259
+ /**
260
+ * use to logout API.
261
+ * @param {Object} req - request data.
262
+ * @returns {Promise} This invalidates the access token.
263
+ */
264
+ logout_user = async (req) => {
265
+ var funcname = 'logout_user'
266
+ let AuthrizationToken = this.AccessToken
267
+ let vers = this.Version
268
+ return new Promise(async function (resolve, reject) {
269
+ try {
270
+ var url = Config.SYNC_API + Config["logout"]
271
+ await axios.post((url), req, {
272
+ headers: {
273
+ Authorization: AuthrizationToken,
274
+ }
275
+ })
276
+ .then(Response => {
277
+ console.log(`${funcname} response`, Response.data, funcname)
278
+ resolve(Response.data)
279
+ })
280
+ }
281
+ catch (e) {
282
+ var err = new errorHandler(e).getError()
283
+ console.log(`${funcname} response`, { "Error": err, "inputs": req }, funcname)
284
+ reject(err)
285
+ }
286
+ })
287
+ }
260
288
  /**
261
289
  * get orderbook to get order details of order placed on current day.
262
290
  * @returns {Promise} returns orderbook detail on resolve or error message and error code on failure
package/config/config.js CHANGED
@@ -24,5 +24,6 @@ export const Config = {
24
24
  "history" : "/history",
25
25
  "quotes" : "/quotes",
26
26
  "market_depth" : "/depth",
27
- "optionChain" : "/options-chain-v3"
27
+ "optionChain" : "/options-chain-v3",
28
+ "logout" : "/logout"
28
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fyers-web-sdk-v3",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "fyers api for web compatibility",
5
5
  "main": "index.js",
6
6
  "scripts": {