@bookerinvestmentgroup/proto-models-ts
v1.4.0
Published
Generated TypeScript protobuf models for trading and financial data
Maintainers
Readme
Proto Models TypeScript
Generated TypeScript protobuf models for trading and financial data.
Installation
npm install @bookerinvestmentgroup/proto-models-tsUsage
import { Quote, QuoteData, CompanyInfo } from '@bookerinvestmentgroup/proto-models-ts';
// Create a quote object
const quote = new Quote({
symbol: "AAPL",
quote: new QuoteData({
price: 150.25,
priceChange: 2.50,
priceChangePercent: 1.69,
bid: 150.20,
ask: 150.30,
volume: 1000000,
dayHigh: 152.00,
dayLow: 148.50,
yearHigh: 180.00,
yearLow: 120.00
})
});
// Serialize to binary
const buffer = quote.serializeBinary();
// Deserialize from binary
const deserializedQuote = Quote.deserializeBinary(buffer);Available Models
QuoteandQuoteData- Real-time quote informationCompanyInfo,KeyStats,CompanyInfoRequest- Company details and statisticsChartrelated models - Chart and candlestick dataOptionChainrelated models - Options chain dataWheelStrategyrelated models - Wheel trading strategy data
TypeScript Support
This package includes full TypeScript type definitions, providing excellent IntelliSense and compile-time type checking.
Dependencies
google-protobuf- Google's Protocol Buffer runtime for JavaScript
Building from Source
- Generate protobuf files:
../../GenProtos.sh - Copy generated files:
npm run copy-protos - Build the package:
npm run build - Create package:
npm pack
