@avalabs/evm-module 0.0.19 → 0.0.21

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.
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@avalabs/evm-module",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "type": "module",
8
8
  "dependencies": {
9
- "@avalabs/vm-module-types": "0.0.19",
9
+ "@avalabs/vm-module-types": "0.0.21",
10
10
  "@avalabs/coingecko-sdk": "v2.8.0-alpha.193",
11
11
  "@avalabs/utils-sdk": "2.8.0-alpha.193",
12
12
  "@avalabs/etherscan-sdk": "v2.8.0-alpha.193",
@@ -62,7 +62,7 @@ export const getErc20Balances = async ({
62
62
  ? bnToBig(token.balance, token.decimals).mul(priceInCurrency).toNumber()
63
63
  : undefined;
64
64
  const balanceDisplayValue = balanceToDisplayValue(token.balance, token.decimals);
65
- const balanceCurrencyDisplayValue = balanceInCurrency ? balanceInCurrency.toFixed(2) : '';
65
+ const balanceCurrencyDisplayValue = balanceInCurrency?.toFixed(2);
66
66
 
67
67
  return {
68
68
  ...acc,
@@ -88,7 +88,7 @@ describe('get-native-token-balances', () => {
88
88
  decimals: 18,
89
89
  logoUri: 'https://example.com/logo.png',
90
90
  balance: new BN('0'),
91
- balanceCurrencyDisplayValue: '',
91
+ balanceCurrencyDisplayValue: undefined,
92
92
  balanceDisplayValue: '0',
93
93
  coingeckoId: '123',
94
94
  type: 'NATIVE',
@@ -38,7 +38,7 @@ export const getNativeTokenBalances = async ({
38
38
  const balanceInCurrency = priceInCurrency
39
39
  ? bnToBig(balance, networkToken.decimals).mul(priceInCurrency).toNumber()
40
40
  : undefined;
41
- const balanceCurrencyDisplayValue = balanceInCurrency ? balanceInCurrency.toFixed(2) : '';
41
+ const balanceCurrencyDisplayValue = balanceInCurrency?.toFixed(2);
42
42
 
43
43
  return {
44
44
  ...networkToken,
@@ -85,7 +85,7 @@ const convertErc20TokenWithBalanceToTokenWithBalance = (
85
85
  return tokenBalances.map((token: Erc20TokenBalance): TokenWithBalanceERC20 => {
86
86
  const balance = new BN(token.balance);
87
87
  const balanceDisplayValue = balanceToDisplayValue(balance, token.decimals);
88
- const balanceCurrencyDisplayValue = token.balanceValue?.value.toString() ?? '';
88
+ const balanceCurrencyDisplayValue = token.balanceValue?.value.toString();
89
89
  const priceInCurrency = token.price?.value;
90
90
  const balanceInCurrency = priceInCurrency
91
91
  ? bnToBig(balance, token.decimals).mul(priceInCurrency).toNumber()
@@ -29,7 +29,7 @@ export const getNativeTokenBalances = async ({
29
29
  const balanceInCurrency = priceInCurrency
30
30
  ? bnToBig(balance, nativeTokenBalance.decimals).mul(priceInCurrency).toNumber()
31
31
  : undefined;
32
- const balanceCurrencyDisplayValue = balanceInCurrency ? balanceInCurrency.toFixed(2) : '';
32
+ const balanceCurrencyDisplayValue = balanceInCurrency?.toFixed(2);
33
33
 
34
34
  return {
35
35
  name: nativeTokenBalance.name,