Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
longbridge
Advanced tools
longbridge
provides an easy-to-use interface for invokes Longbridge OpenAPI
.
Install Longbridge OpenAPI SDK
npm install longbridge
Setting environment variables(MacOS/Linux)
export LONGBRIDGE_APP_KEY="App Key get from user center"
export LONGBRIDGE_APP_SECRET="App Secret get from user center"
export LONGBRIDGE_ACCESS_TOKEN="Access Token get from user center"
Setting environment variables(Windows)
setx LONGBRIDGE_APP_KEY "App Key get from user center"
setx LONGBRIDGE_APP_SECRET "App Secret get from user center"
setx LONGBRIDGE_ACCESS_TOKEN "Access Token get from user center"
const { Config, QuoteContext } = require("longbridge");
let config = Config.fromEnv();
QuoteContext.new(config)
.then((ctx) => ctx.quote(["700.HK", "AAPL.US", "TSLA.US", "NFLX.US"]))
.then((resp) => {
for (let obj of resp) {
console.log(obj.toString())
}
});
const { Config, QuoteContext, SubType } = require("longbridge");
let config = Config.fromEnv();
QuoteContext.new(config).then((ctx) => {
ctx.setOnQuote((_, event) => console.log(event.toString()));
ctx.subscribe(
["700.HK", "AAPL.US", "TSLA.US", "NFLX.US"],
[SubType.Quote],
true
);
});
const {
Config,
TradeContext,
Decimal,
OrderSide,
TimeInForceType,
OrderType,
} = require("longbridge");
let config = Config.fromEnv();
TradeContext.new(config)
.then((ctx) =>
ctx.submitOrder({
symbol: "700.HK",
orderType: OrderType.LO,
side: OrderSide.Buy,
timeInForce: TimeInForceType.Day,
submittedPrice: new Decimal("50"),
submittedQuantity: 200,
})
)
.then((resp) => console.log(resp.toString()));
Licensed under either of
FAQs
A Node.js library for Longbridge Open API
The npm package longbridge receives a total of 7 weekly downloads. As such, longbridge popularity was classified as not popular.
We found that longbridge demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.