@fintekkers/ledger-models 0.1.96 → 0.1.98
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
|
@@ -31,7 +31,7 @@ class TransactionService {
|
|
|
31
31
|
createRequest.setCreateTransactionInput(transaction.proto);
|
|
32
32
|
|
|
33
33
|
const validateCreateOrUpdateAsync = promisify(this.client.validateCreateOrUpdate.bind(this.client));
|
|
34
|
-
const response = await validateCreateOrUpdateAsync(createRequest);
|
|
34
|
+
const response = await validateCreateOrUpdateAsync(createRequest) as SummaryProto;
|
|
35
35
|
return response;
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -42,7 +42,7 @@ class TransactionService {
|
|
|
42
42
|
createRequest.setCreateTransactionInput(transaction.proto);
|
|
43
43
|
|
|
44
44
|
const createTransactionAsync = promisify(this.client.createOrUpdate.bind(this.client));
|
|
45
|
-
const response = await createTransactionAsync(createRequest);
|
|
45
|
+
const response = await createTransactionAsync(createRequest) as CreateTransactionResponseProto;
|
|
46
46
|
return response;
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,79 +31,37 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
31
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
32
|
});
|
|
10
33
|
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
35
|
// Model Utils
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
test('test creating a transaction against the portfolio service',
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
case 0: return [4 /*yield*/, searchListTransactions()];
|
|
49
|
-
case 1:
|
|
50
|
-
isTrue = _a.sent();
|
|
51
|
-
expect(isTrue).toBe(true);
|
|
52
|
-
return [2 /*return*/];
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}); }, 30000);
|
|
36
|
+
const field_pb_1 = require("../../../fintekkers/models/position/field_pb");
|
|
37
|
+
const dt = __importStar(require("../../models/utils/datetime"));
|
|
38
|
+
const TransactionService_1 = require("./TransactionService");
|
|
39
|
+
const positionfilter_1 = require("../../models/position/positionfilter");
|
|
40
|
+
test('test creating a transaction against the portfolio service', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
const isTrue = yield searchListTransactions();
|
|
42
|
+
expect(isTrue).toBe(true);
|
|
43
|
+
}), 30000);
|
|
56
44
|
function searchListTransactions() {
|
|
57
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
transaction.getIssuerName();
|
|
78
|
-
//Or we can get information from the security
|
|
79
|
-
transaction.getSecurity().getAssetClass();
|
|
80
|
-
}
|
|
81
|
-
return [2 /*return*/, true];
|
|
82
|
-
}
|
|
83
|
-
});
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const now = dt.ZonedDateTime.now();
|
|
47
|
+
const transactionService = new TransactionService_1.TransactionService();
|
|
48
|
+
const positionFilter = new positionfilter_1.PositionFilter();
|
|
49
|
+
positionFilter.addEqualsFilter(field_pb_1.FieldProto.ASSET_CLASS, 'Fixed Income');
|
|
50
|
+
// positionFilter.addEqualsFilter(FieldProto.ID, transactionID);
|
|
51
|
+
const transactions = yield transactionService.searchTransaction(now.toProto(), positionFilter);
|
|
52
|
+
console.timeEnd("searchTransaction");
|
|
53
|
+
if (transactions === undefined) {
|
|
54
|
+
console.log('No transactions found');
|
|
55
|
+
throw Error('No transactions found');
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
let transaction = transactions[0];
|
|
59
|
+
//We can get data straight from the transaction
|
|
60
|
+
transaction.getIssuerName();
|
|
61
|
+
//Or we can get information from the security
|
|
62
|
+
transaction.getSecurity().getAssetClass();
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
84
65
|
});
|
|
85
66
|
}
|
|
86
67
|
//# sourceMappingURL=transaction.search.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.search.test.js","sourceRoot":"","sources":["transaction.search.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transaction.search.test.js","sourceRoot":"","sources":["transaction.search.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,cAAc;AACd,2EAA0E;AAG1E,gEAAkD;AAOlD,6DAA0D;AAK1D,yEAAsE;AAEtE,IAAI,CAAC,2DAA2D,EAAE,GAAS,EAAE;IAC3E,MAAM,MAAM,GAAG,MAAM,sBAAsB,EAAE,CAAC;IAC9C,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAA,EAAE,KAAK,CAAC,CAAC;AAEV,SAAe,sBAAsB;;QACnC,MAAM,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;QACnC,MAAM,kBAAkB,GAAG,IAAI,uCAAkB,EAAE,CAAC;QAEpD,MAAM,cAAc,GAAG,IAAI,+BAAc,EAAE,CAAC;QAC5C,cAAc,CAAC,eAAe,CAAC,qBAAU,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QAEvE,gEAAgE;QAChE,MAAM,YAAY,GAAG,MAAM,kBAAkB,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC,CAAC;QAC/F,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QAErC,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;YAC/B,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;YACrC,MAAM,KAAK,CAAC,uBAAuB,CAAC,CAAC;QACvC,CAAC;aAAM,CAAC;YACN,IAAI,WAAW,GAAgB,YAAY,CAAC,CAAC,CAAC,CAAC;YAE/C,+CAA+C;YAC/C,WAAW,CAAC,aAAa,EAAE,CAAC;YAE5B,6CAA6C;YAC7C,WAAW,CAAC,WAAW,EAAE,CAAC,aAAa,EAAE,CAAC;QAC5C,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
26
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
27
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -8,189 +31,122 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
31
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
32
|
});
|
|
10
33
|
};
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
36
|
};
|
|
38
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
38
|
// Models
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
const decimal_value_pb_1 = require("../../../fintekkers/models/util/decimal_value_pb");
|
|
40
|
+
const local_date_pb_1 = require("../../../fintekkers/models/util/local_date_pb");
|
|
42
41
|
// Model Utils
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
test('test printing a transaction to string',
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
case 0: return [4 /*yield*/, testToString()];
|
|
61
|
-
case 1:
|
|
62
|
-
isTrue = _a.sent();
|
|
63
|
-
expect(isTrue).toBe(true);
|
|
64
|
-
return [2 /*return*/];
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
}); }, 30000);
|
|
42
|
+
const field_pb_1 = require("../../../fintekkers/models/position/field_pb");
|
|
43
|
+
const uuid = __importStar(require("../../models/utils/uuid"));
|
|
44
|
+
const dt = __importStar(require("../../models/utils/datetime"));
|
|
45
|
+
const SecurityService_1 = require("../security-service/SecurityService");
|
|
46
|
+
const transaction_type_pb_1 = require("../../../fintekkers/models/transaction/transaction_type_pb");
|
|
47
|
+
const transaction_pb_1 = require("../../../fintekkers/models/transaction/transaction_pb");
|
|
48
|
+
const price_pb_1 = require("../../../fintekkers/models/price/price_pb");
|
|
49
|
+
const PortfolioService_1 = require("../portfolio-service/PortfolioService");
|
|
50
|
+
const TransactionService_1 = require("./TransactionService");
|
|
51
|
+
const transaction_1 = __importDefault(require("../../models/transaction/transaction"));
|
|
52
|
+
const assert = require("assert");
|
|
53
|
+
const positionfilter_1 = require("../../models/position/positionfilter");
|
|
54
|
+
const position_status_pb_1 = require("../../../fintekkers/models/position/position_status_pb");
|
|
55
|
+
test('test printing a transaction to string', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
|
+
const isTrue = yield testToString();
|
|
57
|
+
expect(isTrue).toBe(true);
|
|
58
|
+
}), 30000);
|
|
68
59
|
function testToString() {
|
|
69
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return [4 /*yield*/, getTransaction(now, positionFilter, today)];
|
|
79
|
-
case 1:
|
|
80
|
-
transactionProto = _a.sent();
|
|
81
|
-
transaction = new transaction_1.default(transactionProto);
|
|
82
|
-
transaction.toString();
|
|
83
|
-
return [2 /*return*/, true];
|
|
84
|
-
}
|
|
85
|
-
});
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const now = dt.ZonedDateTime.now();
|
|
62
|
+
const today = new local_date_pb_1.LocalDateProto().setDay(1).setMonth(1).setYear(2021);
|
|
63
|
+
const positionFilter = new positionfilter_1.PositionFilter();
|
|
64
|
+
positionFilter.addEqualsFilter(field_pb_1.FieldProto.ASSET_CLASS, 'Fixed Income');
|
|
65
|
+
const transactionProto = yield getTransaction(now, positionFilter, today);
|
|
66
|
+
const transaction = new transaction_1.default(transactionProto);
|
|
67
|
+
transaction.toString();
|
|
68
|
+
return true;
|
|
86
69
|
});
|
|
87
70
|
}
|
|
88
|
-
test('test creating a transaction against the transaction service',
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
case 0: return [4 /*yield*/, testTransaction()];
|
|
93
|
-
case 1:
|
|
94
|
-
isTrue = _a.sent();
|
|
95
|
-
expect(isTrue).toBe(true);
|
|
96
|
-
return [2 /*return*/];
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
}); }, 30000);
|
|
71
|
+
test('test creating a transaction against the transaction service', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
72
|
+
const isTrue = yield testTransaction();
|
|
73
|
+
expect(isTrue).toBe(true);
|
|
74
|
+
}), 30000);
|
|
100
75
|
function testTransaction() {
|
|
101
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if (transactions === undefined) {
|
|
132
|
-
console.log('No transactions found');
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
console.log(transactions.length);
|
|
136
|
-
}
|
|
137
|
-
return [2 /*return*/, true];
|
|
138
|
-
}
|
|
139
|
-
});
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
const transactionService = new TransactionService_1.TransactionService();
|
|
78
|
+
const now = dt.ZonedDateTime.now();
|
|
79
|
+
const today = new local_date_pb_1.LocalDateProto().setDay(1).setMonth(1).setYear(2021);
|
|
80
|
+
const positionFilter = new positionfilter_1.PositionFilter();
|
|
81
|
+
positionFilter.addEqualsFilter(field_pb_1.FieldProto.ASSET_CLASS, 'Fixed Income');
|
|
82
|
+
const transaction = yield getTransaction(now, positionFilter, today);
|
|
83
|
+
// var validationSummary = await transactionService.validateCreateTransaction(new Transaction(transaction));
|
|
84
|
+
// assert(validationSummary.getErrorsList().length == 0, "Validation errors found");
|
|
85
|
+
console.time("createTransaction");
|
|
86
|
+
var createTransactionResponse = yield transactionService.createTransaction(new transaction_1.default(transaction));
|
|
87
|
+
const transactionResponse = createTransactionResponse.getTransactionResponse();
|
|
88
|
+
assert(transactionResponse, "No transaction response found");
|
|
89
|
+
console.timeEnd("createTransaction");
|
|
90
|
+
console.log("Searching transaction");
|
|
91
|
+
console.time("searchTransaction");
|
|
92
|
+
const transactionUuid = transactionResponse.getUuid();
|
|
93
|
+
if (!transactionUuid)
|
|
94
|
+
throw new Error("Transaction UUID is required");
|
|
95
|
+
const transactionID = uuid.UUID.fromU8Array(transactionUuid.getRawUuid_asU8());
|
|
96
|
+
positionFilter.addEqualsFilter(field_pb_1.FieldProto.ID, transactionID);
|
|
97
|
+
const transactions = yield transactionService.searchTransaction(now.toProto(), positionFilter);
|
|
98
|
+
console.timeEnd("searchTransaction");
|
|
99
|
+
if (transactions === undefined) {
|
|
100
|
+
console.log('No transactions found');
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
console.log(transactions.length);
|
|
104
|
+
}
|
|
105
|
+
return true;
|
|
140
106
|
});
|
|
141
107
|
}
|
|
142
108
|
function getTransaction(now, positionFilter, today) {
|
|
143
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return [4 /*yield*/, securityService
|
|
152
|
-
.searchSecurity(now.toProto(), positionFilter)
|
|
153
|
-
.then(function (fixedIncomeSecurities) {
|
|
154
|
-
return fixedIncomeSecurities;
|
|
155
|
-
})];
|
|
156
|
-
case 1:
|
|
157
|
-
fixedIncomeSecurities = _a.sent();
|
|
158
|
-
console.timeEnd("searchSecurity");
|
|
159
|
-
security = fixedIncomeSecurities[0];
|
|
160
|
-
console.time("searchPortfolio");
|
|
161
|
-
return [4 /*yield*/, portfolioService.searchPortfolio(now.toProto(), new positionfilter_1.PositionFilter().addEqualsFilter(field_pb_1.FieldProto.PORTFOLIO_NAME, 'TEST PORTFOLIO'))];
|
|
162
|
-
case 2:
|
|
163
|
-
portfolios = _a.sent();
|
|
164
|
-
console.timeEnd("searchPortfolio");
|
|
165
|
-
if (portfolios === undefined) {
|
|
166
|
-
throw new Error('No portfolios found');
|
|
167
|
-
}
|
|
168
|
-
portfolio = portfolios[0];
|
|
169
|
-
if (portfolio.getPortfolioName().includes('Federal')) {
|
|
170
|
-
throw new Error('Portfolio is not a test portfolio! Abandoning test');
|
|
171
|
-
}
|
|
172
|
-
transaction = new transaction_pb_1.TransactionProto();
|
|
173
|
-
transaction.setObjectClass('Transaction');
|
|
174
|
-
transaction.setVersion('0.0.1');
|
|
175
|
-
transaction.setUuid(uuid.UUID.random().toUUIDProto());
|
|
176
|
-
transaction.setAsOf(now.toProto());
|
|
177
|
-
transaction.setTradeDate(today);
|
|
178
|
-
transaction.setSettlementDate(today); //Same day settlement
|
|
179
|
-
transaction.setTransactionType(transaction_type_pb_1.TransactionTypeProto.BUY);
|
|
180
|
-
transaction.setPositionStatus(position_status_pb_1.PositionStatusProto.EXECUTED);
|
|
181
|
-
transaction.setPrice(new price_pb_1.PriceProto()
|
|
182
|
-
.setObjectClass('Price')
|
|
183
|
-
.setAsOf(now.toProto())
|
|
184
|
-
.setVersion('0.0.1')
|
|
185
|
-
.setSecurity(security.proto)
|
|
186
|
-
.setUuid(uuid.UUID.random().toUUIDProto())
|
|
187
|
-
.setPrice(new decimal_value_pb_1.DecimalValueProto().setArbitraryPrecisionValue('100.00')));
|
|
188
|
-
transaction.setQuantity(new decimal_value_pb_1.DecimalValueProto().setArbitraryPrecisionValue('10000.00'));
|
|
189
|
-
transaction.setPortfolio(portfolio.proto);
|
|
190
|
-
transaction.setSecurity(security.proto);
|
|
191
|
-
return [2 /*return*/, transaction];
|
|
192
|
-
}
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
const securityService = new SecurityService_1.SecurityService();
|
|
111
|
+
const portfolioService = new PortfolioService_1.PortfolioService();
|
|
112
|
+
console.time("searchSecurity");
|
|
113
|
+
let fixedIncomeSecurities = yield securityService
|
|
114
|
+
.searchSecurity(now.toProto(), positionFilter)
|
|
115
|
+
.then((fixedIncomeSecurities) => {
|
|
116
|
+
return fixedIncomeSecurities;
|
|
193
117
|
});
|
|
118
|
+
console.timeEnd("searchSecurity");
|
|
119
|
+
let security = fixedIncomeSecurities[0];
|
|
120
|
+
console.time("searchPortfolio");
|
|
121
|
+
let portfolios = yield portfolioService.searchPortfolio(now.toProto(), new positionfilter_1.PositionFilter().addEqualsFilter(field_pb_1.FieldProto.PORTFOLIO_NAME, 'TEST PORTFOLIO'));
|
|
122
|
+
console.timeEnd("searchPortfolio");
|
|
123
|
+
if (portfolios === undefined) {
|
|
124
|
+
throw new Error('No portfolios found');
|
|
125
|
+
}
|
|
126
|
+
const portfolio = portfolios[0];
|
|
127
|
+
if (portfolio.getPortfolioName().includes('Federal')) {
|
|
128
|
+
throw new Error('Portfolio is not a test portfolio! Abandoning test');
|
|
129
|
+
}
|
|
130
|
+
const transaction = new transaction_pb_1.TransactionProto();
|
|
131
|
+
transaction.setObjectClass('Transaction');
|
|
132
|
+
transaction.setVersion('0.0.1');
|
|
133
|
+
transaction.setUuid(uuid.UUID.random().toUUIDProto());
|
|
134
|
+
transaction.setAsOf(now.toProto());
|
|
135
|
+
transaction.setTradeDate(today);
|
|
136
|
+
transaction.setSettlementDate(today); //Same day settlement
|
|
137
|
+
transaction.setTransactionType(transaction_type_pb_1.TransactionTypeProto.BUY);
|
|
138
|
+
transaction.setPositionStatus(position_status_pb_1.PositionStatusProto.EXECUTED);
|
|
139
|
+
transaction.setPrice(new price_pb_1.PriceProto()
|
|
140
|
+
.setObjectClass('Price')
|
|
141
|
+
.setAsOf(now.toProto())
|
|
142
|
+
.setVersion('0.0.1')
|
|
143
|
+
.setSecurity(security.proto)
|
|
144
|
+
.setUuid(uuid.UUID.random().toUUIDProto())
|
|
145
|
+
.setPrice(new decimal_value_pb_1.DecimalValueProto().setArbitraryPrecisionValue('100.00')));
|
|
146
|
+
transaction.setQuantity(new decimal_value_pb_1.DecimalValueProto().setArbitraryPrecisionValue('10000.00'));
|
|
147
|
+
transaction.setPortfolio(portfolio.proto);
|
|
148
|
+
transaction.setSecurity(security.proto);
|
|
149
|
+
return transaction;
|
|
194
150
|
});
|
|
195
151
|
}
|
|
196
152
|
//# sourceMappingURL=transaction.test.js.map
|
|
@@ -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,SAAS;AACT,uFAAqF;AACrF,iFAA+E;AAE/E,cAAc;AACd,2EAA0E;AAE1E,8DAAgD;AAChD,gEAAkD;AAElD,yEAAsE;AACtE,oGAAkG;AAClG,0FAAyF;AACzF,wEAAuE;AACvE,4EAAyE;AACzE,6DAA0D;AAC1D,uFAA+D;AAG/D,iCAAkC;AAClC,yEAAsE;AACtE,+FAA6F;AAG7F,IAAI,CAAC,uCAAuC,EAAE,GAAS,EAAE;IACvD,MAAM,MAAM,GAAG,MAAM,YAAY,EAAE,CAAC;IACpC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAA,EAAE,KAAK,CAAC,CAAC;AAEV,SAAe,YAAY;;QACzB,MAAM,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;QACnC,MAAM,KAAK,GAAG,IAAI,8BAAc,EAAE,CAAC,M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C,CAAC;QACnC,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAChC,WAAW,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,qBAAqB;QAC3D,WAAW,CAAC,kBAAkB,CAAC,0CAAoB,CAAC,GAAG,CAAC,CAAC;QACzD,WAAW,CAAC,iBAAiB,CAAC,wCAAmB,CAAC,QAAQ,CAAC,CAAC;QAC5D,WAAW,CAAC,QAAQ,CAClB,IAAI,qBAAU,EAAE;aACb,cAAc,CAAC,OAAO,CAAC;aACvB,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;aACtB,UAAU,CAAC,OAAO,CAAC;aACnB,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC;aAC3B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC;aACzC,QAAQ,CAAC,IAAI,oCAAiB,EAAE,CAAC,0BAA0B,CAAC,QAAQ,CAAC,CAAC,CAC1E,CAAC;QACF,WAAW,CAAC,WAAW,CAAC,IAAI,oCAAiB,EAAE,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC,CAAC;QACxF,WAAW,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC1C,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACxC,OAAO,WAAW,CAAC;IACrB,CAAC;CAAA"}
|
|
@@ -74,7 +74,9 @@ async function testTransaction(): Promise<boolean> {
|
|
|
74
74
|
|
|
75
75
|
console.time("searchTransaction");
|
|
76
76
|
|
|
77
|
-
const
|
|
77
|
+
const transactionUuid = transactionResponse.getUuid();
|
|
78
|
+
if (!transactionUuid) throw new Error("Transaction UUID is required");
|
|
79
|
+
const transactionID = uuid.UUID.fromU8Array(transactionUuid.getRawUuid_asU8());
|
|
78
80
|
positionFilter.addEqualsFilter(FieldProto.ID, transactionID);
|
|
79
81
|
const transactions = await transactionService.searchTransaction(now.toProto(), positionFilter);
|
|
80
82
|
console.timeEnd("searchTransaction");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fintekkers/ledger-models",
|
|
3
3
|
"todo": "Replace the version with build script version number",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.98",
|
|
5
5
|
"description": "ledger model protos ",
|
|
6
6
|
"authors": [
|
|
7
7
|
"David Doherty",
|
|
@@ -25,7 +25,10 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@babel/preset-env": "^7.22.9",
|
|
28
|
+
"@types/google-protobuf": "^3.15.12",
|
|
28
29
|
"@types/jest": "^29.5.3",
|
|
30
|
+
"@types/luxon": "^3.6.2",
|
|
31
|
+
"@types/uuid": "^10.0.0",
|
|
29
32
|
"grpc_tools_node_protoc_ts": "^5.3.3",
|
|
30
33
|
"jest": "^29.6.1",
|
|
31
34
|
"jsdom": "^22.1.0",
|
package/tsconfig.json
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compileOnSave": true,
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"target": "
|
|
4
|
+
"target": "es2016",
|
|
5
5
|
"module": "commonjs",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"sourceMap": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"moduleResolution": "node",
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true
|
|
13
|
+
},
|
|
14
|
+
"include": [
|
|
15
|
+
"node/**/*"
|
|
16
|
+
],
|
|
17
|
+
"exclude": [
|
|
18
|
+
"node_modules",
|
|
19
|
+
]
|
|
11
20
|
}
|
|
12
21
|
// {
|
|
13
22
|
// "compilerOptions": {
|