Skip to content

Commit

Permalink
Merge branch 'development' of github.com:kingsley-einstein/uusd.ubq.f…
Browse files Browse the repository at this point in the history
…i into development
  • Loading branch information
kingsley-einstein committed Dec 13, 2024
2 parents 0333eaf + ec3a5c7 commit 61d1096
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/scripts/faucet.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getContract } from "viem";
import { diamondAddress, ufaucetAbi } from "./constants.json";
import { mainnet } from "viem/chains";
import { getConnectedClient } from "./connect-wallet";
import { diamondAddress, ufaucetAbi } from "./constants.json";
import { publicClient } from "./shared";

interface CollateralInformation {
Expand Down Expand Up @@ -33,7 +33,8 @@ const contract = getContract({

export async function getAllCollaterals() {
try {
return (await contract.read.allCollaterals()) as `0x${string}`[];
const collaterals = (await contract.read.allCollaterals()) as `0x${string}`[];
return collaterals.filter((c): c is `0x${string}` => /^0x[0-9a-fA-F]+$/.test(c));
} catch (error) {
return [];
}
Expand Down

0 comments on commit 61d1096

Please sign in to comment.