Update get balance for token not handle by privy

This commit is contained in:
2025-08-17 01:32:00 +07:00
parent 0fb8178cea
commit 3464e072d6
2 changed files with 28 additions and 2 deletions

View File

@@ -184,7 +184,8 @@ public class EvmManager : IEvmManager
public async Task<List<EvmBalance>> GetAllBalances(Chain chain, string publicAddress) public async Task<List<EvmBalance>> GetAllBalances(Chain chain, string publicAddress)
{ {
var balances = new List<EvmBalance>(); var balances = new List<EvmBalance>();
foreach (var ticker in Enum.GetValues<Ticker>())
foreach (var ticker in TokenService.GetEligibleTickersForBalance())
{ {
try try
{ {
@@ -196,7 +197,7 @@ public class EvmManager : IEvmManager
} }
catch (Exception ex) catch (Exception ex)
{ {
// TODO : handle exception SentrySdk.CaptureException(ex);
} }
} }
@@ -361,6 +362,14 @@ public class EvmManager : IEvmManager
} }
} }
var othersChains = ChainService.GetChains();
foreach (var chain in othersChains)
{
evmBalances.AddRange(await GetAllBalances(chain, publicAddress));
}
return evmBalances; return evmBalances;
} }
catch (Exception ex) catch (Exception ex)

View File

@@ -66,4 +66,21 @@ public static class TokenService
Arbitrum.Address.USDC => Ticker.USDC, Arbitrum.Address.USDC => Ticker.USDC,
_ => throw new NotImplementedException(), _ => throw new NotImplementedException(),
}; };
public static List<Ticker> GetEligibleTickersForBalance()
{
return new List<Ticker>
{
Ticker.LINK,
Ticker.UNI,
Ticker.GMX,
Ticker.SOL,
Ticker.SUI,
Ticker.ARB,
Ticker.AAVE,
Ticker.XRP,
Ticker.PENDLE,
Ticker.BNB
};
}
} }