@sebspark/tradeinsight 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -1
- package/dist/index.d.mts +1 -29
- package/dist/index.d.ts +1 -29
- package/dist/index.js +0 -3
- package/dist/index.mjs +0 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
1
|
# `@sebspark/tradeinsight`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
TradeInsight client library with helpers for creating/parsing instrument IDs and consuming ticker feeds.
|
|
4
|
+
|
|
5
|
+
## Instrument IDs
|
|
6
|
+
|
|
7
|
+
### Create ID
|
|
8
|
+
|
|
9
|
+
```javascript
|
|
10
|
+
const isin = 'SE0000108656'
|
|
11
|
+
const mic = 'XSTO'
|
|
12
|
+
const currency = 'SEK'
|
|
13
|
+
const id = createStockId({ isin, mic, currency })
|
|
14
|
+
|
|
15
|
+
console.log(id)
|
|
16
|
+
// STOCK-SE0000108656;XSTO;SEK
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Parse ID
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
const { type, fromCurrency, toCurrency } = parseId('FOREX-USD;EUR')
|
|
23
|
+
console.log(type, fromCurrency, toCurrency)
|
|
24
|
+
// FOREX, USD, EUR
|
|
25
|
+
```
|
package/dist/index.d.mts
CHANGED
|
@@ -20,24 +20,6 @@ declare const CloudSchema: {
|
|
|
20
20
|
avroDefinition: string;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
/**
|
|
24
|
-
* @deprecated Use the Ticker type instead.
|
|
25
|
-
*/
|
|
26
|
-
interface StockTicker {
|
|
27
|
-
id: string;
|
|
28
|
-
mic: string;
|
|
29
|
-
isin: string;
|
|
30
|
-
ticker: string;
|
|
31
|
-
currencyCode: string;
|
|
32
|
-
price: InstrumentPrice;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated Use the TickerMessage type instead.
|
|
36
|
-
*/
|
|
37
|
-
interface StockTickerMessage {
|
|
38
|
-
tickers: StockTicker[];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
23
|
declare const createStockId: ({ isin, mic, currency, }: {
|
|
42
24
|
isin: string;
|
|
43
25
|
currency: string;
|
|
@@ -57,19 +39,9 @@ declare const parseId: (id: string) => {
|
|
|
57
39
|
toCurrency?: string;
|
|
58
40
|
};
|
|
59
41
|
|
|
60
|
-
/**
|
|
61
|
-
* @deprecated Use TickersTopic instead
|
|
62
|
-
*/
|
|
63
|
-
declare const StockTickerTopic = "tradeinsight.stockticker";
|
|
64
|
-
/**
|
|
65
|
-
* @deprecated Use TickersPubSubChannels instead
|
|
66
|
-
*/
|
|
67
|
-
type StockTickerPubSubChannels = {
|
|
68
|
-
[StockTickerTopic]: StockTickerMessage;
|
|
69
|
-
};
|
|
70
42
|
declare const TickersTopic = "tradeinsight.tickers";
|
|
71
43
|
type TickersPubSubChannels = {
|
|
72
44
|
[TickersTopic]: TickerMessage;
|
|
73
45
|
};
|
|
74
46
|
|
|
75
|
-
export { CloudSchema, type InstrumentPrice, type
|
|
47
|
+
export { CloudSchema, type InstrumentPrice, type Ticker, type TickerMessage, type TickersPubSubChannels, TickersTopic, createForexId, createStockId, parseId };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,24 +20,6 @@ declare const CloudSchema: {
|
|
|
20
20
|
avroDefinition: string;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
/**
|
|
24
|
-
* @deprecated Use the Ticker type instead.
|
|
25
|
-
*/
|
|
26
|
-
interface StockTicker {
|
|
27
|
-
id: string;
|
|
28
|
-
mic: string;
|
|
29
|
-
isin: string;
|
|
30
|
-
ticker: string;
|
|
31
|
-
currencyCode: string;
|
|
32
|
-
price: InstrumentPrice;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated Use the TickerMessage type instead.
|
|
36
|
-
*/
|
|
37
|
-
interface StockTickerMessage {
|
|
38
|
-
tickers: StockTicker[];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
23
|
declare const createStockId: ({ isin, mic, currency, }: {
|
|
42
24
|
isin: string;
|
|
43
25
|
currency: string;
|
|
@@ -57,19 +39,9 @@ declare const parseId: (id: string) => {
|
|
|
57
39
|
toCurrency?: string;
|
|
58
40
|
};
|
|
59
41
|
|
|
60
|
-
/**
|
|
61
|
-
* @deprecated Use TickersTopic instead
|
|
62
|
-
*/
|
|
63
|
-
declare const StockTickerTopic = "tradeinsight.stockticker";
|
|
64
|
-
/**
|
|
65
|
-
* @deprecated Use TickersPubSubChannels instead
|
|
66
|
-
*/
|
|
67
|
-
type StockTickerPubSubChannels = {
|
|
68
|
-
[StockTickerTopic]: StockTickerMessage;
|
|
69
|
-
};
|
|
70
42
|
declare const TickersTopic = "tradeinsight.tickers";
|
|
71
43
|
type TickersPubSubChannels = {
|
|
72
44
|
[TickersTopic]: TickerMessage;
|
|
73
45
|
};
|
|
74
46
|
|
|
75
|
-
export { CloudSchema, type InstrumentPrice, type
|
|
47
|
+
export { CloudSchema, type InstrumentPrice, type Ticker, type TickerMessage, type TickersPubSubChannels, TickersTopic, createForexId, createStockId, parseId };
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
CloudSchema: () => CloudSchema,
|
|
24
|
-
StockTickerTopic: () => StockTickerTopic,
|
|
25
24
|
TickersTopic: () => TickersTopic,
|
|
26
25
|
createForexId: () => createForexId,
|
|
27
26
|
createStockId: () => createStockId,
|
|
@@ -161,12 +160,10 @@ var parseId = (id) => {
|
|
|
161
160
|
};
|
|
162
161
|
|
|
163
162
|
// src/pubsub/main.ts
|
|
164
|
-
var StockTickerTopic = "tradeinsight.stockticker";
|
|
165
163
|
var TickersTopic = "tradeinsight.tickers";
|
|
166
164
|
// Annotate the CommonJS export names for ESM import in node:
|
|
167
165
|
0 && (module.exports = {
|
|
168
166
|
CloudSchema,
|
|
169
|
-
StockTickerTopic,
|
|
170
167
|
TickersTopic,
|
|
171
168
|
createForexId,
|
|
172
169
|
createStockId,
|
package/dist/index.mjs
CHANGED
|
@@ -130,11 +130,9 @@ var parseId = (id) => {
|
|
|
130
130
|
};
|
|
131
131
|
|
|
132
132
|
// src/pubsub/main.ts
|
|
133
|
-
var StockTickerTopic = "tradeinsight.stockticker";
|
|
134
133
|
var TickersTopic = "tradeinsight.tickers";
|
|
135
134
|
export {
|
|
136
135
|
CloudSchema,
|
|
137
|
-
StockTickerTopic,
|
|
138
136
|
TickersTopic,
|
|
139
137
|
createForexId,
|
|
140
138
|
createStockId,
|