@exodus/web3-ethereum-utils 3.23.0 → 3.25.0

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.
@@ -2,6 +2,7 @@
2
2
  This utility makes an API call to a simulation service, parses the response and mutates the supplied "simulationResult" object
3
3
  with the according balance changes.
4
4
  */
5
+ import { pick } from '@exodus/basic-utils';
5
6
  import { createCurrency, makeSimulationAPICall } from '@exodus/web3-utils';
6
7
  export const BLOWFISH_EVM_CHAINS = {
7
8
  ethereum: {
@@ -63,11 +64,22 @@ const handleExpectedBalanceChange = (expectedBalanceChange, simulationResult, {
63
64
  (kind === 'ERC1155_TRANSFER' && !asset.decimals);
64
65
  const symbol = asset.symbol;
65
66
  const decimals = isNftTransfer ? 1 : asset.decimals;
67
+ const asset_ = pick(asset, [
68
+ 'address',
69
+ 'imageUrl',
70
+ 'name',
71
+ 'symbol',
72
+ 'verified',
73
+ ]);
74
+ if (isNftTransfer) {
75
+ asset_.imageUrl = data?.metadata?.rawImageUrl;
76
+ }
66
77
  if (kind === 'ERC20_APPROVAL' ||
67
78
  kind === 'ERC721_APPROVAL_FOR_ALL' ||
68
79
  kind === 'ERC1155_APPROVAL_FOR_ALL' ||
69
80
  kind === 'ERC721_APPROVAL') {
70
81
  willApprove.push({
82
+ asset: asset_,
71
83
  spender: data.spender.address,
72
84
  unitName: symbol,
73
85
  balance: createCurrency({
@@ -84,6 +96,7 @@ const handleExpectedBalanceChange = (expectedBalanceChange, simulationResult, {
84
96
  return;
85
97
  }
86
98
  const balanceChange = {
99
+ asset: asset_,
87
100
  balance,
88
101
  };
89
102
  if (isNftTransfer) {
package/lib/types.d.ts CHANGED
@@ -34,6 +34,7 @@ export declare type EthWalletWatchAssetOptions = {
34
34
  symbol?: string;
35
35
  decimals?: number;
36
36
  image?: string;
37
+ chainId?: number;
37
38
  };
38
39
  export interface EthWalletWatchAsset {
39
40
  type: string;
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.23.0",
4
+ "version": "3.25.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "module": "lib/index.js",
@@ -29,10 +29,11 @@
29
29
  "@exodus/web3-types": "0.0.0"
30
30
  },
31
31
  "dependencies": {
32
+ "@exodus/basic-utils": "^2.5.1",
32
33
  "@exodus/ethereumjs-common": "^2.4.0-exodus.6",
33
34
  "@exodus/ethereumjs-tx": "^3.3.0-exodus.6",
34
35
  "@exodus/web3-utils": "^1.43.0",
35
36
  "@metamask/eth-sig-util": "^4.0.1"
36
37
  },
37
- "gitHead": "8ba379ef8cf8553458af3a6dc7d5a8d97951852f"
38
+ "gitHead": "23ffed4aa324577548687a217407f36b5ac93606"
38
39
  }