@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.
- package/node/fintekkers/models/portfolio/portfolio_grpc_pb.js +1 -0
- package/node/fintekkers/models/position/field_grpc_pb.js +1 -0
- package/node/fintekkers/models/position/measure_grpc_pb.js +1 -0
- package/node/fintekkers/models/position/position_filter_grpc_pb.js +1 -0
- package/node/fintekkers/models/position/position_grpc_pb.js +1 -0
- package/node/fintekkers/models/position/position_status_grpc_pb.js +1 -0
- package/node/fintekkers/models/position/position_util_grpc_pb.js +1 -0
- package/node/fintekkers/models/price/price_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/bond/auction_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/bond/issuance_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/coupon_frequency_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/coupon_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/identifier/identifier_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/identifier/identifier_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/security_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/security_pb.test.d.ts +1 -0
- package/node/fintekkers/models/security/security_pb.test.js +10 -10
- package/node/fintekkers/models/security/security_pb.test.js.map +1 -1
- package/node/fintekkers/models/security/security_quantity_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/security_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/tenor_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/tenor_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/strategy/strategy_allocation_grpc_pb.js +1 -0
- package/node/fintekkers/models/strategy/strategy_grpc_pb.js +1 -0
- package/node/fintekkers/models/transaction/transaction_grpc_pb.js +1 -0
- package/node/fintekkers/models/transaction/transaction_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/api/api_key_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/date_range_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/date_range_pb.d.ts +43 -0
- package/node/fintekkers/models/util/date_range_pb.js +310 -0
- package/node/fintekkers/models/util/decimal_value_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/endpoint_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/local_date_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/local_timestamp_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/lock/node_partition_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/lock/node_state_grpc_pb.js +1 -0
- package/node/fintekkers/models/util/uuid_grpc_pb.js +1 -0
- package/node/fintekkers/requests/portfolio/create_portfolio_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/portfolio/create_portfolio_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/portfolio/query_portfolio_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/portfolio/query_portfolio_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/position/query_position_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/position/query_position_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/price/create_price_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/price/create_price_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/price/query_price_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/price/query_price_request_pb.d.ts +47 -0
- package/node/fintekkers/requests/price/query_price_request_pb.js +190 -2
- package/node/fintekkers/requests/price/query_price_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/security/create_security_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/security/create_security_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/security/get_field_values_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/security/get_field_values_request_pb.js +238 -0
- package/node/fintekkers/requests/security/get_field_values_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/security/get_field_values_response_pb.js +268 -0
- package/node/fintekkers/requests/security/get_fields_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/security/get_fields_response_pb.js +266 -0
- package/node/fintekkers/requests/security/query_security_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/security/query_security_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/transaction/create_transaction_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/transaction/create_transaction_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/transaction/query_transaction_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/transaction/query_transaction_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/util/errors/error_grpc_pb.js +1 -0
- package/node/fintekkers/requests/util/errors/message_grpc_pb.js +1 -0
- package/node/fintekkers/requests/util/errors/summary_grpc_pb.js +1 -0
- package/node/fintekkers/requests/util/lock/lock_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/util/lock/lock_request_pb.js +54 -1
- package/node/fintekkers/requests/util/lock/lock_response_grpc_pb.js +1 -0
- package/node/fintekkers/requests/util/operation_grpc_pb.js +1 -0
- package/node/fintekkers/requests/valuation/valuation_request_grpc_pb.js +1 -0
- package/node/fintekkers/requests/valuation/valuation_response_grpc_pb.js +1 -0
- package/node/wrappers/models/portfolio/portfolio.d.ts +15 -0
- package/node/wrappers/models/portfolio/portfolio.js +26 -21
- package/node/wrappers/models/portfolio/portfolio.js.map +1 -1
- package/node/wrappers/models/portfolio/portfolio.ts +6 -2
- package/node/wrappers/models/position/field.d.ts +7 -0
- package/node/wrappers/models/position/field.js +10 -14
- package/node/wrappers/models/position/field.js.map +1 -1
- package/node/wrappers/models/position/field.test.d.ts +1 -0
- package/node/wrappers/models/position/field.test.js +10 -48
- package/node/wrappers/models/position/field.test.js.map +1 -1
- package/node/wrappers/models/position/field.ts +1 -2
- package/node/wrappers/models/position/position.d.ts +32 -0
- package/node/wrappers/models/position/position.js +89 -83
- package/node/wrappers/models/position/position.js.map +1 -1
- package/node/wrappers/models/position/position.test.d.ts +1 -0
- package/node/wrappers/models/position/position.test.js +128 -198
- package/node/wrappers/models/position/position.test.js.map +1 -1
- package/node/wrappers/models/position/position.test.ts +1 -1
- package/node/wrappers/models/position/position.ts +19 -12
- package/node/wrappers/models/position/positionfilter.d.ts +24 -0
- package/node/wrappers/models/position/positionfilter.js +19 -20
- package/node/wrappers/models/position/positionfilter.js.map +1 -1
- package/node/wrappers/models/position/positionfilter.ts +1 -1
- package/node/wrappers/models/security/security.d.ts +23 -0
- package/node/wrappers/models/security/security.js +55 -44
- package/node/wrappers/models/security/security.js.map +1 -1
- package/node/wrappers/models/security/security.test.d.ts +1 -0
- package/node/wrappers/models/security/security.test.js +14 -11
- package/node/wrappers/models/security/security.test.js.map +1 -1
- package/node/wrappers/models/security/security.ts +13 -6
- package/node/wrappers/models/transaction/transaction.d.ts +36 -0
- package/node/wrappers/models/transaction/transaction.js +98 -68
- package/node/wrappers/models/transaction/transaction.js.map +1 -1
- package/node/wrappers/models/transaction/transaction.test.d.ts +1 -0
- package/node/wrappers/models/transaction/transaction.test.js +12 -9
- package/node/wrappers/models/transaction/transaction.test.js.map +1 -1
- package/node/wrappers/models/transaction/transaction.ts +30 -12
- package/node/wrappers/models/transaction/transaction_type.d.ts +17 -0
- package/node/wrappers/models/transaction/transaction_type.js +12 -12
- package/node/wrappers/models/transaction/transaction_type.js.map +1 -1
- package/node/wrappers/models/transaction/transaction_type.ts +5 -5
- package/node/wrappers/models/utils/date.d.ts +11 -0
- package/node/wrappers/models/utils/date.js +16 -17
- package/node/wrappers/models/utils/date.js.map +1 -1
- package/node/wrappers/models/utils/date.test.d.ts +1 -0
- package/node/wrappers/models/utils/date.test.js +28 -58
- package/node/wrappers/models/utils/date.test.js.map +1 -1
- package/node/wrappers/models/utils/date.ts +1 -1
- package/node/wrappers/models/utils/datetime.d.ts +14 -0
- package/node/wrappers/models/utils/datetime.js +41 -34
- package/node/wrappers/models/utils/datetime.js.map +1 -1
- package/node/wrappers/models/utils/datetime.test.d.ts +1 -0
- package/node/wrappers/models/utils/datetime.test.js +40 -70
- package/node/wrappers/models/utils/datetime.test.js.map +1 -1
- package/node/wrappers/models/utils/datetime.ts +13 -8
- package/node/wrappers/models/utils/protoEnum.d.ts +12 -0
- package/node/wrappers/models/utils/protoEnum.js +22 -24
- package/node/wrappers/models/utils/protoEnum.js.map +1 -1
- package/node/wrappers/models/utils/protoEnum.test.d.ts +1 -0
- package/node/wrappers/models/utils/protoEnum.test.js +13 -13
- package/node/wrappers/models/utils/protoEnum.test.js.map +1 -1
- package/node/wrappers/models/utils/requestcontext.d.ts +13 -0
- package/node/wrappers/models/utils/requestcontext.js +52 -44
- package/node/wrappers/models/utils/requestcontext.js.map +1 -1
- package/node/wrappers/models/utils/requestcontext.ts +15 -15
- package/node/wrappers/models/utils/requestcontext_d.d.ts +6 -0
- package/node/wrappers/models/utils/requestcontext_d.js +1 -0
- package/node/wrappers/models/utils/serialization.d.ts +12 -0
- package/node/wrappers/models/utils/serialization.js +19 -22
- package/node/wrappers/models/utils/serialization.js.map +1 -1
- package/node/wrappers/models/utils/serialization.test.d.ts +1 -0
- package/node/wrappers/models/utils/serialization.test.js +14 -14
- package/node/wrappers/models/utils/serialization.test.js.map +1 -1
- package/node/wrappers/models/utils/serialization.ts +1 -1
- package/node/wrappers/models/utils/serialization.util.d.ts +4 -0
- package/node/wrappers/models/utils/serialization.util.js +25 -25
- package/node/wrappers/models/utils/serialization.util.js.map +1 -1
- package/node/wrappers/models/utils/serialization.util.test.d.ts +1 -0
- package/node/wrappers/models/utils/serialization.util.test.js +15 -15
- package/node/wrappers/models/utils/serialization.util.test.js.map +1 -1
- package/node/wrappers/models/utils/serialization.util.ts +5 -5
- package/node/wrappers/models/utils/uuid.d.ts +13 -0
- package/node/wrappers/models/utils/uuid.js +53 -31
- package/node/wrappers/models/utils/uuid.js.map +1 -1
- package/node/wrappers/models/utils/uuid.test.d.ts +1 -0
- package/node/wrappers/models/utils/uuid.test.js +7 -7
- package/node/wrappers/models/utils/uuid.test.js.map +1 -1
- package/node/wrappers/models/utils/uuid.ts +1 -1
- package/node/wrappers/requests/position/QueryPositionRequest.d.ts +19 -0
- package/node/wrappers/requests/position/QueryPositionRequest.js +19 -20
- package/node/wrappers/requests/position/QueryPositionRequest.js.map +1 -1
- package/node/wrappers/services/portfolio-service/PortfolioService.d.ts +15 -0
- package/node/wrappers/services/portfolio-service/PortfolioService.js +58 -109
- package/node/wrappers/services/portfolio-service/PortfolioService.js.map +1 -1
- package/node/wrappers/services/portfolio-service/PortfolioService.ts +2 -2
- package/node/wrappers/services/portfolio-service/portfolioService.test.d.ts +1 -0
- package/node/wrappers/services/portfolio-service/portfolioService.test.js +47 -64
- package/node/wrappers/services/portfolio-service/portfolioService.test.js.map +1 -1
- package/node/wrappers/services/position-service/PositionService.d.ts +10 -0
- package/node/wrappers/services/position-service/PositionService.js +45 -83
- package/node/wrappers/services/position-service/PositionService.js.map +1 -1
- package/node/wrappers/services/position-service/position.test.d.ts +1 -0
- package/node/wrappers/services/position-service/position.test.js +52 -118
- package/node/wrappers/services/position-service/position.test.js.map +1 -1
- package/node/wrappers/services/position-service/position.test.ts +7 -1
- package/node/wrappers/services/security-service/SecurityService.d.ts +15 -0
- package/node/wrappers/services/security-service/SecurityService.js +86 -117
- package/node/wrappers/services/security-service/SecurityService.js.map +1 -1
- package/node/wrappers/services/security-service/SecurityService.ts +2 -2
- package/node/wrappers/services/security-service/security.maturityLadder.test.d.ts +1 -0
- package/node/wrappers/services/security-service/security.maturityLadder.test.js +40 -75
- package/node/wrappers/services/security-service/security.maturityLadder.test.js.map +1 -1
- package/node/wrappers/services/security-service/security.maturityLadder.test.ts +1 -1
- package/node/wrappers/services/security-service/security.test.d.ts +1 -0
- package/node/wrappers/services/security-service/security.test.js +88 -114
- package/node/wrappers/services/security-service/security.test.js.map +1 -1
- package/node/wrappers/services/security-service/security.test.ts +2 -2
- package/node/wrappers/services/transaction-service/TransactionService.d.ts +13 -0
- package/node/wrappers/services/transaction-service/TransactionService.js +53 -98
- package/node/wrappers/services/transaction-service/TransactionService.js.map +1 -1
- package/node/wrappers/services/transaction-service/TransactionService.ts +2 -2
- package/node/wrappers/services/transaction-service/transaction.search.test.d.ts +1 -0
- package/node/wrappers/services/transaction-service/transaction.search.test.js +51 -70
- package/node/wrappers/services/transaction-service/transaction.search.test.js.map +1 -1
- package/node/wrappers/services/transaction-service/transaction.test.d.ts +1 -0
- package/node/wrappers/services/transaction-service/transaction.test.js +127 -171
- package/node/wrappers/services/transaction-service/transaction.test.js.map +1 -1
- package/node/wrappers/services/transaction-service/transaction.test.ts +3 -1
- package/package.json +4 -1
- package/tsconfig.json +15 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"positionfilter.js","sourceRoot":"","sources":["positionfilter.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"positionfilter.js","sourceRoot":"","sources":["positionfilter.ts"],"names":[],"mappings":";;;AAAA,2FAA6G;AAE7G,oEAAmD;AACnD,+FAA6F;AAE7F,MAAa,cAAc;IAGvB;QACI,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,qBAAqB,CAAC,KAAiB,EAAE,gBAAwB;QAC7D,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,yCAAsB,CAAC,MAAM,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC;IACxF,CAAC;IAED;;;OAGG;IACH,eAAe,CAAC,KAAiB,EAAE,UAAe;QAC9C,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,UAAoB,CAAC,CAAC;QACnE,CAAC;aAAM,CAAC;YACJ,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,yCAAsB,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QACvF,CAAC;IACL,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,KAAiB,EAAE,QAAgC,EAAE,UAAgB,EAAE,gBAAyB;QACtG,MAAM,aAAa,GAAG,IAAI,gCAAa,EAAE,CAAC;QAC1C,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,0BAA0B;QACzD,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAEpC,IAAI,gBAAgB;YAChB,aAAa,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;aAC9C,IAAI,UAAU,EAAE,CAAC;YAClB,aAAa,CAAC,mBAAmB,CAAC,IAAA,yBAAI,EAAC,UAAU,CAAC,CAAC,CAAC;QACxD,CAAC;aAAM,CAAC;YACJ,MAAM,IAAI,KAAK,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,
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
12
|
-
return
|
|
13
|
-
}
|
|
14
|
-
|
|
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
|
-
|
|
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(
|
|
38
|
+
throw new Error(`Field not mapped in Security wrapper: ${field}`);
|
|
39
39
|
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return
|
|
46
|
-
}
|
|
47
|
-
|
|
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
|
-
|
|
55
|
+
}
|
|
56
|
+
getProductClass() {
|
|
51
57
|
throw new Error('Not implemented yet. See Java implementation for reference');
|
|
52
|
-
}
|
|
53
|
-
|
|
58
|
+
}
|
|
59
|
+
getProductType() {
|
|
54
60
|
throw new Error('Not implemented yet. See Java implementation for reference');
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return serialization_1.ProtoSerializationUtil.deserialize(
|
|
67
|
-
}
|
|
68
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
1
|
+
{"version":3,"file":"security.js","sourceRoot":"","sources":["security.ts"],"names":[],"mappings":";;AAAA,2EAA0E;AAG1E,gDAAkD;AAClD,wCAAqC;AACrC,0DAAgE;AAEhE,MAAM,Q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,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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
test('test the security wrapper',
|
|
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
|
-
|
|
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":"
|
|
1
|
+
{"version":3,"file":"security.test.js","sourceRoot":"","sources":["security.test.ts"],"names":[],"mappings":";;;;;AAAA,iFAA+E;AAC/E,wCAAqC;AAErC,iCAAkC;AAClC,0DAAkC;AAElC,uFAAqF;AACrF,iFAAgF;AAChF,iGAA+F;AAC/F,uFAAqF;AACrF,6GAA0G;AAG1G,IAAI,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACnC,iBAAiB,EAAE,CAAC;AACxB,CAAC,CAAC,CAAC;AAEH,SAAS,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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
70
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
19
|
+
toString() {
|
|
20
|
+
var _a, _b, _c, _d, _e, _f;
|
|
17
21
|
try {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
|
32
|
+
return `Transaction toString() serialization failed: ${e}`;
|
|
29
33
|
}
|
|
30
|
-
}
|
|
31
|
-
|
|
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
|
-
|
|
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(
|
|
59
|
+
throw new Error(`Field not mapped in Security wrapper: ${field}`);
|
|
56
60
|
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return new
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
106
|
+
}
|
|
107
|
+
getDirectedQuantity() {
|
|
83
108
|
return this.getQuantity().mul(this.getTransactionType().getDirectionMultiplier());
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return new date_1.LocalDate(
|
|
90
|
-
}
|
|
91
|
-
|
|
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
|
-
|
|
124
|
+
}
|
|
125
|
+
getTradeName() {
|
|
95
126
|
return this.proto.getTradeName();
|
|
96
|
-
}
|
|
97
|
-
|
|
127
|
+
}
|
|
128
|
+
getPositionStatus() {
|
|
98
129
|
return this.proto.getPositionStatus();
|
|
99
|
-
}
|
|
100
|
-
|
|
130
|
+
}
|
|
131
|
+
getChildrenTransactions() {
|
|
101
132
|
return this.proto.getChildtransactionsList();
|
|
102
|
-
}
|
|
103
|
-
|
|
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
|
-
|
|
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":"
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["transaction.ts"],"names":[],"mappings":";;;;;AAEA,yDAAqD;AAGrD,2EAA0E;AAG1E,oEAA4C;AAC5C,uEAA+C;AAE/C,aAAa;AACb,gDAAkD;AAClD,wCAAqC;AACrC,wCAA0C;AAC1C,2CAAqC;AAErC,MAAM,WAAW;IAGf,YAAY,KAAuB;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,QAAQ;;QACN,IAAI,CAAC;YACH,MAAM,OAAO,GACX,MAAA,MAAA,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,0CAAE,QAAQ,EAAE,mCAAI,MAAM,CAAC;YAEhD,MAAM,SAAS,GACb,MAAA,MAAA,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,0CAAE,QAAQ,EAAE,mCAAI,MAAM,CAAC;YAElD,MAAM,kBAAkB,GACtB,MAAA,MAAA,IAAI,CAAC,KAAK,CAAC,qBAAqB,EAAE,0CAAE,QAAQ,EAAE,mCAAI,MAAM,CAAC;YAE3D,OAAO,GAAG,CAAA,4BAA6B,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,KAAK;gBACpG,aAAa,IAAI,CAAC,YAAY,EAAE,CAAC,QAAQ,EAAE,cAAc,IAAI,CAAC,kBAAkB,EAAE,YAAY,IAAI,CAAC,QAAQ,EAAE,eAAe,IAAI,CAAC,WAAW,EAAE,KAAK;gBACnJ,QAAQ,IAAI,CAA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;IAED,YAAY;QACV,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC;IACnC,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC;IACxC,CAAC;IAED,uBAAuB;QACrB,OAAO,IAAI,CAAC,KAAK,CAAC,wBAAwB,EAAE,CAAC;IAC/C,CAAC;IAGD,MAAM,CAAC,KAAkB;QACvB,IAAI,KAAK,YAAY,WAAW,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
test('test the transaction wrapper',
|
|
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
|
-
|
|
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":"
|
|
1
|
+
{"version":3,"file":"transaction.test.js","sourceRoot":"","sources":["transaction.test.ts"],"names":[],"mappings":";;;;;AAAA,iFAA+E;AAC/E,wCAAqC;AAErC,iCAAkC;AAClC,gEAAwC;AACxC,0FAAyF;AACzF,oGAAkG;AAElG,uFAAqF;AAGrF,IAAI,CAAC,8BAA8B,EAAE,GAAG,EAAE;IACtC,iBAAiB,EAAE,CAAC;AACtB,CAAC,CAAC,CAAC;AAEL,SAAS,iBAAiB;IACtB,MAAM,WAAW,GAAG,gBAAgB,EAAE,CAAC;IAEvC,MAAM,CAAC,WAAW,CAAC,kBAAkB,EAAE,CAAC,QAAQ,EAAE,KAAK,KAAK,CAAC,CAAC;IAC9D,MAAM,CAAC,WAAW,CAAC,mBAAmB,EAAE,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,gBAAgB;IAErB,OAAO,IAAI,qBAAW,CAAC,IAAI,iCAAgB,EAAE;SAC5C,cAAc,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,WAAI,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC;SACtF,YAAY,CAAC,IAAI,8BAAc,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACtE,kBAAkB,CAAC,0CAAoB,CAAC,GAAG,CAAC;SAC5C,WAAW,CAAC,IAAI,oCAAiB,EAAE,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC;SAC1E,iBAAiB,CAAC,IAAI,8BAAc,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,CAAC"}
|