@super-protocol/sdk-js 0.10.8-beta.0 → 0.11.0-beta.0
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/build/models/Order.d.ts +1 -2
- package/build/models/Order.js +4 -11
- package/build/types/Order.d.ts +0 -2
- package/build/types/Order.js +0 -1
- package/package.json +1 -1
package/build/models/Order.d.ts
CHANGED
|
@@ -102,8 +102,7 @@ declare class Order {
|
|
|
102
102
|
/**
|
|
103
103
|
* Completes order
|
|
104
104
|
*/
|
|
105
|
-
complete(status: OrderStatus, encryptedResult?: string,
|
|
106
|
-
transactionOptions?: TransactionOptions): Promise<void>;
|
|
105
|
+
complete(status: OrderStatus, encryptedResult?: string, transactionOptions?: TransactionOptions): Promise<void>;
|
|
107
106
|
/**
|
|
108
107
|
* Function for creating sub orders for current order
|
|
109
108
|
* @param subOrderInfo - order info for new subOrder
|
package/build/models/Order.js
CHANGED
|
@@ -126,18 +126,13 @@ var Order = /** @class */ (function () {
|
|
|
126
126
|
*/
|
|
127
127
|
Order.prototype.getOrderResult = function () {
|
|
128
128
|
return __awaiter(this, void 0, void 0, function () {
|
|
129
|
-
var orderInfoParams
|
|
129
|
+
var orderInfoParams;
|
|
130
130
|
return __generator(this, function (_a) {
|
|
131
131
|
switch (_a.label) {
|
|
132
132
|
case 0: return [4 /*yield*/, Order.contract.methods.getOrder(this.id).call()];
|
|
133
133
|
case 1:
|
|
134
134
|
orderInfoParams = _a.sent();
|
|
135
|
-
|
|
136
|
-
if (orderInfoParams[1][4] === Order_1.OrderStatus.Error)
|
|
137
|
-
result[1] = orderInfoParams[2][0];
|
|
138
|
-
else
|
|
139
|
-
result[0] = orderInfoParams[2][0];
|
|
140
|
-
return [2 /*return*/, (this.orderResult = (0, utils_1.tupleToObject)(result, Order_1.OrderResultStructure))];
|
|
135
|
+
return [2 /*return*/, (this.orderResult = (0, utils_1.tupleToObject)([orderInfoParams[2][0], orderInfoParams[2][1]], Order_1.OrderResultStructure))];
|
|
141
136
|
}
|
|
142
137
|
});
|
|
143
138
|
});
|
|
@@ -404,17 +399,15 @@ var Order = /** @class */ (function () {
|
|
|
404
399
|
/**
|
|
405
400
|
* Completes order
|
|
406
401
|
*/
|
|
407
|
-
Order.prototype.complete = function (status, encryptedResult,
|
|
408
|
-
transactionOptions) {
|
|
402
|
+
Order.prototype.complete = function (status, encryptedResult, transactionOptions) {
|
|
409
403
|
if (encryptedResult === void 0) { encryptedResult = ""; }
|
|
410
|
-
if (encryptedError === void 0) { encryptedError = ""; }
|
|
411
404
|
return __awaiter(this, void 0, void 0, function () {
|
|
412
405
|
return __generator(this, function (_a) {
|
|
413
406
|
switch (_a.label) {
|
|
414
407
|
case 0:
|
|
415
408
|
transactionOptions !== null && transactionOptions !== void 0 ? transactionOptions : this.checkInitOrder(transactionOptions);
|
|
416
409
|
(0, utils_1.checkIfActionAccountInitialized)(transactionOptions);
|
|
417
|
-
return [4 /*yield*/, TxManager_1.default.execute(Order.contract.methods.completeOrder, [this.id, status,
|
|
410
|
+
return [4 /*yield*/, TxManager_1.default.execute(Order.contract.methods.completeOrder, [this.id, status, encryptedResult], transactionOptions)];
|
|
418
411
|
case 1:
|
|
419
412
|
_a.sent();
|
|
420
413
|
return [2 /*return*/];
|
package/build/types/Order.d.ts
CHANGED
|
@@ -61,12 +61,10 @@ export declare type ExtendedOrderInfo = OrderInfo & {
|
|
|
61
61
|
};
|
|
62
62
|
export declare const OrderResultStructure: {
|
|
63
63
|
encryptedResult: StringConstructor;
|
|
64
|
-
encryptedError: StringConstructor;
|
|
65
64
|
orderPrice: StringConstructor;
|
|
66
65
|
};
|
|
67
66
|
export declare type OrderResult = {
|
|
68
67
|
encryptedResult: string;
|
|
69
|
-
encryptedError: string;
|
|
70
68
|
orderPrice: string;
|
|
71
69
|
};
|
|
72
70
|
export declare type SubOrderParams = {
|
package/build/types/Order.js
CHANGED
|
@@ -35,6 +35,5 @@ exports.OrderInfoStructureArray = [exports.OrderInfoStructure];
|
|
|
35
35
|
// Order of keys and type conversion functions for this object in blockchain contract
|
|
36
36
|
exports.OrderResultStructure = {
|
|
37
37
|
encryptedResult: String,
|
|
38
|
-
encryptedError: String,
|
|
39
38
|
orderPrice: String,
|
|
40
39
|
};
|