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

extra-fyers.web

Package Overview
Dependencies
Maintainers
1
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extra-fyers.web

A Javascript interface for FYERS API.

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
190
increased by850%
Maintainers
1
Weekly downloads
ย 
Created
Source

A Javascript interface for FYERS API.
๐Ÿ“ฆ Node.js, ๐ŸŒ Web, ๐Ÿ“œ Files, ๐Ÿ“ฐ Docs.

The objective of this package is to provide a cleaner interface to FYERS API. The http namespace provides the same interface as FYERS HTTP API. The top namespace (global functions, classes) provide a facade for this HTTP API and provides additional utility functions, such as calculating charges.

Global functions associated with FYERS API, such as getPositions(), are stateless and accept Authorization as the first parameter. On the other hand, the Api class includes stateful functions which do not require the Authorization parameter (required while creating object). Note that this authorization can be obtained be performing login with loginStep1() and loginStep2().

The goals for the future include adding support for processing symbol master files (for getting a list of symbols and associated ISIN, description), and providing support for websocket interface.

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

Stability: Experimental.


const fyers = require('extra-fyers');

async function main() {
  var appId       = '****';  // app_id recieved after creating app
  var accessToken = '****';  // access_token recieved after login
  var api = new fyers.Api(appId, accessToken);

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

  // List holdings.
  console.log(await api.getHoldings());

  // Place CNC market order for SBIN (equity) on NSE for 5 shares
  var id = await api.placeOrder({symbol: 'NSE:SBIN-EQ', quantity: 5});

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


Index

PropertyDescription
exchangeDescriptionGet exchange description.
exchangeGet exchange code.
segmentDescriptionGet segment description.
segmentGet segment code.
positionSideDescriptionGet position side description.
positionSideGet position side code.
orderSideDescriptionGet order side description.
orderSideGet order side code.
orderSourceDescriptionGet order source description.
orderSourceGet order source code.
orderStatusDescriptionGet order status description.
orderStatusGet order status code.
orderTypeDescriptionGet order type description.
orderTypeGet order type code.
orderValidityDescriptionGet order validity description.
orderValidityGet order validity code.
optionTypeDescriptionGet option type description.
optionTypeGet option type code.
holdingTypeDescriptionGet holding type description.
holdingTypeGet holding type code.
productTypeDescriptionGet product type description.
productTypeGet product type code.
instrumentTypeDescriptionGet instrument type description.
instrumentTypeGet instrument type code.
equityDeliveryChargesGet equity delivery charges.
equityIntradayChargesGet equity intraday charges.
equityFuturesChargesGet equity futures charges.
equityOptionsChargesGet equity options charges.
currencyFuturesChargesGet currency futures charges.
currencyOptionsChargesGet currency options charges.
commodityFuturesChargesGet commodity futures charges.
commodityOptionsChargesGet commodity options charges.
loginStep1Get request step 1 for authorization.
loginStep2Get request step 2 for authorization.
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.
modifyOrderModifies an order placed on any exchange via Fyers.
modifyOrdersModifies orders placed on any exchange via Fyers.
cancelOrderCancels an order placed on any exchange via Fyers.
cancelOrdersCancels orders placed on any exchange via Fyers.
exitPositionExits a position on the current trading day.
exitAllPositionsExits all positions on the current trading day.
convertPositionConverts a position on the current trading day.
getMarketStatusGet the current market status of all the exchanges and their segments.
getMarketHistoryGet the 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.
ApiContainer for storing authorization details.


References



Keywords

FAQs

Package last updated on 05 Apr 2022

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc