@exodus/web3-ethereum-utils 4.7.4 → 4.7.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.
@@ -54,28 +54,29 @@ export const createSimulateTransactions = ({ apiEndpoint, headers: headersFromDe
54
54
  const message = 'Cannot locally simulate batched transactions.';
55
55
  simulationResult.warnings.push({ kind: 'INTERNAL_ERROR', severity: 'HIGH', message });
56
56
  simulationResult.metadata.humanReadableError = message;
57
- return simulationResult;
58
57
  }
59
- // Local simulation also mutates the simulationResult, so we need to check if it was successful
60
- const simulatedLocally = tryEstimatingChangesLocally({
61
- asset,
62
- simulationResult,
63
- transaction: transactions[0],
64
- });
65
- // If local simulation succeeded, add fee for the (single) transaction now
66
- if (simulatedLocally) {
67
- simulationResult.metadata.simulatedLocally = true;
58
+ else {
68
59
  const transaction = transactions[0];
69
- simulationResult.balanceChanges.willPayFee.push({
70
- balance: estimateFee({ asset, transaction }),
71
- feeDetails: getTxFeeDetails(transaction),
60
+ // Local simulation also mutates the simulationResult, so we need to check if it was successful
61
+ const simulatedLocally = tryEstimatingChangesLocally({
62
+ asset,
63
+ simulationResult,
64
+ transaction,
72
65
  });
73
- }
74
- else {
75
- // Local Simulation also failed.
76
- const message = 'Balance changes cannot be estimated.';
77
- simulationResult.warnings.push({ kind: 'INTERNAL_ERROR', severity: 'HIGH', message });
78
- simulationResult.metadata.humanReadableError = message;
66
+ // If local simulation succeeded, add fee for the (single) transaction now
67
+ if (simulatedLocally) {
68
+ simulationResult.metadata.simulatedLocally = true;
69
+ simulationResult.balanceChanges.willPayFee.push({
70
+ balance: estimateFee({ asset, transaction }),
71
+ feeDetails: getTxFeeDetails(transaction),
72
+ });
73
+ }
74
+ else {
75
+ // Local Simulation also failed.
76
+ const message = 'Balance changes cannot be estimated.';
77
+ simulationResult.warnings.push({ kind: 'INTERNAL_ERROR', severity: 'HIGH', message });
78
+ simulationResult.metadata.humanReadableError = message;
79
+ }
79
80
  }
80
81
  if (simulationTransactionInternalResult.errorMessage) {
81
82
  simulationResult.metadata.humanReadableError = simulationTransactionInternalResult.errorMessage;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@exodus/web3-ethereum-utils",
3
3
  "description": "Web3 Ethereum utils.",
4
- "version": "4.7.4",
4
+ "version": "4.7.5",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "module": "lib/index.js",
@@ -35,7 +35,10 @@
35
35
  "test": "run -T exodus-test --jest --esbuild"
36
36
  },
37
37
  "devDependencies": {
38
- "@exodus/web3-types": "1.59.2"
38
+ "@exodus/assets": "^11.9.0",
39
+ "@exodus/ethereum-meta": "^2.12.0",
40
+ "@exodus/web3-types": "1.59.2",
41
+ "lodash": "^4.17.21"
39
42
  },
40
43
  "dependencies": {
41
44
  "@exodus/basic-utils": "^3.0.1",
@@ -51,5 +54,5 @@
51
54
  "url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Aweb3-ethereum-utils"
52
55
  },
53
56
  "homepage": "https://github.com/ExodusMovement/assets/tree/master/web3/web3-ethereum-utils",
54
- "gitHead": "69553b4abf01b543d0e6006299166b8f7cc6271c"
57
+ "gitHead": "38608063e5eafb78384c129e0b24b2da2d3ab238"
55
58
  }