@sebspark/tradeinsight 0.5.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/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
|
+
```
|