Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
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.