@super-protocol/sdk-js 0.13.4 → 0.14.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/contracts/app.json +488 -35
- package/build/models/Offer.js +16 -10
- package/build/models/Order.d.ts +1 -1
- package/build/models/Order.js +8 -2
- package/build/models/Provider.d.ts +2 -0
- package/build/models/Provider.js +14 -0
- package/build/models/TeeOffer.js +24 -12
- package/build/staticModels/ActiveOrders.d.ts +5 -0
- package/build/staticModels/ActiveOrders.js +41 -0
- package/build/staticModels/Consensus.d.ts +3 -0
- package/build/staticModels/Consensus.js +65 -0
- package/build/staticModels/Orders.d.ts +3 -2
- package/build/staticModels/Orders.js +60 -4
- package/build/staticModels/SuperproToken.d.ts +2 -2
- package/build/staticModels/SuperproToken.js +13 -3
- package/build/types/Order.d.ts +6 -0
- package/build/types/Order.js +2 -0
- package/build/types/Web3.d.ts +3 -0
- package/build/utils/TxManager.d.ts +1 -0
- package/build/utils/TxManager.js +41 -12
- package/package.json +1 -1
package/build/utils/TxManager.js
CHANGED
|
@@ -89,18 +89,47 @@ var TxManager = /** @class */ (function () {
|
|
|
89
89
|
return __awaiter(this, void 0, void 0, function () {
|
|
90
90
|
var transaction, txData;
|
|
91
91
|
return __generator(this, function (_a) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
switch (_a.label) {
|
|
93
|
+
case 0:
|
|
94
|
+
transaction = method.apply(void 0, args);
|
|
95
|
+
txData = {
|
|
96
|
+
to: to,
|
|
97
|
+
data: transaction.encodeABI(),
|
|
98
|
+
};
|
|
99
|
+
return [4 /*yield*/, TxManager.publishTransaction(txData, transactionOptions, transaction)];
|
|
100
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
TxManager.dryRun = function (method, args, transactionOptions) {
|
|
106
|
+
var _a;
|
|
107
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
108
|
+
var transaction, from, result, e_1;
|
|
109
|
+
return __generator(this, function (_b) {
|
|
110
|
+
switch (_b.label) {
|
|
111
|
+
case 0:
|
|
112
|
+
transaction = method.apply(void 0, args);
|
|
113
|
+
from = (_a = transactionOptions === null || transactionOptions === void 0 ? void 0 : transactionOptions.from) !== null && _a !== void 0 ? _a : store_1.default.actionAccount;
|
|
114
|
+
_b.label = 1;
|
|
115
|
+
case 1:
|
|
116
|
+
_b.trys.push([1, 3, , 4]);
|
|
117
|
+
return [4 /*yield*/, transaction.call({ from: from })];
|
|
118
|
+
case 2:
|
|
119
|
+
result = _b.sent();
|
|
120
|
+
return [2 /*return*/, result];
|
|
121
|
+
case 3:
|
|
122
|
+
e_1 = _b.sent();
|
|
123
|
+
e_1.txErrorMsg = e_1.data.message || "Error text is undefined";
|
|
124
|
+
throw e_1;
|
|
125
|
+
case 4: return [2 /*return*/];
|
|
126
|
+
}
|
|
98
127
|
});
|
|
99
128
|
});
|
|
100
129
|
};
|
|
101
130
|
TxManager.publishTransaction = function (txData, transactionOptions, transactionCall) {
|
|
102
131
|
return __awaiter(this, void 0, void 0, function () {
|
|
103
|
-
var web3, options, estimatedGas,
|
|
132
|
+
var web3, options, estimatedGas, e_2, nonceTracker, signingKey, transactionResultData, signed, e_3;
|
|
104
133
|
return __generator(this, function (_a) {
|
|
105
134
|
switch (_a.label) {
|
|
106
135
|
case 0:
|
|
@@ -124,8 +153,8 @@ var TxManager = /** @class */ (function () {
|
|
|
124
153
|
estimatedGas = _a.sent();
|
|
125
154
|
return [3 /*break*/, 5];
|
|
126
155
|
case 4:
|
|
127
|
-
|
|
128
|
-
TxManager.logger.debug({ error:
|
|
156
|
+
e_2 = _a.sent();
|
|
157
|
+
TxManager.logger.debug({ error: e_2 }, "Fail to calculate estimated gas");
|
|
129
158
|
estimatedGas = constants_1.defaultGasLimit;
|
|
130
159
|
return [3 /*break*/, 5];
|
|
131
160
|
case 5:
|
|
@@ -191,14 +220,14 @@ var TxManager = /** @class */ (function () {
|
|
|
191
220
|
nonceTracker.onTransactionPublished();
|
|
192
221
|
return [2 /*return*/, transactionResultData];
|
|
193
222
|
case 15:
|
|
194
|
-
|
|
195
|
-
TxManager.logger.error(
|
|
223
|
+
e_3 = _a.sent();
|
|
224
|
+
TxManager.logger.error(e_3, "Error during transaction execution");
|
|
196
225
|
if (!nonceTracker) return [3 /*break*/, 17];
|
|
197
226
|
return [4 /*yield*/, nonceTracker.onTransactionError()];
|
|
198
227
|
case 16:
|
|
199
228
|
_a.sent();
|
|
200
229
|
_a.label = 17;
|
|
201
|
-
case 17: throw
|
|
230
|
+
case 17: throw e_3;
|
|
202
231
|
case 18: return [2 /*return*/];
|
|
203
232
|
}
|
|
204
233
|
});
|