Skip to content

Commit

Permalink
fix: avax balance
Browse files Browse the repository at this point in the history
  • Loading branch information
amalcaraz committed May 27, 2024
1 parent 4782f1a commit a35898f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/domain/connect/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,15 @@ export abstract class BaseConnectionProviderManager {

async getBalance(account: Account): Promise<number> {
if (account instanceof AvalancheAccount) {
const superfluidAccount = createFromAvalancheAccount(account)
try {
// @note: refactor in SDK calling init inside this method
const superfluidAccount = createFromAvalancheAccount(account)
await superfluidAccount.init()

const balance = await superfluidAccount.getALEPHBalance()
return balance.toNumber()
} catch {
} catch (e) {
console.error(e)
return 0
}
}
Expand Down

0 comments on commit a35898f

Please sign in to comment.