@dhedge/v2-sdk 2.0.2 → 2.0.3

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.
@@ -18326,7 +18326,7 @@ function _call() {
18326
18326
  }
18327
18327
 
18328
18328
  var getGasEstimateData = /*#__PURE__*/function () {
18329
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(estimateFunc, txInfoData, txOptions) {
18329
+ var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(pool, estimateFunc, txInfoData, txOptions, sdkOptions) {
18330
18330
  var gas, gasEstimationError;
18331
18331
  return runtime_1.wrap(function _callee2$(_context2) {
18332
18332
  while (1) {
@@ -18339,34 +18339,54 @@ var getGasEstimateData = /*#__PURE__*/function () {
18339
18339
  gas = null;
18340
18340
  gasEstimationError = null;
18341
18341
  _context2.prev = 3;
18342
- _context2.next = 6;
18343
- return estimateFunc(txInfoData.to, txInfoData.txData, txOptions);
18344
18342
 
18345
- case 6:
18343
+ if (!(!pool.isDhedge || !isSdkOptionsBoolean(sdkOptions) && sdkOptions.useTraderAddressAsFrom)) {
18344
+ _context2.next = 10;
18345
+ break;
18346
+ }
18347
+
18348
+ _context2.next = 7;
18349
+ return estimateFunc(_extends({
18350
+ to: txInfoData.to,
18351
+ data: txInfoData.txData
18352
+ }, txOptions));
18353
+
18354
+ case 7:
18346
18355
  gas = _context2.sent;
18356
+ _context2.next = 13;
18357
+ break;
18358
+
18359
+ case 10:
18347
18360
  _context2.next = 12;
18361
+ return estimateFunc(txInfoData.to, txInfoData.txData, txOptions);
18362
+
18363
+ case 12:
18364
+ gas = _context2.sent;
18365
+
18366
+ case 13:
18367
+ _context2.next = 18;
18348
18368
  break;
18349
18369
 
18350
- case 9:
18351
- _context2.prev = 9;
18370
+ case 15:
18371
+ _context2.prev = 15;
18352
18372
  _context2.t0 = _context2["catch"](3);
18353
18373
  gasEstimationError = _context2.t0;
18354
18374
 
18355
- case 12:
18375
+ case 18:
18356
18376
  return _context2.abrupt("return", _extends({
18357
18377
  gas: gas,
18358
18378
  gasEstimationError: gasEstimationError
18359
18379
  }, txInfoData));
18360
18380
 
18361
- case 13:
18381
+ case 19:
18362
18382
  case "end":
18363
18383
  return _context2.stop();
18364
18384
  }
18365
18385
  }
18366
- }, _callee2, null, [[3, 9]]);
18386
+ }, _callee2, null, [[3, 15]]);
18367
18387
  }));
18368
18388
 
18369
- return function getGasEstimateData(_x12, _x13, _x14) {
18389
+ return function getGasEstimateData(_x12, _x13, _x14, _x15, _x16) {
18370
18390
  return _ref.apply(this, arguments);
18371
18391
  };
18372
18392
  }();
@@ -18408,7 +18428,7 @@ var getPoolTxOrGasEstimate = /*#__PURE__*/function () {
18408
18428
  }
18409
18429
 
18410
18430
  _context3.next = 8;
18411
- return getGasEstimateData(pool.signer.estimateGas, txInfoData, txOptions);
18431
+ return getGasEstimateData(pool, pool.signer.estimateGas.bind(pool.signer), txInfoData, txOptions, sdkOptions);
18412
18432
 
18413
18433
  case 8:
18414
18434
  return _context3.abrupt("return", _context3.sent);
@@ -18434,7 +18454,7 @@ var getPoolTxOrGasEstimate = /*#__PURE__*/function () {
18434
18454
  }
18435
18455
 
18436
18456
  _context3.next = 19;
18437
- return getGasEstimateData(pool.poolLogic.estimateGas.execTransaction, txInfoData, txOptions);
18457
+ return getGasEstimateData(pool, pool.poolLogic.estimateGas.execTransaction, txInfoData, txOptions, sdkOptions);
18438
18458
 
18439
18459
  case 19:
18440
18460
  return _context3.abrupt("return", _context3.sent);
@@ -18454,7 +18474,7 @@ var getPoolTxOrGasEstimate = /*#__PURE__*/function () {
18454
18474
  }, _callee3);
18455
18475
  }));
18456
18476
 
18457
- return function getPoolTxOrGasEstimate(_x15, _x16, _x17) {
18477
+ return function getPoolTxOrGasEstimate(_x17, _x18, _x19) {
18458
18478
  return _ref2.apply(this, arguments);
18459
18479
  };
18460
18480
  }();