Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
inves-broker
Advanced tools
inves-broker
provides a unified interface for dealing with multiple broker APIs in the Indian stock market.
npm install inves-broker
import { IConnect, BrokerName } from 'inves-broker';
const kite = IConnect(BrokerName.KITE, {
kiteAPIKey: process.env.KITE_API_KEY,
kiteAPISecret: process.env.KITE_API_SECRET
});
const kiteUrl = await kite.getLoginURL({});
const paytm = IConnect(BrokerName.PAYTM_MONEY, {
paytmMoneyAPIKey: process.env.PAYTM_API_KEY,
paytmMoneyAPISecret: process.env.PAYTM_API_SECRET
});
const paytmUrl = await paytm.getLoginURL({});
Building a platform to support order placement and retrieval via multiple brokers is an exhaustive task. To achieve the same end goal, each broker has a slightly different way of doing things. Integrating each broker would require extensive reading of all the documentation followed by a tedious implementation.
We enforce a standard of how you should place an order, get order information, etc. This standard closely conforms to Zerodha's way of doing things. If you are familiar with using the Kite API, you will find inves-broker
's interface to be similar. For exceptional cases where a broker cannot fit within a standard, we provide an extended support for that. Hence, all brokers under inves-broker
follow the Open-closed principle.
Each broker class will provide the methods listed here. In some cases, it will be necessary to deviate from the standard. This is described below.
Paytm Money and Dhan identify an instrument via its list of security ids. This list needs to be downloaded once a day. By default, when you place an order, this list is downloaded and stored in memory for the next 24 hours. Hence, the first call to place an order would be slow. Subsequent calls would just hit the cache. However, if you wish to pre-fetch this list, even before you invoke the placeOrder
method, you can do this via following:
import { IConnect, BrokerName, PaytmMoneyBroker } from 'inves-broker';
const broker = IConnect(BrokerName.PAYTM_MONEY, config);
if (broker instanceof PaytmMoneyBroker) {
await broker.triggerMemoizationOfSecurityList();
}
FAQs
Interact with multiple broker APIs in the Indian stock market.
The npm package inves-broker receives a total of 1,266 weekly downloads. As such, inves-broker popularity was classified as popular.
We found that inves-broker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.