@fintekkers/ledger-models 0.1.112 → 0.1.113

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.
@@ -0,0 +1,17 @@
1
+ import Security from './security';
2
+ import { SecurityProto } from '../../../fintekkers/models/security/security_pb';
3
+ import { DecimalValueProto } from '../../../fintekkers/models/util/decimal_value_pb';
4
+ import { CouponTypeProto } from '../../../fintekkers/models/security/coupon_type_pb';
5
+ import { CouponFrequencyProto } from '../../../fintekkers/models/security/coupon_frequency_pb';
6
+ import { LocalDate } from '../utils/date';
7
+ import { IssuanceProto } from '../../../fintekkers/models/security/bond/issuance_pb';
8
+ declare class BondSecurity extends Security {
9
+ constructor(proto: SecurityProto);
10
+ getCouponRate(): DecimalValueProto;
11
+ getFaceValue(): DecimalValueProto;
12
+ getCouponType(): CouponTypeProto;
13
+ getCouponFrequency(): CouponFrequencyProto;
14
+ getDatedDate(): LocalDate | undefined;
15
+ getIssuanceInfo(): IssuanceProto[];
16
+ }
17
+ export default BondSecurity;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const security_1 = __importDefault(require("./security"));
7
+ const security_type_pb_1 = require("../../../fintekkers/models/security/security_type_pb");
8
+ const date_1 = require("../utils/date");
9
+ class BondSecurity extends security_1.default {
10
+ constructor(proto) {
11
+ super(proto);
12
+ if (proto.getSecurityType() !== security_type_pb_1.SecurityTypeProto.BOND_SECURITY) {
13
+ throw new Error(`BondSecurity requires BOND_SECURITY type, got ${security_type_pb_1.SecurityTypeProto[proto.getSecurityType()]}`);
14
+ }
15
+ }
16
+ getCouponRate() {
17
+ const rate = this.proto.getCouponRate();
18
+ if (!rate)
19
+ throw new Error("Coupon rate is required for bonds");
20
+ return rate;
21
+ }
22
+ getFaceValue() {
23
+ const faceValue = this.proto.getFaceValue();
24
+ if (!faceValue)
25
+ throw new Error("Face value is required for bonds");
26
+ return faceValue;
27
+ }
28
+ getCouponType() {
29
+ return this.proto.getCouponType();
30
+ }
31
+ getCouponFrequency() {
32
+ return this.proto.getCouponFrequency();
33
+ }
34
+ getDatedDate() {
35
+ const datedDate = this.proto.getDatedDate();
36
+ return datedDate ? new date_1.LocalDate(datedDate) : undefined;
37
+ }
38
+ getIssuanceInfo() {
39
+ return this.proto.getIssuanceInfoList();
40
+ }
41
+ }
42
+ exports.default = BondSecurity;
43
+ //# sourceMappingURL=BondSecurity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BondSecurity.js","sourceRoot":"","sources":["BondSecurity.ts"],"names":[],"mappings":";;;;;AAAA,0DAAkC;AAElC,2FAAyF;AAIzF,wCAA0C;AAG1C,MAAM,YAAa,SAAQ,kBAAQ;IACjC,YAAY,KAAoB;QAC9B,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,KAAK,CAAC,eAAe,EAAE,KAAK,oCAAiB,CAAC,aAAa,EAAE,CAAC;YAChE,MAAM,IAAI,KAAK,CACb,iDAAiD,oCAAiB,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,EAAE,CAC9F,CAAC;QACJ,CAAC;IACH,CAAC;IAED,aAAa;QACX,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QACxC,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QAChE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY;QACV,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;QAC5C,IAAI,CAAC,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACpE,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;IACpC,CAAC;IAED,kBAAkB;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,kBAAkB,EAAE,CAAC;IACzC,CAAC;IAED,YAAY;QACV,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;QAC5C,OAAO,SAAS,CAAC,CAAC,CAAC,IAAI,gBAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1D,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,CAAC;IAC1C,CAAC;CACF;AAED,kBAAe,YAAY,CAAC"}
@@ -0,0 +1,51 @@
1
+ import Security from './security';
2
+ import { SecurityProto } from '../../../fintekkers/models/security/security_pb';
3
+ import { SecurityTypeProto } from '../../../fintekkers/models/security/security_type_pb';
4
+ import { DecimalValueProto } from '../../../fintekkers/models/util/decimal_value_pb';
5
+ import { CouponTypeProto } from '../../../fintekkers/models/security/coupon_type_pb';
6
+ import { CouponFrequencyProto } from '../../../fintekkers/models/security/coupon_frequency_pb';
7
+ import { LocalDate } from '../utils/date';
8
+ import { IssuanceProto } from '../../../fintekkers/models/security/bond/issuance_pb';
9
+
10
+ class BondSecurity extends Security {
11
+ constructor(proto: SecurityProto) {
12
+ super(proto);
13
+ if (proto.getSecurityType() !== SecurityTypeProto.BOND_SECURITY) {
14
+ throw new Error(
15
+ `BondSecurity requires BOND_SECURITY type, got ${SecurityTypeProto[proto.getSecurityType()]}`
16
+ );
17
+ }
18
+ }
19
+
20
+ getCouponRate(): DecimalValueProto {
21
+ const rate = this.proto.getCouponRate();
22
+ if (!rate) throw new Error("Coupon rate is required for bonds");
23
+ return rate;
24
+ }
25
+
26
+ getFaceValue(): DecimalValueProto {
27
+ const faceValue = this.proto.getFaceValue();
28
+ if (!faceValue) throw new Error("Face value is required for bonds");
29
+ return faceValue;
30
+ }
31
+
32
+ getCouponType(): CouponTypeProto {
33
+ return this.proto.getCouponType();
34
+ }
35
+
36
+ getCouponFrequency(): CouponFrequencyProto {
37
+ return this.proto.getCouponFrequency();
38
+ }
39
+
40
+ getDatedDate(): LocalDate | undefined {
41
+ const datedDate = this.proto.getDatedDate();
42
+ return datedDate ? new LocalDate(datedDate) : undefined;
43
+ }
44
+
45
+ getIssuanceInfo(): IssuanceProto[] {
46
+ return this.proto.getIssuanceInfoList();
47
+ }
48
+ }
49
+
50
+ export default BondSecurity;
51
+
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fintekkers/ledger-models",
3
3
  "todo": "Replace the version with build script version number",
4
- "version": "0.1.112",
4
+ "version": "0.1.113",
5
5
  "description": "ledger model protos ",
6
6
  "authors": [
7
7
  "David Doherty",