@barchart/portfolio-api-common 1.3.21 → 1.3.22
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 +27 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
# @barchart/portfolio-api-common
|
|
2
|
-
## Barchart Portfolio API Common Components
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
A *private* library of shared JavaScript code pertaining to the paper-trading portfolio system.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
### Overview
|
|
6
|
+
|
|
7
|
+
Simply put, this project contains code that runs on both the servers (i.e. Serverless applications) and clients (e.g. browser, mobile, etc).
|
|
8
|
+
|
|
9
|
+
#### [lib/serialization](https://github.com/barchart/portfolio-api-common/tree/master/lib/serialization)
|
|
10
|
+
|
|
11
|
+
Data is passed between client and server in JSON format. However, the code works with more complex types. For example, [Decimal](https://github.com/barchart/barchart-common-js/blob/master/lang/Decimal.js) instances are used in place of [native JavaScript floats](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number). [Day](https://github.com/barchart/barchart-common-js/blob/master/lang/Day.js) instances are used instead of [native JavaScript Dates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date).
|
|
12
|
+
|
|
13
|
+
So, before data is exchanged, it must be converted to pure JSON. Conversely, when data is received, as pure JSON, its translated into more complex types before use. This is facilitated by the [Schema](https://github.com/barchart/barchart-common-js/blob/master/serialization/json/Schema.js) definitions which build custom "reviver" functions for [JSON parsing](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse).
|
|
14
|
+
|
|
15
|
+
#### [lib/processing](https://github.com/barchart/portfolio-api-common/tree/master/lib/processing)
|
|
16
|
+
|
|
17
|
+
For reporting and display purposes, positions can be grouped together (by asset class, by portfolio, by user, etc). This code supports aggregation and gain/loss calculation. It is used by server-generated reports and dynamic user interfaces.
|
|
18
|
+
|
|
19
|
+
### Notable Consumers
|
|
20
|
+
|
|
21
|
+
* [aws-lambda-portfolio](https://github.com/barchart/aws-lambda-portfolio) - Serverless applications (i.e. the servers)
|
|
22
|
+
* [portfolio-client-js](https://github.com/barchart/portfolio-client-js) - JavaScript client SDK for communicating with server API's.
|
|
23
|
+
* [tgam-portfolio-ui-js](https://github.com/barchart/tgam-portfolio-ui-js) - A dynamic, single-page HTML UI.
|
|
24
|
+
|
|
25
|
+
### Package Managers
|
|
26
|
+
|
|
27
|
+
This library has been published as a *private* module to NPM as [@barchart/portfolio-api-common](https://www.npmjs.com/package/@barchart/portfolio-api-common).
|
|
28
|
+
|
|
29
|
+
> npm login
|
|
30
|
+
> npm install @barchart/portfolio-api-common -S
|