@exodus/web3-ethereum-utils 3.31.0 → 3.31.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.
@@ -33,6 +33,9 @@ const createBalanceAmount = (amount, { decimals, symbol }) => {
33
33
  const handleExpectedBalanceChange = (expectedBalanceChange, simulationResult, { network }) => {
34
34
  const { willApprove, willSend, willReceive } = simulationResult.balanceChanges;
35
35
  const { data, kind } = expectedBalanceChange.rawInfo;
36
+ if (kind === 'FARCASTER_CHANGE_RECOVERY_ADDRESS' || kind === 'ERC20_PERMIT') {
37
+ return;
38
+ }
36
39
  const { asset } = data;
37
40
  // ERC1155 is a multi-token standard (https://eips.ethereum.org/EIPS/eip-1155) and can be used for NFTs as well.
38
41
  const isNftTransfer = kind === 'ERC721_TRANSFER' ||
@@ -4,8 +4,13 @@ import { estimateSimpleTransfer, NotSimpleTransferError, } from './estimateSimpl
4
4
  */
5
5
  export const tryEstimatingChangesLocally = ({ asset, simulationResult, transaction, }) => {
6
6
  try {
7
- const transferValue = estimateSimpleTransfer({ asset, transaction });
8
- simulationResult.balanceChanges.willSend.push({ balance: transferValue });
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.0",
4
+ "version": "3.31.2",
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": "312f25a38096f8a1dcb9bfb7124d59e89d8be873"
39
+ "gitHead": "5a85c94903861c5afdc9099e6a0d62293b3874e7"
40
40
  }