@super-protocol/sdk-js 0.7.1-beta.2 → 0.7.1-beta.5
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/contracts/app.json
CHANGED
|
@@ -42,7 +42,7 @@ declare class OrdersFactory {
|
|
|
42
42
|
* @param transactionOptions - object what contains alternative action account or gas limit (optional)
|
|
43
43
|
* @returns {Promise<void>} - Does not return id of created order!
|
|
44
44
|
*/
|
|
45
|
-
static createWorkflow(perentOrderInfo: OrderInfo, subOrdersInfo: OrderInfo[], externalId?: string, transactionOptions?: TransactionOptions): Promise<void>;
|
|
45
|
+
static createWorkflow(perentOrderInfo: OrderInfo, subOrdersInfo: OrderInfo[], holdDeposit?: string, externalId?: string, transactionOptions?: TransactionOptions): Promise<void>;
|
|
46
46
|
/**
|
|
47
47
|
* Function for refilling order deposit
|
|
48
48
|
* @param orderId - order id
|
|
@@ -141,7 +141,7 @@ var OrdersFactory = /** @class */ (function () {
|
|
|
141
141
|
* @returns {Promise<void>} - Does not return id of created order!
|
|
142
142
|
*/
|
|
143
143
|
OrdersFactory.createOrder = function (orderInfo, holdDeposit, suspended, externalId, transactionOptions) {
|
|
144
|
-
if (holdDeposit === void 0) { holdDeposit =
|
|
144
|
+
if (holdDeposit === void 0) { holdDeposit = "0"; }
|
|
145
145
|
if (suspended === void 0) { suspended = false; }
|
|
146
146
|
if (externalId === void 0) { externalId = "default"; }
|
|
147
147
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -178,8 +178,8 @@ var OrdersFactory = /** @class */ (function () {
|
|
|
178
178
|
notFound = {
|
|
179
179
|
consumer: consumer,
|
|
180
180
|
externalId: externalId,
|
|
181
|
-
offerId:
|
|
182
|
-
orderId:
|
|
181
|
+
offerId: "-1",
|
|
182
|
+
orderId: "-1",
|
|
183
183
|
};
|
|
184
184
|
response = foundIds.length > 0 ? foundIds[0].returnValues : notFound;
|
|
185
185
|
return [2 /*return*/, response];
|
|
@@ -195,7 +195,8 @@ var OrdersFactory = /** @class */ (function () {
|
|
|
195
195
|
* @param transactionOptions - object what contains alternative action account or gas limit (optional)
|
|
196
196
|
* @returns {Promise<void>} - Does not return id of created order!
|
|
197
197
|
*/
|
|
198
|
-
OrdersFactory.createWorkflow = function (perentOrderInfo, subOrdersInfo, externalId, transactionOptions) {
|
|
198
|
+
OrdersFactory.createWorkflow = function (perentOrderInfo, subOrdersInfo, holdDeposit, externalId, transactionOptions) {
|
|
199
|
+
if (holdDeposit === void 0) { holdDeposit = "0"; }
|
|
199
200
|
if (externalId === void 0) { externalId = "default"; }
|
|
200
201
|
return __awaiter(this, void 0, void 0, function () {
|
|
201
202
|
var contract, perentOrderInfoArgs, formattedExternalId, subOrdersInfoArgs;
|
|
@@ -207,7 +208,7 @@ var OrdersFactory = /** @class */ (function () {
|
|
|
207
208
|
perentOrderInfoArgs = (0, utils_1.objectToTuple)(perentOrderInfo, Order_1.OrderInfoStructure);
|
|
208
209
|
formattedExternalId = (0, utils_2.formatBytes32String)(externalId);
|
|
209
210
|
subOrdersInfoArgs = (0, utils_1.objectToTuple)(subOrdersInfo, Order_1.OrderInfoStructureArray);
|
|
210
|
-
return [4 /*yield*/, TxManager_1.default.execute(contract.methods.createWorkflow, [perentOrderInfoArgs, formattedExternalId, subOrdersInfoArgs], transactionOptions)];
|
|
211
|
+
return [4 /*yield*/, TxManager_1.default.execute(contract.methods.createWorkflow, [perentOrderInfoArgs, holdDeposit, formattedExternalId, subOrdersInfoArgs], transactionOptions)];
|
|
211
212
|
case 1:
|
|
212
213
|
_a.sent();
|
|
213
214
|
return [2 /*return*/];
|
package/build/types/Order.d.ts
CHANGED
|
@@ -31,6 +31,18 @@ export declare const OrderInfoStructure: {
|
|
|
31
31
|
selectedOffers: StringConstructor[];
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
+
export declare const OrderInfoStructureArray: {
|
|
35
|
+
offer: StringConstructor;
|
|
36
|
+
resultPublicKey: StringConstructor;
|
|
37
|
+
encryptedRequirements: StringConstructor;
|
|
38
|
+
encryptedArgs: StringConstructor;
|
|
39
|
+
status: typeof OrderStatus;
|
|
40
|
+
args: {
|
|
41
|
+
slots: NumberConstructor;
|
|
42
|
+
inputOffers: StringConstructor[];
|
|
43
|
+
selectedOffers: StringConstructor[];
|
|
44
|
+
};
|
|
45
|
+
}[];
|
|
34
46
|
export declare type OrderInfo = {
|
|
35
47
|
offer: string;
|
|
36
48
|
resultPublicKey: string;
|
|
@@ -44,7 +56,6 @@ export declare type ExtendedOrderInfo = OrderInfo & {
|
|
|
44
56
|
externalId: string;
|
|
45
57
|
holdSum: string;
|
|
46
58
|
};
|
|
47
|
-
export declare const OrderInfoStructureArray: never[];
|
|
48
59
|
export declare const OrderResultStructure: {
|
|
49
60
|
encryptedResult: StringConstructor;
|
|
50
61
|
encryptedError: StringConstructor;
|
package/build/types/Order.js
CHANGED
|
@@ -29,7 +29,7 @@ exports.OrderInfoStructure = {
|
|
|
29
29
|
args: exports.OrderArgsStructure,
|
|
30
30
|
};
|
|
31
31
|
// Array of order info structures
|
|
32
|
-
exports.OrderInfoStructureArray = [];
|
|
32
|
+
exports.OrderInfoStructureArray = [exports.OrderInfoStructure];
|
|
33
33
|
// Order of keys and type conversion functions for this object in blockchain contract
|
|
34
34
|
exports.OrderResultStructure = {
|
|
35
35
|
encryptedResult: String,
|