From fb6122bf7266df365337291990bccbefcaefd6b3 Mon Sep 17 00:00:00 2001 From: guanbinrui Date: Mon, 19 May 2025 13:38:44 +0800 Subject: [PATCH 1/4] chore: bump version to 2.33.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 62858581e0e0..9a2d83aaf5ab 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "yarn": ">=999.0.0", "npm": ">=999.0.0" }, - "version": "2.33.1", + "version": "2.33.2", "private": true, "license": "AGPL-3.0-or-later", "scripts": { From 94ad968c449f1e9095b47085949bc67fafede90b Mon Sep 17 00:00:00 2001 From: Wukong Sun Date: Wed, 14 May 2025 16:53:13 +0800 Subject: [PATCH 2/4] fix: mf-6715 update firefly domain (#12227) --- packages/mask/popups/pages/Friends/common.tsx | 4 ++-- .../src/SiteAdaptor/RedPacket/index.tsx | 2 +- .../components/SocialBadges/FarcasterList.tsx | 2 +- packages/plugins/Web3Profile/src/utils.ts | 2 +- packages/shared-base/src/Site/types.ts | 2 +- .../web3-providers/src/Firefly/RedPacket.ts | 2 +- .../web3-providers/src/Firefly/constants.ts | 2 +- .../web3-providers/src/LensV3/constants.ts | 2 +- .../web3-shared/base/src/helpers/resolver.ts | 4 ++-- pnpm-lock.yaml | 21 ------------------- 10 files changed, 11 insertions(+), 32 deletions(-) diff --git a/packages/mask/popups/pages/Friends/common.tsx b/packages/mask/popups/pages/Friends/common.tsx index d2eceae97e57..a698552cbc49 100644 --- a/packages/mask/popups/pages/Friends/common.tsx +++ b/packages/mask/popups/pages/Friends/common.tsx @@ -22,8 +22,8 @@ export const PlatformUrlMap: Record = { [NextIDPlatform.Unstoppable]: 'https://ud.me/', [NextIDPlatform.GitHub]: 'https://github.com/', [NextIDPlatform.SpaceId]: 'https://bscscan.com/address/', - [NextIDPlatform.Farcaster]: 'https://firefly.mask.social/profile/farcaster/', - [NextIDPlatform.LENS]: 'https://firefly.mask.social/profile/lens/', + [NextIDPlatform.Farcaster]: 'https://firefly.social/profile/farcaster/', + [NextIDPlatform.LENS]: 'https://firefly.social/profile/lens/', [NextIDPlatform.Ethereum]: 'https://etherscan.io/address/', [NextIDPlatform.Keybase]: 'https://keybase.io/', } diff --git a/packages/plugins/RedPacket/src/SiteAdaptor/RedPacket/index.tsx b/packages/plugins/RedPacket/src/SiteAdaptor/RedPacket/index.tsx index e802275c4411..81c678870dcd 100644 --- a/packages/plugins/RedPacket/src/SiteAdaptor/RedPacket/index.tsx +++ b/packages/plugins/RedPacket/src/SiteAdaptor/RedPacket/index.tsx @@ -248,7 +248,7 @@ export const RedPacket = memo(function RedPacket({ payload, currentPluginID }: R {card} diff --git a/packages/plugins/Web3Profile/src/SiteAdaptor/components/SocialBadges/FarcasterList.tsx b/packages/plugins/Web3Profile/src/SiteAdaptor/components/SocialBadges/FarcasterList.tsx index bee2437b425f..c4c6d91046c9 100644 --- a/packages/plugins/Web3Profile/src/SiteAdaptor/components/SocialBadges/FarcasterList.tsx +++ b/packages/plugins/Web3Profile/src/SiteAdaptor/components/SocialBadges/FarcasterList.tsx @@ -74,7 +74,7 @@ interface FarcasterListItemProps { const FarcasterListItem = memo(function FarcasterListItem({ account }) { const { classes } = useStyles() - const profileUri = `https://firefly.mask.social/profile/farcaster/${account.fid}` + const profileUri = `https://firefly.social/profile/farcaster/${account.fid}` const farcasterIcon = return ( diff --git a/packages/plugins/Web3Profile/src/utils.ts b/packages/plugins/Web3Profile/src/utils.ts index 821237c86bf6..c6182a6804a3 100644 --- a/packages/plugins/Web3Profile/src/utils.ts +++ b/packages/plugins/Web3Profile/src/utils.ts @@ -3,7 +3,7 @@ import type { FireflyConfigAPI, NextIDBaseAPI } from '@masknet/web3-providers/ty import urlcat from 'urlcat' export function getFireflyLensProfileLink(handle: string) { - return urlcat('https://firefly.mask.social/profile/lens/:handle', { handle }) + return urlcat('https://firefly.social/profile/lens/:handle', { handle }) } export const NextIdLensToFireflyLens = (account: NextIDBaseAPI.LensAccount): FireflyConfigAPI.LensAccount => { diff --git a/packages/shared-base/src/Site/types.ts b/packages/shared-base/src/Site/types.ts index 3b8cd0a00aeb..db3956523127 100644 --- a/packages/shared-base/src/Site/types.ts +++ b/packages/shared-base/src/Site/types.ts @@ -6,7 +6,7 @@ export enum EnhanceableSite { Instagram = 'instagram.com', OpenSea = 'opensea.io', Mirror = 'mirror.xyz', - Firefly = 'firefly.mask.social', + Firefly = 'firefly.social', } export enum ExtensionSite { diff --git a/packages/web3-providers/src/Firefly/RedPacket.ts b/packages/web3-providers/src/Firefly/RedPacket.ts index c1b04cd1d302..2b215c8f40d0 100644 --- a/packages/web3-providers/src/Firefly/RedPacket.ts +++ b/packages/web3-providers/src/Firefly/RedPacket.ts @@ -12,7 +12,7 @@ import { fetchJSON } from '../entry-helpers.js' import { FireflyRedPacketAPI, type FireflyResponse } from '../entry-types.js' const siteType = getSiteType() -const SITE_URL = siteType === EnhanceableSite.Firefly ? location.origin : 'https://firefly.mask.social' +const SITE_URL = siteType === EnhanceableSite.Firefly ? location.origin : 'https://firefly.social' const FIREFLY_ROOT_URL = process.env.NEXT_PUBLIC_FIREFLY_API_URL || (process.env.NODE_ENV === 'development' ? 'https://api-dev.firefly.land' : 'https://api.firefly.land') diff --git a/packages/web3-providers/src/Firefly/constants.ts b/packages/web3-providers/src/Firefly/constants.ts index 0f4057a5b462..6ddd9f5f4093 100644 --- a/packages/web3-providers/src/Firefly/constants.ts +++ b/packages/web3-providers/src/Firefly/constants.ts @@ -1,5 +1,5 @@ export const FIREFLY_BASE_URL = 'https://api.firefly.land' -export const FIREFLY_SITE_URL = 'https://firefly.mask.social' +export const FIREFLY_SITE_URL = 'https://firefly.social' export const EMAIL_REGEX = /(([^\s"(),./:;<>@[\\\]]+(\.[^\s"(),./:;<>@[\\\]]+)*)|(".+"))@((\[(?:\d{1,3}\.){3}\d{1,3}])|(([\dA-Za-z-]+\.)+[A-Za-z]{2,}))$/ diff --git a/packages/web3-providers/src/LensV3/constants.ts b/packages/web3-providers/src/LensV3/constants.ts index 9078d383d479..08cec680e94f 100644 --- a/packages/web3-providers/src/LensV3/constants.ts +++ b/packages/web3-providers/src/LensV3/constants.ts @@ -1,3 +1,3 @@ export const LENS_ROOT_API = 'https://api.lens.xyz/' -export const FIREFLY_SITE_URL = 'https://firefly.mask.social' +export const FIREFLY_SITE_URL = 'https://firefly.social' export const LENS_MEDIA_SNAPSHOT_URL = 'https://ik.imagekit.io/lens/media-snapshot' diff --git a/packages/web3-shared/base/src/helpers/resolver.ts b/packages/web3-shared/base/src/helpers/resolver.ts index 046ab2b4232f..d7951f25ea22 100644 --- a/packages/web3-shared/base/src/helpers/resolver.ts +++ b/packages/web3-shared/base/src/helpers/resolver.ts @@ -187,7 +187,7 @@ export const resolveNextIDPlatformLink = (networkPlatform: NextIDPlatform, ident case NextIDPlatform.RSS3: return `https://rss3.io/result?search=${identifier}` case NextIDPlatform.LENS: - return `https://firefly.mask.social/profile/lens/${identifier}` + return `https://firefly.social/profile/lens/${identifier}` case NextIDPlatform.REDDIT: return `https://www.reddit.com/user/${identifier}` case NextIDPlatform.SYBIL: @@ -197,7 +197,7 @@ export const resolveNextIDPlatformLink = (networkPlatform: NextIDPlatform, ident case NextIDPlatform.SpaceId: return `https://bscscan.com/address/${identifier}` case NextIDPlatform.Farcaster: - return `https://firefly.mask.social/profile/farcaster/${identifier}` + return `https://firefly.social/profile/farcaster/${identifier}` case NextIDPlatform.Bit: return `https://bit.cc/${name}` case NextIDPlatform.Unstoppable: diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 09e133d1b5ab..464e6c1ce502 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4066,25 +4066,21 @@ packages: resolution: {integrity: sha512-lJ7s/pOQWRJ0mstjZQnVyX2/3QRXZ9cpFHJDZ7e81Y8QSn/iqxTrnK0DPgxUrDG8hYKQmWQdQLU4sP5DKBz0Jg==} cpu: [arm64] os: [linux] - libc: [glibc] '@dprint/linux-arm64-musl@0.45.1': resolution: {integrity: sha512-un2awe1L1sAJLsCPSEUrE0/cgupdzbYFoyBOutyU1zHR9KQn47AtIDw+chvuinU4xleHDuEGyXGuJ6NE+Ky6vw==} cpu: [arm64] os: [linux] - libc: [musl] '@dprint/linux-x64-glibc@0.45.1': resolution: {integrity: sha512-5Civht90S/g8zlyYB7n4oH78p+sLbNqeFCFuImJRK7uRxZwCRya7lji6RwlB6DQ7qngVqovTHj9RLOYfZzfVlg==} cpu: [x64] os: [linux] - libc: [glibc] '@dprint/linux-x64-musl@0.45.1': resolution: {integrity: sha512-p2/gjnHDd8GRCvtey5HZO4o/He6pSmY/zpcCuIXprFW9P0vNlEj3DFhz4FPpOKXM+csrsVWWs2E0T/xr5QZtVg==} cpu: [x64] os: [linux] - libc: [musl] '@dprint/typescript@0.90.5': resolution: {integrity: sha512-/1aP6saonFvJyQN3l2is6eTOec3GnLGyW+opid/eDm8pnlhwzYl8A9p36pI6WO5jLl/a9Ghod+LWpvSOuXFGUw==} @@ -5474,28 +5470,24 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] - libc: [glibc] '@napi-rs/image-linux-arm64-musl@1.4.1': resolution: {integrity: sha512-zp5YOfAMf3Wl5Nl872ubB1Yhy/qzR6AHlzyTHvsNQcoeKQSXZeQ0pSeDO78TaoYXtytBF6FHi5DVmuqmz5lxOg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - libc: [musl] '@napi-rs/image-linux-x64-gnu@1.4.1': resolution: {integrity: sha512-Z+4dShhM3kzYhSINT9jd52DCLKUYH23B7tHEuNW6PIl0eCZmgi2lYRawbmA98rFdmAckfFtYEEg4if6HEbyGgQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - libc: [glibc] '@napi-rs/image-linux-x64-musl@1.4.1': resolution: {integrity: sha512-wJh76KSVjJXtmsddhsU+lNYqvXMv0wyzSPMFF/zYPryjUeNAWZp3P59OKj2mq8eFK22t17pBxbZb6uru2bFT7A==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - libc: [musl] '@napi-rs/image-win32-ia32-msvc@1.4.1': resolution: {integrity: sha512-aB7JDZp1InE6nj25dg2+Xmv2I1aM+nTfI5v9r7dM6VPTByDHo2NtHqCtTeMM5xlpvMcUTwjyrZHwV1WJGZKNtQ==} @@ -5651,35 +5643,30 @@ packages: engines: {node: '>= 10.0.0'} cpu: [arm] os: [linux] - libc: [glibc] '@parcel/watcher-linux-arm64-glibc@2.3.0': resolution: {integrity: sha512-mQ0gBSQEiq1k/MMkgcSB0Ic47UORZBmWoAWlMrTW6nbAGoLZP+h7AtUM7H3oDu34TBFFvjy4JCGP43JlylkTQA==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] - libc: [glibc] '@parcel/watcher-linux-arm64-musl@2.3.0': resolution: {integrity: sha512-LXZAExpepJew0Gp8ZkJ+xDZaTQjLHv48h0p0Vw2VMFQ8A+RKrAvpFuPVCVwKJCr5SE+zvaG+Etg56qXvTDIedw==} engines: {node: '>= 10.0.0'} cpu: [arm64] os: [linux] - libc: [musl] '@parcel/watcher-linux-x64-glibc@2.3.0': resolution: {integrity: sha512-P7Wo91lKSeSgMTtG7CnBS6WrA5otr1K7shhSjKHNePVmfBHDoAOHYRXgUmhiNfbcGk0uMCHVcdbfxtuiZCHVow==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] - libc: [glibc] '@parcel/watcher-linux-x64-musl@2.3.0': resolution: {integrity: sha512-+kiRE1JIq8QdxzwoYY+wzBs9YbJ34guBweTK8nlzLKimn5EQ2b2FSC+tAOpq302BuIMjyuUGvBiUhEcLIGMQ5g==} engines: {node: '>= 10.0.0'} cpu: [x64] os: [linux] - libc: [musl] '@parcel/watcher-wasm@2.3.0': resolution: {integrity: sha512-ejBAX8H0ZGsD8lSICDNyMbSEtPMWgDL0WFCt/0z7hyf5v8Imz4rAM8xY379mBsECkq/Wdqa5WEDLqtjZ+6NxfA==} @@ -6016,25 +6003,21 @@ packages: resolution: {integrity: sha512-DTtFBJmgQQrVWjbklpgJDr3kE9Uf1fHsPh+1GVslsBuyn+o4O7JslrnjuVsQCYKoiEg0Lg4ZPQmwnhJLHssZ5A==} cpu: [arm64] os: [linux] - libc: [glibc] '@rspack/binding-linux-arm64-musl@1.2.7': resolution: {integrity: sha512-01/OoQQF9eyDvRKkxj4DzCznfGZIvnzI8qOsrv+M7VBm8FLoKpb3hygXixaGQOXmNL42XTh61qjgm++fBu6aUA==} cpu: [arm64] os: [linux] - libc: [musl] '@rspack/binding-linux-x64-gnu@1.2.7': resolution: {integrity: sha512-lUOAUq0YSsofCXsP6XnlgfH0ZRDZ2X2XqXLXYjqf4xkSxCl5eBmE0EQYjAHF4zjUvU5rVx4a4bDLWv7+t3bOHg==} cpu: [x64] os: [linux] - libc: [glibc] '@rspack/binding-linux-x64-musl@1.2.7': resolution: {integrity: sha512-ZrPXfgT30p4DlydYavaTHiluxHkWvZHt7K4q7qNyTfYYowG6jRGwWi/PATdugNICGv027Wsh5nzEO4o27Iuhwg==} cpu: [x64] os: [linux] - libc: [musl] '@rspack/binding-win32-arm64-msvc@1.2.7': resolution: {integrity: sha512-1OzzM+OUSWX39XYcDfxJ8bGX5vNNrRejCMGotBEdP+uQ3KMWCPz0G4KRc3QIjghaLIYk3ofd83hcfUxyk/2Xog==} @@ -6528,28 +6511,24 @@ packages: engines: {node: '>=10'} cpu: [arm64] os: [linux] - libc: [glibc] '@swc/core-linux-arm64-musl@1.11.7': resolution: {integrity: sha512-cTydaYBwDbVV5CspwVcCp9IevYWpGD1cF5B5KlBdjmBzxxeWyTAJRtKzn8w5/UJe/MfdAptarpqMPIs2f33YEQ==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - libc: [musl] '@swc/core-linux-x64-gnu@1.11.7': resolution: {integrity: sha512-YAX2KfYPlbDsnZiVMI4ZwotF3VeURUrzD+emJgFf1g26F4eEmslldgnDrKybW7V+bObsH22cDqoy6jmQZgpuPQ==} engines: {node: '>=10'} cpu: [x64] os: [linux] - libc: [glibc] '@swc/core-linux-x64-musl@1.11.7': resolution: {integrity: sha512-mYT6FTDZyYx5pailc8xt6ClS2yjKmP8jNHxA9Ce3K21n5qkKilI5M2N7NShwXkd3Ksw3F29wKrg+wvEMXTRY/A==} engines: {node: '>=10'} cpu: [x64] os: [linux] - libc: [musl] '@swc/core-win32-arm64-msvc@1.11.7': resolution: {integrity: sha512-uLDQEcv0BHcepypstyxKkNsW6KfLyI5jVxTbcxka+B2UnMcFpvoR87nGt2JYW0grO2SNZPoFz+UnoKL9c6JxpA==} From fcbb5097647ada908b47adafbc9a0c346ba63630 Mon Sep 17 00:00:00 2001 From: Wukong Sun Date: Sat, 17 May 2025 14:25:02 +0800 Subject: [PATCH 3/4] fix(farcaster): mf-6717 use username for farcaster identity (#12232) --- .../ContactCard/ConnectedAccounts/index.tsx | 2 +- .../components/SocialBadges/FarcasterList.tsx | 4 ++-- .../UI/components/SocialAccountList/index.tsx | 2 +- packages/web3-providers/src/Web3Bio/index.ts | 22 +++++-------------- 4 files changed, 10 insertions(+), 20 deletions(-) diff --git a/packages/mask/popups/pages/Friends/ContactCard/ConnectedAccounts/index.tsx b/packages/mask/popups/pages/Friends/ContactCard/ConnectedAccounts/index.tsx index 02de61ee13a1..427536fe8de3 100644 --- a/packages/mask/popups/pages/Friends/ContactCard/ConnectedAccounts/index.tsx +++ b/packages/mask/popups/pages/Friends/ContactCard/ConnectedAccounts/index.tsx @@ -36,7 +36,7 @@ interface ConnectedAccountsProps { localProfile?: ProfileIdentifier } -export const ConnectedAccounts = memo(function ({ +export const ConnectedAccounts = memo(function ConnectedAccounts({ avatar, nextId, profiles, diff --git a/packages/plugins/Web3Profile/src/SiteAdaptor/components/SocialBadges/FarcasterList.tsx b/packages/plugins/Web3Profile/src/SiteAdaptor/components/SocialBadges/FarcasterList.tsx index c4c6d91046c9..af5bedddbc32 100644 --- a/packages/plugins/Web3Profile/src/SiteAdaptor/components/SocialBadges/FarcasterList.tsx +++ b/packages/plugins/Web3Profile/src/SiteAdaptor/components/SocialBadges/FarcasterList.tsx @@ -74,11 +74,11 @@ interface FarcasterListItemProps { const FarcasterListItem = memo(function FarcasterListItem({ account }) { const { classes } = useStyles() - const profileUri = `https://firefly.social/profile/farcaster/${account.fid}` + const profileUri = `https://firefly.social/profile/farcaster/${account.username}` const farcasterIcon = return ( - +
{profileUri.length ? { return { platform: NextIDPlatform.Farcaster, - identity: account.fid.toString(), + identity: account.username, address: account.signer_address, displayName: account.display_name, avatar: account.avatar.url, diff --git a/packages/web3-providers/src/Web3Bio/index.ts b/packages/web3-providers/src/Web3Bio/index.ts index 83020c5e7d3a..fc495804536e 100644 --- a/packages/web3-providers/src/Web3Bio/index.ts +++ b/packages/web3-providers/src/Web3Bio/index.ts @@ -12,16 +12,6 @@ type Response = error: string } -function patchProfile(profile: Web3BioProfile): Web3BioProfile { - if (profile.platform === NextIDPlatform.Farcaster && profile.social?.uid) { - return { - ...profile, - identity: profile.social.uid.toString(), - } - } - return profile -} - export class Web3Bio { static fetchFromWeb3Bio(request: Request | RequestInfo, init?: RequestInit) { return fetchCachedJSON(request, { @@ -34,21 +24,21 @@ export class Web3Bio { static async getProfilesByTwitterId(handle: string) { const url = urlcat(WEB3_BIO_HOST, `/profile/twitter,${handle.toLowerCase()}`) - const res = await Web3Bio.fetchFromWeb3Bio>(url) - return Array.isArray(res) ? res.map(patchProfile) : [] + const profiles = await Web3Bio.fetchFromWeb3Bio>(url) + return Array.isArray(profiles) ? profiles : [] } /** Get profiles by address or domain */ static async getProfilesBy(domainOrAddress: string) { const url = urlcat(WEB3_BIO_HOST, '/profile/:id', { id: domainOrAddress }) - const res = await Web3Bio.fetchFromWeb3Bio>(url) - return Array.isArray(res) ? res.map(patchProfile) : [] + const profiles = await Web3Bio.fetchFromWeb3Bio>(url) + return Array.isArray(profiles) ? profiles : [] } static async getProfilesByNextId(pubkey: string) { const url = urlcat(WEB3_BIO_HOST, '/profile/nextid,:pubkey', { pubkey }) - const res = await Web3Bio.fetchFromWeb3Bio>(url) - return Array.isArray(res) ? res.map(patchProfile) : [] + const profiles = await Web3Bio.fetchFromWeb3Bio>(url) + return Array.isArray(profiles) ? profiles : [] } static async getAllLens(twitterId: string) { From 705829d2b7c89e56b1881a636cb8a6656177f972 Mon Sep 17 00:00:00 2001 From: Wukong Sun Date: Tue, 20 May 2025 10:50:07 +0800 Subject: [PATCH 4/4] fix(RSS3): mf-6716 remove rss3 profile fetching (#12234) Remove RSS3.getProfiles API usage from avatar component and DSearch provider. --- .../components/UserAvatar/index.tsx | 47 +----------- packages/vitest-setup/handlers/DSearch.ts | 72 ------------------- packages/web3-providers/src/DSearch/index.ts | 28 -------- .../web3-providers/src/RSS3/apis/RSS3API.ts | 15 +--- 4 files changed, 3 insertions(+), 159 deletions(-) diff --git a/packages/plugins/RSS3/src/SiteAdaptor/components/UserAvatar/index.tsx b/packages/plugins/RSS3/src/SiteAdaptor/components/UserAvatar/index.tsx index ab9d9a50906c..e14277f53762 100644 --- a/packages/plugins/RSS3/src/SiteAdaptor/components/UserAvatar/index.tsx +++ b/packages/plugins/RSS3/src/SiteAdaptor/components/UserAvatar/index.tsx @@ -1,23 +1,8 @@ -import { EthereumBlockie, Image } from '@masknet/shared' +import { EthereumBlockie } from '@masknet/shared' import { makeStyles } from '@masknet/theme' -import { RSS3 } from '@masknet/web3-providers' -import { resolveIPFS_URL } from '@masknet/web3-shared-base' -import { isValidAddress } from '@masknet/web3-shared-evm' -import { useQuery } from '@tanstack/react-query' import { memo, type HTMLProps } from 'react' const useStyles = makeStyles<{ size: number }>()((theme, { size }) => ({ - container: { - display: 'inline-block !important', - width: size, - height: size, - borderRadius: '50%', - overflow: 'hidden', - }, - fallbackImage: { - width: size, - height: size, - }, blockie: { width: size, height: size, @@ -32,33 +17,5 @@ interface Props extends HTMLProps { } export const UserAvatar = memo(function UserAvatar({ identity, size = 20, ...rest }: Props) { const { classes } = useStyles({ size }) - const { data: profile } = useQuery({ - queryKey: ['rss3-profiles', identity], - queryFn: async () => { - if (!identity || isValidAddress(identity)) return null - const profiles = await RSS3.getProfiles(identity) - if (!profiles.length) return null - return profiles.find((x) => x.handle === identity) - }, - }) - const url = profile?.profile_uri?.[0] - if (!url) { - return ( - - ) - } - return ( - - ) + return }) diff --git a/packages/vitest-setup/handlers/DSearch.ts b/packages/vitest-setup/handlers/DSearch.ts index 63fca9b4faf7..79a0d24e45e5 100644 --- a/packages/vitest-setup/handlers/DSearch.ts +++ b/packages/vitest-setup/handlers/DSearch.ts @@ -135,76 +135,4 @@ export const DSearchHandlers = [ { status: 200 }, ) }), - - http.get(`${rss3BaseURL}/datasets/domains/profiles`, () => { - return HttpResponse.json([ - { - address: '0x934b510d4c9103e6a87aef13b816fb080286d649', - network: 'crossbell', - platform: 'Crossbell', - source: 'Crossbell', - name: 'Suji Yan', - handle: 'suji.csb', - bio: 'Founder Mask Network $Mask; maintain mstdn.jp mastodon.cloud ; Engineer; Journalist; 💪FOSS/Anti996; 中文/日本語 mask.io', - url: 'https://crossbell.io/@suji', - profile_uri: ['https://ipfs.io/ipfs/QmeYWaMUekPthkMnb5FMkiPLBTfu1PLkQFvZM3a7oftzNu/'], - }, - { - address: '0x934b510d4c9103e6a87aef13b816fb080286d649', - network: 'farcaster', - platform: 'Farcaster', - source: 'Farcaster', - name: 'Suji Yan', - handle: 'suji', - bio: 'Mask.io / suji_yan.twitter', - url: 'https://www.discove.xyz/@suji', - }, - { - address: '0x934b510d4c9103e6a87aef13b816fb080286d649', - network: 'ethereum', - platform: 'ENS Registrar', - source: 'ENS Registrar', - name: 'sujiyan', - handle: 'sujiyan.eth', - bio: '', - url: 'https://mask.io', - expire_at: '2027-01-30T04:49:54Z', - profile_uri: ['https://i.imgur.com/rkMlngS_d.webp?maxwidth=640&shape=thumb&fidelity=medium'], - }, - { - address: '0x934b510d4c9103e6a87aef13b816fb080286d649', - network: 'crossbell', - platform: 'Crossbell', - source: 'Crossbell', - name: '', - handle: 'sujiyan.csb', - bio: '', - url: 'https://crossbell.io/@sujiyan', - }, - { - address: '0x934b510d4c9103e6a87aef13b816fb080286d649', - network: 'binance_smart_chain', - platform: 'Space ID', - source: 'Space ID', - name: 'sujiyan', - handle: 'sujiyan.bnb', - bio: '', - expire_at: '2023-09-18T03:44:56Z', - profile_uri: [ - 'https://meta.image.space.id/image/mainnet/1724643242156410158978553366859696090187901297468846704390299624367871799562.svg', - ], - }, - { - address: '0x934b510d4c9103e6a87aef13b816fb080286d649', - network: 'polygon', - platform: 'Lens', - source: 'Lens', - name: 'Suji Yan', - handle: 'sujiyan.lens', - bio: 'Mask.io', - url: 'https://lenster.xyz/u/sujiyan.lens', - profile_uri: ['https://ipfs.io/ipfs/QmeYWaMUekPthkMnb5FMkiPLBTfu1PLkQFvZM3a7oftzNu'], - }, - ]) - }), ] diff --git a/packages/web3-providers/src/DSearch/index.ts b/packages/web3-providers/src/DSearch/index.ts index 351ead9e11b0..492e72f60446 100644 --- a/packages/web3-providers/src/DSearch/index.ts +++ b/packages/web3-providers/src/DSearch/index.ts @@ -38,7 +38,6 @@ import { CoinGeckoSearchAPI } from '../CoinGecko/apis/DSearchAPI.js' import { CoinGeckoTrending } from '../CoinGecko/apis/TrendingAPI.js' import { ENS } from '../ENS/index.js' import { NFTScanCollectionSearchAPI, NFTScanSearchAPI } from '../NFTScan/apis/DSearchAPI.js' -import { PlatformToChainIdMap } from '../RSS3/constants.js' import { RSS3 } from '../RSS3/index.js' import { SpaceID } from '../SpaceID/index.js' import { DSEARCH_BASE_URL } from './constants.js' @@ -140,25 +139,6 @@ class DSearchAPI>> { - const profiles = await RSS3.getProfiles(handle) - return profiles - .filter((x) => x.handle === handle) - .map((profile) => { - const chainId = PlatformToChainIdMap[profile.network] as ChainId - if (!chainId) console.error(`Not chain id configured for network ${profile.network}`) - - return { - type: SearchResultType.Domain, - pluginID: NetworkPluginID.PLUGIN_EVM, - chainId, - keyword: handle, - domain: profile.handle, - address: profile.address, - } - }) - } - private async searchRSS3NameService(handle: string): Promise>> { const result = await RSS3.getNameService(handle) if (!result) return [] @@ -457,14 +437,6 @@ class DSearchAPI - // vitalik.lens, vitalik.bit, etc. including ENS BNB - // Can't get .bit domain via RSS3 profile API. - if (isValidHandle(lowerKeyword) && !lowerKeyword.endsWith('.bit')) { - if (lowerKeyword.endsWith('.eth')) Telemetry.captureEvent(EventType.Access, EventID.EntryTimelineDsearchEns) - else Telemetry.captureEvent(EventType.Access, EventID.EntryTimelineDsearchName) - const domains = (await this.searchRSS3Handle(lowerKeyword)) as T[] - if (domains.length) return domains - } if (lowerKeyword.endsWith('.bit')) { Telemetry.captureEvent(EventType.Access, EventID.EntryTimelineDsearchName) return this.searchRSS3NameService(lowerKeyword) as Promise diff --git a/packages/web3-providers/src/RSS3/apis/RSS3API.ts b/packages/web3-providers/src/RSS3/apis/RSS3API.ts index cfc2999b1ac0..13f382cd8b47 100644 --- a/packages/web3-providers/src/RSS3/apis/RSS3API.ts +++ b/packages/web3-providers/src/RSS3/apis/RSS3API.ts @@ -1,6 +1,6 @@ import { createIndicator, createNextIndicator, createPageable } from '@masknet/shared-base' import { queryClient } from '@masknet/shared-base-ui' -import { isValidAddress, type ChainId } from '@masknet/web3-shared-evm' +import { type ChainId } from '@masknet/web3-shared-evm' import { Telemetry } from '@masknet/web3-telemetry' import { ExceptionID, ExceptionType } from '@masknet/web3-telemetry/types' import * as RSS3Next from /* webpackDefer: true */ 'rss3-next' @@ -127,19 +127,6 @@ export class RSS3 { ) } - static async getProfiles(account: string | undefined) { - if (!account) return [] - if (!account.includes('.') && !isValidAddress(account)) return [] - const url = urlcat(RSS3_ENDPOINT, '/datasets/domains/profiles', { - account, - }) - - const response = await fetchFromRSS3(url) - if ('error' in response) return [] - - return response - } - static async getNameService(handle: string) { const url = urlcat(RSS3_ENDPOINT, '/ns/:handle', { handle,