Skip to content

Class diagram for SwapProvider and useSwap refactor #123

@Dargon789

Description

@Dargon789

Reviewer's Guide

This PR introduces SIWE and social login (guest/Epic) support, overhauls the wallet-widget’s listing and filtering into a unified GeneralList, refactors navigation headers into distinct subcomponents, and reshapes the checkout flow with new contexts and selection steps, while bumping package versions and updating styling utilities.

Class diagram for SwapProvider and useSwap refactor

classDiagram
    class SwapProvider {
      - lifiChains: ChainId[]
      - lifiTokens: Token[]
      + useEffect() fetches supported chains and tokens
      + provides lifiChains, lifiTokens to context
    }
    class useSwap {
      + lifiChains
      + lifiTokens
    }
    SwapProvider <|-- useSwap
Loading

Class diagram for SequenceCheckoutProvider navigation refactor

classDiagram
    class SequenceCheckoutProvider {
      - checkoutHistory: HistoryCheckout
      - getCheckoutFlowHeader()
      - getCheckoutFlowContent()
      + useEffect() resets checkoutHistory on modal open
      + provides NavigationCheckoutContext
    }
    class NavigationCheckoutContextProvider {
      + history: HistoryCheckout
      + setHistory()
      + defaultLocation: NavigationCheckout
    }
    SequenceCheckoutProvider o-- NavigationCheckoutContextProvider
Loading

Class diagram for SocialLink context and modal integration

classDiagram
    class SequenceConnectProvider {
      - isSocialLinkOpen: boolean
      - setIsSocialLinkOpen()
      + SocialLinkContextProvider
      + SocialLink modal
    }
    class SocialLinkContextProvider {
      + isSocialLinkOpen
      + setIsSocialLinkOpen()
      + waasConfigKey
    }
    class SocialLink {
      + UI for linking guest/epic account
    }
    SequenceConnectProvider o-- SocialLinkContextProvider
    SocialLinkContextProvider o-- SocialLink
Loading

Class diagram for GeneralList and FilterMenu refactor

classDiagram
    class GeneralList {
      + variant: 'default' | 'swap'
      + renders unified list for tokens, collectibles, etc.
    }
    class FilterMenu {
      + filterMenuType: 'tokens' | 'collectibles' | 'history'
      + renders FilterOptions
    }
    class FilterOptions {
      + filterType: 'wallets' | 'networks' | 'collections'
    }
    GeneralList o-- FilterMenu
    FilterMenu o-- FilterOptions
Loading

File-Level Changes

Change Details Files
Social login and SIWE integration
  • Added guestWaas and epicWaas connectors with logos and sequenceWaaS logic
  • Introduced useSocialLink hook, SocialLinkContextProvider, and SocialLink modal UI
  • Integrated EpicAuthProvider into Connect flow to handle redirects
  • Extended Connected examples with signSIWE and signTypedData handlers
packages/connect/src
examples/next/src/app/components/Connected.tsx
Unified listing and filtering
  • Replaced separate TokenList/CollectiblesList/History with GeneralList component
  • Consolidated filters into FilterOptions and MiniButton using SlideupDrawer
  • Refactored useGetAllCollections and useGetAllTokensDetails for new list
  • Updated various views to use GeneralList
packages/wallet-widget/src/components/SearchLists
packages/wallet-widget/src/hooks
packages/wallet-widget/src/views
Navigation header refactor
  • Extracted NavigationHeader into type-based subcomponents (HomeHeader, TokenHeader, etc.)
  • Created NavigationHeaderContext for search and tabs
  • Updated getHeader/getContent utils to use new header components
packages/wallet-widget/src/components/NavigationHeader
packages/wallet-widget/src/components/SequenceWalletProvider/utils
Checkout UI and flow revamp
  • Updated SequenceCheckoutProvider with NavigationCheckoutContext
  • Created PaymentSelection, TokenSelection, PayWithCrypto, and PayWithCreditCard components
  • Replaced legacy modals with new tab-based checkout steps
packages/checkout/src
packages/checkout/src/views
Style, version, and utility updates
  • Bumped package versions to 5.3.6 across connect, hooks, checkout, immutable-connector, wallet-widget
  • Updated styles.ts with new utilities and fixes
  • Added truncateAtIndex helper and adjusted tailwind classes
packages/connect/src/styles.ts
packages/connect/src/utils/helpers.ts
package.json

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Originally posted by @sourcery-ai[bot] in #110 (comment)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdependenciesPull requests that update a dependency filedocumentationImprovements or additions to documentationduplicateThis issue or pull request already existsenhancementNew feature or requestgood first issueGood for newcomersinvalidThis doesn't seem rightjavascriptPull requests that update javascript codequestionFurther information is requested

Projects

Status

Backlog

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions