@super-protocol/sdk-js 0.15.2-beta.0 → 0.15.2

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.
@@ -63,7 +63,7 @@ class ProviderRegistry {
63
63
  return __awaiter(this, void 0, void 0, function* () {
64
64
  const contract = BlockchainConnector_1.default.getInstance().getContract(transactionOptions);
65
65
  (0, utils_1.checkIfActionAccountInitialized)(transactionOptions);
66
- yield TxManager_1.default.execute(contract.methods.refillProviderSecurityDepo, [amount, recipient], transactionOptions);
66
+ yield TxManager_1.default.execute(contract.methods.refillProviderSecurityDepoFor, [amount, recipient], transactionOptions);
67
67
  });
68
68
  }
69
69
  /**
@@ -19,6 +19,19 @@ const utils_1 = require("../utils");
19
19
  const Superpro_1 = __importDefault(require("../staticModels/Superpro"));
20
20
  const constants_1 = require("../constants");
21
21
  const lodash_1 = __importDefault(require("lodash"));
22
+ class Web3TransactionError extends Error {
23
+ constructor(originalError, message) {
24
+ super(message);
25
+ this.name = "Web3TransactionError";
26
+ this.originalError = originalError;
27
+ }
28
+ }
29
+ class Web3TransactionRevertedByEvmError extends Web3TransactionError {
30
+ constructor(originalError, message) {
31
+ super(originalError, message);
32
+ this.name = "Web3TransactionRevertedByEvmError";
33
+ }
34
+ }
22
35
  class TxManager {
23
36
  static init(web3) {
24
37
  this.web3 = web3;
@@ -63,6 +76,7 @@ class TxManager {
63
76
  });
64
77
  }
65
78
  static publishTransaction(txData, transactionOptions, transactionCall) {
79
+ var _a;
66
80
  return __awaiter(this, void 0, void 0, function* () {
67
81
  this.checkIfInitialized();
68
82
  (0, utils_1.checkIfActionAccountInitialized)(transactionOptions);
@@ -133,10 +147,16 @@ class TxManager {
133
147
  return transactionResultData;
134
148
  }
135
149
  catch (e) {
136
- TxManager.logger.error(e, "Error during transaction execution");
150
+ const message = "Error during transaction execution";
151
+ TxManager.logger.error(e, message);
137
152
  if (nonceTracker)
138
153
  yield nonceTracker.onTransactionError();
139
- throw e;
154
+ if ((_a = e.message) === null || _a === void 0 ? void 0 : _a.includes("Transaction has been reverted by the EVM")) {
155
+ throw new Web3TransactionRevertedByEvmError(e, message);
156
+ }
157
+ else {
158
+ throw new Web3TransactionError(e, message);
159
+ }
140
160
  }
141
161
  });
142
162
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@super-protocol/sdk-js",
3
- "version": "0.15.2-beta.0",
3
+ "version": "0.15.2",
4
4
  "main": "build/index.js",
5
5
  "license": "MIT",
6
6
  "files": [