@fintekkers/ledger-models 0.1.60 → 0.1.62

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 (92) hide show
  1. package/babel.config.js +3 -1
  2. package/index.js +1 -15
  3. package/index.js.map +1 -1
  4. package/index.ts +1 -19
  5. package/jest.config.js +4 -0
  6. package/node/fintekkers/models/security/security_pb.test.js +29 -30
  7. package/node/fintekkers/models/security/security_pb.test.js.map +1 -0
  8. package/node/fintekkers/models/security/security_pb.test.ts +33 -0
  9. package/node/fintekkers/requests/transaction/query_transaction_request_pb.d.ts +3 -0
  10. package/node/fintekkers/requests/transaction/query_transaction_request_pb.js +31 -1
  11. package/node/fintekkers/requests/transaction/query_transaction_response_pb.d.ts +7 -0
  12. package/node/fintekkers/requests/transaction/query_transaction_response_pb.js +54 -1
  13. package/node/wrappers/models/position/position.js +14 -9
  14. package/node/wrappers/models/position/position.js.map +1 -1
  15. package/node/wrappers/models/position/position.test.js +43 -0
  16. package/node/wrappers/models/position/position.test.js.map +1 -0
  17. package/node/wrappers/models/position/position.test.ts +70 -0
  18. package/node/wrappers/models/position/position.ts +17 -10
  19. package/node/wrappers/models/security/security.js +1 -1
  20. package/node/wrappers/models/security/security.js.map +1 -1
  21. package/node/wrappers/models/security/security.ts +1 -1
  22. package/node/wrappers/models/transaction/transaction.js +12 -10
  23. package/node/wrappers/models/transaction/transaction.js.map +1 -1
  24. package/node/wrappers/models/transaction/transaction.test.js +26 -0
  25. package/node/wrappers/models/transaction/transaction.test.js.map +1 -0
  26. package/node/wrappers/models/transaction/transaction.test.ts +36 -0
  27. package/node/wrappers/models/transaction/transaction.ts +15 -13
  28. package/node/wrappers/models/transaction/transaction_type.js +44 -0
  29. package/node/wrappers/models/transaction/transaction_type.js.map +1 -0
  30. package/node/wrappers/models/transaction/transaction_type.ts +47 -0
  31. package/node/wrappers/models/utils/date.js +25 -0
  32. package/node/wrappers/models/utils/date.js.map +1 -0
  33. package/node/wrappers/models/utils/date.ts +31 -0
  34. package/node/wrappers/models/utils/datetime.js +4 -4
  35. package/node/wrappers/models/utils/datetime.js.map +1 -1
  36. package/node/wrappers/models/utils/datetime.ts +4 -4
  37. package/node/wrappers/models/utils/requestcontext.js +55 -0
  38. package/node/wrappers/models/utils/requestcontext.js.map +1 -0
  39. package/node/wrappers/models/utils/requestcontext.ts +44 -0
  40. package/node/wrappers/models/utils/requestcontext_d.js +1 -0
  41. package/node/wrappers/models/utils/requestcontext_d.js.map +1 -0
  42. package/node/wrappers/models/utils/requestcontext_d.ts +7 -0
  43. package/node/wrappers/models/utils/serialization.js +6 -4
  44. package/node/wrappers/models/utils/serialization.js.map +1 -1
  45. package/node/wrappers/models/utils/serialization.test.js +13 -54
  46. package/node/wrappers/models/utils/serialization.test.js.map +1 -1
  47. package/node/wrappers/models/utils/serialization.test.ts +12 -10
  48. package/node/wrappers/models/utils/serialization.ts +8 -8
  49. package/node/wrappers/models/utils/serialization.util.js +76 -0
  50. package/node/wrappers/models/utils/serialization.util.js.map +1 -0
  51. package/node/wrappers/models/utils/serialization.util.test.js +24 -0
  52. package/node/wrappers/models/utils/serialization.util.test.js.map +1 -0
  53. package/node/wrappers/models/utils/serialization.util.test.ts +29 -0
  54. package/node/wrappers/models/utils/serialization.util.ts +85 -0
  55. package/node/wrappers/services/portfolio-service/PortfolioService.js +5 -8
  56. package/node/wrappers/services/portfolio-service/PortfolioService.js.map +1 -1
  57. package/node/wrappers/services/portfolio-service/PortfolioService.ts +5 -6
  58. package/node/wrappers/{portfolio.test.js → services/portfolio-service/portfolio.test.js} +12 -11
  59. package/node/wrappers/services/portfolio-service/portfolio.test.js.map +1 -0
  60. package/node/wrappers/services/portfolio-service/portfolio.test.ts +40 -0
  61. package/node/wrappers/services/position-service/PositionService.js +4 -6
  62. package/node/wrappers/services/position-service/PositionService.js.map +1 -1
  63. package/node/wrappers/services/position-service/PositionService.ts +4 -22
  64. package/node/wrappers/{position.test.js → services/position-service/position.test.js} +28 -22
  65. package/node/wrappers/services/position-service/position.test.js.map +1 -0
  66. package/node/wrappers/{position.test.ts → services/position-service/position.test.ts} +25 -29
  67. package/node/wrappers/services/security-service/SecurityService.js +4 -8
  68. package/node/wrappers/services/security-service/SecurityService.js.map +1 -1
  69. package/node/wrappers/services/security-service/SecurityService.ts +3 -6
  70. package/node/wrappers/{security.test.js → services/security-service/security.test.js} +26 -19
  71. package/node/wrappers/services/security-service/security.test.js.map +1 -0
  72. package/node/wrappers/{security.test.ts → services/security-service/security.test.ts} +22 -20
  73. package/node/wrappers/services/transaction-service/TransactionService.js +40 -50
  74. package/node/wrappers/services/transaction-service/TransactionService.js.map +1 -1
  75. package/node/wrappers/services/transaction-service/TransactionService.ts +13 -15
  76. package/node/wrappers/{transaction.test.js → services/transaction-service/transaction.test.js} +41 -25
  77. package/node/wrappers/services/transaction-service/transaction.test.js.map +1 -0
  78. package/node/wrappers/services/transaction-service/transaction.test.ts +97 -0
  79. package/package.json +4 -2
  80. package/web/fintekkers/requests/transaction/query_transaction_request_pb.d.ts +4 -0
  81. package/web/fintekkers/requests/transaction/query_transaction_request_pb.js +31 -1
  82. package/web/fintekkers/requests/transaction/query_transaction_response_pb.d.ts +7 -0
  83. package/web/fintekkers/requests/transaction/query_transaction_response_pb.js +54 -1
  84. package/node/wrappers/models/utils/util.js +0 -28
  85. package/node/wrappers/models/utils/util.js.map +0 -1
  86. package/node/wrappers/models/utils/util.ts +0 -28
  87. package/node/wrappers/portfolio.test.js.map +0 -1
  88. package/node/wrappers/portfolio.test.ts +0 -36
  89. package/node/wrappers/position.test.js.map +0 -1
  90. package/node/wrappers/security.test.js.map +0 -1
  91. package/node/wrappers/transaction.test.js.map +0 -1
  92. package/node/wrappers/transaction.test.ts +0 -90
package/babel.config.js CHANGED
@@ -1,3 +1,5 @@
1
1
  module.exports = {
2
- presets: ['@babel/preset-env']
2
+ presets: ['@babel/preset-env',
3
+
4
+ '@babel/preset-typescript',]
3
5
  };
package/index.js CHANGED
@@ -1,16 +1,2 @@
1
- "use strict";
2
- // import { testPortfolio } from './node/wrappers/portfolio.test';
3
- // testPortfolio();
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- // import { testSecurity } from './node/wrappers/security.test';
6
- // testSecurity();
7
- // //TODO: Add position convenience wrapper
8
- // import { testPosition } from './node/wrappers/position.test';
9
- // testPosition();
10
- // import { testSerialization } from './node/wrappers/models/utils/serialization.test';
11
- // testSerialization();
12
- // TODO - Transactions
13
- var transaction_test_1 = require("./node/wrappers/transaction.test");
14
- (0, transaction_test_1.testTransaction)();
15
- // TODO - Positions
1
+ console.log('Done');
16
2
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,kEAAkE;AAClE,mBAAmB;;AAEnB,gEAAgE;AAChE,kBAAkB;AAElB,2CAA2C;AAC3C,gEAAgE;AAChE,kBAAkB;AAElB,uFAAuF;AACvF,uBAAuB;AAEvB,sBAAsB;AAEtB,qEAAmE;AACnE,IAAA,kCAAe,GAAE,CAAC;AAClB,mBAAmB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC"}
package/index.ts CHANGED
@@ -1,19 +1 @@
1
- // import { testPortfolio } from './node/wrappers/portfolio.test';
2
- // testPortfolio();
3
-
4
- // import { testSecurity } from './node/wrappers/security.test';
5
- // testSecurity();
6
-
7
- // //TODO: Add position convenience wrapper
8
- // import { testPosition } from './node/wrappers/position.test';
9
- // testPosition();
10
-
11
- // import { testSerialization } from './node/wrappers/models/utils/serialization.test';
12
- // testSerialization();
13
-
14
- // TODO - Transactions
15
-
16
- import { testTransaction } from './node/wrappers/transaction.test';
17
- testTransaction();
18
- // TODO - Positions
19
-
1
+ console.log('Done');
package/jest.config.js ADDED
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ preset: 'ts-jest',
3
+ testMatch: ["**/*.test.ts"]
4
+ };
@@ -1,32 +1,31 @@
1
- import jspb from 'google-protobuf';
2
- import fintekkers_models_util_decimal_value_pb from '../util/decimal_value_pb';
3
- import fintekkers_models_util_local_date_pb from '../util/local_date_pb';
4
- import fintekkers_models_util_local_timestamp_pb from '../util/local_timestamp_pb';
5
- import fintekkers_models_util_uuid_pb from '../util/uuid_pb';
6
- import fintekkers_models_security_identifier_identifier_pb from './identifier/identifier_pb';
7
- import fintekkers_models_security_security_type_pb from './security_type_pb';
8
- import fintekkers_models_security_security_pb from './security_pb';
9
- import fintekkers_models_security_security_quantity_type_pb from './security_quantity_type_pb';
10
- import fintekkers_models_security_coupon_frequency_pb from './coupon_frequency_pb';
11
- import fintekkers_models_security_coupon_type_pb from './coupon_type_pb';
12
-
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
13
3
  // Import or define the SecurityProto class
14
- import { SecurityProto } from './security_pb';
15
-
16
- test('create a security proto (from sue) object and test it can be read', () => {
17
- // Usage example
18
- const security = new SecurityProto();
19
-
20
- security.setObjectClass('SomeObjectClass');
21
- security.setVersion('1.0');
22
-
23
- // ... set other properties of the security object ...
24
-
25
- // Serialize the object to a binary representation
26
- const binaryData = security.serializeBinary();
27
-
28
- // Deserialize the binary data back to a SecurityProto object
29
- const deserializedSecurity = SecurityProto.deserializeBinary(binaryData);
30
-
31
- console.log(deserializedSecurity.toObject());
4
+ var decimal_value_pb_1 = require("../util/decimal_value_pb");
5
+ var local_date_pb_1 = require("../util/local_date_pb");
6
+ var coupon_frequency_pb_1 = require("./coupon_frequency_pb");
7
+ var coupon_type_pb_1 = require("./coupon_type_pb");
8
+ var security_pb_1 = require("./security_pb");
9
+ var security_type_pb_1 = require("./security_type_pb");
10
+ test('create a security proto (from sue) object and test it can be read', function () {
11
+ // Usage example
12
+ var security = new security_pb_1.SecurityProto();
13
+ security.setObjectClass('SomeObjectClass');
14
+ security.setVersion('1.0');
15
+ security.setAssetClass('FixedIncome');
16
+ security.setCouponFrequency(coupon_frequency_pb_1.CouponFrequencyProto.ANNUALLY);
17
+ security.setCouponRate(new decimal_value_pb_1.DecimalValueProto().setArbitraryPrecisionValue('0.05'));
18
+ security.setFaceValue(new decimal_value_pb_1.DecimalValueProto().setArbitraryPrecisionValue('1000.00'));
19
+ security.setIssueDate(new local_date_pb_1.LocalDateProto().setYear(2023).setMonth(1).setDay(1));
20
+ security.setDatedDate(new local_date_pb_1.LocalDateProto().setYear(2023).setMonth(1).setDay(1));
21
+ security.setMaturityDate(new local_date_pb_1.LocalDateProto().setYear(2023).setMonth(1).setDay(1));
22
+ security.setSecurityType(security_type_pb_1.SecurityTypeProto.BOND_SECURITY);
23
+ security.setCouponType(coupon_type_pb_1.CouponTypeProto.FIXED);
24
+ // Serialize the object to a binary representation
25
+ var binaryData = security.serializeBinary();
26
+ // Deserialize the binary data back to a SecurityProto object
27
+ var deserializedSecurity = security_pb_1.SecurityProto.deserializeBinary(binaryData);
28
+ // Test that the deserialized object is the same as the original
29
+ expect(deserializedSecurity.toObject()).toEqual(security.toObject());
32
30
  });
31
+ //# sourceMappingURL=security_pb.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"security_pb.test.js","sourceRoot":"","sources":["security_pb.test.ts"],"names":[],"mappings":";;AAAA,2CAA2C;AAC3C,6DAA6D;AAC7D,uDAAuD;AACvD,6DAA6D;AAC7D,mDAAmD;AACnD,6CAA8C;AAC9C,uDAAuD;AAEvD,IAAI,CAAC,mEAAmE,EAAE;IACxE,gBAAgB;IAChB,IAAM,QAAQ,GAAG,IAAI,2BAAa,EAAE,CAAC;IAErC,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAC3C,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAC3B,QAAQ,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;IACtC,QAAQ,CAAC,kBAAkB,CAAC,0CAAoB,CAAC,QAAQ,CAAC,CAAC;IAC3D,QAAQ,CAAC,aAAa,CAAC,IAAI,oCAAiB,EAAE,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAC;IACnF,QAAQ,CAAC,YAAY,CAAC,IAAI,oCAAiB,EAAE,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC,CAAC;IACrF,QAAQ,CAAC,YAAY,CAAC,IAAI,8BAAc,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,QAAQ,CAAC,YAAY,CAAC,IAAI,8BAAc,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,QAAQ,CAAC,eAAe,CAAC,IAAI,8BAAc,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACnF,QAAQ,CAAC,eAAe,CAAC,oCAAiB,CAAC,aAAa,CAAC,CAAC;IAC1D,QAAQ,CAAC,aAAa,CAAC,gCAAe,CAAC,KAAK,CAAC,CAAA;IAE7C,kDAAkD;IAClD,IAAM,UAAU,GAAG,QAAQ,CAAC,eAAe,EAAE,CAAC;IAE9C,6DAA6D;IAC7D,IAAM,oBAAoB,GAAG,2BAAa,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAEzE,gEAAgE;IAChE,MAAM,CAAC,oBAAoB,CAAC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;AACvE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,33 @@
1
+ // Import or define the SecurityProto class
2
+ import { DecimalValueProto } from '../util/decimal_value_pb';
3
+ import { LocalDateProto } from '../util/local_date_pb';
4
+ import { CouponFrequencyProto } from './coupon_frequency_pb';
5
+ import { CouponTypeProto } from './coupon_type_pb';
6
+ import { SecurityProto } from './security_pb';
7
+ import { SecurityTypeProto } from './security_type_pb';
8
+
9
+ test('create a security proto (from sue) object and test it can be read', () => {
10
+ // Usage example
11
+ const security = new SecurityProto();
12
+
13
+ security.setObjectClass('SomeObjectClass');
14
+ security.setVersion('1.0');
15
+ security.setAssetClass('FixedIncome');
16
+ security.setCouponFrequency(CouponFrequencyProto.ANNUALLY);
17
+ security.setCouponRate(new DecimalValueProto().setArbitraryPrecisionValue('0.05'));
18
+ security.setFaceValue(new DecimalValueProto().setArbitraryPrecisionValue('1000.00'));
19
+ security.setIssueDate(new LocalDateProto().setYear(2023).setMonth(1).setDay(1));
20
+ security.setDatedDate(new LocalDateProto().setYear(2023).setMonth(1).setDay(1));
21
+ security.setMaturityDate(new LocalDateProto().setYear(2023).setMonth(1).setDay(1));
22
+ security.setSecurityType(SecurityTypeProto.BOND_SECURITY);
23
+ security.setCouponType(CouponTypeProto.FIXED)
24
+
25
+ // Serialize the object to a binary representation
26
+ const binaryData = security.serializeBinary();
27
+
28
+ // Deserialize the binary data back to a SecurityProto object
29
+ const deserializedSecurity = SecurityProto.deserializeBinary(binaryData);
30
+
31
+ // Test that the deserialized object is the same as the original
32
+ expect(deserializedSecurity.toObject()).toEqual(security.toObject());
33
+ });
@@ -28,6 +28,8 @@ export class QueryTransactionRequestProto extends jspb.Message {
28
28
  clearAsOf(): void;
29
29
  getAsOf(): fintekkers_models_util_local_timestamp_pb.LocalTimestampProto | undefined;
30
30
  setAsOf(value?: fintekkers_models_util_local_timestamp_pb.LocalTimestampProto): QueryTransactionRequestProto;
31
+ getLimit(): number;
32
+ setLimit(value: number): QueryTransactionRequestProto;
31
33
 
32
34
  serializeBinary(): Uint8Array;
33
35
  toObject(includeInstance?: boolean): QueryTransactionRequestProto.AsObject;
@@ -46,5 +48,6 @@ export namespace QueryTransactionRequestProto {
46
48
  uuidsList: Array<fintekkers_models_util_uuid_pb.UUIDProto.AsObject>,
47
49
  searchTransactionInput?: fintekkers_models_position_position_filter_pb.PositionFilterProto.AsObject,
48
50
  asOf?: fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.AsObject,
51
+ limit: number,
49
52
  }
50
53
  }
@@ -93,7 +93,8 @@ proto.fintekkers.requests.transaction.QueryTransactionRequestProto.toObject = fu
93
93
  uuidsList: jspb.Message.toObjectList(msg.getUuidsList(),
94
94
  fintekkers_models_util_uuid_pb.UUIDProto.toObject, includeInstance),
95
95
  searchTransactionInput: (f = msg.getSearchTransactionInput()) && fintekkers_models_position_position_filter_pb.PositionFilterProto.toObject(includeInstance, f),
96
- asOf: (f = msg.getAsOf()) && fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.toObject(includeInstance, f)
96
+ asOf: (f = msg.getAsOf()) && fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.toObject(includeInstance, f),
97
+ limit: jspb.Message.getFieldWithDefault(msg, 24, 0)
97
98
  };
98
99
 
99
100
  if (includeInstance) {
@@ -153,6 +154,10 @@ proto.fintekkers.requests.transaction.QueryTransactionRequestProto.deserializeBi
153
154
  reader.readMessage(value,fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.deserializeBinaryFromReader);
154
155
  msg.setAsOf(value);
155
156
  break;
157
+ case 24:
158
+ var value = /** @type {number} */ (reader.readInt32());
159
+ msg.setLimit(value);
160
+ break;
156
161
  default:
157
162
  reader.skipField();
158
163
  break;
@@ -220,6 +225,13 @@ proto.fintekkers.requests.transaction.QueryTransactionRequestProto.serializeBina
220
225
  fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.serializeBinaryToWriter
221
226
  );
222
227
  }
228
+ f = message.getLimit();
229
+ if (f !== 0) {
230
+ writer.writeInt32(
231
+ 24,
232
+ f
233
+ );
234
+ }
223
235
  };
224
236
 
225
237
 
@@ -371,4 +383,22 @@ proto.fintekkers.requests.transaction.QueryTransactionRequestProto.prototype.has
371
383
  };
372
384
 
373
385
 
386
+ /**
387
+ * optional int32 limit = 24;
388
+ * @return {number}
389
+ */
390
+ proto.fintekkers.requests.transaction.QueryTransactionRequestProto.prototype.getLimit = function() {
391
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 24, 0));
392
+ };
393
+
394
+
395
+ /**
396
+ * @param {number} value
397
+ * @return {!proto.fintekkers.requests.transaction.QueryTransactionRequestProto} returns this
398
+ */
399
+ proto.fintekkers.requests.transaction.QueryTransactionRequestProto.prototype.setLimit = function(value) {
400
+ return jspb.Message.setProto3IntField(this, 24, value);
401
+ };
402
+
403
+
374
404
  goog.object.extend(exports, proto.fintekkers.requests.transaction);
@@ -7,6 +7,7 @@
7
7
  import * as jspb from "google-protobuf";
8
8
  import * as fintekkers_models_transaction_transaction_pb from "../../../fintekkers/models/transaction/transaction_pb";
9
9
  import * as fintekkers_requests_transaction_query_transaction_request_pb from "../../../fintekkers/requests/transaction/query_transaction_request_pb";
10
+ import * as fintekkers_requests_util_errors_summary_pb from "../../../fintekkers/requests/util/errors/summary_pb";
10
11
 
11
12
  export class QueryTransactionResponseProto extends jspb.Message {
12
13
  getObjectClass(): string;
@@ -23,6 +24,11 @@ export class QueryTransactionResponseProto extends jspb.Message {
23
24
  setTransactionResponseList(value: Array<fintekkers_models_transaction_transaction_pb.TransactionProto>): QueryTransactionResponseProto;
24
25
  addTransactionResponse(value?: fintekkers_models_transaction_transaction_pb.TransactionProto, index?: number): fintekkers_models_transaction_transaction_pb.TransactionProto;
25
26
 
27
+ hasErrorsOrWarnings(): boolean;
28
+ clearErrorsOrWarnings(): void;
29
+ getErrorsOrWarnings(): fintekkers_requests_util_errors_summary_pb.SummaryProto | undefined;
30
+ setErrorsOrWarnings(value?: fintekkers_requests_util_errors_summary_pb.SummaryProto): QueryTransactionResponseProto;
31
+
26
32
  serializeBinary(): Uint8Array;
27
33
  toObject(includeInstance?: boolean): QueryTransactionResponseProto.AsObject;
28
34
  static toObject(includeInstance: boolean, msg: QueryTransactionResponseProto): QueryTransactionResponseProto.AsObject;
@@ -39,5 +45,6 @@ export namespace QueryTransactionResponseProto {
39
45
  version: string,
40
46
  createTransactionRequest?: fintekkers_requests_transaction_query_transaction_request_pb.QueryTransactionRequestProto.AsObject,
41
47
  transactionResponseList: Array<fintekkers_models_transaction_transaction_pb.TransactionProto.AsObject>,
48
+ errorsOrWarnings?: fintekkers_requests_util_errors_summary_pb.SummaryProto.AsObject,
42
49
  }
43
50
  }
@@ -25,6 +25,8 @@ var fintekkers_models_transaction_transaction_pb = require('../../../fintekkers/
25
25
  goog.object.extend(proto, fintekkers_models_transaction_transaction_pb);
26
26
  var fintekkers_requests_transaction_query_transaction_request_pb = require('../../../fintekkers/requests/transaction/query_transaction_request_pb.js');
27
27
  goog.object.extend(proto, fintekkers_requests_transaction_query_transaction_request_pb);
28
+ var fintekkers_requests_util_errors_summary_pb = require('../../../fintekkers/requests/util/errors/summary_pb.js');
29
+ goog.object.extend(proto, fintekkers_requests_util_errors_summary_pb);
28
30
  goog.exportSymbol('proto.fintekkers.requests.transaction.QueryTransactionResponseProto', null, global);
29
31
  /**
30
32
  * Generated by JsPbCodeGenerator.
@@ -90,7 +92,8 @@ proto.fintekkers.requests.transaction.QueryTransactionResponseProto.toObject = f
90
92
  version: jspb.Message.getFieldWithDefault(msg, 2, ""),
91
93
  createTransactionRequest: (f = msg.getCreateTransactionRequest()) && fintekkers_requests_transaction_query_transaction_request_pb.QueryTransactionRequestProto.toObject(includeInstance, f),
92
94
  transactionResponseList: jspb.Message.toObjectList(msg.getTransactionResponseList(),
93
- fintekkers_models_transaction_transaction_pb.TransactionProto.toObject, includeInstance)
95
+ fintekkers_models_transaction_transaction_pb.TransactionProto.toObject, includeInstance),
96
+ errorsOrWarnings: (f = msg.getErrorsOrWarnings()) && fintekkers_requests_util_errors_summary_pb.SummaryProto.toObject(includeInstance, f)
94
97
  };
95
98
 
96
99
  if (includeInstance) {
@@ -145,6 +148,11 @@ proto.fintekkers.requests.transaction.QueryTransactionResponseProto.deserializeB
145
148
  reader.readMessage(value,fintekkers_models_transaction_transaction_pb.TransactionProto.deserializeBinaryFromReader);
146
149
  msg.addTransactionResponse(value);
147
150
  break;
151
+ case 40:
152
+ var value = new fintekkers_requests_util_errors_summary_pb.SummaryProto;
153
+ reader.readMessage(value,fintekkers_requests_util_errors_summary_pb.SummaryProto.deserializeBinaryFromReader);
154
+ msg.setErrorsOrWarnings(value);
155
+ break;
148
156
  default:
149
157
  reader.skipField();
150
158
  break;
@@ -204,6 +212,14 @@ proto.fintekkers.requests.transaction.QueryTransactionResponseProto.serializeBin
204
212
  fintekkers_models_transaction_transaction_pb.TransactionProto.serializeBinaryToWriter
205
213
  );
206
214
  }
215
+ f = message.getErrorsOrWarnings();
216
+ if (f != null) {
217
+ writer.writeMessage(
218
+ 40,
219
+ f,
220
+ fintekkers_requests_util_errors_summary_pb.SummaryProto.serializeBinaryToWriter
221
+ );
222
+ }
207
223
  };
208
224
 
209
225
 
@@ -318,4 +334,41 @@ proto.fintekkers.requests.transaction.QueryTransactionResponseProto.prototype.cl
318
334
  };
319
335
 
320
336
 
337
+ /**
338
+ * optional fintekkers.requests.util.errors.SummaryProto errors_or_warnings = 40;
339
+ * @return {?proto.fintekkers.requests.util.errors.SummaryProto}
340
+ */
341
+ proto.fintekkers.requests.transaction.QueryTransactionResponseProto.prototype.getErrorsOrWarnings = function() {
342
+ return /** @type{?proto.fintekkers.requests.util.errors.SummaryProto} */ (
343
+ jspb.Message.getWrapperField(this, fintekkers_requests_util_errors_summary_pb.SummaryProto, 40));
344
+ };
345
+
346
+
347
+ /**
348
+ * @param {?proto.fintekkers.requests.util.errors.SummaryProto|undefined} value
349
+ * @return {!proto.fintekkers.requests.transaction.QueryTransactionResponseProto} returns this
350
+ */
351
+ proto.fintekkers.requests.transaction.QueryTransactionResponseProto.prototype.setErrorsOrWarnings = function(value) {
352
+ return jspb.Message.setWrapperField(this, 40, value);
353
+ };
354
+
355
+
356
+ /**
357
+ * Clears the message field making it undefined.
358
+ * @return {!proto.fintekkers.requests.transaction.QueryTransactionResponseProto} returns this
359
+ */
360
+ proto.fintekkers.requests.transaction.QueryTransactionResponseProto.prototype.clearErrorsOrWarnings = function() {
361
+ return this.setErrorsOrWarnings(undefined);
362
+ };
363
+
364
+
365
+ /**
366
+ * Returns whether this field is set.
367
+ * @return {boolean}
368
+ */
369
+ proto.fintekkers.requests.transaction.QueryTransactionResponseProto.prototype.hasErrorsOrWarnings = function() {
370
+ return jspb.Message.getField(this, 40) != null;
371
+ };
372
+
373
+
321
374
  goog.object.extend(exports, proto.fintekkers.requests.transaction);
@@ -1,13 +1,18 @@
1
- // // Note: Some classes and functions have been omitted or simplified due to lack of context.
2
- // import { FieldProto } from "../../../fintekkers/models/position/field_pb";
3
- // import { PositionProto } from "../../../fintekkers/models/position/position_pb";
4
- // import { FieldMapEntry } from "../../../fintekkers/models/position/position_util_pb";
5
- // class Position {
6
- // positionProto: PositionProto;
7
- // constructor(positionProto: PositionProto) {
8
- // this.positionProto = positionProto;
9
- // }
1
+ "use strict";
2
+ // Note: Some classes and functions have been omitted or simplified due to lack of context.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ var Position = /** @class */ (function () {
5
+ function Position(positionProto) {
6
+ this.positionProto = positionProto;
7
+ //For each field, put into a map
8
+ this.positionProto.getFieldsList().forEach(function (field) {
9
+ console.log(field);
10
+ });
11
+ }
12
+ return Position;
13
+ }());
10
14
  // get_field_value(field: FieldProto): any {
15
+ // this.positionProto.getFieldsList()
11
16
  // return this.get_field(new FieldMapEntry({ field }));
12
17
  // }
13
18
  // get_field(field_to_get: FieldMapEntry): any {
@@ -1 +1 @@
1
- {"version":3,"file":"position.js","sourceRoot":"","sources":["position.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAE9F,6EAA6E;AAC7E,mFAAmF;AACnF,wFAAwF;AAExF,mBAAmB;AACnB,oCAAoC;AAEpC,kDAAkD;AAClD,4CAA4C;AAC5C,QAAQ;AAER,gDAAgD;AAChD,6DAA6D;AAC7D,QAAQ;AA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AACrD,wDAAwD;AACxD,yBAAyB;AACzB,kEAAkE;AAClE,oCAAoC;AACpC,yBAAyB;AACzB,UAAU;AAEV,6BAA6B;AAC7B,QAAQ;AAER,0DAA0D;AAC1D,kCAAkC;AAClC,qEAAqE;AACrE,uBAAuB;AACvB,QAAQ;AAER,mDAAmD;AACnD,uDAAuD;AACvD,oCAAoC;AACpC,sCAAsC;AACtC,yBAAyB;AACzB,UAAU;AACV,wCAAwC;AACxC,qBAAqB;AACrB,QAAQ;AAER,iEAAiE;AACjE,oGAAoG;AACpG,6EAA6E;AAC7E,gDAAgD;AAChD,QAAQ;AAER,iGAAiG;AACjG,MAAM;AAEN,kFAAkF;AAClF,iGAAiG;AACjG,wFAAwF;AACxF,iFAAiF;AACjF,4DAA4D"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var position_pb_1 = require("../../../fintekkers/models/position/position_pb");
4
+ var position_util_pb_1 = require("../../../fintekkers/models/position/position_util_pb");
5
+ var field_pb_1 = require("../../../fintekkers/models/position/field_pb");
6
+ test('test the position wrapper', function () {
7
+ testSerialization();
8
+ });
9
+ function testSerialization() {
10
+ var transaction = dummyPosition();
11
+ // assert(transaction.getTransactionType().toString() === 'BUY');
12
+ // assert(transaction.getDirectedQuantity().toNumber() > 0);
13
+ }
14
+ function pack() {
15
+ var message = new position_pb_1.PositionProto();
16
+ // Create a value of any type (in this case, a string)
17
+ // const stringValue = "Hello, Any!";
18
+ // const anyValue = new Any();
19
+ // anyValue.pack(stringValue, "type.googleapis.com/google.protobuf.StringValue");
20
+ // message.setValue(anyValue);
21
+ // // Serialize the message to a binary buffer
22
+ // const serialized = message.serializeBinary();
23
+ // // Deserialize the binary buffer
24
+ // const deserializedMessage = PositionProto.deserializeBinary(serialized);
25
+ // const deserializedValue = deserializedMessage.getFieldsList()[0];
26
+ // if (deserializedValue.is(string)) {
27
+ // const unpackedValue = deserializedValue.unpack(StringValue.deserializeBinary);
28
+ // console.log(unpackedValue.getValue()); // Output: Hello, Any!
29
+ // }
30
+ }
31
+ function dummyPosition() {
32
+ var field = new position_util_pb_1.FieldMapEntry()
33
+ .setField(field_pb_1.FieldProto.TRANSACTION_TYPE);
34
+ // .setFieldValuePacked
35
+ return new position_pb_1.PositionProto();
36
+ // new TransactionProto()
37
+ // .setObjectClass('Transaction').setVersion('0.0.1').setUuid(UUID.random().toUUIDProto())
38
+ // .setTradeDate(new LocalDateProto().setYear(2021).setMonth(1).setDay(1))
39
+ // .setTransactionType(TransactionTypeProto.BUY)
40
+ // .setQuantity(new DecimalValueProto().setArbitraryPrecisionValue('1000.00'))
41
+ // .setSettlementDate(new LocalDateProto().setYear(2021).setMonth(1).setDay(1)));
42
+ }
43
+ //# sourceMappingURL=position.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position.test.js","sourceRoot":"","sources":["position.test.ts"],"names":[],"mappings":";;AAcA,+EAAgF;AAChF,yFAAqF;AACrF,yEAA0E;AAI1E,IAAI,CAAC,2BAA2B,EAAE;IAC9B,iBAAiB,EAAE,CAAC;AACtB,CAAC,CAAC,CAAC;AAEL,SAAS,iBAAiB;IACtB,IAAM,WAAW,GAAG,aAAa,EAAE,CAAC;IAEpC,iEAAiE;IACjE,4DAA4D;AAChE,CAAC;AAED,SAAS,IAAI;IACT,IAAM,OAAO,GAAG,IAAI,2BAAa,EAAE,CAAC;IAEpC,sDAAsD;IACtD,qCAAqC;IACrC,8BAA8B;IAC9B,iFAAiF;IAEjF,8BAA8B;IAE9B,8CAA8C;IAC9C,gDAAgD;IAEhD,mCAAmC;IACnC,2EAA2E;IAC3E,oEAAoE;IAEpE,sCAAsC;IACtC,iFAAiF;IACjF,gEAAgE;IAChE,IAAI;AAER,CAAC;AAED,SAAS,aAAa;IAClB,IAAI,KAAK,GAAG,IAAI,gCAAa,EAAE;SAC1B,QAAQ,CAAC,qBAAU,CAAC,gBAAgB,CAAC,CAAC;IACvC,uBAAuB;IAE3B,OAAO,IAAI,2BAAa,EAAE,CAAC;IAE3B,yBAAyB;IACzB,0FAA0F;IAC1F,0EAA0E;IAC1E,gDAAgD;IAChD,8EAA8E;IAC9E,iFAAiF;AACrF,CAAC"}
@@ -0,0 +1,70 @@
1
+ import { LocalDateProto } from '../../../fintekkers/models/util/local_date_pb';
2
+ import { UUIDProto } from '../../../fintekkers/models/util/uuid_pb';
3
+ import { ProtoSerializationUtil } from '../utils/serialization';
4
+ import { UUID } from '../utils/uuid';
5
+
6
+ import assert = require('assert');
7
+ import Transaction from '../transaction/transaction';
8
+ import { TransactionProto } from '../../../fintekkers/models/transaction/transaction_pb';
9
+ import { TransactionTypeProto } from '../../../fintekkers/models/transaction/transaction_type_pb';
10
+ import { LocalTimestampProto } from '../../../fintekkers/models/util/local_timestamp_pb';
11
+
12
+ import { Timestamp } from '@grpc/grpc-js/build/src/generated/google/protobuf/Timestamp';
13
+ import { DecimalValueProto } from '../../../fintekkers/models/util/decimal_value_pb';
14
+ import { PriceProto } from '../../../fintekkers/models/price/price_pb';
15
+ import { PositionProto } from '../../../fintekkers/models/position/position_pb';
16
+ import { FieldMapEntry } from '../../../fintekkers/models/position/position_util_pb';
17
+ import { FieldProto } from '../../../fintekkers/models/position/field_pb';
18
+
19
+
20
+
21
+ test('test the position wrapper', () => {
22
+ testSerialization();
23
+ });
24
+
25
+ function testSerialization(): void {
26
+ const transaction = dummyPosition();
27
+
28
+ // assert(transaction.getTransactionType().toString() === 'BUY');
29
+ // assert(transaction.getDirectedQuantity().toNumber() > 0);
30
+ }
31
+
32
+ function pack() {
33
+ const message = new PositionProto();
34
+
35
+ // Create a value of any type (in this case, a string)
36
+ // const stringValue = "Hello, Any!";
37
+ // const anyValue = new Any();
38
+ // anyValue.pack(stringValue, "type.googleapis.com/google.protobuf.StringValue");
39
+
40
+ // message.setValue(anyValue);
41
+
42
+ // // Serialize the message to a binary buffer
43
+ // const serialized = message.serializeBinary();
44
+
45
+ // // Deserialize the binary buffer
46
+ // const deserializedMessage = PositionProto.deserializeBinary(serialized);
47
+ // const deserializedValue = deserializedMessage.getFieldsList()[0];
48
+
49
+ // if (deserializedValue.is(string)) {
50
+ // const unpackedValue = deserializedValue.unpack(StringValue.deserializeBinary);
51
+ // console.log(unpackedValue.getValue()); // Output: Hello, Any!
52
+ // }
53
+
54
+ }
55
+
56
+ function dummyPosition() {
57
+ let field = new FieldMapEntry()
58
+ .setField(FieldProto.TRANSACTION_TYPE);
59
+ // .setFieldValuePacked
60
+
61
+ return new PositionProto();
62
+
63
+ // new TransactionProto()
64
+ // .setObjectClass('Transaction').setVersion('0.0.1').setUuid(UUID.random().toUUIDProto())
65
+ // .setTradeDate(new LocalDateProto().setYear(2021).setMonth(1).setDay(1))
66
+ // .setTransactionType(TransactionTypeProto.BUY)
67
+ // .setQuantity(new DecimalValueProto().setArbitraryPrecisionValue('1000.00'))
68
+ // .setSettlementDate(new LocalDateProto().setYear(2021).setMonth(1).setDay(1)));
69
+ }
70
+
@@ -1,17 +1,24 @@
1
- // // Note: Some classes and functions have been omitted or simplified due to lack of context.
1
+ // Note: Some classes and functions have been omitted or simplified due to lack of context.
2
2
 
3
- // import { FieldProto } from "../../../fintekkers/models/position/field_pb";
4
- // import { PositionProto } from "../../../fintekkers/models/position/position_pb";
5
- // import { FieldMapEntry } from "../../../fintekkers/models/position/position_util_pb";
3
+ import { FieldProto } from "../../../fintekkers/models/position/field_pb";
4
+ import { PositionProto } from "../../../fintekkers/models/position/position_pb";
5
+ import { FieldMapEntry } from "../../../fintekkers/models/position/position_util_pb";
6
6
 
7
- // class Position {
8
- // positionProto: PositionProto;
9
-
10
- // constructor(positionProto: PositionProto) {
11
- // this.positionProto = positionProto;
12
- // }
7
+ class Position {
8
+ positionProto: PositionProto;
13
9
 
10
+ constructor(positionProto: PositionProto) {
11
+ this.positionProto = positionProto;
12
+
13
+ //For each field, put into a map
14
+ this.positionProto.getFieldsList().forEach(field => {
15
+ console.log(field);
16
+ });
17
+
18
+ }
19
+ }
14
20
  // get_field_value(field: FieldProto): any {
21
+ // this.positionProto.getFieldsList()
15
22
  // return this.get_field(new FieldMapEntry({ field }));
16
23
  // }
17
24
 
@@ -69,7 +69,7 @@ var Security = /** @class */ (function () {
69
69
  };
70
70
  Security.prototype.equals = function (other) {
71
71
  if (other instanceof Security) {
72
- return this.get_id().equals(other.get_id());
72
+ return this.getID().equals(other.getID());
73
73
  }
74
74
  else {
75
75
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"security.js","sourceRoot":"","sources":["security.ts"],"names":[],"mappings":";;AAAA,yEAA0E;AAG1E,8CAAkD;AAClD,sCAAqC;AAErC;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;gBA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OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC,CAAC,mDAAmD;IACxF,CAAC;IAED,+BAAY,GAAZ;QACE,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;QACvC,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,kCAAe,GAAf;QACE,IAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC;QAC1C,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,gCAAa,GAAb;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;IACpC,CAAC;IAED,yBAAM,GAAN,UAAO,KAAe;QACpB,IAAI,KAAK,YAAY,QAAQ,EAAE;YAC7B,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;SAC3C;aAAM;YACL,OAAO,KAAK,CAAC;SACd;IACH,CAAC;IACH,eAAC;AAAD,CAAC,AAtFD,IAsFC;AAED,kBAAe,QAAQ,CAAC"}
@@ -85,7 +85,7 @@ class Security {
85
85
 
86
86
  equals(other: Security): boolean {
87
87
  if (other instanceof Security) {
88
- return this.get_id().equals(other.get_id());
88
+ return this.getID().equals(other.getID());
89
89
  } else {
90
90
  return false;
91
91
  }
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var field_pb_1 = require("../../../fintekkers/models/position/field_pb");
4
+ var transaction_type_1 = require("./transaction_type");
4
5
  var security_1 = require("../security/security");
5
6
  var datetime_1 = require("../utils/datetime");
6
7
  var uuid_1 = require("../utils/uuid");
8
+ var date_1 = require("../utils/date");
7
9
  var decimal_js_1 = require("decimal.js");
8
10
  var Transaction = /** @class */ (function () {
9
11
  function Transaction(proto) {
@@ -22,10 +24,10 @@ var Transaction = /** @class */ (function () {
22
24
  return "WHOOPS";
23
25
  }
24
26
  };
25
- Transaction.prototype.get_fields = function () {
27
+ Transaction.prototype.getFields = function () {
26
28
  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];
27
29
  };
28
- Transaction.prototype.get_field = function (field) {
30
+ Transaction.prototype.getField = function (field) {
29
31
  switch (field) {
30
32
  case field_pb_1.FieldProto.ID:
31
33
  case field_pb_1.FieldProto.SECURITY_ID:
@@ -68,23 +70,23 @@ var Transaction = /** @class */ (function () {
68
70
  Transaction.prototype.getPrice = function () {
69
71
  return this.proto.getPrice();
70
72
  };
71
- Transaction.prototype.getSettlementDate = function () {
72
- return this.proto.getSettlementDate();
73
- };
74
73
  Transaction.prototype.getQuantity = function () {
75
74
  return new decimal_js_1.Decimal(this.proto.getQuantity().getArbitraryPrecisionValue());
76
75
  };
77
76
  Transaction.prototype.getIssuerName = function () {
78
77
  return this.getSecurity().getIssuerName();
79
78
  };
80
- // public BigDecimal getDirectedQuantity() {
81
- // return quantity.multiply(transactionType.getDirectionMultiplier());
82
- // }
79
+ Transaction.prototype.getDirectedQuantity = function () {
80
+ return this.getQuantity().mul(this.getTransactionType().getDirectionMultiplier());
81
+ };
83
82
  Transaction.prototype.getTradeDate = function () {
84
- return this.proto.getTradeDate();
83
+ return new date_1.LocalDate(this.proto.getTradeDate());
84
+ };
85
+ Transaction.prototype.getSettlementDate = function () {
86
+ return new date_1.LocalDate(this.proto.getSettlementDate());
85
87
  };
86
88
  Transaction.prototype.getTransactionType = function () {
87
- return this.getTransactionType();
89
+ return new transaction_type_1.TransactionType(this.proto.getTransactionType());
88
90
  };
89
91
  Transaction.prototype.getTradeName = function () {
90
92
  return this.proto.getTradeName();