@super-protocol/sdk-js 0.11.8-beta.0 → 0.11.9-beta.1

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.
@@ -60,6 +60,7 @@ var utils_2 = require("ethers/lib/utils");
60
60
  var BlockchainConnector_1 = __importDefault(require("../connectors/BlockchainConnector"));
61
61
  var Superpro_1 = __importDefault(require("../staticModels/Superpro"));
62
62
  var TxManager_1 = __importDefault(require("../utils/TxManager"));
63
+ var BlockchainEventsListener_1 = __importDefault(require("../connectors/BlockchainEventsListener"));
63
64
  var Order = /** @class */ (function () {
64
65
  function Order(orderId) {
65
66
  this.id = orderId;
@@ -555,7 +556,9 @@ var Order = /** @class */ (function () {
555
556
  Order.prototype.onOrderStatusUpdated = function (callback) {
556
557
  var _this = this;
557
558
  var logger = this.logger.child({ method: "onOrderStatusUpdated" });
558
- var subscription = Order.contract.events
559
+ // TODO: add ability to use this event without https provider initialization
560
+ var contractWss = BlockchainEventsListener_1.default.getInstance().getContract();
561
+ var subscription = contractWss.events
559
562
  .OrderStatusUpdated()
560
563
  .on("data", function (event) { return __awaiter(_this, void 0, void 0, function () {
561
564
  return __generator(this, function (_a) {
@@ -129,7 +129,19 @@ var TxManager = /** @class */ (function () {
129
129
  estimatedGas = constants_1.defaultGasLimit;
130
130
  return [3 /*break*/, 5];
131
131
  case 5:
132
- txData.gas = Math.ceil(estimatedGas * store_1.default.gasLimitMultiplier);
132
+ txData.gas = estimatedGas;
133
+ txData.gas = Math.ceil(txData.gas * store_1.default.gasLimitMultiplier);
134
+ // defaultGasLimit is max gas limit
135
+ txData.gas = txData.gas < constants_1.defaultGasLimit ? txData.gas : constants_1.defaultGasLimit;
136
+ if (options.gas) {
137
+ if (options.gas < estimatedGas) {
138
+ TxManager.logger.warn({
139
+ estimated: estimatedGas,
140
+ specified: options.gas,
141
+ }, "Fail to calculate estimated gas");
142
+ }
143
+ txData.gas = options.gas;
144
+ }
133
145
  _a.label = 6;
134
146
  case 6:
135
147
  if (!(!(0, utils_1.checkForUsingExternalTxManager)(transactionOptions) && this.nonceTrackers[options.from])) return [3 /*break*/, 8];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@super-protocol/sdk-js",
3
- "version": "0.11.8-beta.0",
3
+ "version": "0.11.9-beta.1",
4
4
  "main": "build/index.js",
5
5
  "license": "MIT",
6
6
  "files": [