diff --git a/.i18n-codegen.json b/.i18n-codegen.json index a9395a1f305..267e4688113 100644 --- a/.i18n-codegen.json +++ b/.i18n-codegen.json @@ -462,18 +462,6 @@ "trans": "CalendarTrans", "emitTS": true } - }, - { - "input": "./packages/plugins/FriendTech/src/locales/en-US.json", - "output": "./packages/plugins/FriendTech/src/locales/i18n_generated", - "parser": { "type": "i18next", "contextSeparator": "$", "pluralSeparator": "_" }, - "generator": { - "type": "i18next/react-hooks", - "hooks": "useI18N", - "namespace": "io.mask.friend-tech", - "trans": "Translate", - "emitTS": true - } } ] } diff --git a/packages/icons/icon-generated-as-jsx.js b/packages/icons/icon-generated-as-jsx.js index 35dc9758c39..c3b027bcf9a 100644 --- a/packages/icons/icon-generated-as-jsx.js +++ b/packages/icons/icon-generated-as-jsx.js @@ -4092,11 +4092,6 @@ export const FindTruman = /*#__PURE__*/ __createIcon('FindTruman', [ u: () => new URL('./plugins/FindTruman.png', import.meta.url).href, }, ]) -export const FriendTech = /*#__PURE__*/ __createIcon('FriendTech', [ - { - u: () => new URL('./plugins/FriendTech.svg', import.meta.url).href, - }, -]) export const Gitcoin = /*#__PURE__*/ __createIcon('Gitcoin', [ { c: ['dark'], diff --git a/packages/icons/icon-generated-as-url.js b/packages/icons/icon-generated-as-url.js index 1462048b398..122d994557b 100644 --- a/packages/icons/icon-generated-as-url.js +++ b/packages/icons/icon-generated-as-url.js @@ -378,7 +378,6 @@ export function ens_url() { return new URL("./plugins/ENS.png", import.meta.url) export function ens_cover_url() { return new URL("./plugins/ENSCover.svg", import.meta.url).href } export function file_service_url() { return new URL("./plugins/FileService.svg", import.meta.url).href } export function find_truman_url() { return new URL("./plugins/FindTruman.png", import.meta.url).href } -export function friend_tech_url() { return new URL("./plugins/FriendTech.svg", import.meta.url).href } export function gitcoin_dark_url() { return new URL("./plugins/Gitcoin.dark.svg", import.meta.url).href } export function gitcoin_light_url() { return new URL("./plugins/Gitcoin.light.svg", import.meta.url).href } export function good_ghosting_dark_url() { return new URL("./plugins/GoodGhosting.dark.svg", import.meta.url).href } diff --git a/packages/icons/plugins/FriendTech.svg b/packages/icons/plugins/FriendTech.svg deleted file mode 100644 index 25333741c6d..00000000000 --- a/packages/icons/plugins/FriendTech.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/packages/mask/background/services/helper/i18n-cache-query-list.ts b/packages/mask/background/services/helper/i18n-cache-query-list.ts index 23d001aa816..cd3aa582694 100644 --- a/packages/mask/background/services/helper/i18n-cache-query-list.ts +++ b/packages/mask/background/services/helper/i18n-cache-query-list.ts @@ -37,5 +37,4 @@ export default { 'plugins/ProfileCard/src/locales/%locale%.json': 'io.mask.web3-profile-card', 'plugins/SwitchLogo/src/locales/%locale%.json': 'io.mask.switch-logo', 'plugins/Calendar/src/locales/%locale%.json': 'io.mask.calendar', - 'plugins/FriendTech/src/locales/%locale%.json': 'io.mask.friend-tech', } diff --git a/packages/mask/package.json b/packages/mask/package.json index 4dca289a822..7398670771a 100644 --- a/packages/mask/package.json +++ b/packages/mask/package.json @@ -52,7 +52,6 @@ "@masknet/plugin-cross-chain-bridge": "workspace:^", "@masknet/plugin-debugger": "workspace:^", "@masknet/plugin-file-service": "workspace:^", - "@masknet/plugin-friend-tech": "workspace:^", "@masknet/plugin-gitcoin": "workspace:^", "@masknet/plugin-go-plus-security": "workspace:^", "@masknet/plugin-handle": "workspace:^", diff --git a/packages/mask/shared/plugin-infra/register.js b/packages/mask/shared/plugin-infra/register.js index 6849417df8e..8c45bf0b51d 100644 --- a/packages/mask/shared/plugin-infra/register.js +++ b/packages/mask/shared/plugin-infra/register.js @@ -29,4 +29,3 @@ import '@masknet/plugin-snapshot/register' import '@masknet/plugin-redpacket/register' import '@masknet/plugin-switch-logo/register' import '@masknet/plugin-calendar/register' -import '@masknet/plugin-friend-tech/register' diff --git a/packages/plugins/Avatar/src/Application/PersonaPage.tsx b/packages/plugins/Avatar/src/Application/PersonaPage.tsx index c520d7ce3cc..6e622706f52 100644 --- a/packages/plugins/Avatar/src/Application/PersonaPage.tsx +++ b/packages/plugins/Avatar/src/Application/PersonaPage.tsx @@ -66,7 +66,7 @@ export function PersonaPage() { return ( <> - + {isPending ? diff --git a/packages/plugins/FriendTech/package.json b/packages/plugins/FriendTech/package.json deleted file mode 100644 index 2722b0da7fa..00000000000 --- a/packages/plugins/FriendTech/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "@masknet/plugin-friend-tech", - "private": true, - "sideEffects": [ - "./src/register.ts" - ], - "type": "module", - "exports": { - ".": { - "mask-src": "./src/index.ts", - "default": "./dist/index.js" - }, - "./register": { - "mask-src": "./src/register.ts", - "default": "./dist/register.js" - } - }, - "dependencies": { - "@masknet/icons": "workspace:^", - "@masknet/plugin-infra": "workspace:^", - "@masknet/shared": "workspace:^", - "@masknet/shared-base": "workspace:^", - "@masknet/shared-base-ui": "workspace:^", - "@masknet/theme": "workspace:^", - "@masknet/web3-hooks-base": "workspace:^", - "@masknet/web3-providers": "workspace:^", - "@masknet/web3-shared-base": "workspace:^", - "@masknet/web3-shared-evm": "workspace:^", - "@servie/events": "^3.0.0", - "bignumber.js": "9.1.2", - "react-router-dom": "^6.24.0", - "react-use": "^17.5.0", - "urlcat": "^3.1.0" - }, - "lingui": { - "catalogs": [ - { - "path": "src/locale/{locale}", - "include": [ - "src" - ] - } - ], - "compileNamespace": "json", - "locales": [ - "en-US", - "ja-JP", - "ko-KR", - "zh-CN", - "zh-TW" - ], - "fallbackLocales": { - "zh-CN": "zh-TW", - "zh-TW": "zh-CN", - "default": "en-US" - } - } -} diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/ActionsContent.tsx b/packages/plugins/FriendTech/src/SiteAdaptor/ActionsContent.tsx deleted file mode 100644 index 2787b0e46bf..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/ActionsContent.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { PluginWalletStatusBar } from '@masknet/shared' -import { useMatch } from 'react-router-dom' -import { RoutePaths } from '../constants.js' - -export function MainActionsContent() { - const matchMain = !!useMatch(RoutePaths.Main) - - return matchMain ? : null -} diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/FriendTechDialog.tsx b/packages/plugins/FriendTech/src/SiteAdaptor/FriendTechDialog.tsx deleted file mode 100644 index 07a00633c78..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/FriendTechDialog.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import { makeStyles } from '@masknet/theme' -import { DialogActions, DialogContent } from '@mui/material' -import { memo, useMemo } from 'react' -import { MemoryRouter } from 'react-router-dom' -import urlcat from 'urlcat' -import { RoutePaths } from '../constants.js' -import { FriendTechRoutes } from './Routes.js' -import { RouterDialog } from './components/RouterDialog.js' -import { MainActionsContent } from './ActionsContent.js' - -const useStyles = makeStyles()((theme) => ({ - paper: { - width: 600, - maxWidth: 'none', - height: 620, - boxShadow: 'none', - backgroundImage: 'none', - [theme.breakpoints.down('sm')]: { - margin: 12, - }, - }, - content: { - padding: 0, - overflow: 'auto', - boxSizing: 'border-box', - '&::-webkit-scrollbar': { - display: 'none', - }, - }, - actions: { - padding: 0, - }, -})) -interface FriendTechDialogProps { - onClose: () => void - address?: string -} - -export const FriendTechDialog = memo(function FriendTechDialog({ onClose, address }: FriendTechDialogProps) { - const { classes } = useStyles() - - const initialEntries = useMemo(() => { - if (!address) return [RoutePaths.Exit, RoutePaths.Main] - const OpenEntry = { - pathname: RoutePaths.Detail, - search: '?' + urlcat('', { address }), - } - return [RoutePaths.Exit, OpenEntry] - }, [address]) - return ( - - - - - - - - - - - ) -}) diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/FriendTechInjection.tsx b/packages/plugins/FriendTech/src/SiteAdaptor/FriendTechInjection.tsx deleted file mode 100644 index e53ff1b1fb7..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/FriendTechInjection.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { memo, useCallback, useEffect, useState } from 'react' -import { emitter } from './emitter.js' -import { FriendTechDialog } from './FriendTechDialog.js' - -export const FriendTechInjection = memo(function FriendTechInjection() { - const [open, setOpen] = useState(false) - const [address, setAddress] = useState() - useEffect(() => { - const unsubscribe = emitter.on('open', ({ address }) => { - setOpen(true) - setAddress(address) - }) - return () => { - unsubscribe() - } - }, []) - const onClose = useCallback(() => setOpen(false), []) - - if (!open) return null - return -}) diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/FriendTechNameWidget.tsx b/packages/plugins/FriendTech/src/SiteAdaptor/FriendTechNameWidget.tsx deleted file mode 100644 index 4be71a21d7a..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/FriendTechNameWidget.tsx +++ /dev/null @@ -1,70 +0,0 @@ -import { Icons } from '@masknet/icons' -import { Plugin } from '@masknet/plugin-infra' -import { memo, useCallback, useEffect, type MouseEvent } from 'react' -import { useUserInfo } from './hooks/useUserInfo.js' -import { viewUser } from './emitter.js' -import { Box, Typography } from '@mui/material' -import { formatBalance } from '@masknet/web3-shared-base' -import { makeStyles } from '@masknet/theme' -import { useUser } from './hooks/useUser.js' -import { ProgressiveText } from '@masknet/shared' - -const useStyles = makeStyles()((theme) => ({ - bar: { - padding: '2px 4px', - height: 20, - boxSizing: 'border-box', - borderRadius: 8, - display: 'flex', - alignItems: 'center', - gap: 4, - margin: theme.spacing(0.5, 0), - }, - icon: { - filter: 'drop-shadow(0px 6px 12px rgba(1, 186, 250, 0.20))', - }, - text: { - fontSize: 12, - fontWeight: 400, - color: theme.palette.maskColor.main, - }, -})) - -interface Props extends Plugin.SiteAdaptor.NameWidgetOptions {} - -export const FriendTechNameWidget = memo(function FriendTechNameWidget({ userId, slot, onStatusUpdate }: Props) { - const { classes, theme } = useStyles() - const { data: userInfo } = useUserInfo(userId) - const disabled = !userInfo - useEffect(() => { - onStatusUpdate?.(disabled) - }, [disabled]) - const isSidebar = slot === Plugin.SiteAdaptor.NameWidgetSlot.Sidebar - const { data: user, isLoading: loadingUser } = useUser(isSidebar ? userInfo?.address : undefined) - - const handleClick = useCallback( - (event: MouseEvent) => { - event.preventDefault() - event.stopPropagation() - viewUser(userInfo?.address) - }, - [userInfo?.address], - ) - if (!userInfo) return null - - if (isSidebar) { - return ( - - - - - {user?.rank || '-'} - - - {formatBalance(userInfo.displayPrice, 18)} - - ) - } - - return -}) diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/Main.tsx b/packages/plugins/FriendTech/src/SiteAdaptor/Main.tsx deleted file mode 100644 index 4cf2d8a5c19..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/Main.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { useParamTab } from '@masknet/shared' -import { useAccount } from '@masknet/web3-hooks-base' -import { Box, Typography } from '@mui/material' -import { TitleTabs } from '../constants.js' -import { HistoryList } from './components/HistoryList.js' -import { KeysTab } from './components/KeysTab.js' -import { useI18N } from '../locales/i18n_generated.js' - -export function Main() { - const [tab] = useParamTab(TitleTabs.Keys) - const t = useI18N() - const account = useAccount() - - if (!account) { - return ( - - t.palette.maskColor.third}> - {t.wallet_require()} - - - ) - } - - if (tab === TitleTabs.History) - return ( - - - - ) - return -} diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/Order.tsx b/packages/plugins/FriendTech/src/SiteAdaptor/Order.tsx deleted file mode 100644 index b6bf27a2f09..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/Order.tsx +++ /dev/null @@ -1,213 +0,0 @@ -import { Icons } from '@masknet/icons' -import { ProgressiveText, ReversedAddress } from '@masknet/shared' -import { ShadowRootTooltip, makeStyles } from '@masknet/theme' -import { Box, Button, InputBase, Typography, inputBaseClasses } from '@mui/material' -import { memo, useEffect, useMemo, useState } from 'react' -import { useSearchParams } from 'react-router-dom' -import { FRIEND_TECH_CONTRACT_ADDRESS } from '../constants.js' -import { Translate, useI18N } from '../locales/i18n_generated.js' -import { useEstimateSellGas } from './hooks/useEstimateSellGas.js' -import { useAccount, useGasPrice } from '@masknet/web3-hooks-base' -import { NetworkPluginID } from '@masknet/shared-base' -import { ChainId } from '@masknet/web3-shared-evm' -import { BigNumber } from 'bignumber.js' -import { useOwnKeys } from './hooks/useOwnKeys.js' -import { useUser } from './hooks/useUser.js' -import { formatBalance } from '@masknet/web3-shared-base' - -const useStyles = makeStyles()((theme) => ({ - icon: { - filter: 'drop-shadow(0px 6px 12px rgba(1, 186, 250, 0.20))', - }, - summary: { - display: 'flex', - fontSize: 14, - fontWeight: 700, - alignItems: 'center', - color: theme.palette.maskColor.main, - }, - bold: { - fontSize: 18, - marginLeft: 4, - marginRight: 4, - }, - input: { - position: 'relative', - height: 66, - padding: theme.spacing(1.25, 1.5), - color: theme.palette.maskColor.main, - fontWeight: 700, - [`& > .${inputBaseClasses.input}`]: { - paddingTop: `${theme.spacing(2.75)}!important`, - paddingBottom: '0px !important', - flex: 2, - paddingLeft: '0px !important', - fontSize: 14, - fontWeight: 400, - '&::-webkit-outer-spin-button,&::-webkit-inner-spin-button': { - WebkitAppearance: 'none', - margin: 0, - }, - }, - }, - amountLabel: { - position: 'absolute', - top: 10, - left: 12, - color: theme.palette.maskColor.second, - fontFamily: 'Helvetica', - fontSize: 13, - lineHeight: '18px', - whiteSpace: 'nowrap', - '& > sub': { - position: 'absolute', - top: -2, - right: -2, - }, - }, - infos: { - border: `1px solid ${theme.palette.maskColor.line}`, - padding: theme.spacing(1.5), - marginTop: theme.spacing(1.5), - borderRadius: 8, - }, - infoRow: { - display: 'flex', - justifyContent: 'space-between', - marginBottom: theme.spacing(1), - }, - infoLabel: { - fontSize: 14, - color: theme.palette.maskColor.second, - }, - infoValue: { - fontSize: 14, - fontWeight: 700, - }, -})) - -export const Order = memo(function Order() { - const t = useI18N() - const { classes, theme } = useStyles() - const account = useAccount() - const [params, setParams] = useSearchParams() - const [count, setCount] = useState(1) - const address = params.get('address')! - useEffect(() => { - setParams( - (p) => { - p.set('count', count.toString()) - return p.toString() - }, - { replace: true }, - ) - }, [count]) - - const { data: user, isLoading: loadingPrice } = useUser(address) - const { data: own, isLoading: loadingOwnCount } = useOwnKeys(address, account) - const { data: gas, isPending: isEstimating } = useEstimateSellGas(address, account, count.toString()) - const [price, { isLoading: isLoadingPrice }] = useGasPrice(NetworkPluginID.PLUGIN_EVM, { - chainId: ChainId.Base, - }) - const gasFee = useMemo(() => { - if (!price || !gas) return 0 - const value = new BigNumber(price).times(gas) - return formatBalance(value, 18) - }, [price, gas]) - - const cost = useMemo(() => { - const value = new BigNumber(user?.displayPrice ?? 0).times(count) - return formatBalance(value, 18) - }, [user?.displayPrice, count]) - - return ( - - - - - - {/* eslint-disable-next-line react/naming-convention/component-name */} - , - }} - /> - - - - - - - {t.you_currently_hold({ count: own! })} - - - - - { - let value = Number.parseInt(event.currentTarget.value, 10) - value = Number.isNaN(value) ? 1 : value - setCount(Math.max(1, value)) - }} - startAdornment={{t.amount()}*} - /> - - -
-
- {t.from()} - - - -
-
- {t.to()} - - - -
-
- {t.action()} - {t.sell_key()} -
-
- {t.total_amount()} - {cost} ETH -
-
- {t.gas_fee()} - - {gasFee} ETH - -
-
-
- ) -}) diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/Routes.tsx b/packages/plugins/FriendTech/src/SiteAdaptor/Routes.tsx deleted file mode 100644 index c25c2c88754..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/Routes.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { Navigate, Route, Routes } from 'react-router-dom' -import { RoutePaths } from '../constants.js' -import { Main } from './Main.js' -import { UserDetail } from './UserDetail.js' -import { Order } from './Order.js' - -export function FriendTechRoutes() { - return ( - - } /> - } /> - } /> - {/* If router is embedded inside a dialog, */} - {/* which should know it's time to close itself once we enter Exit */} - - } /> - - ) -} diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/UserDetail.tsx b/packages/plugins/FriendTech/src/SiteAdaptor/UserDetail.tsx deleted file mode 100644 index 435a49acfad..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/UserDetail.tsx +++ /dev/null @@ -1,109 +0,0 @@ -import { makeStyles } from '@masknet/theme' -import { Typography } from '@mui/material' -import { memo, useEffect, useState } from 'react' -import { useSearchParams } from 'react-router-dom' -import { useI18N } from '../locales/i18n_generated.js' -import { HistoryList } from './components/HistoryList.js' -import { HoldingList } from './components/HoldingList.js' -import { UserProfile } from './components/UserProfile.js' -import { useUser } from './hooks/useUser.js' - -const useStyles = makeStyles()((theme, _, refs) => ({ - container: { - padding: theme.spacing(2), - display: 'flex', - flexDirection: 'column', - overflow: 'auto', - height: '100%', - boxSizing: 'border-box', - }, - tabs: { - display: 'flex', - gap: theme.spacing(1.5), - marginTop: theme.spacing(1.5), - }, - tab: { - borderRadius: 8, - border: `1px solid ${theme.palette.maskColor.line}`, - padding: theme.spacing(1.5), - display: 'flex', - alignItems: 'center', - cursor: 'pointer', - flex: 1, - }, - name: { - color: theme.palette.maskColor.second, - }, - value: { - color: theme.palette.maskColor.main, - fontWeight: 700, - marginLeft: 'auto', - }, - selectedTab: { - backgroundColor: theme.palette.maskColor.highlight, - borderColor: theme.palette.maskColor.highlight, - [`& .${refs.name}`]: { - fontWeight: 700, - color: theme.palette.maskColor.bottom, - }, - [`& .${refs.value}`]: { - fontWeight: 700, - color: theme.palette.maskColor.bottom, - }, - }, - tabContent: { - overflow: 'auto', - marginTop: theme.spacing(1.5), - overscrollBehavior: 'contain', - flexGrow: 1, - '&::-webkit-scrollbar': { - display: 'none', - }, - }, -})) - -export const UserDetail = memo(function UserDetail() { - type TabKey = 'trades' | 'holding' - const t = useI18N() - const { classes, cx } = useStyles() - const [params, setParams] = useSearchParams() - const address = params.get('address')! - const { data: user, isLoading } = useUser(address) - const [tab, setTab] = useState('trades') - - useEffect(() => { - setParams( - (p) => { - p.set('title', user?.twitterName || '') - return p.toString() - }, - { replace: true }, - ) - }, [user?.twitterName]) - - return ( -
- -
-
setTab('trades')}> - {t.trades()} -
-
setTab('holding')}> - {t.holding()} - {user?.holdingCount} -
-
-
- {tab === 'trades' ? - - : } -
-
- ) -}) diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/components/HistoryList.tsx b/packages/plugins/FriendTech/src/SiteAdaptor/components/HistoryList.tsx deleted file mode 100644 index f77f4a584e0..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/components/HistoryList.tsx +++ /dev/null @@ -1,153 +0,0 @@ -import { ElementAnchor, EmptyStatus, FormattedBalance, Image } from '@masknet/shared' -import { makeStyles } from '@masknet/theme' -import { FriendTech } from '@masknet/web3-providers' -import { formatBalance, formatElapsed, isSameAddress } from '@masknet/web3-shared-base' -import { Box, List, ListItem, Skeleton, Typography, type ListProps } from '@mui/material' -import { useInfiniteQuery } from '@tanstack/react-query' -import { range } from 'lodash-es' -import { memo, useMemo } from 'react' -import { useNavigate } from 'react-router-dom' -import urlcat from 'urlcat' -import { RoutePaths } from '../../constants.js' -import { Translate } from '../../locales/i18n_generated.js' - -const useStyles = makeStyles()((theme) => ({ - list: { - paddingTop: 0, - overscrollBehavior: 'contain', - }, - activity: { - fontSize: 14, - padding: 0, - marginBottom: theme.spacing(1.5), - }, - link: { - cursor: 'pointer', - }, - avatarStack: { - display: 'flex', - }, - avatar: { - borderRadius: '50%', - width: 40, - height: 40, - }, -})) - -interface Props extends ListProps { - account: string -} - -function HistoryItemSkeleton() { - const { classes, theme } = useStyles() - return ( - - - - - - - - - - - - - - ) -} - -export const HistoryList = memo(function HistoryList({ account, className, ...rest }: Props) { - const navigate = useNavigate() - const { classes, theme, cx } = useStyles() - const { data, isFetching, isLoading, fetchNextPage, dataUpdatedAt } = useInfiniteQuery({ - enabled: !!account, - queryKey: ['friend-tech', 'activities', account], - initialPageParam: undefined as any, - queryFn: ({ pageParam: nextIndicator }) => FriendTech.getActivities(account, nextIndicator), - getNextPageParam: (x) => x.nextIndicator, - }) - const activities = useMemo(() => data?.pages.flatMap((x) => x.data) || [], [data?.pages]) - - if (!isLoading && !activities.length) { - return ( - - - - ) - } - - return ( - - {activities.map((activity) => ( - - - - - - - - {/* eslint-disable-next-line react/naming-convention/component-name */} - { - if (isSameAddress(account, activity.subject.address)) return - const otherLink = urlcat(RoutePaths.Detail, { - address: activity.subject.address, - title: activity.subject.name, - }) - navigate(otherLink) - }} - /> - ), - }} - /> - - - - - {' '} - ETH - - , {formatElapsed(activity.createdAt)} - - - - ))} - {isFetching ? range(6).map((i) => ) : null} - fetchNextPage()} key={dataUpdatedAt} height={1} /> - - ) -}) diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/components/HoldingCard.tsx b/packages/plugins/FriendTech/src/SiteAdaptor/components/HoldingCard.tsx deleted file mode 100644 index cc3d7562ae1..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/components/HoldingCard.tsx +++ /dev/null @@ -1,187 +0,0 @@ -import { Icons } from '@masknet/icons' -import { CopyButton, FormattedBalance, Image, ProgressiveText, ReversedAddress } from '@masknet/shared' -import { NetworkPluginID } from '@masknet/shared-base' -import { useEverSeen } from '@masknet/shared-base-ui' -import { ShadowRootTooltip, TextOverflowTooltip, makeStyles } from '@masknet/theme' -import { useWeb3Utils } from '@masknet/web3-hooks-base' -import { type FriendTech as FT } from '@masknet/web3-providers/types' -import { formatBalance, isSameAddress } from '@masknet/web3-shared-base' -import { ChainId } from '@masknet/web3-shared-evm' -import { Link, Skeleton, Typography } from '@mui/material' -import { memo, type HTMLProps } from 'react' -import { useNavigate, useSearchParams } from 'react-router-dom' -import urlcat from 'urlcat' -import { RoutePaths } from '../../constants.js' -import { useI18N } from '../../locales/i18n_generated.js' -import { useUser } from '../hooks/useUser.js' - -const useStyles = makeStyles()((theme) => ({ - avatar: { - borderRadius: '50%', - }, - name: { - fontSize: 12, - maxWidth: '90%', - textOverflow: 'ellipsis', - overflow: 'hidden', - whiteSpace: 'nowrap', - }, - address: { - fontSize: 12, - display: 'flex', - alignItems: 'center', - gap: 6, - marginTop: 6, - }, - link: { - fontSize: 14, - display: 'flex', - alignItems: 'center', - color: theme.palette.maskColor.main, - }, - keyPrice: { - display: 'flex', - alignItems: 'center', - color: theme.palette.maskColor.main, - fontWeight: 700, - }, - holdingCard: { - border: `1px solid ${theme.palette.maskColor.line}`, - borderRadius: 8, - padding: theme.spacing(1.5), - cursor: 'pointer', - }, - rank: { - fontSize: 12, - color: theme.palette.maskColor.main, - fontWeight: 700, - }, - holding: { - display: 'flex', - flexDirection: 'column', - alignItems: 'center', - }, - holderMeta: { - marginTop: theme.spacing(1), - }, - holderMetaItem: { - display: 'flex', - justifyContent: 'space-between', - '&:not(:first-of-type)': { - marginTop: 8, - }, - }, - holderMetaLabel: { - color: theme.palette.maskColor.second, - fontSize: 14, - }, - holderMetaValue: { - color: theme.palette.maskColor.main, - fontWeight: 700, - }, -})) - -interface Props extends HTMLProps { - holding: FT.Holder - holder: string -} - -export const HoldingCard = memo(function HoldingCard({ holding, holder, className, ...rest }: Props) { - const { classes, cx } = useStyles() - const t = useI18N() - const Utils = useWeb3Utils(NetworkPluginID.PLUGIN_EVM) - const [seen, ref] = useEverSeen() - const [params] = useSearchParams() - - // Disable loading with empty string until component appearances. - const { data: user, isLoading: loading } = useUser(seen ? holding.address : '') - const navigate = useNavigate() - - return ( -
{ - if (isSameAddress(params.get('address'), holding.address)) return - navigate(urlcat(RoutePaths.Detail, { address: holding.address, title: holding.twitterName })) - }} - {...rest}> - - # {user?.rank} - -
- - - - @{holding.twitterUsername} - - -
- - - - - -
-
-
-
- {t.key()} - {holding.balance} -
-
- {t.value()} - - - - -
-
-
- ) -}) - -export const HoldingCardSkeleton = memo(function HoldingCardSkeleton({ - className, - ...rest -}: HTMLProps) { - const { classes, cx } = useStyles() - const t = useI18N() - - return ( -
- -
- - -
- -
-
-
-
- {t.key()} - -
-
- {t.value()} - - - -
-
-
- ) -}) diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/components/HoldingList.tsx b/packages/plugins/FriendTech/src/SiteAdaptor/components/HoldingList.tsx deleted file mode 100644 index 0c1163214a0..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/components/HoldingList.tsx +++ /dev/null @@ -1,105 +0,0 @@ -import { ElementAnchor } from '@masknet/shared' -import { EMPTY_LIST } from '@masknet/shared-base' -import { makeStyles } from '@masknet/theme' -import { useAccount } from '@masknet/web3-hooks-base' -import { FriendTech } from '@masknet/web3-providers' -import { isSameAddress } from '@masknet/web3-shared-base' -import { Box, Link, Typography } from '@mui/material' -import { useInfiniteQuery } from '@tanstack/react-query' -import { range, uniqBy } from 'lodash-es' -import { memo, useMemo, type HTMLProps } from 'react' -import { Translate } from '../../locales/i18n_generated.js' -import { HoldingCard, HoldingCardSkeleton } from './HoldingCard.js' - -const useStyles = makeStyles()((theme) => ({ - container: { - display: 'flex', - flexDirection: 'column', - overflow: 'auto', - height: '100%', - boxSizing: 'border-box', - overscrollBehavior: 'contain', - '&::-webkit-scrollbar': { - display: 'none', - }, - }, - holdings: { - flexGrow: 1, - display: 'grid', - gridTemplateColumns: 'repeat(3, 1fr)', - gridTemplateRows: 'auto 1fr', - gap: theme.spacing(1.5), - }, - holdingCard: { - overflow: 'auto', - }, -})) - -interface Props extends HTMLProps { - address: string -} -export const HoldingList = memo(function HoldingList({ address, ...rest }: Props) { - const { classes, cx, theme } = useStyles() - const account = useAccount() - - const { data, isFetching, fetchNextPage } = useInfiniteQuery({ - queryKey: ['friend-tech', 'holdings', address], - initialPageParam: undefined as any, - queryFn: async ({ pageParam: nextIndicator }) => { - return FriendTech.getHolding(address, nextIndicator) - }, - getNextPageParam: (x) => x.nextIndicator, - }) - const holdings = useMemo(() => { - if (!data?.pages.length) return EMPTY_LIST - // There could be duplicate users. - return uniqBy( - data.pages.flatMap((x) => x.data), - (x) => x.address, - ) - }, [data?.pages]) - - if (!isFetching && !holdings.length) { - const noKeysContext = isSameAddress(address, account) ? 'mine' : 'other' - return ( -
- - - {/* eslint-disable-next-line react/naming-convention/component-name */} - - ), - }} - /> - - -
- ) - } - - return ( -
-
- {holdings.map((holding) => ( - - ))} - {isFetching ? range(4).map((i) => ) : null} -
- fetchNextPage()} key={holdings.length} height={10} /> -
- ) -}) diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/components/KeysTab.tsx b/packages/plugins/FriendTech/src/SiteAdaptor/components/KeysTab.tsx deleted file mode 100644 index 1d6cd93e4ec..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/components/KeysTab.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import { makeStyles } from '@masknet/theme' -import { useAccount } from '@masknet/web3-hooks-base' -import { useUser } from '../hooks/useUser.js' -import { UserProfile } from './UserProfile.js' -import { HoldingList } from './HoldingList.js' - -const useStyles = makeStyles()((theme) => ({ - container: { - padding: theme.spacing(2), - display: 'flex', - flexDirection: 'column', - overflow: 'auto', - height: '100%', - boxSizing: 'border-box', - }, - holdingList: { - marginTop: theme.spacing(1.5), - }, -})) - -export function KeysTab() { - const { classes } = useStyles() - const account = useAccount() - const { data: user, isLoading } = useUser(account) - - return ( -
- - -
- ) -} diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/components/RouterDialog.tsx b/packages/plugins/FriendTech/src/SiteAdaptor/components/RouterDialog.tsx deleted file mode 100644 index 8fb6b018ed5..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/components/RouterDialog.tsx +++ /dev/null @@ -1,72 +0,0 @@ -import { Icons } from '@masknet/icons' -import { - ApplicationSettingTabs, - InjectedDialog, - useOpenApplicationSettings, - useParamTab, - type InjectedDialogProps, -} from '@masknet/shared' -import { PluginID } from '@masknet/shared-base' -import { MaskTabList } from '@masknet/theme' -import { TabContext } from '@mui/lab' -import { IconButton, Tab } from '@mui/material' -import { useLayoutEffect, useMemo } from 'react' -import { matchPath, useLocation, useNavigate, useSearchParams } from 'react-router-dom' -import { RoutePaths, TitleTabs } from '../../constants.js' -import { useI18N } from '../../locales/i18n_generated.js' - -export function RouterDialog(props: InjectedDialogProps) { - const t = useI18N() - const { pathname } = useLocation() - const navigate = useNavigate() - const [params] = useSearchParams() - const paramTitle = params.get('title') - - const title = useMemo(() => { - if (matchPath(RoutePaths.Detail, pathname)) { - return paramTitle || t.name() - } - if (matchPath(RoutePaths.Order, pathname)) return t.sell() - return t.name() - }, [t, pathname, paramTitle]) - - useLayoutEffect(() => { - if (pathname === RoutePaths.Exit) { - props.onClose?.() - } - }, [pathname === RoutePaths.Exit, props.onClose]) - - const [tab, handleTabChange] = useParamTab(TitleTabs.Keys) - const titleTabs = - matchPath(RoutePaths.Main, pathname) ? - - - - - : undefined - const openApplicationBoardDialog = useOpenApplicationSettings() - - return ( - - { - navigate(-1) - }} - titleTail={ - { - openApplicationBoardDialog(ApplicationSettingTabs.pluginSwitch, PluginID.FriendTech) - }}> - - - } - /> - - ) -} diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/components/UserProfile.tsx b/packages/plugins/FriendTech/src/SiteAdaptor/components/UserProfile.tsx deleted file mode 100644 index 3b8cecad713..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/components/UserProfile.tsx +++ /dev/null @@ -1,214 +0,0 @@ -import { Icons } from '@masknet/icons' -import { useLastRecognizedIdentity } from '@masknet/plugin-infra/content-script' -import { CopyButton, FormattedBalance, Image, ProgressiveText, ReversedAddress } from '@masknet/shared' -import { NetworkPluginID } from '@masknet/shared-base' -import { ShadowRootTooltip, TextOverflowTooltip, makeStyles } from '@masknet/theme' -import { useAccount, useWeb3Utils } from '@masknet/web3-hooks-base' -import { type FriendTech as FT } from '@masknet/web3-providers/types' -import { formatBalance } from '@masknet/web3-shared-base' -import { ChainId } from '@masknet/web3-shared-evm' -import { Link, Skeleton, Typography } from '@mui/material' -import { memo, type HTMLProps } from 'react' -import { useI18N } from '../../locales/i18n_generated.js' -import { useOwnKeys } from '../hooks/useOwnKeys.js' - -const useStyles = makeStyles()((theme) => ({ - userInfo: { - border: `1px solid ${theme.palette.maskColor.line}`, - display: 'grid', - gap: theme.spacing(1.5), - padding: theme.spacing(1.5), - borderRadius: 8, - gridTemplateColumns: 'repeat(6, 1fr)', - }, - profile: { - display: 'flex', - alignItems: 'center', - flexGrow: 1, - gridColumn: '1/4', - }, - avatar: { - borderRadius: '50%', - }, - account: { - marginLeft: theme.spacing(1), - marginRight: 'auto', - overflow: 'auto', - }, - name: { - fontSize: 12, - fontWeight: 700, - color: theme.palette.maskColor.main, - textOverflow: 'ellipsis', - overflow: 'hidden', - whiteSpace: 'nowrap', - }, - address: { - display: 'flex', - alignItems: 'center', - fontSize: 12, - gap: 6, - }, - key: { - display: 'flex', - flexDirection: 'column', - justifyContent: 'center', - flexGrow: 1, - gridColumn: '4/7', - }, - keyPrice: { - display: 'flex', - alignItems: 'center', - color: theme.palette.maskColor.main, - fontWeight: 700, - }, - row: { - display: 'flex', - padding: theme.spacing(0, 1.5), - alignItems: 'center', - }, - meta: { - display: 'flex', - padding: theme.spacing(1.5), - height: 42, - boxSizing: 'border-box', - alignItems: 'center', - justifyContent: 'space-between', - backgroundColor: theme.palette.maskColor.bg, - borderRadius: 8, - gridColumn: 'span 2', - }, - metaLabel: { - color: theme.palette.maskColor.second, - fontSize: 14, - textTransform: 'capitalize', - }, - metaValue: { - fontSize: 14, - display: 'flex', - alignItems: 'center', - fontWeight: 700, - color: theme.palette.maskColor.main, - }, - link: { - fontSize: 14, - display: 'flex', - alignItems: 'center', - color: theme.palette.maskColor.main, - }, -})) - -interface Props extends HTMLProps { - address: string - user?: FT.User | null - loading?: boolean - variant?: 'self' | 'other' -} - -export const UserProfile = memo(function UserProfile({ user, address, loading, variant, className, ...rest }: Props) { - const { classes, theme, cx } = useStyles() - const t = useI18N() - const identity = useLastRecognizedIdentity() - const myAccount = useAccount() - const Utils = useWeb3Utils(NetworkPluginID.PLUGIN_EVM) - const isOther = variant === 'other' - const { data: ownCount, isLoading: loadingOwnCount } = useOwnKeys(address, myAccount) - const uiName = user?.twitterUsername || identity?.identifier?.userId - return ( -
-
- {loading ? - - : - } -
- - - @{uiName} - - -
- - - - - -
-
- {user?.twitterName ? - - - - : null} -
-
-
- - {t.key_price()} - - - - - - - - -
- {isOther ? -
- - {t.you_own()} - - - {ownCount === undefined ? '--' : t.keys({ count: ownCount })} - -
- : null} -
- {isOther ? null : ( - <> -
- {t.holders()} - - {user?.holderCount} - -
-
- {t.your_rank()} - - {user?.rank !== undefined ? `#${user.rank}` : '--'} - -
-
- {t.holding()} - - {t.keys({ - count: user?.holdingCount || 0, - })} - -
- - )} -
- ) -}) diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/emitter.ts b/packages/plugins/FriendTech/src/SiteAdaptor/emitter.ts deleted file mode 100644 index abeb03da244..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/emitter.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Emitter } from '@servie/events' - -export const emitter = new Emitter<{ open: [{ address?: string }] }>() - -export function viewUser(address?: string) { - emitter.emit('open', { address }) -} diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/hooks/useEstimateSellGas.ts b/packages/plugins/FriendTech/src/SiteAdaptor/hooks/useEstimateSellGas.ts deleted file mode 100644 index fb193f99047..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/hooks/useEstimateSellGas.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { EVMContractReadonly } from '@masknet/web3-providers' -import { ChainId } from '@masknet/web3-shared-evm' -import { useQuery } from '@tanstack/react-query' -import { FRIEND_TECH_CONTRACT_ADDRESS } from '../../constants.js' - -export function useEstimateSellGas(subjectAddress: string, myAddress: string, count: string) { - return useQuery({ - queryKey: ['friend-tech', 'sell-gas', subjectAddress, myAddress, count], - refetchInterval: 10, - queryFn: async () => { - if (!count) return 0 - const contract = EVMContractReadonly.getFriendTech(FRIEND_TECH_CONTRACT_ADDRESS, { - chainId: ChainId.Base, - }) - const gas = await contract?.methods.sellShares(subjectAddress, count).estimateGas({ - from: myAddress, - }) - return gas - }, - }) -} diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/hooks/useOwnKeys.ts b/packages/plugins/FriendTech/src/SiteAdaptor/hooks/useOwnKeys.ts deleted file mode 100644 index 201f62b42a4..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/hooks/useOwnKeys.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { EVMContractReadonly } from '@masknet/web3-providers' -import { useQuery } from '@tanstack/react-query' -import { FRIEND_TECH_CONTRACT_ADDRESS } from '../../constants.js' -import { BigNumber } from 'bignumber.js' -import { ChainId } from '@masknet/web3-shared-evm' - -export function useOwnKeys(subjectAddress: string, myAddress: string) { - return useQuery({ - enabled: !!myAddress, - queryKey: ['friend-tech', 'own-keys', subjectAddress, myAddress], - queryFn: async () => { - const contract = EVMContractReadonly.getFriendTech(FRIEND_TECH_CONTRACT_ADDRESS, { - chainId: ChainId.Base, - }) - const count = await contract?.methods.sharesBalance(subjectAddress, myAddress).call() - if (!count) return 0 - return new BigNumber(count).toNumber() - }, - }) -} diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/hooks/useUser.ts b/packages/plugins/FriendTech/src/SiteAdaptor/hooks/useUser.ts deleted file mode 100644 index 21be88d377c..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/hooks/useUser.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { FriendTech } from '@masknet/web3-providers' -import { useQuery } from '@tanstack/react-query' - -export function useUser(address?: string) { - return useQuery({ - enabled: !!address, - queryKey: ['friend-tech', 'user', address], - queryFn: () => FriendTech.getUser(address), - }) -} diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/hooks/useUserInfo.ts b/packages/plugins/FriendTech/src/SiteAdaptor/hooks/useUserInfo.ts deleted file mode 100644 index 5206e3828a3..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/hooks/useUserInfo.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { FriendTech } from '@masknet/web3-providers' -import { useQuery } from '@tanstack/react-query' - -/** Get user info by twitter user id */ -export function useUserInfo(userId: string | undefined) { - return useQuery({ - enabled: !!userId, - queryKey: ['friend-tech', 'twitter-user', userId], - queryFn: () => FriendTech.getUserInfo(userId), - }) -} diff --git a/packages/plugins/FriendTech/src/SiteAdaptor/index.tsx b/packages/plugins/FriendTech/src/SiteAdaptor/index.tsx deleted file mode 100644 index 2c46aa076f4..00000000000 --- a/packages/plugins/FriendTech/src/SiteAdaptor/index.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import { Icons } from '@masknet/icons' -import type { Plugin } from '@masknet/plugin-infra' -import { base } from '../base.js' -import { FriendTechInjection } from './FriendTechInjection.js' -import { FriendTechNameWidget } from './FriendTechNameWidget.js' -import { useI18N } from '../locales/i18n_generated.js' - -function Name() { - const t = useI18N() - return t.name() -} -function Desc() { - const t = useI18N() - return t.description() -} -const site: Plugin.SiteAdaptor.Definition = { - ...base, - GlobalInjection() { - return - }, - ApplicationEntries: [ - (() => { - const icon = - const name = - const iconFilterColor = 'rgba(1, 186, 250, 0.20)' - return { - ApplicationEntryID: base.ID, - icon, - category: 'dapp', - description: , - name, - iconFilterColor, - } - })(), - ], - NameWidget: { - ID: `${base.ID}_name_widget`, - priority: 2, - UI: { - Content: FriendTechNameWidget, - }, - }, -} - -export default site diff --git a/packages/plugins/FriendTech/src/base.ts b/packages/plugins/FriendTech/src/base.ts deleted file mode 100644 index 3b7f2b4a78d..00000000000 --- a/packages/plugins/FriendTech/src/base.ts +++ /dev/null @@ -1,24 +0,0 @@ -import type { Plugin } from '@masknet/plugin-infra' -import { EnhanceableSite, PluginID } from '@masknet/shared-base' -import { PLUGIN_DESCRIPTION, PLUGIN_NAME } from './constants.js' -import { languages } from './locales/languages.js' - -export const base: Plugin.Shared.Definition = { - ID: PluginID.FriendTech, - name: { fallback: PLUGIN_NAME }, - description: { fallback: PLUGIN_DESCRIPTION }, - publisher: { name: { fallback: '' }, link: '' }, - enableRequirement: { - supports: { - type: 'opt-out', - sites: { - [EnhanceableSite.Localhost]: true, - }, - }, - target: 'stable', - web3: {}, - }, - inMinimalModeByDefault: true, - experimentalMark: true, - i18n: languages, -} diff --git a/packages/plugins/FriendTech/src/constants.ts b/packages/plugins/FriendTech/src/constants.ts deleted file mode 100644 index aa4d359ef03..00000000000 --- a/packages/plugins/FriendTech/src/constants.ts +++ /dev/null @@ -1,19 +0,0 @@ -export const PLUGIN_DESCRIPTION = "Display the user's friend key related information on the timeline on x.com." -export const PLUGIN_NAME = 'Friend' - -export const FRIEND_TECH_CONTRACT_ADDRESS = '0xcf205808ed36593aa40a44f10c7f7c2f67d4a4d4' - -export const enum RoutePaths { - Main = '/main', - Detail = '/detail', - UploadFile = '/upload', - Order = '/order', - Exit = '/exit', -} - -export enum TitleTabs { - Keys = 'Keys', - History = 'History', - Buy = 'Buy', - Sell = 'Sell', -} diff --git a/packages/plugins/FriendTech/src/env.d.ts b/packages/plugins/FriendTech/src/env.d.ts deleted file mode 100644 index 868322d5ff3..00000000000 --- a/packages/plugins/FriendTech/src/env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/packages/plugins/FriendTech/src/locale/en-US.json b/packages/plugins/FriendTech/src/locale/en-US.json deleted file mode 100644 index c02cb2bcf79..00000000000 --- a/packages/plugins/FriendTech/src/locale/en-US.json +++ /dev/null @@ -1 +0,0 @@ -{ "messages": {} } diff --git a/packages/plugins/FriendTech/src/locale/en-US.po b/packages/plugins/FriendTech/src/locale/en-US.po deleted file mode 100644 index d6676ae2901..00000000000 --- a/packages/plugins/FriendTech/src/locale/en-US.po +++ /dev/null @@ -1,14 +0,0 @@ -msgid "" -msgstr "" -"POT-Creation-Date: 1970-01-01 00:00+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: @lingui/cli\n" -"Language: en-US\n" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: \n" -"Last-Translator: \n" -"Language-Team: \n" -"Plural-Forms: \n" diff --git a/packages/plugins/FriendTech/src/locale/ja-JP.json b/packages/plugins/FriendTech/src/locale/ja-JP.json deleted file mode 100644 index c02cb2bcf79..00000000000 --- a/packages/plugins/FriendTech/src/locale/ja-JP.json +++ /dev/null @@ -1 +0,0 @@ -{ "messages": {} } diff --git a/packages/plugins/FriendTech/src/locale/ja-JP.po b/packages/plugins/FriendTech/src/locale/ja-JP.po deleted file mode 100644 index b15d494c24d..00000000000 --- a/packages/plugins/FriendTech/src/locale/ja-JP.po +++ /dev/null @@ -1,19 +0,0 @@ -msgid "" -msgstr "" -"POT-Creation-Date: 1970-01-01 00:00+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: @lingui/cli\n" -"Language: ja\n" -"Project-Id-Version: mask-network\n" -"Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2024-09-03 09:18\n" -"Last-Translator: \n" -"Language-Team: Japanese\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Crowdin-Project: mask-network\n" -"X-Crowdin-Project-ID: 468872\n" -"X-Crowdin-Language: ja\n" -"X-Crowdin-File: /[DimensionDev.Maskbook] develop/packages/plugins/FriendTech/src/locale/en-US.po\n" -"X-Crowdin-File-ID: 966\n" diff --git a/packages/plugins/FriendTech/src/locale/ko-KR.json b/packages/plugins/FriendTech/src/locale/ko-KR.json deleted file mode 100644 index c02cb2bcf79..00000000000 --- a/packages/plugins/FriendTech/src/locale/ko-KR.json +++ /dev/null @@ -1 +0,0 @@ -{ "messages": {} } diff --git a/packages/plugins/FriendTech/src/locale/ko-KR.po b/packages/plugins/FriendTech/src/locale/ko-KR.po deleted file mode 100644 index ca54356729c..00000000000 --- a/packages/plugins/FriendTech/src/locale/ko-KR.po +++ /dev/null @@ -1,19 +0,0 @@ -msgid "" -msgstr "" -"POT-Creation-Date: 1970-01-01 00:00+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: @lingui/cli\n" -"Language: ko\n" -"Project-Id-Version: mask-network\n" -"Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2024-09-03 09:18\n" -"Last-Translator: \n" -"Language-Team: Korean\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Crowdin-Project: mask-network\n" -"X-Crowdin-Project-ID: 468872\n" -"X-Crowdin-Language: ko\n" -"X-Crowdin-File: /[DimensionDev.Maskbook] develop/packages/plugins/FriendTech/src/locale/en-US.po\n" -"X-Crowdin-File-ID: 966\n" diff --git a/packages/plugins/FriendTech/src/locale/qya-AA.po b/packages/plugins/FriendTech/src/locale/qya-AA.po deleted file mode 100644 index c5d7a9cefcb..00000000000 --- a/packages/plugins/FriendTech/src/locale/qya-AA.po +++ /dev/null @@ -1,20 +0,0 @@ -msgid "" -msgstr "" -"POT-Creation-Date: 1970-01-01 00:00+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: @lingui/cli\n" -"Language: qya\n" -"Project-Id-Version: mask-network\n" -"Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2024-09-03 09:18\n" -"Last-Translator: \n" -"Language-Team: Quenya\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Crowdin-Project: mask-network\n" -"X-Crowdin-Project-ID: 468872\n" -"X-Crowdin-Language: qya-AA\n" -"X-Crowdin-File: /[DimensionDev.Maskbook] develop/packages/plugins/FriendTech/src/locale/en-US.po\n" -"X-Crowdin-File-ID: 966\n" - diff --git a/packages/plugins/FriendTech/src/locale/zh-CN.json b/packages/plugins/FriendTech/src/locale/zh-CN.json deleted file mode 100644 index c02cb2bcf79..00000000000 --- a/packages/plugins/FriendTech/src/locale/zh-CN.json +++ /dev/null @@ -1 +0,0 @@ -{ "messages": {} } diff --git a/packages/plugins/FriendTech/src/locale/zh-CN.po b/packages/plugins/FriendTech/src/locale/zh-CN.po deleted file mode 100644 index fe8e3346195..00000000000 --- a/packages/plugins/FriendTech/src/locale/zh-CN.po +++ /dev/null @@ -1,19 +0,0 @@ -msgid "" -msgstr "" -"POT-Creation-Date: 1970-01-01 00:00+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: @lingui/cli\n" -"Language: zh\n" -"Project-Id-Version: mask-network\n" -"Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2024-09-03 09:18\n" -"Last-Translator: \n" -"Language-Team: Chinese Simplified\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Crowdin-Project: mask-network\n" -"X-Crowdin-Project-ID: 468872\n" -"X-Crowdin-Language: zh-CN\n" -"X-Crowdin-File: /[DimensionDev.Maskbook] develop/packages/plugins/FriendTech/src/locale/en-US.po\n" -"X-Crowdin-File-ID: 966\n" diff --git a/packages/plugins/FriendTech/src/locale/zh-TW.json b/packages/plugins/FriendTech/src/locale/zh-TW.json deleted file mode 100644 index c02cb2bcf79..00000000000 --- a/packages/plugins/FriendTech/src/locale/zh-TW.json +++ /dev/null @@ -1 +0,0 @@ -{ "messages": {} } diff --git a/packages/plugins/FriendTech/src/locale/zh-TW.po b/packages/plugins/FriendTech/src/locale/zh-TW.po deleted file mode 100644 index f5619ff8494..00000000000 --- a/packages/plugins/FriendTech/src/locale/zh-TW.po +++ /dev/null @@ -1,19 +0,0 @@ -msgid "" -msgstr "" -"POT-Creation-Date: 1970-01-01 00:00+0000\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: @lingui/cli\n" -"Language: zh\n" -"Project-Id-Version: mask-network\n" -"Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2024-09-03 09:18\n" -"Last-Translator: \n" -"Language-Team: Chinese Traditional\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Crowdin-Project: mask-network\n" -"X-Crowdin-Project-ID: 468872\n" -"X-Crowdin-Language: zh-TW\n" -"X-Crowdin-File: /[DimensionDev.Maskbook] develop/packages/plugins/FriendTech/src/locale/en-US.po\n" -"X-Crowdin-File-ID: 966\n" diff --git a/packages/plugins/FriendTech/src/locales/en-US.json b/packages/plugins/FriendTech/src/locales/en-US.json deleted file mode 100644 index ac42673e232..00000000000 --- a/packages/plugins/FriendTech/src/locales/en-US.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "Friend", - "description": "Display the user's friend key related information on the timeline on x.com.", - "order": "Order", - "key_price": "Key Price", - "your_key": "Your Key", - "you_own": "You Own", - "key": "Keys", - "holders": "Holders", - "holding": "Holding", - "history": "History", - "sell": "Sell", - "buy": "Buy", - "value": "Value", - "trades": "Trades", - "amount": "Amount", - "portfolio": "Portfolio", - "holder_count": "Holder Count", - "your_rank": "Your Rank", - "total_value": "Total Value", - "price_tooltip": "The price of next share is equal to the S^2 / 16000*1 ether where S is the current number of keys.", - "keys_one": "{{count}} Key", - "keys_other": "{{count}} Keys", - "no_keys$other": "There's no one holding. go explore", - "no_keys$mine": "You don't have any keys in your wallet. go explore", - "key_trade$buy_one": "{{- trader}} bought {{count}} {{- subject}} key", - "key_trade$buy_other": "{{- trader}} bought {{count}} {{- subject}} keys", - "key_trade$sell_one": "{{- trader}} sold {{count}} {{- subject}} key", - "key_trade$sell_other": "{{- trader}} sold {{count}} {{- subject}} keys", - "sell_summary_one": "Sell {{count}} key for {{cost}} ETH", - "sell_summary_other": "Sell {{count}} keys for {{cost}} ETH", - "you_currently_hold_one": "You currently hold: {{count}} key", - "you_currently_hold_other": "You currently hold: {{count}} keys", - "from": "From", - "to": "To", - "action": "Action", - "total_amount": "Total Amount", - "gas_fee": "Gas fee", - "sell_key": "Sell Key", - "wallet_require": "Connecting to the wallet to see what keys are held." -} diff --git a/packages/plugins/FriendTech/src/locales/index.ts b/packages/plugins/FriendTech/src/locales/index.ts deleted file mode 100644 index 5d88b2e093a..00000000000 --- a/packages/plugins/FriendTech/src/locales/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -// This file is auto generated. DO NOT EDIT -// Run `npx gulp sync-languages` to regenerate. -// Default fallback language in a family of languages are chosen by the alphabet order -// To overwrite this, please overwrite packages/scripts/src/locale-kit-next/index.ts - -export * from './i18n_generated.js' diff --git a/packages/plugins/FriendTech/src/locales/ja-JP.json b/packages/plugins/FriendTech/src/locales/ja-JP.json deleted file mode 100644 index 646ec602f8f..00000000000 --- a/packages/plugins/FriendTech/src/locales/ja-JP.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "友達", - "description": "x.comのタイムラインにユーザーのフレンドキーに関する情報を表示します。", - "order": "注文", - "key_price": "キー価格", - "your_key": "あなたのキー", - "you_own": "所持", - "key": "キー", - "holders": "ホルダー", - "holding": "保持中", - "history": "履歴", - "sell": "売却", - "buy": "購入", - "value": "価値", - "trades": "トレード", - "amount": "量", - "portfolio": "ポートフォリオ", - "holder_count": "ホルダーの数", - "your_rank": "あなたのランク", - "total_value": "合計額", - "price_tooltip": "次のシェアの価格は、S^2 / 16000*1 のエーテルに等しい。ここで、Sは現在のキー数です。", - "keys_one": "{{count}} キー", - "keys_other": "{{count}} キー", - "no_keys$other": "保有している人はいません。 探検する", - "no_keys$mine": "ウォレットにはキーがありません。 探検する", - "key_trade$buy_one": "{{- trader}} が {{count}} {{- subject}} キーを購入しました", - "key_trade$buy_other": "{{- trader}} が {{count}} {{- subject}} キーを購入しました", - "key_trade$sell_one": "{{- trader}} が {{count}} {{- subject}} キーを売りました", - "key_trade$sell_other": "{{- trader}} が {{count}} {{- subject}} キーを売却しました", - "sell_summary_one": "{{count}} キーを {{cost}} ETHで売却する", - "sell_summary_other": "{{count}} キーを {{cost}} ETHで売却する", - "you_currently_hold_one": "現在保留中: {{count}} キー", - "you_currently_hold_other": "現在保留中: {{count}} キー", - "from": "から", - "to": "宛先:", - "action": "動作", - "total_amount": "合計金額", - "gas_fee": "ガス料金", - "sell_key": "キーを販売", - "wallet_require": "ウォレットに接続して、キーが保持されているかを確認します。" -} diff --git a/packages/plugins/FriendTech/src/locales/ko-KR.json b/packages/plugins/FriendTech/src/locales/ko-KR.json deleted file mode 100644 index 3d828eb862f..00000000000 --- a/packages/plugins/FriendTech/src/locales/ko-KR.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "친구", - "description": "X.com 의 타임라인에 사용자의 친구 키 관련 정보를 표시합니다.", - "order": "오더", - "key_price": "가격 설정", - "your_key": "키", - "you_own": "You Own", - "key": "키", - "holders": "홀더", - "holding": "보유중", - "history": "역사 기록", - "sell": "매출", - "buy": "구매", - "value": "값", - "trades": "거래", - "amount": "수량", - "portfolio": "포트폴리오", - "holder_count": "홀더 수량", - "your_rank": "나의 순위", - "total_value": "총 가치", - "price_tooltip": "다음 지분의 가격은 S^2 / 16000*1 ETH와 같으며, 여기서 S는 현재 키의 개수입니다.", - "keys_one": "{{count}} 키", - "keys_other": "{{count}} 키", - "no_keys$other": "보유중인 키가 없습니다. go explore", - "no_keys$mine": "월렛에서 아무 키가 없습니다. go explore", - "key_trade$buy_one": "{{- trader}} 구매 {{count}} {{- subject}} 키", - "key_trade$buy_other": "{{- trader}} 구매 {{count}} {{- subject}} 키", - "key_trade$sell_one": "{{- trader}} 매출 {{count}} {{- subject}} 키", - "key_trade$sell_other": "{{- trader}} 매출 {{count}} {{- subject}} 키", - "sell_summary_one": "{{cost}} ETH의 가격으로 {{count}} 키를 매출합니다.", - "sell_summary_other": "{{cost}} ETH의 가격으로 {{count}} 키를 매출합니다.", - "you_currently_hold_one": "보유중인 키: {{count}}", - "you_currently_hold_other": "보유중인 키: {{count}}", - "from": "From", - "to": "To", - "action": "행동", - "total_amount": "총액", - "gas_fee": "가스비", - "sell_key": "키 매출", - "wallet_require": "월렛을 연결하여 보유하고 있는 키를 확인합니다." -} diff --git a/packages/plugins/FriendTech/src/locales/languages.ts b/packages/plugins/FriendTech/src/locales/languages.ts deleted file mode 100644 index 29beb44b1fd..00000000000 --- a/packages/plugins/FriendTech/src/locales/languages.ts +++ /dev/null @@ -1,68 +0,0 @@ -// This file is auto generated. DO NOT EDIT -// Run `npx gulp sync-languages` to regenerate. -// Default fallback language in a family of languages are chosen by the alphabet order -// To overwrite this, please overwrite packages/scripts/src/locale-kit-next/index.ts -import en_US from './en-US.json' -import ja_JP from './ja-JP.json' -import ko_KR from './ko-KR.json' -import qya_AA from './qya-AA.json' -import zh_CN from './zh-CN.json' -import zh_TW from './zh-TW.json' -import lingui_en_US from '../locale/en-US.json' -import lingui_ja_JP from '../locale/ja-JP.json' -import lingui_ko_KR from '../locale/ko-KR.json' -import lingui_zh_CN from '../locale/zh-CN.json' -import lingui_zh_TW from '../locale/zh-TW.json' -export const languages = { - en: en_US, - ja: ja_JP, - ko: ko_KR, - qy: qya_AA, - 'zh-CN': zh_CN, - zh: zh_TW, -} -export const linguiLanguages = { - en: lingui_en_US, - ja: lingui_ja_JP, - ko: lingui_ko_KR, - 'zh-CN': lingui_zh_CN, - zh: lingui_zh_TW, -} -// @ts-ignore -if (import.meta.webpackHot) { - // @ts-ignore - import.meta.webpackHot.accept( - ['./en-US.json', './ja-JP.json', './ko-KR.json', './qya-AA.json', './zh-CN.json', './zh-TW.json'], - () => - globalThis.dispatchEvent?.( - new CustomEvent('MASK_I18N_HMR', { - detail: [ - 'io.mask.friend-tech', - { en: en_US, ja: ja_JP, ko: ko_KR, qy: qya_AA, 'zh-CN': zh_CN, zh: zh_TW }, - ], - }), - ), - ) - // @ts-ignore - import.meta.webpackHot.accept( - [ - '../locale/en-US.json', - '../locale/ja-JP.json', - '../locale/ko-KR.json', - '../locale/zh-CN.json', - '../locale/zh-TW.json', - ], - () => - globalThis.dispatchEvent?.( - new CustomEvent('MASK_I18N_HMR_LINGUI', { - detail: { - en: lingui_en_US, - ja: lingui_ja_JP, - ko: lingui_ko_KR, - 'zh-CN': lingui_zh_CN, - zh: lingui_zh_TW, - }, - }), - ), - ) -} diff --git a/packages/plugins/FriendTech/src/locales/qya-AA.json b/packages/plugins/FriendTech/src/locales/qya-AA.json deleted file mode 100644 index d5402f8e80a..00000000000 --- a/packages/plugins/FriendTech/src/locales/qya-AA.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "crwdns22558:0crwdne22558:0", - "description": "crwdns22560:0crwdne22560:0", - "order": "crwdns22562:0crwdne22562:0", - "key_price": "crwdns22564:0crwdne22564:0", - "your_key": "crwdns22566:0crwdne22566:0", - "you_own": "crwdns22568:0crwdne22568:0", - "key": "crwdns22570:0crwdne22570:0", - "holders": "crwdns22572:0crwdne22572:0", - "holding": "crwdns22574:0crwdne22574:0", - "history": "crwdns22576:0crwdne22576:0", - "sell": "crwdns22578:0crwdne22578:0", - "buy": "crwdns22580:0crwdne22580:0", - "value": "crwdns22582:0crwdne22582:0", - "trades": "crwdns22584:0crwdne22584:0", - "amount": "crwdns22586:0crwdne22586:0", - "portfolio": "crwdns22588:0crwdne22588:0", - "holder_count": "crwdns22590:0crwdne22590:0", - "your_rank": "crwdns22592:0crwdne22592:0", - "total_value": "crwdns22594:0crwdne22594:0", - "price_tooltip": "crwdns22596:0crwdne22596:0", - "keys_one": "crwdns22598:0{{count}}crwdne22598:0", - "keys_other": "crwdns22600:0{{count}}crwdne22600:0", - "no_keys$other": "crwdns22602:0crwdne22602:0", - "no_keys$mine": "crwdns22604:0crwdne22604:0", - "key_trade$buy_one": "crwdns22606:0{{- trader}}crwdnd22606:0{{count}}crwdnd22606:0{{- subject}}crwdne22606:0", - "key_trade$buy_other": "crwdns22608:0{{- trader}}crwdnd22608:0{{count}}crwdnd22608:0{{- subject}}crwdne22608:0", - "key_trade$sell_one": "crwdns22610:0{{- trader}}crwdnd22610:0{{count}}crwdnd22610:0{{- subject}}crwdne22610:0", - "key_trade$sell_other": "crwdns22612:0{{- trader}}crwdnd22612:0{{count}}crwdnd22612:0{{- subject}}crwdne22612:0", - "sell_summary_one": "crwdns22614:0{{count}}crwdnd22614:0{{cost}}crwdne22614:0", - "sell_summary_other": "crwdns22616:0{{count}}crwdnd22616:0{{cost}}crwdne22616:0", - "you_currently_hold_one": "crwdns22618:0{{count}}crwdne22618:0", - "you_currently_hold_other": "crwdns22620:0{{count}}crwdne22620:0", - "from": "crwdns22622:0crwdne22622:0", - "to": "crwdns22624:0crwdne22624:0", - "action": "crwdns22626:0crwdne22626:0", - "total_amount": "crwdns22628:0crwdne22628:0", - "gas_fee": "crwdns22630:0crwdne22630:0", - "sell_key": "crwdns22632:0crwdne22632:0", - "wallet_require": "crwdns22636:0crwdne22636:0" -} diff --git a/packages/plugins/FriendTech/src/locales/zh-CN.json b/packages/plugins/FriendTech/src/locales/zh-CN.json deleted file mode 100644 index 7a9a5089009..00000000000 --- a/packages/plugins/FriendTech/src/locales/zh-CN.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "朋友", - "description": "在x.com上显示用户的好友 Key 的相关信息。", - "order": "顺序", - "key_price": "Key Price", - "your_key": "你的 Key", - "you_own": "你拥有", - "key": "Keys", - "holders": "持有者", - "holding": "正在持有", - "history": "历史", - "sell": "出售", - "buy": "购买", - "value": "价值", - "trades": "交易", - "amount": "金额", - "portfolio": "资产组合", - "holder_count": "拥有者计数", - "your_rank": "您的排名", - "total_value": "总值", - "price_tooltip": "下一次分享的价格等于S^2 / 16000*1 ether ,其中S是当前的 keys 的数量。", - "keys_one": "{{count}} Key", - "keys_other": "{{count}} Keys", - "no_keys$other": "没有人持有。go explore", - "no_keys$mine": "你的钱包未持有任何 Keys。go explore", - "key_trade$buy_one": "{{- trader}} 购买了 {{count}} {{- subject}} key", - "key_trade$buy_other": "{{- trader}} 购买了 {{count}} {{- subject}} keys", - "key_trade$sell_one": "{{- trader}} 出售了 {{count}} {{- subject}} key", - "key_trade$sell_other": "{{- trader}} 出售了 {{count}} {{- subject}} keys", - "sell_summary_one": "出售{{count}} key 换回 {{cost}} ETH", - "sell_summary_other": "出售{{count}} keys 换回 {{cost}} ETH", - "you_currently_hold_one": "您当前的持有量:{{count}} key", - "you_currently_hold_other": "您当前的持有量:{{count}} keys", - "from": "从", - "to": "至", - "action": "操作", - "total_amount": "总金额", - "gas_fee": "Gas 费用", - "sell_key": "出售密钥", - "wallet_require": "正在连接到钱包以查看持有的 Key。" -} diff --git a/packages/plugins/FriendTech/src/locales/zh-TW.json b/packages/plugins/FriendTech/src/locales/zh-TW.json deleted file mode 100644 index 0967ef424bc..00000000000 --- a/packages/plugins/FriendTech/src/locales/zh-TW.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/packages/plugins/FriendTech/src/register.ts b/packages/plugins/FriendTech/src/register.ts deleted file mode 100644 index b163fd4dfd9..00000000000 --- a/packages/plugins/FriendTech/src/register.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { registerPlugin } from '@masknet/plugin-infra' -import { base } from './base.js' - -registerPlugin({ - ...base, - SiteAdaptor: { - load: () => import('./SiteAdaptor/index.js'), - hotModuleReload: (hot) => - import.meta.webpackHot?.accept('./SiteAdaptor', () => hot(import('./SiteAdaptor/index.js'))), - }, -}) diff --git a/packages/plugins/FriendTech/tsconfig.json b/packages/plugins/FriendTech/tsconfig.json deleted file mode 100644 index 4ff9e78d376..00000000000 --- a/packages/plugins/FriendTech/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "rootDir": "src", - "outDir": "dist", - "tsBuildInfoFile": "dist/.tsbuildinfo" - }, - "include": ["src", "src/**/*.json"], - "references": [{ "path": "../../plugin-infra/tsconfig.json" }, { "path": "../../shared/tsconfig.json" }] -} diff --git a/packages/plugins/tsconfig.json b/packages/plugins/tsconfig.json index e94fa35e677..a14264f891d 100644 --- a/packages/plugins/tsconfig.json +++ b/packages/plugins/tsconfig.json @@ -11,7 +11,6 @@ { "path": "./CyberConnect/tsconfig.json" }, { "path": "./Debugger/tsconfig.json" }, { "path": "./FileService/tsconfig.json" }, - { "path": "./FriendTech/tsconfig.json" }, { "path": "./Gitcoin/tsconfig.json" }, { "path": "./GoPlusSecurity/tsconfig.json" }, { "path": "./Handle/tsconfig.json" }, diff --git a/packages/shared-base/src/types/PluginID.ts b/packages/shared-base/src/types/PluginID.ts index 645a7bf1fd8..8c38aa5bccf 100644 --- a/packages/shared-base/src/types/PluginID.ts +++ b/packages/shared-base/src/types/PluginID.ts @@ -32,7 +32,6 @@ export enum PluginID { Savings = 'com.savings', Wallet = 'com.maskbook.wallet', FileService = 'com.maskbook.fileservice', - FriendTech = 'io.mask.friend-tech', CyberConnect = 'me.cyberconnect.app', GoPlusSecurity = 'io.gopluslabs.security', CrossChainBridge = 'io.mask.cross-chain-bridge', diff --git a/packages/web3-contracts/abis/FriendTech.json b/packages/web3-contracts/abis/FriendTech.json deleted file mode 100644 index 37ea7a70bb1..00000000000 --- a/packages/web3-contracts/abis/FriendTech.json +++ /dev/null @@ -1,170 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" }, - { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { "indexed": false, "internalType": "address", "name": "trader", "type": "address" }, - { "indexed": false, "internalType": "address", "name": "subject", "type": "address" }, - { "indexed": false, "internalType": "bool", "name": "isBuy", "type": "bool" }, - { "indexed": false, "internalType": "uint256", "name": "shareAmount", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "ethAmount", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "protocolEthAmount", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "subjectEthAmount", "type": "uint256" }, - { "indexed": false, "internalType": "uint256", "name": "supply", "type": "uint256" } - ], - "name": "Trade", - "type": "event" - }, - { - "inputs": [ - { "internalType": "address", "name": "sharesSubject", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "buyShares", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "sharesSubject", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "getBuyPrice", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "sharesSubject", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "getBuyPriceAfterFee", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "uint256", "name": "supply", "type": "uint256" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "getPrice", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "sharesSubject", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "getSellPrice", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "sharesSubject", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "getSellPriceAfterFee", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "protocolFeeDestination", - "outputs": [{ "internalType": "address", "name": "", "type": "address" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "protocolFeePercent", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { "inputs": [], "name": "renounceOwnership", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { "internalType": "address", "name": "sharesSubject", "type": "address" }, - { "internalType": "uint256", "name": "amount", "type": "uint256" } - ], - "name": "sellShares", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "_feeDestination", "type": "address" }], - "name": "setFeeDestination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "_feePercent", "type": "uint256" }], - "name": "setProtocolFeePercent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [{ "internalType": "uint256", "name": "_feePercent", "type": "uint256" }], - "name": "setSubjectFeePercent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { "internalType": "address", "name": "", "type": "address" }, - { "internalType": "address", "name": "", "type": "address" } - ], - "name": "sharesBalance", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "", "type": "address" }], - "name": "sharesSupply", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "subjectFeePercent", - "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/packages/web3-contracts/types/FriendTech.d.ts b/packages/web3-contracts/types/FriendTech.d.ts deleted file mode 100644 index 08f293fe535..00000000000 --- a/packages/web3-contracts/types/FriendTech.d.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import type BN from 'bn.js' -import type { ContractOptions } from 'web3-eth-contract' -import type { EventLog } from 'web3-core' -import type { EventEmitter } from 'events' -import type { - Callback, - PayableTransactionObject, - NonPayableTransactionObject, - BlockType, - ContractEventLog, - BaseContract, -} from './types.js' - -export interface EventOptions { - filter?: object - fromBlock?: BlockType - topics?: string[] -} - -export type OwnershipTransferred = ContractEventLog<{ - previousOwner: string - newOwner: string - 0: string - 1: string -}> -export type Trade = ContractEventLog<{ - trader: string - subject: string - isBuy: boolean - shareAmount: string - ethAmount: string - protocolEthAmount: string - subjectEthAmount: string - supply: string - 0: string - 1: string - 2: boolean - 3: string - 4: string - 5: string - 6: string - 7: string -}> - -export interface FriendTech extends BaseContract { - constructor(jsonInterface: any[], address?: string, options?: ContractOptions): FriendTech - clone(): FriendTech - methods: { - buyShares(sharesSubject: string, amount: number | string | BN): PayableTransactionObject - - getBuyPrice(sharesSubject: string, amount: number | string | BN): NonPayableTransactionObject - - getBuyPriceAfterFee(sharesSubject: string, amount: number | string | BN): NonPayableTransactionObject - - getPrice(supply: number | string | BN, amount: number | string | BN): NonPayableTransactionObject - - getSellPrice(sharesSubject: string, amount: number | string | BN): NonPayableTransactionObject - - getSellPriceAfterFee(sharesSubject: string, amount: number | string | BN): NonPayableTransactionObject - - owner(): NonPayableTransactionObject - - protocolFeeDestination(): NonPayableTransactionObject - - protocolFeePercent(): NonPayableTransactionObject - - renounceOwnership(): NonPayableTransactionObject - - sellShares(sharesSubject: string, amount: number | string | BN): PayableTransactionObject - - setFeeDestination(_feeDestination: string): NonPayableTransactionObject - - setProtocolFeePercent(_feePercent: number | string | BN): NonPayableTransactionObject - - setSubjectFeePercent(_feePercent: number | string | BN): NonPayableTransactionObject - - sharesBalance(arg0: string, arg1: string): NonPayableTransactionObject - - sharesSupply(arg0: string): NonPayableTransactionObject - - subjectFeePercent(): NonPayableTransactionObject - - transferOwnership(newOwner: string): NonPayableTransactionObject - } - events: { - OwnershipTransferred(cb?: Callback): EventEmitter - OwnershipTransferred(options?: EventOptions, cb?: Callback): EventEmitter - - Trade(cb?: Callback): EventEmitter - Trade(options?: EventOptions, cb?: Callback): EventEmitter - - allEvents(options?: EventOptions, cb?: Callback): EventEmitter - } - - once(event: 'OwnershipTransferred', cb: Callback): void - once(event: 'OwnershipTransferred', options: EventOptions, cb: Callback): void - - once(event: 'Trade', cb: Callback): void - once(event: 'Trade', options: EventOptions, cb: Callback): void -} diff --git a/packages/web3-contracts/types/index.d.ts b/packages/web3-contracts/types/index.d.ts index 3175df9e5b2..81b47b86ba5 100644 --- a/packages/web3-contracts/types/index.d.ts +++ b/packages/web3-contracts/types/index.d.ts @@ -20,7 +20,6 @@ export type { ERC20Bytes32 } from './ERC20Bytes32.js' export type { ERC721 } from './ERC721.js' export type { EntryPoint } from './EntryPoint.js' export type { ExchangeProxy } from './ExchangeProxy.js' -export type { FriendTech } from './FriendTech.js' export type { HappyRedPacketV1 } from './HappyRedPacketV1.js' export type { HappyRedPacketV2 } from './HappyRedPacketV2.js' export type { HappyRedPacketV3 } from './HappyRedPacketV3.js' diff --git a/packages/web3-providers/src/FriendTech/constants.ts b/packages/web3-providers/src/FriendTech/constants.ts deleted file mode 100644 index 45acbdaf297..00000000000 --- a/packages/web3-providers/src/FriendTech/constants.ts +++ /dev/null @@ -1 +0,0 @@ -export const HOST = 'https://prod-api.kosetto.com' diff --git a/packages/web3-providers/src/FriendTech/index.ts b/packages/web3-providers/src/FriendTech/index.ts deleted file mode 100644 index 4c71f59b438..00000000000 --- a/packages/web3-providers/src/FriendTech/index.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { createNextIndicator, createPageable, EMPTY_LIST, type PageIndicator } from '@masknet/shared-base' -import urlcat from 'urlcat' -import { fetchJSON } from '../helpers/fetchJSON.js' -import { type FriendTech as FT } from '../types/FriendTech.js' -import { HOST } from './constants.js' - -type Response = T | { message: string } -type PaginationResponse = (T & { nextPageStart?: number }) | { message: string } -type HoldersResponse = PaginationResponse<{ - users: FT.Holder[] -}> -type ActivitiesResponse = PaginationResponse<{ - users: FT.TradeRecord[] -}> - -export class FriendTech { - static async getUser(address?: string) { - if (!address) return null - const url = urlcat(HOST, '/users/:address', { address }) - const response = await fetchJSON>(url) - if ('message' in response) return null - return response - } - - static async getHolders(address: string, indicator?: PageIndicator) { - if (!address) return createPageable(EMPTY_LIST, indicator, undefined) - const url = urlcat(HOST, '/users/:address/token/holders', { address, pageStart: indicator?.id }) - - const response = await fetchJSON(url) - if ('message' in response) return createPageable(EMPTY_LIST, indicator, undefined) - return createPageable( - response.users, - indicator, - response.nextPageStart ? createNextIndicator(indicator, response.nextPageStart.toString()) : undefined, - ) - } - static async getHolding(address: string, indicator?: PageIndicator) { - if (!address) return createPageable(EMPTY_LIST, indicator, undefined) - const url = urlcat(HOST, '/users/:address/token-holdings', { address, pageStart: indicator?.id }) - - const response = await fetchJSON(url) - if ('message' in response) return createPageable(EMPTY_LIST, indicator, undefined) - return createPageable( - response.users, - indicator, - response.nextPageStart ? createNextIndicator(indicator, response.nextPageStart.toString()) : undefined, - ) - } - static async getActivities(address: string, indicator?: PageIndicator) { - const url = urlcat(HOST, '/users/:address/trade-activity', { address, pageStart: indicator?.id }) - - const response = await fetchJSON(url) - if ('message' in response) return createPageable(EMPTY_LIST, indicator, undefined) - return createPageable( - response.users, - indicator, - response.nextPageStart ? createNextIndicator(indicator, response.nextPageStart.toString()) : undefined, - ) - } - - /** Get user info by twitter user id */ - static async getUserInfo(userId?: string) { - if (!userId) return null - const url = urlcat(HOST, '/twitter-users/:userId', { userId }) - const response = await fetchJSON(url) - return response.address ? response : null - } -} diff --git a/packages/web3-providers/src/Web3/EVM/apis/ContractReadonlyAPI.ts b/packages/web3-providers/src/Web3/EVM/apis/ContractReadonlyAPI.ts index 46801e3ab54..e34a105d477 100644 --- a/packages/web3-providers/src/Web3/EVM/apis/ContractReadonlyAPI.ts +++ b/packages/web3-providers/src/Web3/EVM/apis/ContractReadonlyAPI.ts @@ -15,7 +15,6 @@ import type { BaseContract } from '@masknet/web3-contracts/types/types.js' import type { AirdropV2 } from '@masknet/web3-contracts/types/AirdropV2.js' import type { WETH } from '@masknet/web3-contracts/types/WETH.js' import type { PoolStateV3 } from '@masknet/web3-contracts/types/PoolStateV3.js' -import type { FriendTech } from '@masknet/web3-contracts/types/FriendTech.js' import BalanceCheckerABI from '@masknet/web3-contracts/abis/BalanceChecker.json' import ERC20ABI from '@masknet/web3-contracts/abis/ERC20.json' @@ -28,7 +27,6 @@ import WalletABI from '@masknet/web3-contracts/abis/Wallet.json' import MulticallABI from '@masknet/web3-contracts/abis/Multicall.json' import WETH_ABI from '@masknet/web3-contracts/abis/WETH.json' import PoolStateV3ABI from '@masknet/web3-contracts/abis/PoolStateV3.json' -import FriendTechABI from '@masknet/web3-contracts/abis/FriendTech.json' import { EVMRequestReadonlyAPI } from './RequestReadonlyAPI.js' import type { EVMConnectionOptions } from '../types/index.js' @@ -102,9 +100,5 @@ export class EVMContractReadonlyAPI { getPoolStateV3(address: string | undefined, initial?: EVMConnectionOptions) { return this.getWeb3Contract(address, PoolStateV3ABI as AbiItem[], initial) } - - getFriendTech(address: string, initial?: EVMConnectionOptions) { - return this.getWeb3Contract(address, FriendTechABI as AbiItem[], initial) - } } export const EVMContractReadonly = EVMContractReadonlyAPI.Default diff --git a/packages/web3-providers/src/entry-types.ts b/packages/web3-providers/src/entry-types.ts index 83807b417bc..ff88cefa98c 100644 --- a/packages/web3-providers/src/entry-types.ts +++ b/packages/web3-providers/src/entry-types.ts @@ -33,7 +33,6 @@ export * from './types/Wallet.js' export * from './types/Lens.js' export * from './types/Storage.js' export * from './types/Snapshot.js' -export * from './types/FriendTech.js' export * from './types/Store.js' // Provider Implementations diff --git a/packages/web3-providers/src/entry.ts b/packages/web3-providers/src/entry.ts index 09b7c1b1b35..06f55592885 100644 --- a/packages/web3-providers/src/entry.ts +++ b/packages/web3-providers/src/entry.ts @@ -23,7 +23,6 @@ export { TheGraphRedPacket } from './TheGraph/index.js' export { SimpleHashEVM, SimpleHashSolana, SPAM_SCORE } from './SimpleHash/index.js' export { SnapshotSearch } from './Snapshot/index.js' export { Snapshot } from './Snapshot/index.js' -export { FriendTech } from './FriendTech/index.js' export { MaskWalletProviderInstance as MaskWalletProvider } from './Web3/EVM/providers/index.js' diff --git a/packages/web3-providers/src/types/FriendTech.ts b/packages/web3-providers/src/types/FriendTech.ts deleted file mode 100644 index f15be1ff0f9..00000000000 --- a/packages/web3-providers/src/types/FriendTech.ts +++ /dev/null @@ -1,48 +0,0 @@ -export namespace FriendTech { - export interface Holder { - address: string - id: number - balance: number - /** unix timestamp in milliseconds */ - lastOnline: string - twitterName: string - twitterPfpUrl: string - twitterUserId: string - twitterUsername: string - } - export interface User extends Omit { - displayPrice: string - holderCount: number - holdingCount: number - lifetimeFeesCollectedInWei: string - rank: string - shareSupply: 6 - userBio: string | null - watchlistCount: string - } - export interface TradeRecord { - /** unix timestamp in milliseconds */ - createdAt: number - shareAmount: string - trader: { - address: string - pfpUrl: string - /** Twitter handle */ - username: string - name: string - } - subject: { - address: string - pfpUrl: string - username: string - name: string - } - isBuy: boolean - ethAmount: string - transactionIndex: number - blockNumber: number - commenterPfpUrls: string | null - /** number */ - commentCount: string - } -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d2e3c967183..d761595228f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -429,9 +429,6 @@ importers: '@masknet/plugin-file-service': specifier: workspace:^ version: link:../plugins/FileService - '@masknet/plugin-friend-tech': - specifier: workspace:^ - version: link:../plugins/FriendTech '@masknet/plugin-gitcoin': specifier: workspace:^ version: link:../plugins/Gitcoin @@ -1299,54 +1296,6 @@ importers: specifier: ^1.0.2 version: 1.0.2 - packages/plugins/FriendTech: - dependencies: - '@masknet/icons': - specifier: workspace:^ - version: link:../../icons - '@masknet/plugin-infra': - specifier: workspace:^ - version: link:../../plugin-infra - '@masknet/shared': - specifier: workspace:^ - version: link:../../shared - '@masknet/shared-base': - specifier: workspace:^ - version: link:../../shared-base - '@masknet/shared-base-ui': - specifier: workspace:^ - version: link:../../shared-base-ui - '@masknet/theme': - specifier: workspace:^ - version: link:../../theme - '@masknet/web3-hooks-base': - specifier: workspace:^ - version: link:../../web3-hooks/base - '@masknet/web3-providers': - specifier: workspace:^ - version: link:../../web3-providers - '@masknet/web3-shared-base': - specifier: workspace:^ - version: link:../../web3-shared/base - '@masknet/web3-shared-evm': - specifier: workspace:^ - version: link:../../web3-shared/evm - '@servie/events': - specifier: ^3.0.0 - version: 3.0.0 - bignumber.js: - specifier: 9.1.2 - version: 9.1.2 - react-router-dom: - specifier: ^6.24.0 - version: 6.24.0(react-dom@0.0.0-experimental-58af67a8f8-20240628(react@0.0.0-experimental-58af67a8f8-20240628))(react@0.0.0-experimental-58af67a8f8-20240628) - react-use: - specifier: ^17.5.0 - version: 17.5.0(patch_hash=tokvlmgj4xqkhjmndck4f7nw3q)(react-dom@0.0.0-experimental-58af67a8f8-20240628(react@0.0.0-experimental-58af67a8f8-20240628))(react@0.0.0-experimental-58af67a8f8-20240628) - urlcat: - specifier: ^3.1.0 - version: 3.1.0(patch_hash=scyjp2cqyqu6oq4kmzjh3isyxa) - packages/plugins/Gitcoin: dependencies: '@masknet/icons': @@ -3836,6 +3785,9 @@ packages: resolution: {integrity: sha512-VRnXRqsYNXq1jzNf6piJnUamtgVGuL5/8dVXl/Qy7xGyHBqLaHbQ6QKDCc/qf9Z3gFzFSjIZZle+pNPJ925psA==, tarball: https://npm.pkg.github.com/download/@DimensionDev/holoflows-kit/0.9.0-20240322092738-f9180f3/1d2e9df5c5cd2a733c547ceafed4860973f10836} peerDependencies: '@types/webextension-polyfill': ^0.10.0 + peerDependenciesMeta: + '@types/webextension-polyfill': + optional: true '@dimensiondev/mask-wallet-core@0.1.0-20211013082857-eb62e5f': resolution: {integrity: sha512-2d7v1/z9Khw4O7J7oBNKLBo7BONd7ZE2gpw34uHVtdG9i0aEz+LSRappgNTZyUZ/+TRJ7ZgAf+Dbeql1oPMvNA==, tarball: https://npm.pkg.github.com/download/@DimensionDev/mask-wallet-core/0.1.0-20211013082857-eb62e5f/04f14f2d88766a9ab098a686785f824270c5ed90} @@ -16355,9 +16307,10 @@ snapshots: '@dimensiondev/holoflows-kit@0.9.0-20240322092738-f9180f3(@types/webextension-polyfill@0.10.7)': dependencies: '@servie/events': 3.0.0 - '@types/webextension-polyfill': 0.10.7 lodash-es: 4.17.21 tslib: 2.6.2 + optionalDependencies: + '@types/webextension-polyfill': 0.10.7 '@dimensiondev/mask-wallet-core@0.1.0-20211013082857-eb62e5f(protobufjs@7.2.3)': dependencies: diff --git a/tsconfig.json b/tsconfig.json index bb0517add64..0a03cdb377f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -138,7 +138,6 @@ "@masknet/plugin-profilecard": ["./packages/plugins/ProfileCard/src/index.ts"], "@masknet/plugin-savings": ["./packages/plugins/Savings/src/index.ts"], "@masknet/plugin-snapshot": ["./packages/plugins/Snapshot/src/index.ts"], - "@masknet/plugin-friend-tech": ["./packages/plugins/FriendTech/src/tsconfig.json"], // @masknet/scripts: insert-here 3 "@masknet/plugin-switch-logo": ["./packages/plugins/SwitchLogo/src/index.ts"], "@masknet/plugin-calendar": ["./packages/plugins/Calendar/src/index.ts"]