Socket
Socket
Sign inDemoInstall

@extra-fyers/http.web

Package Overview
Dependencies
4
Maintainers
1
Versions
101
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @extra-fyers/http.web

A Javascript interface for FYERS API \{http\} web.


Version published
Maintainers
1
Install size
286 kB
Created

Readme

Source

A Javascript interface for FYERS API {http}.
📦 Node.js, 🌐 Web, 📜 Files, 📰 Docs.

[FYERS] is one of the cheapest online stock brokers in India, that offers trading in the equity (NSE, BSE), currency (NSE), and commodity segments (MCX). The objective of this package is to provide a cleaner interface to FYERS API. This http namespace provides the same interface as FYERS HTTP API.

Global functions associated with FYERS API, such as getPositions(), are stateless and accept Authorization as the first parameter. Note that this authorization can be obtained be performing login with loginStep1() and loginStep2().

This package is available in both Node.js and Web formats. The web format is exposed as extra_fyers_http standalone variable and can be loaded from jsDelivr CDN.

This is part of package extra-fyers.
Stability: Experimental.


const {http} = require('extra-fyers');

async function main() {
  var app_id       = '****';  // app_id recieved after creating app
  var access_token = '****';  // access_token recieved after login
  var auth = {app_id, access_token};

  // List equity and commodity fund limits.
  console.log(await http.getFunds(auth));

  // List holdings.
  console.log(await http.getHoldings(auth));

  // Place CNC market order for SBIN (equity) on NSE for 5 shares
  var id = await http.placeOrder(auth, {
    symbol: 'NSE:SBIN-EQ',
    productType: "CNC",
    qty: 5,
    side: 1, // BUY
    type: 2, // MARKET
    offlineOrder: "False"
  });

  // List postions for today (should list NSE:SBIN-EQ-CNC).
  console.log(await http.getPositions(auth));
}
main();


Index

PropertyDescription
API_URLRoot URL for API requests.
DATA_URLRoot URL for Data API requests.
SYMBOLS_URLRoot URL for Symbol master files.
loginStep1Get request step 1 for authorization (browser only).
loginStep2Get request step 2 for authorization (browser, server).
getProfileGet basic details of the client.
getFundsGet balance available for the user for capital as well as the commodity market.
getHoldingsGet the equity and mutual fund holdings which the user has in this demat account.
getOrderGet details of an order placed in the current trading day.
getOrdersGet details of all the orders placed in the current trading day.
getPositionsGet details of all the positions in the current trading day.
getTradesGet details of all the trades in the current trading day.
placeOrderPlace an order to any exchange via Fyers.
placeOrdersPlace multiple orders to any exchange via Fyers.
modifyOrderModify an order placed on any exchange via Fyers.
modifyOrdersModify orders placed on any exchange via Fyers.
cancelOrderCancel an order placed on any exchange via Fyers.
cancelOrdersCancel orders placed on any exchange via Fyers.
exitPositionExit a position on the current trading day.
exitAllPositionsExit all positions on the current trading day.
convertPositionConvert a position on the current trading day.
getMarketStatusGet the current market status of all the exchanges and their segments.
getMarketHistoryGet the current market history for a particular symbol.
getMarketQuotesGet the current market quotes for a set of symbols.
getMarketDepthGet the current market depth for a particular symbol.
getSymbolMasterGet all the latest symbols of all the exchanges from the symbol master files.
generateEdisTpinGenerate e-DIS TPIN for validating/authorising transaction.
getEdisTransactionsGet the necessary information regarding the holdings you have on your and also the Status of the holdings. If the “sell” for the particular holdings is a success or not.
submitEdisHoldingsStepRedirect to CDSL page for login where you can submit your Holdings information and accordingly you can provide the same to exchange to Sell your holdings (browser only).
inquireEdisTransactionInquire the information/status of the provided transaction Id for the respective holdings you have on your end.


References



Keywords

FAQs

Last updated on 22 Sep 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc