Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add lending pool balances to UI #28

Merged
merged 3 commits into from
Sep 10, 2024

Conversation

Teolhyn
Copy link
Member

@Teolhyn Teolhyn commented Sep 10, 2024

  • Add getter for pool balances
  • Add functionality to get the balance data through transaction simulation
  • Add recurring fetching of contract balances to front-end with six second intervals.

Copy link
Member

@kovipu kovipu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tosi hyvää kamaa

Comment on lines 15 to 16
const [totalSupplied, setTotalSupplied] = useState<string>('0');
const [supplyAPY, setSupplyAPY] = useState<string>('0.00%');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Näissä ei oo pakko määrittää tota <string> explisiittisesti, TS inferoi sen tosta default-arvosta.

Comment on lines 36 to 51
const formatSuppliedAmount = useCallback((amount: bigint) => {
const ten_k = BigInt(10_000 * 10_000_000);
const one_m = BigInt(1_000_000 * 10_000_000);
switch (true) {
case amount > one_m:
return `${(Number(amount) / (1_000_000 * 10_000_000)).toFixed(2)}M`;
case amount > ten_k:
return `${(Number(amount) / (1_000 * 10_000_000)).toFixed(1)}K`;
default:
return `${(Number(amount) / 10_000_000).toFixed(1)}`;
}
}, []);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tän voisi piilottaa abstraktion taakse, vaikkapa uuteen formatting.ts tiedostoon

@Teolhyn Teolhyn force-pushed the feat/get-balance-and-ui-balances branch from 0a8ec54 to 3039336 Compare September 10, 2024 15:06
@Teolhyn Teolhyn requested a review from kovipu September 10, 2024 15:14
@Teolhyn Teolhyn force-pushed the feat/get-balance-and-ui-balances branch from 3039336 to dfa2458 Compare September 10, 2024 15:19
@Teolhyn Teolhyn merged commit 62dbec6 into main Sep 10, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants