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

refactor: PoolCore, remove pool.displayTokens, new display token functions #373

Open
wants to merge 32 commits into
base: feat/vote-list
Choose a base branch
from

Conversation

agualis
Copy link
Collaborator

@agualis agualis commented Dec 20, 2024

This goes on top of the big voting list PR because that contains many displayToken related changes that would conflict the the planned tokens refactor.

Main changes:

  • Removes all API deprecated pool.displayTokens calls.
  • Simplifies token related components types by using ApiToken instead of types like GqlDisplayToken
  • Centralises token display helpers in a new file (pool.tokens.display.ts). Note that this is just a temporary file. Its methods and the file itself will be renamed/moved in another PR (where we will fix the logic related with pool actions and getPoolActionableTokens).
  • Sorts display pool tokens by index to have a more predictable token display outputs.
  • Adds integration tests to cover all the new extracted functions above (covering all the pool edge cases).
  • Introduces a new PoolCore type to start cleaning the mess around different Pool types (Pool, PoolListItem, PoolData...) used across the Pool token display related components. (This must be simplified even more in incoming PRs but we need it now to enable previous points).

TODO:
The refactor is far from perfect but should unblock Voting list PR and simplify the path to a cleaner code base.

  • Cyclic dependency in pool.tokens.display: Fixed in refactor: replace blockExplorer hook by plain TS functions #378
  • TokenRow the pool token related logic is messy, we need to find proper abstractions and functions for pool.tokens.utils.ts
  • VoteListTableRow: Different problems with pool structure (check TODOs in that file)
  • Rename long functions like getCompositionDisplayTokensWithPossibleNestedTokensWithBalance
  • Rethink all the logic around PoolCore, Pool, FeaturedPool, PoolListItem, GqlPoolElement...
  • Do we need balance in underlying tokens? (review and test all posible edge cases)
  • There are 2 TokenRow components (one in TokenRowSelectList)with optional props like pool, token, apiToken...Review if we can simplify.
  • Extract a Fragment for FeaturedPools and create a PR to remove them (they are not currently used)

Copy link

vercel bot commented Dec 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mono-beets-v3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 7, 2025 5:16pm
mono-frontend-v3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 7, 2025 5:16pm
mono-test-v3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 7, 2025 5:16pm

* chore: bump graphql

* skip flaky test

* fix integration test

---------

Co-authored-by: Alberto Gualis <[email protected]>
* chore: update dependencies recommended by dependabot

* chore: update dependencies recommended by dependabot2
packages/lib/modules/pool/PoolList/PoolListTokenPills.tsx Outdated Show resolved Hide resolved
packages/lib/modules/pool/pool.tokens.display.ts Outdated Show resolved Hide resolved
packages/lib/modules/pool/pool.tokens.display.ts Outdated Show resolved Hide resolved
packages/lib/modules/pool/pool.tokens.display.ts Outdated Show resolved Hide resolved
packages/lib/modules/pool/PoolDetail/PoolComposition.tsx Outdated Show resolved Hide resolved
* update pagination props

* add withdraw

* First pass on moving the theme towards the new brand

* add tinycolor2 types

* move to beets folder

* add min height

* fix alignment for last page

* Top level pass supporting new designs

* adjust input color

* darken the grays, fix input bgs

* update withdraw action

* update provider

* remove navlink

* clean up grays

* Revert some theme changes

* darker color for active button

* copy latest marketing page from balancer

* rename to Stake S

* chore: Landing page init

* chore: Add section

* Mocking additional sections

* layout staked sonic section

* updates for sonic

* preparing for sonic

* Fill in mabeets section

* align card heights

* Drop in staked sonic pieces

* build out social club section

* add staking bg

* Fix grow earn svg

* updated sts copy

* add balancer v3 section

* Add security section

* feat: add new isBufferAllowed field to gql tokens

* more sonic updates

* fix min deposit

* Add CTAs, clean up spacing

* mobile cleanup pass

* fix security spacing

* fix for sonic

* update contract addresses

* change path to sts

* split amounts

* update relayer address

* update withdraw

* add faq section

* update unstake & withdraw

* update hardcoded balancer references

* chore: Add animated title

* chore: Add hero bg image

* chore: Fix heading on mobile

* Swap out hero text

* Fix stS subheadline

* update label name to suggested one

* show pool creator for balancer

* add balancer sdk for wagmi generate

* Revert "show pool creator for balancer"

This reverts commit a39b191.

* chore: add sonic integration test

* use correct pool creator url

* put back tokens

* update token input checks

* refetch balances on success

* only show appzi for balancer

* update refetching withdrawal requests

* update favicon

* show dark/light switcher for balancer

* update policies

* rename for clarity

* show pool name for beets

* hide boosted and v3

* block adding liq here

* add a space

* fix wnativeasset address

* chore: Change hero spacing

* feat: LZBEETS migrator

* Clean up, hook up mabeets link

* Add mabeets link

* fix twitter link

* Use new logo

* fix link

* updated with infographic

* fix alignment

* remove sub stats

* fix type error

* updated banner

* update footer copy

* Add migration link

* fill out faq

* fix mobile nav

* fix promo banner

* Fix copy

* add discord redirect

* move to lib/modules

* add risks page

* Add better migration image

* clean up migration copy

* iterating on migration flow

* add protocol data

* remove brand assets link

* update svg

* update mobile nav

* reduce the height

* hide "to sonic" on smaller screens

* add opengraph image

* Swap liquidity for yield, force white for final color

* update metadata

* set a metadata base

* update package.json

* Add sonic pools list

* fix build error

* beets migrator

* temp add ccontract

* remove overrides again

* add approval flow

* only show boost for balancer

* switch to drpc

* update faq txt

* add migration guide links

* add links to data cards

* update migrator

* updated copy

* add landing modal

* push copy change

* fix case

* add sts data

* manually add mc3

* chore: bump to sdk 1.0.2

* typo

* add & view sts data

* Add audit link

* Improve validator selection

* fixes


* Add network dropdown for pools

* add checkbox to hide modal

* fix hydration error

* add note to unstake flow

* add sfc contract

* update contracts again

* fix multicall

* update hook

* update hook

* refactor: Lst component

* added stats section, hiding charts currently

* shrink stats

* clean up

* specify bg color explicitly

* set correct default network

* format token amount

* data hook up

* extend rate label

* update faq text

* push updated copy

* remove lzbeets migrator button here

* add aprs to mabeets

* remove risks link

* scroll to anchor

* fix mabeets apr calc

* fix apr calc

* use beets opengraph image

* add icons

* add sonic-logo

* Add amount received for stake and unstake

* fix missing button

* Add lz beets migration modal

* add network switch, uncomment code

* fix approval flow

* Filter pools based on connected network

* use custom format

* add logouri

* update lst withdraw flow

* add withdraw request helper

* fix withdraw flow

* fix: use dRPC in integration test fork

* chore: add blocknumber for sonic

* chore: add gnosis fork blocknumber

* update customLinks

* remove unstake receipt parser

* update receipt parsers

---------

Co-authored-by: Daniel <[email protected]>
Co-authored-by: Gareth Fuller <[email protected]>
Co-authored-by: Alberto Gualis <[email protected]>
Co-authored-by: daniel <[email protected]>
@agualis agualis requested a review from garethfuller January 7, 2025 15:17
* chore: add disallowNestedActions

* chore: clean disallowNestedActions setup

* chore: remove old phantom pool from disallowedNested
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.

4 participants