Skip to content

[WIP] topic integrate lifi #716

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

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
cc5cf19
f
marcelines May 19, 2025
290b304
f
marcelines May 19, 2025
93dc4c1
f: adds sticky container to page and fixes sticky behavior
marcelines May 21, 2025
a47c3ae
f: adds dropdown sort and action-buttons components
marcelines May 21, 2025
2f059a1
f
marcelines May 21, 2025
f2e8d20
f
marcelines May 22, 2025
934a734
f: splitted layout
marcelines May 23, 2025
8d9b6ef
f: adds assets detail page
marcelines May 23, 2025
d7166ee
f: adds detail page for collectibles
marcelines May 26, 2025
465ce29
f: pagination collectibles
marcelines May 26, 2025
301357c
f: parallel routes behavior for asset detail
marcelines May 26, 2025
aea00a7
f
marcelines May 26, 2025
43f87a5
f: css only
marcelines May 26, 2025
2b17b82
f: minor fixes and detail for collectible on both views
marcelines May 27, 2025
49e1ea7
f: pathname fix active state for listing
marcelines May 27, 2025
922a21a
f: adds network breakdown and token logo components
marcelines May 27, 2025
10d988e
f
marcelines May 27, 2025
8150019
f: markdown
marcelines Jun 2, 2025
53e7a3f
f
marcelines Jun 3, 2025
84b423b
f
marcelines Jun 4, 2025
14399a3
feat: add LiFi widget
JulesFiliot Jun 6, 2025
c6f15f7
feat(lifi-widget): implement ExchangeDialog and integrate with Token …
JulesFiliot Jun 19, 2025
8bdf4c6
feat(lifi-widget): add optional config prop to LifiWidget component
JulesFiliot Jun 23, 2025
14a52cd
feat(WIP-lifi): integrate wallet into lifi
JulesFiliot Jun 23, 2025
4e2ebb2
feat(lifi-widget): WIP handle token auto select
JulesFiliot Jun 23, 2025
8f8cc04
feat(lifi-widget-exchange): add auto chain resolution && selection
JulesFiliot Jun 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
"typescript.tsdk": "node_modules/typescript/lib",
"npm.packageManager": "pnpm",
"eslint.useESLintClass": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
},
"eslint.workingDirectories": [
"./packages/colors",
"./packages/icons",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@ import { Suspense } from 'react'

import { Button, Tooltip } from '@status-im/components'
import { BuyIcon, ReceiveBlurIcon } from '@status-im/icons/20'
import { StickyHeaderContainer } from '@status-im/wallet/components'
import {
Balance,
CurrencyAmount,
NetworkBreakdown,
StickyHeaderContainer,
TokenLogo,
} from '@status-im/wallet/components'
import { cx } from 'class-variance-authority'
import { notFound } from 'next/navigation'
import { MDXRemote } from 'next-mdx-remote/rsc'
import { ErrorBoundary } from 'react-error-boundary'

import { getAPIClient } from '../../../../..//data/api'
import { Balance } from '../../../../_components/balance'
import { BuyCryptoDrawer } from '../../../../_components/buy-crypto-drawer'
import { portfolioComponents } from '../../../../_components/content'
import { CurrencyAmount } from '../../../../_components/currency-amount'
import { ReceiveCryptoDrawer } from '../../../../_components/receive-crypto-drawer'
import { TokenAmount } from '../../../../_components/token-amount'
import { Chart } from '../_components/chart'
import { Loading } from '../_components/chart/loading'
import { NetworkBreakdown } from './_components/network-breakdown'
import { TokenLogo } from './_components/token-logo'

import type { ApiOutput, NetworkType } from '@status-im/wallet/data'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import { Button } from '@status-im/components'
import { ExternalIcon, OptionsIcon, SadIcon } from '@status-im/icons/20'
import { OpenseaIcon } from '@status-im/icons/social'
import { CurrencyAmount, NetworkLogo } from '@status-im/wallet/components'

import { getAPIClient } from '../../../../../../../data/api'
import { CurrencyAmount } from '../../../../../../_components/currency-amount'
import { NetworkLogo } from '../../../../../../_components/network-logo'
import { ImageLightbox } from './_components/image-lightbox'
import { InfoCard } from './_components/info-card'

Expand Down
3 changes: 2 additions & 1 deletion apps/portfolio/src/app/[address]/@list/@balance/default.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Balance } from '@status-im/wallet/components'

import { getAPIClient } from '../../../../data/api'
import { Balance } from '../../../_components/balance'

import type { NetworkType } from '@status-im/wallet/data'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { useMemo } from 'react'

import { Button, Skeleton } from '@status-im/components'
import { SadIcon } from '@status-im/icons/20'
import { useInfiniteLoading } from '@status-im/wallet/hooks'
import { useInfiniteQuery } from '@tanstack/react-query'
import { cx } from 'class-variance-authority'
import { usePathname, useSearchParams } from 'next/navigation'
import { ErrorBoundary } from 'react-error-boundary'

import { Link } from '../../../../_components/link'
import { DEFAULT_SORT, GRADIENTS } from '../../../../_constants'
import { useInfiniteLoading } from '../../../../_hooks/use-infinite-loading'
import { useSearchAndSort } from '../../../../_hooks/use-search-and-sort'

import type { GetCollectiblesProps, GetCollectiblesResponse } from '../_actions'
Expand Down
4 changes: 2 additions & 2 deletions apps/portfolio/src/app/_components/action-buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import { Input } from '@status-im/components'
import { SearchIcon } from '@status-im/icons/20'
import { DropdownSort } from '@status-im/wallet/components'
import { useParams, usePathname } from 'next/navigation'
import { match, P } from 'ts-pattern'

import { useSearchAndSort } from '../_hooks/use-search-and-sort'
import { AdminDropdownSort } from './dropdown-sort'
import { TabLink } from './tab-link'

const checkPathnameAndReturnTabValue = (
Expand Down Expand Up @@ -54,7 +54,7 @@ const ActionButtons = () => {
clearable={!!inputValue}
aria-label="Search"
/>
<AdminDropdownSort
<DropdownSort
data={sortOptions}
onOrderByChange={onOrderByChange}
orderByColumn={orderByColumn}
Expand Down
65 changes: 0 additions & 65 deletions apps/portfolio/src/app/_components/currency-amount.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion apps/portfolio/src/app/_components/detail-drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const DetailDrawer = (props: Props) => {
.with(
P.when(p => {
const segments = p.split('/').filter(Boolean)
return p.includes('/assets/') && segments.length >= 4
return p.includes('/assets/') && segments.length === 3
}),
() => true
)
Expand Down
2 changes: 1 addition & 1 deletion apps/portfolio/src/app/_components/sidenav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import { Avatar } from '@status-im/components'
import { InsightsIcon } from '@status-im/icons/20'
import { CurrencyAmount } from '@status-im/wallet/components'
import { cva, cx } from 'class-variance-authority'
import Link from 'next/link'
import { usePathname } from 'next/navigation'

import { Tooltip } from '../_components/tooltip'
import { useMediaQuery } from '../_hooks/use-media-query'
import { AddAddress } from './add-address'
import { CurrencyAmount } from './currency-amount'
import { FeatureEnabled } from './feature-enabled'

import type { CustomisationColorType } from '@status-im/components'
Expand Down
16 changes: 9 additions & 7 deletions apps/portfolio/src/app/_config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { createConfig, http } from 'wagmi'
import { createClient } from 'viem'
import { createConfig, http, injected } from 'wagmi'
import { arbitrum, mainnet, optimism } from 'wagmi/chains'

export const supportedChains = [mainnet, optimism, arbitrum] as const

export const config = createConfig({
chains: [mainnet, optimism, arbitrum],
chains: supportedChains,
ssr: false,
transports: {
// todo: replace public clients
[mainnet.id]: http(),
[optimism.id]: http(),
[arbitrum.id]: http(),
connectors: [injected()],
// todo: replace public clients
client({ chain }) {
return createClient({ chain, transport: http() })
},
})

Expand Down
6 changes: 6 additions & 0 deletions apps/wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-hook-form": "^7.54.2",
"rehype-react": "^8.0.0",
"rehype-stringify": "^10.0.0",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.0.0",
"superjson": "^2.2.1",
"trpc-chrome": "^1.0.0",
"ts-pattern": "^5.7.1",
"unified": "^11.0.5",
"vite-plugin-node-polyfills": "^0.23.0",
"zod": "^3.23.8"
},
Expand Down
70 changes: 70 additions & 0 deletions apps/wallet/src/components/action-buttons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
'use client'

// import { Input } from '@status-im/components'
// import { SearchIcon } from '@status-im/icons/20'
import { DropdownSort } from '@status-im/wallet/components'

// import { match, P } from 'ts-pattern'
import { TabLink } from './tab-link'

// const checkPathnameAndReturnTabValue = (
// pathname: string,
// ): 'assets' | 'collectibles' => {
// return match(pathname)
// .with(P.string.includes('/assets'), () => 'assets')
// .with(P.string.includes('/collectibles'), () => 'collectibles')
// .otherwise(() => 'assets') as 'assets' | 'collectibles'
// }

// const placeholderText = {
// assets: 'Search asset name or symbol',
// collectibles: 'Search collection or collectible name',
// } as const

type Props = {
address: string
pathname: string
searchAndSortValues: {
inputValue: string
updateSearchParam: (value: string) => void
orderByColumn: string
ascending: boolean
onOrderByChange: (value: string | number, ascending: boolean) => void
sortOptions: Record<string, string>
}
}

const ActionButtons = (props: Props) => {
// const { address, pathname, searchAndSortValues } = props
const { address, searchAndSortValues } = props

// const placeholder = placeholderText[checkPathnameAndReturnTabValue(pathname)]

return (
<div className="flex place-content-between">
<div className="flex gap-1.5">
<TabLink href={`/${address}/assets`}>Assets</TabLink>
<TabLink href={`/${address}/collectibles`}>Collectibles</TabLink>
</div>
<div className="flex items-center gap-2">
{/* <Input
placeholder={placeholder}
icon={<SearchIcon />}
size="32"
value={searchAndSortValues.inputValue}
onChange={searchAndSortValues.updateSearchParam}
clearable={!!searchAndSortValues.inputValue}
aria-label="Search"
/> */}
<DropdownSort
data={searchAndSortValues.sortOptions}
onOrderByChange={searchAndSortValues.onOrderByChange}
orderByColumn={searchAndSortValues.orderByColumn}
ascending={searchAndSortValues.ascending}
/>
</div>
</div>
)
}

export { ActionButtons }
Loading
Loading