Skip to content

Commit

Permalink
fix the faucet chain selection
Browse files Browse the repository at this point in the history
  • Loading branch information
sstraatemans committed Feb 24, 2025
1 parent 761c481 commit e209054
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,13 @@ export const getHighestBalanceChainId = async ({

const chainBalance = data.reduce<IBalance>(
(acc, curr, idx) => {
const balance = (curr.result as any).data?.balance ?? 0;
const balanceResult = (curr.result as any).data?.balance ?? 0;
const balance =
typeof balanceResult === 'number'
? balanceResult
: balanceResult.decimal;

if (balance > acc.balance) {
if (parseFloat(balance) > parseFloat(`${acc.balance}`)) {
return {
balance,
chainId: `${idx}`,
Expand Down

0 comments on commit e209054

Please sign in to comment.