upstox-js-sdk
Version:
The official Node Js client for communicating with the Upstox API
220 lines (185 loc) • 11.1 kB
JavaScript
/*
* Upstox Developer API
* Build your App on the Upstox platform  # Introduction Upstox API is a set of rest APIs that provide data required to build a complete investment and trading platform. Execute orders in real time, manage user portfolio, stream live market data (using Websocket), and more, with the easy to understand API collection. All requests are over HTTPS and the requests are sent with the content-type ‘application/json’. Developers have the option of choosing the response type as JSON or CSV for a few API calls. To be able to use these APIs you need to create an App in the Developer Console and generate your **apiKey** and **apiSecret**. You can use a redirect URL which will be called after the login flow. If you are a **trader**, you can directly create apps from Upstox mobile app or the desktop platform itself from **Apps** sections inside the **Account** Tab. Head over to <a href=\"http://account.upstox.com/developer/apps\" target=\"_blank\">account.upstox.com/developer/apps</a>.</br> If you are a **business** looking to integrate Upstox APIs, reach out to us and we will get a custom app created for you in no time. It is highly recommended that you do not embed the **apiSecret** in your frontend app. Create a remote backend which does the handshake on behalf of the frontend app. Marking the apiSecret in the frontend app will make your app vulnerable to threats and potential issues.
*
* OpenAPI spec version: v2
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 3.0.46
*
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', '../../src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require('../../src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.UpstoxClient);
}
}(this, function(expect, UpstoxClient) {
'use strict';
var instance;
describe('(package)', function() {
describe('OrderBookData', function() {
beforeEach(function() {
instance = new UpstoxClient.OrderBookData();
});
it('should create an instance of OrderBookData', function() {
// TODO: update the code to test OrderBookData
expect(instance).to.be.a(UpstoxClient.OrderBookData);
});
it('should have the property exchange (base name: "exchange")', function() {
// TODO: update the code to test the property exchange
expect(instance).to.have.property('exchange');
// expect(instance.exchange).to.be(expectedValueLiteral);
});
it('should have the property product (base name: "product")', function() {
// TODO: update the code to test the property product
expect(instance).to.have.property('product');
// expect(instance.product).to.be(expectedValueLiteral);
});
it('should have the property price (base name: "price")', function() {
// TODO: update the code to test the property price
expect(instance).to.have.property('price');
// expect(instance.price).to.be(expectedValueLiteral);
});
it('should have the property quantity (base name: "quantity")', function() {
// TODO: update the code to test the property quantity
expect(instance).to.have.property('quantity');
// expect(instance.quantity).to.be(expectedValueLiteral);
});
it('should have the property status (base name: "status")', function() {
// TODO: update the code to test the property status
expect(instance).to.have.property('status');
// expect(instance.status).to.be(expectedValueLiteral);
});
it('should have the property guid (base name: "guid")', function() {
// TODO: update the code to test the property guid
expect(instance).to.have.property('guid');
// expect(instance.guid).to.be(expectedValueLiteral);
});
it('should have the property tag (base name: "tag")', function() {
// TODO: update the code to test the property tag
expect(instance).to.have.property('tag');
// expect(instance.tag).to.be(expectedValueLiteral);
});
it('should have the property instrumentToken (base name: "instrument_token")', function() {
// TODO: update the code to test the property instrumentToken
expect(instance).to.have.property('instrumentToken');
// expect(instance.instrumentToken).to.be(expectedValueLiteral);
});
it('should have the property placedBy (base name: "placed_by")', function() {
// TODO: update the code to test the property placedBy
expect(instance).to.have.property('placedBy');
// expect(instance.placedBy).to.be(expectedValueLiteral);
});
it('should have the property tradingsymbol (base name: "tradingsymbol")', function() {
// TODO: update the code to test the property tradingsymbol
expect(instance).to.have.property('tradingsymbol');
// expect(instance.tradingsymbol).to.be(expectedValueLiteral);
});
it('should have the property orderType (base name: "order_type")', function() {
// TODO: update the code to test the property orderType
expect(instance).to.have.property('orderType');
// expect(instance.orderType).to.be(expectedValueLiteral);
});
it('should have the property validity (base name: "validity")', function() {
// TODO: update the code to test the property validity
expect(instance).to.have.property('validity');
// expect(instance.validity).to.be(expectedValueLiteral);
});
it('should have the property triggerPrice (base name: "trigger_price")', function() {
// TODO: update the code to test the property triggerPrice
expect(instance).to.have.property('triggerPrice');
// expect(instance.triggerPrice).to.be(expectedValueLiteral);
});
it('should have the property disclosedQuantity (base name: "disclosed_quantity")', function() {
// TODO: update the code to test the property disclosedQuantity
expect(instance).to.have.property('disclosedQuantity');
// expect(instance.disclosedQuantity).to.be(expectedValueLiteral);
});
it('should have the property transactionType (base name: "transaction_type")', function() {
// TODO: update the code to test the property transactionType
expect(instance).to.have.property('transactionType');
// expect(instance.transactionType).to.be(expectedValueLiteral);
});
it('should have the property averagePrice (base name: "average_price")', function() {
// TODO: update the code to test the property averagePrice
expect(instance).to.have.property('averagePrice');
// expect(instance.averagePrice).to.be(expectedValueLiteral);
});
it('should have the property filledQuantity (base name: "filled_quantity")', function() {
// TODO: update the code to test the property filledQuantity
expect(instance).to.have.property('filledQuantity');
// expect(instance.filledQuantity).to.be(expectedValueLiteral);
});
it('should have the property pendingQuantity (base name: "pending_quantity")', function() {
// TODO: update the code to test the property pendingQuantity
expect(instance).to.have.property('pendingQuantity');
// expect(instance.pendingQuantity).to.be(expectedValueLiteral);
});
it('should have the property statusMessage (base name: "status_message")', function() {
// TODO: update the code to test the property statusMessage
expect(instance).to.have.property('statusMessage');
// expect(instance.statusMessage).to.be(expectedValueLiteral);
});
it('should have the property statusMessageRaw (base name: "status_message_raw")', function() {
// TODO: update the code to test the property statusMessageRaw
expect(instance).to.have.property('statusMessageRaw');
// expect(instance.statusMessageRaw).to.be(expectedValueLiteral);
});
it('should have the property exchangeOrderId (base name: "exchange_order_id")', function() {
// TODO: update the code to test the property exchangeOrderId
expect(instance).to.have.property('exchangeOrderId');
// expect(instance.exchangeOrderId).to.be(expectedValueLiteral);
});
it('should have the property parentOrderId (base name: "parent_order_id")', function() {
// TODO: update the code to test the property parentOrderId
expect(instance).to.have.property('parentOrderId');
// expect(instance.parentOrderId).to.be(expectedValueLiteral);
});
it('should have the property orderId (base name: "order_id")', function() {
// TODO: update the code to test the property orderId
expect(instance).to.have.property('orderId');
// expect(instance.orderId).to.be(expectedValueLiteral);
});
it('should have the property variety (base name: "variety")', function() {
// TODO: update the code to test the property variety
expect(instance).to.have.property('variety');
// expect(instance.variety).to.be(expectedValueLiteral);
});
it('should have the property orderTimestamp (base name: "order_timestamp")', function() {
// TODO: update the code to test the property orderTimestamp
expect(instance).to.have.property('orderTimestamp');
// expect(instance.orderTimestamp).to.be(expectedValueLiteral);
});
it('should have the property exchangeTimestamp (base name: "exchange_timestamp")', function() {
// TODO: update the code to test the property exchangeTimestamp
expect(instance).to.have.property('exchangeTimestamp');
// expect(instance.exchangeTimestamp).to.be(expectedValueLiteral);
});
it('should have the property isAmo (base name: "is_amo")', function() {
// TODO: update the code to test the property isAmo
expect(instance).to.have.property('isAmo');
// expect(instance.isAmo).to.be(expectedValueLiteral);
});
it('should have the property orderRequestId (base name: "order_request_id")', function() {
// TODO: update the code to test the property orderRequestId
expect(instance).to.have.property('orderRequestId');
// expect(instance.orderRequestId).to.be(expectedValueLiteral);
});
it('should have the property orderRefId (base name: "order_ref_id")', function() {
// TODO: update the code to test the property orderRefId
expect(instance).to.have.property('orderRefId');
// expect(instance.orderRefId).to.be(expectedValueLiteral);
});
});
});
}));