Update get balance for token not handle by privy
This commit is contained in:
@@ -184,7 +184,8 @@ public class EvmManager : IEvmManager
|
||||
public async Task<List<EvmBalance>> GetAllBalances(Chain chain, string publicAddress)
|
||||
{
|
||||
var balances = new List<EvmBalance>();
|
||||
foreach (var ticker in Enum.GetValues<Ticker>())
|
||||
|
||||
foreach (var ticker in TokenService.GetEligibleTickersForBalance())
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -196,7 +197,7 @@ public class EvmManager : IEvmManager
|
||||
}
|
||||
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;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -66,4 +66,21 @@ public static class TokenService
|
||||
Arbitrum.Address.USDC => Ticker.USDC,
|
||||
_ => 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
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user