@exodus/web3-ethereum-utils 3.31.0 → 3.31.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.
|
@@ -4,8 +4,13 @@ import { estimateSimpleTransfer, NotSimpleTransferError, } from './estimateSimpl
|
|
|
4
4
|
*/
|
|
5
5
|
export const tryEstimatingChangesLocally = ({ asset, simulationResult, transaction, }) => {
|
|
6
6
|
try {
|
|
7
|
-
const
|
|
8
|
-
|
|
7
|
+
const estimatedValue = estimateSimpleTransfer({ asset, transaction });
|
|
8
|
+
const actualTransferValue = transaction.from.toLowerCase() === transaction.to.toLowerCase()
|
|
9
|
+
? asset.currency.ZERO
|
|
10
|
+
: estimatedValue;
|
|
11
|
+
simulationResult.balanceChanges.willSend.push({
|
|
12
|
+
balance: actualTransferValue,
|
|
13
|
+
});
|
|
9
14
|
}
|
|
10
15
|
catch (err) {
|
|
11
16
|
const expectedError = err instanceof NotSimpleTransferError;
|
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": "3.31.
|
|
4
|
+
"version": "3.31.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"module": "lib/index.js",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"@exodus/web3-utils": "^1.45.0",
|
|
37
37
|
"@metamask/eth-sig-util": "^4.0.1"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "640977164352986134b0f62de8522d20283b6ba2"
|
|
40
40
|
}
|