@fintekkers/ledger-models 0.1.95 → 0.1.97

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.
Files changed (202) hide show
  1. package/node/fintekkers/models/portfolio/portfolio_grpc_pb.js +1 -0
  2. package/node/fintekkers/models/position/field_grpc_pb.js +1 -0
  3. package/node/fintekkers/models/position/measure_grpc_pb.js +1 -0
  4. package/node/fintekkers/models/position/position_filter_grpc_pb.js +1 -0
  5. package/node/fintekkers/models/position/position_grpc_pb.js +1 -0
  6. package/node/fintekkers/models/position/position_status_grpc_pb.js +1 -0
  7. package/node/fintekkers/models/position/position_util_grpc_pb.js +1 -0
  8. package/node/fintekkers/models/price/price_grpc_pb.js +1 -0
  9. package/node/fintekkers/models/security/bond/auction_type_grpc_pb.js +1 -0
  10. package/node/fintekkers/models/security/bond/issuance_grpc_pb.js +1 -0
  11. package/node/fintekkers/models/security/coupon_frequency_grpc_pb.js +1 -0
  12. package/node/fintekkers/models/security/coupon_type_grpc_pb.js +1 -0
  13. package/node/fintekkers/models/security/identifier/identifier_grpc_pb.js +1 -0
  14. package/node/fintekkers/models/security/identifier/identifier_type_grpc_pb.js +1 -0
  15. package/node/fintekkers/models/security/security_grpc_pb.js +1 -0
  16. package/node/fintekkers/models/security/security_pb.test.d.ts +1 -0
  17. package/node/fintekkers/models/security/security_pb.test.js +10 -10
  18. package/node/fintekkers/models/security/security_pb.test.js.map +1 -1
  19. package/node/fintekkers/models/security/security_quantity_type_grpc_pb.js +1 -0
  20. package/node/fintekkers/models/security/security_type_grpc_pb.js +1 -0
  21. package/node/fintekkers/models/security/tenor_grpc_pb.js +1 -0
  22. package/node/fintekkers/models/security/tenor_type_grpc_pb.js +1 -0
  23. package/node/fintekkers/models/strategy/strategy_allocation_grpc_pb.js +1 -0
  24. package/node/fintekkers/models/strategy/strategy_grpc_pb.js +1 -0
  25. package/node/fintekkers/models/transaction/transaction_grpc_pb.js +1 -0
  26. package/node/fintekkers/models/transaction/transaction_type_grpc_pb.js +1 -0
  27. package/node/fintekkers/models/util/api/api_key_grpc_pb.js +1 -0
  28. package/node/fintekkers/models/util/date_range_grpc_pb.js +1 -0
  29. package/node/fintekkers/models/util/date_range_pb.d.ts +43 -0
  30. package/node/fintekkers/models/util/date_range_pb.js +310 -0
  31. package/node/fintekkers/models/util/decimal_value_grpc_pb.js +1 -0
  32. package/node/fintekkers/models/util/endpoint_grpc_pb.js +1 -0
  33. package/node/fintekkers/models/util/local_date_grpc_pb.js +1 -0
  34. package/node/fintekkers/models/util/local_timestamp_grpc_pb.js +1 -0
  35. package/node/fintekkers/models/util/lock/node_partition_grpc_pb.js +1 -0
  36. package/node/fintekkers/models/util/lock/node_state_grpc_pb.js +1 -0
  37. package/node/fintekkers/models/util/uuid_grpc_pb.js +1 -0
  38. package/node/fintekkers/requests/portfolio/create_portfolio_request_grpc_pb.js +1 -0
  39. package/node/fintekkers/requests/portfolio/create_portfolio_response_grpc_pb.js +1 -0
  40. package/node/fintekkers/requests/portfolio/query_portfolio_request_grpc_pb.js +1 -0
  41. package/node/fintekkers/requests/portfolio/query_portfolio_response_grpc_pb.js +1 -0
  42. package/node/fintekkers/requests/position/query_position_request_grpc_pb.js +1 -0
  43. package/node/fintekkers/requests/position/query_position_response_grpc_pb.js +1 -0
  44. package/node/fintekkers/requests/price/create_price_request_grpc_pb.js +1 -0
  45. package/node/fintekkers/requests/price/create_price_response_grpc_pb.js +1 -0
  46. package/node/fintekkers/requests/price/query_price_request_grpc_pb.js +1 -0
  47. package/node/fintekkers/requests/price/query_price_request_pb.d.ts +47 -0
  48. package/node/fintekkers/requests/price/query_price_request_pb.js +190 -2
  49. package/node/fintekkers/requests/price/query_price_response_grpc_pb.js +1 -0
  50. package/node/fintekkers/requests/security/create_security_request_grpc_pb.js +1 -0
  51. package/node/fintekkers/requests/security/create_security_response_grpc_pb.js +1 -0
  52. package/node/fintekkers/requests/security/get_field_values_request_grpc_pb.js +1 -0
  53. package/node/fintekkers/requests/security/get_field_values_request_pb.js +238 -0
  54. package/node/fintekkers/requests/security/get_field_values_response_grpc_pb.js +1 -0
  55. package/node/fintekkers/requests/security/get_field_values_response_pb.js +268 -0
  56. package/node/fintekkers/requests/security/get_fields_response_grpc_pb.js +1 -0
  57. package/node/fintekkers/requests/security/get_fields_response_pb.js +266 -0
  58. package/node/fintekkers/requests/security/query_security_request_grpc_pb.js +1 -0
  59. package/node/fintekkers/requests/security/query_security_response_grpc_pb.js +1 -0
  60. package/node/fintekkers/requests/transaction/create_transaction_request_grpc_pb.js +1 -0
  61. package/node/fintekkers/requests/transaction/create_transaction_response_grpc_pb.js +1 -0
  62. package/node/fintekkers/requests/transaction/query_transaction_request_grpc_pb.js +1 -0
  63. package/node/fintekkers/requests/transaction/query_transaction_response_grpc_pb.js +1 -0
  64. package/node/fintekkers/requests/util/errors/error_grpc_pb.js +1 -0
  65. package/node/fintekkers/requests/util/errors/message_grpc_pb.js +1 -0
  66. package/node/fintekkers/requests/util/errors/summary_grpc_pb.js +1 -0
  67. package/node/fintekkers/requests/util/lock/lock_request_grpc_pb.js +1 -0
  68. package/node/fintekkers/requests/util/lock/lock_request_pb.js +54 -1
  69. package/node/fintekkers/requests/util/lock/lock_response_grpc_pb.js +1 -0
  70. package/node/fintekkers/requests/util/operation_grpc_pb.js +1 -0
  71. package/node/fintekkers/requests/valuation/valuation_request_grpc_pb.js +1 -0
  72. package/node/fintekkers/requests/valuation/valuation_response_grpc_pb.js +1 -0
  73. package/node/wrappers/models/portfolio/portfolio.d.ts +15 -0
  74. package/node/wrappers/models/portfolio/portfolio.js +26 -21
  75. package/node/wrappers/models/portfolio/portfolio.js.map +1 -1
  76. package/node/wrappers/models/portfolio/portfolio.ts +6 -2
  77. package/node/wrappers/models/position/field.d.ts +7 -0
  78. package/node/wrappers/models/position/field.js +10 -14
  79. package/node/wrappers/models/position/field.js.map +1 -1
  80. package/node/wrappers/models/position/field.test.d.ts +1 -0
  81. package/node/wrappers/models/position/field.test.js +10 -48
  82. package/node/wrappers/models/position/field.test.js.map +1 -1
  83. package/node/wrappers/models/position/field.ts +1 -2
  84. package/node/wrappers/models/position/position.d.ts +32 -0
  85. package/node/wrappers/models/position/position.js +89 -83
  86. package/node/wrappers/models/position/position.js.map +1 -1
  87. package/node/wrappers/models/position/position.test.d.ts +1 -0
  88. package/node/wrappers/models/position/position.test.js +128 -198
  89. package/node/wrappers/models/position/position.test.js.map +1 -1
  90. package/node/wrappers/models/position/position.test.ts +1 -1
  91. package/node/wrappers/models/position/position.ts +19 -12
  92. package/node/wrappers/models/position/positionfilter.d.ts +24 -0
  93. package/node/wrappers/models/position/positionfilter.js +19 -20
  94. package/node/wrappers/models/position/positionfilter.js.map +1 -1
  95. package/node/wrappers/models/position/positionfilter.ts +1 -1
  96. package/node/wrappers/models/security/security.d.ts +23 -0
  97. package/node/wrappers/models/security/security.js +55 -44
  98. package/node/wrappers/models/security/security.js.map +1 -1
  99. package/node/wrappers/models/security/security.test.d.ts +1 -0
  100. package/node/wrappers/models/security/security.test.js +14 -11
  101. package/node/wrappers/models/security/security.test.js.map +1 -1
  102. package/node/wrappers/models/security/security.ts +13 -6
  103. package/node/wrappers/models/transaction/transaction.d.ts +36 -0
  104. package/node/wrappers/models/transaction/transaction.js +98 -68
  105. package/node/wrappers/models/transaction/transaction.js.map +1 -1
  106. package/node/wrappers/models/transaction/transaction.test.d.ts +1 -0
  107. package/node/wrappers/models/transaction/transaction.test.js +12 -9
  108. package/node/wrappers/models/transaction/transaction.test.js.map +1 -1
  109. package/node/wrappers/models/transaction/transaction.ts +30 -12
  110. package/node/wrappers/models/transaction/transaction_type.d.ts +17 -0
  111. package/node/wrappers/models/transaction/transaction_type.js +12 -12
  112. package/node/wrappers/models/transaction/transaction_type.js.map +1 -1
  113. package/node/wrappers/models/transaction/transaction_type.ts +5 -5
  114. package/node/wrappers/models/utils/date.d.ts +11 -0
  115. package/node/wrappers/models/utils/date.js +16 -17
  116. package/node/wrappers/models/utils/date.js.map +1 -1
  117. package/node/wrappers/models/utils/date.test.d.ts +1 -0
  118. package/node/wrappers/models/utils/date.test.js +28 -58
  119. package/node/wrappers/models/utils/date.test.js.map +1 -1
  120. package/node/wrappers/models/utils/date.ts +1 -1
  121. package/node/wrappers/models/utils/datetime.d.ts +14 -0
  122. package/node/wrappers/models/utils/datetime.js +41 -34
  123. package/node/wrappers/models/utils/datetime.js.map +1 -1
  124. package/node/wrappers/models/utils/datetime.test.d.ts +1 -0
  125. package/node/wrappers/models/utils/datetime.test.js +40 -70
  126. package/node/wrappers/models/utils/datetime.test.js.map +1 -1
  127. package/node/wrappers/models/utils/datetime.ts +13 -8
  128. package/node/wrappers/models/utils/protoEnum.d.ts +12 -0
  129. package/node/wrappers/models/utils/protoEnum.js +22 -24
  130. package/node/wrappers/models/utils/protoEnum.js.map +1 -1
  131. package/node/wrappers/models/utils/protoEnum.test.d.ts +1 -0
  132. package/node/wrappers/models/utils/protoEnum.test.js +13 -13
  133. package/node/wrappers/models/utils/protoEnum.test.js.map +1 -1
  134. package/node/wrappers/models/utils/requestcontext.d.ts +13 -0
  135. package/node/wrappers/models/utils/requestcontext.js +52 -44
  136. package/node/wrappers/models/utils/requestcontext.js.map +1 -1
  137. package/node/wrappers/models/utils/requestcontext.ts +15 -15
  138. package/node/wrappers/models/utils/requestcontext_d.d.ts +6 -0
  139. package/node/wrappers/models/utils/requestcontext_d.js +1 -0
  140. package/node/wrappers/models/utils/serialization.d.ts +12 -0
  141. package/node/wrappers/models/utils/serialization.js +19 -22
  142. package/node/wrappers/models/utils/serialization.js.map +1 -1
  143. package/node/wrappers/models/utils/serialization.test.d.ts +1 -0
  144. package/node/wrappers/models/utils/serialization.test.js +14 -14
  145. package/node/wrappers/models/utils/serialization.test.js.map +1 -1
  146. package/node/wrappers/models/utils/serialization.ts +1 -1
  147. package/node/wrappers/models/utils/serialization.util.d.ts +4 -0
  148. package/node/wrappers/models/utils/serialization.util.js +25 -25
  149. package/node/wrappers/models/utils/serialization.util.js.map +1 -1
  150. package/node/wrappers/models/utils/serialization.util.test.d.ts +1 -0
  151. package/node/wrappers/models/utils/serialization.util.test.js +15 -15
  152. package/node/wrappers/models/utils/serialization.util.test.js.map +1 -1
  153. package/node/wrappers/models/utils/serialization.util.ts +5 -5
  154. package/node/wrappers/models/utils/uuid.d.ts +13 -0
  155. package/node/wrappers/models/utils/uuid.js +53 -31
  156. package/node/wrappers/models/utils/uuid.js.map +1 -1
  157. package/node/wrappers/models/utils/uuid.test.d.ts +1 -0
  158. package/node/wrappers/models/utils/uuid.test.js +7 -7
  159. package/node/wrappers/models/utils/uuid.test.js.map +1 -1
  160. package/node/wrappers/models/utils/uuid.ts +1 -1
  161. package/node/wrappers/requests/position/QueryPositionRequest.d.ts +19 -0
  162. package/node/wrappers/requests/position/QueryPositionRequest.js +19 -20
  163. package/node/wrappers/requests/position/QueryPositionRequest.js.map +1 -1
  164. package/node/wrappers/services/portfolio-service/PortfolioService.d.ts +15 -0
  165. package/node/wrappers/services/portfolio-service/PortfolioService.js +58 -109
  166. package/node/wrappers/services/portfolio-service/PortfolioService.js.map +1 -1
  167. package/node/wrappers/services/portfolio-service/PortfolioService.ts +2 -2
  168. package/node/wrappers/services/portfolio-service/portfolioService.test.d.ts +1 -0
  169. package/node/wrappers/services/portfolio-service/portfolioService.test.js +47 -64
  170. package/node/wrappers/services/portfolio-service/portfolioService.test.js.map +1 -1
  171. package/node/wrappers/services/position-service/PositionService.d.ts +10 -0
  172. package/node/wrappers/services/position-service/PositionService.js +45 -83
  173. package/node/wrappers/services/position-service/PositionService.js.map +1 -1
  174. package/node/wrappers/services/position-service/position.test.d.ts +1 -0
  175. package/node/wrappers/services/position-service/position.test.js +52 -118
  176. package/node/wrappers/services/position-service/position.test.js.map +1 -1
  177. package/node/wrappers/services/position-service/position.test.ts +7 -1
  178. package/node/wrappers/services/security-service/SecurityService.d.ts +15 -0
  179. package/node/wrappers/services/security-service/SecurityService.js +86 -117
  180. package/node/wrappers/services/security-service/SecurityService.js.map +1 -1
  181. package/node/wrappers/services/security-service/SecurityService.ts +2 -2
  182. package/node/wrappers/services/security-service/security.maturityLadder.test.d.ts +1 -0
  183. package/node/wrappers/services/security-service/security.maturityLadder.test.js +40 -75
  184. package/node/wrappers/services/security-service/security.maturityLadder.test.js.map +1 -1
  185. package/node/wrappers/services/security-service/security.maturityLadder.test.ts +1 -1
  186. package/node/wrappers/services/security-service/security.test.d.ts +1 -0
  187. package/node/wrappers/services/security-service/security.test.js +88 -114
  188. package/node/wrappers/services/security-service/security.test.js.map +1 -1
  189. package/node/wrappers/services/security-service/security.test.ts +2 -2
  190. package/node/wrappers/services/transaction-service/TransactionService.d.ts +13 -0
  191. package/node/wrappers/services/transaction-service/TransactionService.js +53 -98
  192. package/node/wrappers/services/transaction-service/TransactionService.js.map +1 -1
  193. package/node/wrappers/services/transaction-service/TransactionService.ts +2 -2
  194. package/node/wrappers/services/transaction-service/transaction.search.test.d.ts +1 -0
  195. package/node/wrappers/services/transaction-service/transaction.search.test.js +51 -70
  196. package/node/wrappers/services/transaction-service/transaction.search.test.js.map +1 -1
  197. package/node/wrappers/services/transaction-service/transaction.test.d.ts +1 -0
  198. package/node/wrappers/services/transaction-service/transaction.test.js +127 -171
  199. package/node/wrappers/services/transaction-service/transaction.test.js.map +1 -1
  200. package/node/wrappers/services/transaction-service/transaction.test.ts +3 -1
  201. package/package.json +4 -1
  202. package/tsconfig.json +15 -6
@@ -1 +1 @@
1
- {"version":3,"file":"positionfilter.js","sourceRoot":"","sources":["positionfilter.ts"],"names":[],"mappings":";;;AAAA,yFAA6G;AAE7G,kEAAmD;AACnD,6FAA6F;AAE7F;IAGI;QACI,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,8CAAqB,GAArB,UAAsB,KAAiB,EAAE,gBAAwB;QAC7D,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,yCAAsB,CAAC,MAAM,EAAE,IAAI,EAAE,gBAAgB,CAAC,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CAAC,qCAAqC,CAAC,CAAC;QAC3D,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,UAAU;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,OAAO;QACH,MAAM,mBAAmB,GAAG,IAAI,wCAAmB,EAAE,CAAC;QACtD,mBAAmB,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;QACrD,mBAAmB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACxC,mBAAmB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEjD,OAAO,mBAAmB,CAAC;IAC/B,CAAC;CACJ;AA5DD,wCA4DC"}
@@ -26,7 +26,7 @@ export class PositionFilter {
26
26
  if (typeof fieldValue === 'string') {
27
27
  return this.addEqualsStringFilter(field, fieldValue as string);
28
28
  } else {
29
- return this.addFilter(field, PositionFilterOperator.EQUALS, fieldValue, null);
29
+ return this.addFilter(field, PositionFilterOperator.EQUALS, fieldValue, undefined);
30
30
  }
31
31
  }
32
32
 
@@ -0,0 +1,23 @@
1
+ import { FieldProto } from "../../../fintekkers/models/position/field_pb";
2
+ import { IdentifierProto } from "../../../fintekkers/models/security/identifier/identifier_pb";
3
+ import { SecurityProto } from "../../../fintekkers/models/security/security_pb";
4
+ import { ZonedDateTime } from "../utils/datetime";
5
+ import { UUID } from "../utils/uuid";
6
+ declare class Security {
7
+ proto: SecurityProto;
8
+ constructor(proto: SecurityProto);
9
+ toString(): string;
10
+ getFields(): FieldProto[];
11
+ getField(field: FieldProto): any;
12
+ getID(): UUID;
13
+ getAsOf(): ZonedDateTime;
14
+ getAssetClass(): string;
15
+ getProductClass(): string;
16
+ getProductType(): any;
17
+ getSecurityID(): IdentifierProto;
18
+ getIssueDate(): Date;
19
+ getMaturityDate(): Date;
20
+ getIssuerName(): string;
21
+ equals(other: Security): boolean;
22
+ }
23
+ export default Security;
@@ -1,20 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var field_pb_1 = require("../../../fintekkers/models/position/field_pb");
4
- var datetime_1 = require("../utils/datetime");
5
- var uuid_1 = require("../utils/uuid");
6
- var serialization_1 = require("../utils/serialization");
7
- var Security = /** @class */ (function () {
8
- function Security(proto) {
3
+ const field_pb_1 = require("../../../fintekkers/models/position/field_pb");
4
+ const datetime_1 = require("../utils/datetime");
5
+ const uuid_1 = require("../utils/uuid");
6
+ const serialization_1 = require("../utils/serialization");
7
+ class Security {
8
+ constructor(proto) {
9
9
  this.proto = proto;
10
10
  }
11
- Security.prototype.toString = function () {
12
- return "ID[".concat(this.getID().toString(), "], ").concat(this.getSecurityID(), "[").concat(this.getIssuerName(), "]");
13
- };
14
- Security.prototype.getFields = function () {
11
+ toString() {
12
+ return `ID[${this.getID().toString()}], ${this.getSecurityID()}[${this.getIssuerName()}]`;
13
+ }
14
+ getFields() {
15
15
  return [field_pb_1.FieldProto.ID, field_pb_1.FieldProto.SECURITY_ID, field_pb_1.FieldProto.AS_OF, field_pb_1.FieldProto.ASSET_CLASS, field_pb_1.FieldProto.IDENTIFIER];
16
- };
17
- Security.prototype.getField = function (field) {
16
+ }
17
+ getField(field) {
18
18
  switch (field) {
19
19
  case field_pb_1.FieldProto.ID:
20
20
  case field_pb_1.FieldProto.SECURITY_ID:
@@ -35,48 +35,59 @@ var Security = /** @class */ (function () {
35
35
  case field_pb_1.FieldProto.MATURITY_DATE:
36
36
  throw new Error('Not implemented yet');
37
37
  default:
38
- throw new Error("Field not mapped in Security wrapper: ".concat(field));
38
+ throw new Error(`Field not mapped in Security wrapper: ${field}`);
39
39
  }
40
- };
41
- Security.prototype.getID = function () {
42
- return uuid_1.UUID.fromU8Array(this.proto.getUuid().getRawUuid_asU8());
43
- };
44
- Security.prototype.getAsOf = function () {
45
- return new datetime_1.ZonedDateTime(this.proto.getAsOf());
46
- };
47
- Security.prototype.getAssetClass = function () {
40
+ }
41
+ getID() {
42
+ const uuid = this.proto.getUuid();
43
+ if (!uuid)
44
+ throw new Error("UUID is required");
45
+ return uuid_1.UUID.fromU8Array(uuid.getRawUuid_asU8());
46
+ }
47
+ getAsOf() {
48
+ const asOf = this.proto.getAsOf();
49
+ if (!asOf)
50
+ throw new Error("AsOf is required");
51
+ return new datetime_1.ZonedDateTime(asOf);
52
+ }
53
+ getAssetClass() {
48
54
  return this.proto.getAssetClass();
49
- };
50
- Security.prototype.getProductClass = function () {
55
+ }
56
+ getProductClass() {
51
57
  throw new Error('Not implemented yet. See Java implementation for reference');
52
- };
53
- Security.prototype.getProductType = function () {
58
+ }
59
+ getProductType() {
54
60
  throw new Error('Not implemented yet. See Java implementation for reference');
55
- };
56
- Security.prototype.getSecurityID = function () {
57
- // const id: IdentifierProto = this.proto.identifier;
58
- return this.proto.getIdentifier(); // Assuming you've implemented the Identifier class
59
- };
60
- Security.prototype.getIssueDate = function () {
61
- var date = this.proto.getIssueDate();
62
- return serialization_1.ProtoSerializationUtil.deserialize(this.proto.getIssueDate());
63
- };
64
- Security.prototype.getMaturityDate = function () {
65
- var date = this.proto.getMaturityDate();
66
- return serialization_1.ProtoSerializationUtil.deserialize(this.proto.getMaturityDate());
67
- };
68
- Security.prototype.getIssuerName = function () {
61
+ }
62
+ getSecurityID() {
63
+ const identifier = this.proto.getIdentifier();
64
+ if (!identifier)
65
+ throw new Error("Identifier is required");
66
+ return identifier;
67
+ }
68
+ getIssueDate() {
69
+ const date = this.proto.getIssueDate();
70
+ if (!date)
71
+ throw new Error("IssueDate is required");
72
+ return serialization_1.ProtoSerializationUtil.deserialize(date);
73
+ }
74
+ getMaturityDate() {
75
+ const date = this.proto.getMaturityDate();
76
+ if (!date)
77
+ throw new Error("MaturityDate is required");
78
+ return serialization_1.ProtoSerializationUtil.deserialize(date);
79
+ }
80
+ getIssuerName() {
69
81
  return this.proto.getIssuerName();
70
- };
71
- Security.prototype.equals = function (other) {
82
+ }
83
+ equals(other) {
72
84
  if (other instanceof Security) {
73
85
  return this.getID().equals(other.getID());
74
86
  }
75
87
  else {
76
88
  return false;
77
89
  }
78
- };
79
- return Security;
80
- }());
90
+ }
91
+ }
81
92
  exports.default = Security;
82
93
  //# sourceMappingURL=security.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"security.js","sourceRoot":"","sources":["security.ts"],"names":[],"mappings":";;AAAA,yEAA0E;AAG1E,8CAAkD;AAClD,sCAAqC;AACrC,wDAAgE;AAEhE;IAGE,kBAAY,KAAoB;QAC9B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,2BAAQ,GAAR;QACE,OAAO,aAAM,IAAI,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,gBAAM,IAAI,CAAC,aAAa,EAAE,cAAI,IAAI,CAAC,aAAa,EAAE,MAAG,CAAC;IAC5F,CAAC;IAED,4BAAS,GAAT;QACE,OAAO,CAAC,qBAAU,CAAC,EAAE,EAAE,qBAAU,CAAC,WAAW,EAAE,qBAAU,CAAC,KAAK,EAAE,qBAAU,CAAC,WAAW,EAAE,qBAAU,CAAC,UAAU,CAAC,CAAC;IAClH,CAAC;IAED,2BAAQ,GAAR,UAAS,KAAiB;QACxB,QAAQ,KAAK,EAAE;YACb,KAAK,qBAAU,CAAC,EAAE,CAAC;YACnB,KAAK,qBAAU,CAAC,WAAW;gBACzB,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC;YACtB,KAAK,qBAAU,CAAC,KAAK;gBACnB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;YACxB,KAAK,qBAAU,CAAC,WAAW;gBACzB,OAAO,IAAI,CAAC,aAAa,EAAE,CAAC;YAC9B,KAAK,qBAAU,CAAC,aAAa;gBAC3B,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC;YAChC,KAAK,qBAAU,CAAC,YAAY;gBAC1B,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC;YAC/B,KAAK,qBAAU,CAAC,UAAU;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AC;IAChF,CAAC;IAED,aAAa;QACX,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;QAC9C,IAAI,CAAC,UAAU;YAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC3D,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,YAAY;QACV,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;QACvC,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;QACpD,OAAO,sCAAsB,CAAC,WAAW,CAAC,IAAI,CAAS,CAAC;IAC1D,CAAC;IAED,eAAe;QACb,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;QAC1C,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QACvD,OAAO,sCAAsB,CAAC,WAAW,CAAC,IAAI,CAAS,CAAC;IAC1D,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;IACpC,CAAC;IAED,MAAM,CAAC,KAAe;QACpB,IAAI,KAAK,YAAY,QAAQ,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;QAC5C,CAAC;aAAM,CAAC;YACN,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF;AAED,kBAAe,QAAQ,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,19 +1,22 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var local_date_pb_1 = require("../../../fintekkers/models/util/local_date_pb");
4
- var uuid_1 = require("../utils/uuid");
5
- var assert = require("assert");
6
- var security_1 = require("./security");
7
- var decimal_value_pb_1 = require("../../../fintekkers/models/util/decimal_value_pb");
8
- var security_pb_1 = require("../../../fintekkers/models/security/security_pb");
9
- var coupon_frequency_pb_1 = require("../../../fintekkers/models/security/coupon_frequency_pb");
10
- var coupon_type_pb_1 = require("../../../fintekkers/models/security/coupon_type_pb");
11
- var security_quantity_type_pb_1 = require("../../../fintekkers/models/security/security_quantity_type_pb");
12
- test('test the security wrapper', function () {
6
+ const local_date_pb_1 = require("../../../fintekkers/models/util/local_date_pb");
7
+ const uuid_1 = require("../utils/uuid");
8
+ const assert = require("assert");
9
+ const security_1 = __importDefault(require("./security"));
10
+ const decimal_value_pb_1 = require("../../../fintekkers/models/util/decimal_value_pb");
11
+ const security_pb_1 = require("../../../fintekkers/models/security/security_pb");
12
+ const coupon_frequency_pb_1 = require("../../../fintekkers/models/security/coupon_frequency_pb");
13
+ const coupon_type_pb_1 = require("../../../fintekkers/models/security/coupon_type_pb");
14
+ const security_quantity_type_pb_1 = require("../../../fintekkers/models/security/security_quantity_type_pb");
15
+ test('test the security wrapper', () => {
13
16
  testSerialization();
14
17
  });
15
18
  function testSerialization() {
16
- var security = dummySecurity();
19
+ const security = dummySecurity();
17
20
  assert(security.getMaturityDate().getFullYear() == 2026);
18
21
  }
19
22
  function dummySecurity() {
@@ -1 +1 @@
1
- {"version":3,"file":"security.test.js","sourceRoot":"","sources":["security.test.ts"],"names":[],"mappings":";;AAAA,+EAA+E;AAC/E,sCAAqC;AAErC,+BAAkC;AAClC,uCAAkC;AAElC,qFAAqF;AACrF,+EAAgF;AAChF,+FAA+F;AAC/F,qFAAqF;AACrF,2GAA0G;AAG1G,IAAI,CAAC,2BAA2B,EAAE;IAC9B,iBAAiB,EAAE,CAAC;AACxB,CAAC,CAAC,CAAC;AAEH,SAAS,iBAAiB;IACtB,IAAM,QAAQ,GAAG,aAAa,EAAE,CAAC;IAEjC,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC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AAS,iBAAiB;IACtB,MAAM,QAAQ,GAAG,aAAa,EAAE,CAAC;IAEjC,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,aAAa;IAClB,OAAO,IAAI,kBAAQ,CAAC,IAAI,2BAAa,EAAE;SAClC,cAAc,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,WAAI,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC;SACtF,YAAY,CAAC,IAAI,oCAAiB,EAAE,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC;SAC3E,eAAe,CAAC,qDAAyB,CAAC,mBAAmB,CAAC;SAC9D,aAAa,CAAC,MAAM,CAAC;SACrB,aAAa,CAAC,cAAc,CAAC;SAE7B,aAAa,CAAC,IAAI,oCAAiB,EAAE,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC;SACzE,kBAAkB,CAAC,0CAAoB,CAAC,YAAY,CAAC;SACrD,aAAa,CAAC,gCAAe,CAAC,KAAK,CAAC;SAEpC,eAAe,CAAC,IAAI,8BAAc,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACzE,YAAY,CAAC,IAAI,8BAAc,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACtE,cAAc,CAAC,gBAAgB,CAAC,CACpC,CAAC;AACN,CAAC"}
@@ -46,11 +46,15 @@ class Security {
46
46
  }
47
47
 
48
48
  getID(): UUID {
49
- return UUID.fromU8Array(this.proto.getUuid().getRawUuid_asU8());
49
+ const uuid = this.proto.getUuid();
50
+ if (!uuid) throw new Error("UUID is required");
51
+ return UUID.fromU8Array(uuid.getRawUuid_asU8());
50
52
  }
51
53
 
52
54
  getAsOf(): ZonedDateTime {
53
- return new ZonedDateTime(this.proto.getAsOf());
55
+ const asOf = this.proto.getAsOf();
56
+ if (!asOf) throw new Error("AsOf is required");
57
+ return new ZonedDateTime(asOf);
54
58
  }
55
59
 
56
60
  getAssetClass(): string {
@@ -66,18 +70,21 @@ class Security {
66
70
  }
67
71
 
68
72
  getSecurityID(): IdentifierProto {
69
- // const id: IdentifierProto = this.proto.identifier;
70
- return this.proto.getIdentifier(); // Assuming you've implemented the Identifier class
73
+ const identifier = this.proto.getIdentifier();
74
+ if (!identifier) throw new Error("Identifier is required");
75
+ return identifier;
71
76
  }
72
77
 
73
78
  getIssueDate(): Date {
74
79
  const date = this.proto.getIssueDate();
75
- return ProtoSerializationUtil.deserialize(this.proto.getIssueDate());
80
+ if (!date) throw new Error("IssueDate is required");
81
+ return ProtoSerializationUtil.deserialize(date) as Date;
76
82
  }
77
83
 
78
84
  getMaturityDate(): Date {
79
85
  const date = this.proto.getMaturityDate();
80
- return ProtoSerializationUtil.deserialize(this.proto.getMaturityDate());
86
+ if (!date) throw new Error("MaturityDate is required");
87
+ return ProtoSerializationUtil.deserialize(date) as Date;
81
88
  }
82
89
 
83
90
  getIssuerName(): string {
@@ -0,0 +1,36 @@
1
+ import { PriceProto } from "../../../fintekkers/models/price/price_pb";
2
+ import { TransactionType } from "./transaction_type";
3
+ import { StrategyAllocationProto } from "../../../fintekkers/models/strategy/strategy_allocation_pb";
4
+ import { TransactionProto } from "../../../fintekkers/models/transaction/transaction_pb";
5
+ import { FieldProto } from "../../../fintekkers/models/position/field_pb";
6
+ import { PositionStatusProto } from "../../../fintekkers/models/position/position_status_pb";
7
+ import Security from "../security/security";
8
+ import Portfolio from "../portfolio/portfolio";
9
+ import { ZonedDateTime } from "../utils/datetime";
10
+ import { UUID } from "../utils/uuid";
11
+ import { LocalDate } from "../utils/date";
12
+ import { Decimal } from "decimal.js";
13
+ declare class Transaction {
14
+ proto: TransactionProto;
15
+ constructor(proto: TransactionProto);
16
+ toString(): string;
17
+ getFields(): FieldProto[];
18
+ getField(field: FieldProto): any;
19
+ getID(): UUID;
20
+ getAsOf(): ZonedDateTime;
21
+ getPortfolio(): Portfolio;
22
+ getSecurity(): Security;
23
+ getStrategyAllocation(): StrategyAllocationProto;
24
+ getPrice(): PriceProto;
25
+ getQuantity(): Decimal;
26
+ getIssuerName(): string;
27
+ getDirectedQuantity(): Decimal;
28
+ getTradeDate(): LocalDate;
29
+ getSettlementDate(): LocalDate;
30
+ getTransactionType(): TransactionType;
31
+ getTradeName(): string;
32
+ getPositionStatus(): PositionStatusProto;
33
+ getChildrenTransactions(): TransactionProto[];
34
+ equals(other: Transaction): boolean;
35
+ }
36
+ export default Transaction;
@@ -1,37 +1,41 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var transaction_type_1 = require("./transaction_type");
4
- var field_pb_1 = require("../../../fintekkers/models/position/field_pb");
5
- var security_1 = require("../security/security");
6
- var portfolio_1 = require("../portfolio/portfolio");
6
+ const transaction_type_1 = require("./transaction_type");
7
+ const field_pb_1 = require("../../../fintekkers/models/position/field_pb");
8
+ const security_1 = __importDefault(require("../security/security"));
9
+ const portfolio_1 = __importDefault(require("../portfolio/portfolio"));
7
10
  //Model Utils
8
- var datetime_1 = require("../utils/datetime");
9
- var uuid_1 = require("../utils/uuid");
10
- var date_1 = require("../utils/date");
11
- var decimal_js_1 = require("decimal.js");
12
- var Transaction = /** @class */ (function () {
13
- function Transaction(proto) {
11
+ const datetime_1 = require("../utils/datetime");
12
+ const uuid_1 = require("../utils/uuid");
13
+ const date_1 = require("../utils/date");
14
+ const decimal_js_1 = require("decimal.js");
15
+ class Transaction {
16
+ constructor(proto) {
14
17
  this.proto = proto;
15
18
  }
16
- Transaction.prototype.toString = function () {
19
+ toString() {
20
+ var _a, _b, _c, _d, _e, _f;
17
21
  try {
18
- var validTo = this.proto.getValidTo() ? this.proto.getValidTo().toString() : "NULL";
19
- var validFrom = this.proto.getValidFrom() ? this.proto.getValidFrom().toString() : "NULL";
20
- var strategyAllocation = this.proto.getStrategyAllocation() ? this.getStrategyAllocation().toString() : "NULL";
21
- return "".concat(/*this.proto.isCancelled()*/ false ? "INVALIDATED: " : "", "TXN[").concat(this.getID().toString(), "], ") +
22
- "TradeDate[".concat(this.getTradeDate().toString(), "], TxnType[").concat(this.getTransactionType(), "], Price[").concat(this.getPrice(), "], Quantity[").concat(this.getQuantity(), "], ") +
23
- "AsOf[".concat(this.getAsOf().toString(), "], Portfolio[").concat(this.getPortfolio().getPortfolioName(), "], Issuer[").concat(this.getSecurity().getIssuerName(), "], ") +
24
- "ValidFrom[".concat(validFrom, "], ValidTo[").concat(validTo, "], Strategy[").concat(strategyAllocation, "]");
22
+ const validTo = (_b = (_a = this.proto.getValidTo()) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : "NULL";
23
+ const validFrom = (_d = (_c = this.proto.getValidFrom()) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : "NULL";
24
+ const strategyAllocation = (_f = (_e = this.proto.getStrategyAllocation()) === null || _e === void 0 ? void 0 : _e.toString()) !== null && _f !== void 0 ? _f : "NULL";
25
+ return `${ /*this.proto.isCancelled()*/false ? "INVALIDATED: " : ""}TXN[${this.getID().toString()}], ` +
26
+ `TradeDate[${this.getTradeDate().toString()}], TxnType[${this.getTransactionType()}], Price[${this.getPrice()}], Quantity[${this.getQuantity()}], ` +
27
+ `AsOf[${this.getAsOf().toString()}], Portfolio[${this.getPortfolio().getPortfolioName()}], Issuer[${this.getSecurity().getIssuerName()}], ` +
28
+ `ValidFrom[${validFrom}], ValidTo[${validTo}], Strategy[${strategyAllocation}]`;
25
29
  }
26
30
  catch (e) {
27
31
  console.error(e);
28
- return "Transaction toString() serialization failed: ".concat(e);
32
+ return `Transaction toString() serialization failed: ${e}`;
29
33
  }
30
- };
31
- Transaction.prototype.getFields = function () {
34
+ }
35
+ getFields() {
32
36
  return [field_pb_1.FieldProto.ID, field_pb_1.FieldProto.SECURITY_ID, field_pb_1.FieldProto.AS_OF, field_pb_1.FieldProto.ASSET_CLASS, field_pb_1.FieldProto.IDENTIFIER];
33
- };
34
- Transaction.prototype.getField = function (field) {
37
+ }
38
+ getField(field) {
35
39
  switch (field) {
36
40
  case field_pb_1.FieldProto.ID:
37
41
  case field_pb_1.FieldProto.SECURITY_ID:
@@ -52,63 +56,89 @@ var Transaction = /** @class */ (function () {
52
56
  case field_pb_1.FieldProto.MATURITY_DATE:
53
57
  throw new Error('Not implemented yet');
54
58
  default:
55
- throw new Error("Field not mapped in Security wrapper: ".concat(field));
59
+ throw new Error(`Field not mapped in Security wrapper: ${field}`);
56
60
  }
57
- };
58
- Transaction.prototype.getID = function () {
59
- return uuid_1.UUID.fromU8Array(this.proto.getUuid().getRawUuid_asU8());
60
- };
61
- Transaction.prototype.getAsOf = function () {
62
- return new datetime_1.ZonedDateTime(this.proto.getAsOf());
63
- };
64
- Transaction.prototype.getPortfolio = function () {
65
- return new portfolio_1.default(this.proto.getPortfolio());
66
- };
67
- Transaction.prototype.getSecurity = function () {
68
- return new security_1.default(this.proto.getSecurity());
69
- };
70
- Transaction.prototype.getStrategyAllocation = function () {
71
- return this.proto.getStrategyAllocation();
72
- };
73
- Transaction.prototype.getPrice = function () {
74
- return this.proto.getPrice();
75
- };
76
- Transaction.prototype.getQuantity = function () {
77
- return new decimal_js_1.Decimal(this.proto.getQuantity().getArbitraryPrecisionValue());
78
- };
79
- Transaction.prototype.getIssuerName = function () {
61
+ }
62
+ getID() {
63
+ const uuid = this.proto.getUuid();
64
+ if (!uuid)
65
+ throw new Error("UUID is required");
66
+ return uuid_1.UUID.fromU8Array(uuid.getRawUuid_asU8());
67
+ }
68
+ getAsOf() {
69
+ const asOf = this.proto.getAsOf();
70
+ if (!asOf)
71
+ throw new Error("AsOf is required");
72
+ return new datetime_1.ZonedDateTime(asOf);
73
+ }
74
+ getPortfolio() {
75
+ const portfolio = this.proto.getPortfolio();
76
+ if (!portfolio)
77
+ throw new Error("Portfolio is required");
78
+ return new portfolio_1.default(portfolio);
79
+ }
80
+ getSecurity() {
81
+ const security = this.proto.getSecurity();
82
+ if (!security)
83
+ throw new Error("Security is required");
84
+ return new security_1.default(security);
85
+ }
86
+ getStrategyAllocation() {
87
+ const allocation = this.proto.getStrategyAllocation();
88
+ if (!allocation)
89
+ throw new Error("StrategyAllocation is required");
90
+ return allocation;
91
+ }
92
+ getPrice() {
93
+ const price = this.proto.getPrice();
94
+ if (!price)
95
+ throw new Error("Price is required");
96
+ return price;
97
+ }
98
+ getQuantity() {
99
+ const quantity = this.proto.getQuantity();
100
+ if (!quantity)
101
+ throw new Error("Quantity is required");
102
+ return new decimal_js_1.Decimal(quantity.getArbitraryPrecisionValue());
103
+ }
104
+ getIssuerName() {
80
105
  return this.getSecurity().getIssuerName();
81
- };
82
- Transaction.prototype.getDirectedQuantity = function () {
106
+ }
107
+ getDirectedQuantity() {
83
108
  return this.getQuantity().mul(this.getTransactionType().getDirectionMultiplier());
84
- };
85
- Transaction.prototype.getTradeDate = function () {
86
- return new date_1.LocalDate(this.proto.getTradeDate());
87
- };
88
- Transaction.prototype.getSettlementDate = function () {
89
- return new date_1.LocalDate(this.proto.getSettlementDate());
90
- };
91
- Transaction.prototype.getTransactionType = function () {
109
+ }
110
+ getTradeDate() {
111
+ const tradeDate = this.proto.getTradeDate();
112
+ if (!tradeDate)
113
+ throw new Error("TradeDate is required");
114
+ return new date_1.LocalDate(tradeDate);
115
+ }
116
+ getSettlementDate() {
117
+ const settlementDate = this.proto.getSettlementDate();
118
+ if (!settlementDate)
119
+ throw new Error("SettlementDate is required");
120
+ return new date_1.LocalDate(settlementDate);
121
+ }
122
+ getTransactionType() {
92
123
  return new transaction_type_1.TransactionType(this.proto.getTransactionType());
93
- };
94
- Transaction.prototype.getTradeName = function () {
124
+ }
125
+ getTradeName() {
95
126
  return this.proto.getTradeName();
96
- };
97
- Transaction.prototype.getPositionStatus = function () {
127
+ }
128
+ getPositionStatus() {
98
129
  return this.proto.getPositionStatus();
99
- };
100
- Transaction.prototype.getChildrenTransactions = function () {
130
+ }
131
+ getChildrenTransactions() {
101
132
  return this.proto.getChildtransactionsList();
102
- };
103
- Transaction.prototype.equals = function (other) {
133
+ }
134
+ equals(other) {
104
135
  if (other instanceof Transaction) {
105
136
  return this.getID().equals(other.getID());
106
137
  }
107
138
  else {
108
139
  return false;
109
140
  }
110
- };
111
- return Transaction;
112
- }());
141
+ }
142
+ }
113
143
  exports.default = Transaction;
114
144
  //# sourceMappingURL=transaction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.js","sourceRoot":"","sources":["transaction.ts"],"names":[],"mappings":";;AAEA,uDAAqD;AAGrD,yEAA0E;AAG1E,iDAA4C;AAC5C,oDAA+C;AAE/C,aAAa;AACb,8CAAkD;AAClD,sCAAqC;AACrC,sCAA0C;AAC1C,yCAAqC;AAErC;IAGE,qBAAY,KAAuB;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,8BAAQ,GAAR;QACE,IAAI;YACF,IAAM,OAAO,GACX,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;YAExE,IAAM,SAAS,GACb,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;YAE5E,IAAM,kBAAkB,GACtB,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,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EAAE,CAAC;YACjC,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;QAC5C,CAAC;aAAM,CAAC;YACN,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF;AAED,kBAAe,WAAW,CAAC"}
@@ -1,17 +1,20 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- var local_date_pb_1 = require("../../../fintekkers/models/util/local_date_pb");
4
- var uuid_1 = require("../utils/uuid");
5
- var assert = require("assert");
6
- var transaction_1 = require("./transaction");
7
- var transaction_pb_1 = require("../../../fintekkers/models/transaction/transaction_pb");
8
- var transaction_type_pb_1 = require("../../../fintekkers/models/transaction/transaction_type_pb");
9
- var decimal_value_pb_1 = require("../../../fintekkers/models/util/decimal_value_pb");
10
- test('test the transaction wrapper', function () {
6
+ const local_date_pb_1 = require("../../../fintekkers/models/util/local_date_pb");
7
+ const uuid_1 = require("../utils/uuid");
8
+ const assert = require("assert");
9
+ const transaction_1 = __importDefault(require("./transaction"));
10
+ const transaction_pb_1 = require("../../../fintekkers/models/transaction/transaction_pb");
11
+ const transaction_type_pb_1 = require("../../../fintekkers/models/transaction/transaction_type_pb");
12
+ const decimal_value_pb_1 = require("../../../fintekkers/models/util/decimal_value_pb");
13
+ test('test the transaction wrapper', () => {
11
14
  testSerialization();
12
15
  });
13
16
  function testSerialization() {
14
- var transaction = dummyTransaction();
17
+ const transaction = dummyTransaction();
15
18
  assert(transaction.getTransactionType().toString() === 'BUY');
16
19
  assert(transaction.getDirectedQuantity().toNumber() > 0);
17
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.test.js","sourceRoot":"","sources":["transaction.test.ts"],"names":[],"mappings":";;AAAA,+EAA+E;AAC/E,sCAAqC;AAErC,+BAAkC;AAClC,6CAAw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