
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
smartapi-javascript
Advanced tools
npm i smartapi-javascript
let { SmartAPI, WebSocket } = require("smartapi-javascript");
let smart_api = new SmartAPI({
api_key: "YOUR_API_KEY", // PROVIDE YOUR API KEY HERE
// OPTIONAL
// access_token: "YOUR_ACCESS_TOKEN",
// refresh_token: "YOUR_REFRESH_TOKEN"
});
smart_api.generateSession("CLIENT_CODE", "PASSWORD")
.then((data) => {
return smart_api.getProfile();
// return smart_api.getProfile()
// return smart_api.logout()
// return smart_api.placeOrder({
// "variety": "NORMAL",
// "tradingsymbol": "SBIN-EQ",
// "symboltoken": "3045",
// "transactiontype": "BUY",
// "exchange": "NSE",
// "ordertype": "LIMIT",
// "producttype": "INTRADAY",
// "duration": "DAY",
// "price": "19500",
// "squareoff": "0",
// "stoploss": "0",
// "quantity": "1"
// })
// return smart_api.modifyOrder({
// "orderid": "201130000006424",
// "variety": "NORMAL",
// "tradingsymbol": "SBIN-EQ",
// "symboltoken": "3045",
// "transactiontype": "BUY",
// "exchange": "NSE",
// "ordertype": "LIMIT",
// "producttype": "INTRADAY",
// "duration": "DAY",
// "price": "19500",
// "squareoff": "0",
// "stoploss": "0",
// "quantity": "1"
// });
// return smart_api.cancelOrder({
// "variety": "NORMAL",
// "orderid": "201130000006424"
// });
// V2 API'S
// return smart_api.getOrderBook();
// return smart_api.getTradeBook();
// return smart_api.getRMS();
// return smart_api.getHolding();
// return smart_api.getPosition();
// return smart_api.covertPosition({
// "exchange": "NSE",
// "oldproducttype": "DELIVERY",
// "newproducttype": "MARGIN",
// "tradingsymbol": "SBIN-EQ",
// "transactiontype": "BUY",
// "quantity": 1,
// "type": "DAY"
// });
})
.then((data) => {
// Profile details
})
.catch(ex => {
//Log error
})
// TO HANDLE SESSION EXPIRY, USERS CAN PROVIDE A CUSTOM FUNCTION AS PARAMETER TO setSessionExpiryHook METHOD
smart_api.setSessionExpiryHook(customSessionHook);
function customSessionHook() {
console.log("User loggedout");
// NEW AUTHENTICATION CAN TAKE PLACE HERE
}
########################### Socket Sample Code Starts Here ###########################
let web_socket = new WebSocket({
client_code: "CLIENT_CODE",
feed_token: "FEED_TOKEN",
script: "nse_cm|2885&nse_cm|1594" //exchange|token for multi stocks use & seperator
});
web_socket.connect();
web_socket.on('tick', receiveTick)
function receiveTick(data) {
console.log("Receive stock ticks::", data)
}
########################### Socket Sample Code Ends Here ###########################
FAQs
```bash npm i smartapi-javascript ```
The npm package smartapi-javascript receives a total of 966 weekly downloads. As such, smartapi-javascript popularity was classified as not popular.
We found that smartapi-javascript demonstrated a not healthy version release cadence and project activity because the last version was released 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.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.