Skip to content

Commit 19dd30c

Browse files
committed
rename to getEvmBalance
Signed-off-by: Gerhard Steenkamp <gerhard@umaproject.org>
1 parent 4f91781 commit 19dd30c

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

src/hooks/useBalance/strategies/evm.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Balance, BalanceStrategy } from "./types";
22
import {
3-
getBalance,
3+
getEvmBalance,
44
getNativeBalance,
55
getConfig,
66
getProvider,
@@ -61,7 +61,7 @@ export class EVMBalanceStrategy implements BalanceStrategy {
6161

6262
const balance = tokenInfo?.isNative
6363
? await getNativeBalance(chainId, account, "latest", provider)
64-
: await getBalance(chainId, account, tokenAddress, "latest", provider);
64+
: await getEvmBalance(chainId, account, tokenAddress, "latest", provider);
6565
const balanceDecimals = tokenInfo?.decimals ?? 18;
6666
return {
6767
balance,

src/hooks/useWalletBalanceTrace.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useConnection } from "hooks";
33
import {
44
ChainId,
55
fixedPointAdjustment,
6-
getBalance,
6+
getEvmBalance,
77
getConfig,
88
getNativeBalance,
99
getRoutes,
@@ -85,7 +85,7 @@ const calculateUsdBalances = async (account: string) => {
8585
fromChainId: Number(chainId),
8686
fromTokenSymbol,
8787
fromTokenAddress,
88-
balance: await getBalance(
88+
balance: await getEvmBalance(
8989
Number(chainId),
9090
account,
9191
fromTokenAddress

src/utils/token.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export async function getNativeBalance(
4040
* @param blockNumber The block number to execute the query.
4141
* @returns a Promise that resolves to the balance of the account
4242
*/
43-
export async function getBalance(
43+
export async function getEvmBalance(
4444
chainId: ChainId,
4545
account: string,
4646
tokenAddress: string,
@@ -101,7 +101,7 @@ export async function getTokenBalance(
101101
) {
102102
return chainIsSvm(chainId)
103103
? getSvmBalance(chainId, account, tokenAddress)
104-
: getBalance(chainId, account, tokenAddress);
104+
: getEvmBalance(chainId, account, tokenAddress);
105105
}
106106

107107
/**

src/views/LiquidityPool/hooks/useUserLiquidityPool.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import { useConnection } from "hooks";
22
import { useQuery } from "@tanstack/react-query";
33

4-
import { getConfig, getBalance, getNativeBalance, hubPoolChainId } from "utils";
4+
import {
5+
getConfig,
6+
getEvmBalance,
7+
getNativeBalance,
8+
hubPoolChainId,
9+
} from "utils";
510
import getApiEndpoint from "utils/serverless-api";
611

712
const config = getConfig();
@@ -38,7 +43,7 @@ async function fetchUserLiquidityPool(
3843
const [l1Balance, poolStateOfUser] = await Promise.all([
3944
tokenSymbol === "ETH"
4045
? getNativeBalance(hubPoolChainId, userAddress)
41-
: getBalance(hubPoolChainId, userAddress, l1TokenAddress),
46+
: getEvmBalance(hubPoolChainId, userAddress, l1TokenAddress),
4247
getApiEndpoint().poolsUser(l1TokenAddress, userAddress),
4348
]);
4449
return {

0 commit comments

Comments
 (0)