Skip to content

Commit 5ced2fe

Browse files
guanbinruiswkatmask
andcommitted
[Release] Hotfix 2.33.1 => 2.33.2 (patch) (#12233)
* chore: bump version to 2.33.2 * fix: mf-6715 update firefly domain (#12227) * fix(farcaster): mf-6717 use username for farcaster identity (#12232) * fix(RSS3): mf-6716 remove rss3 profile fetching (#12234) Remove RSS3.getProfiles API usage from avatar component and DSearch provider. --------- Co-authored-by: Wukong Sun <[email protected]>
1 parent 9b572ea commit 5ced2fe

File tree

5 files changed

+4
-160
lines changed

5 files changed

+4
-160
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"yarn": ">=999.0.0",
88
"npm": ">=999.0.0"
99
},
10-
"version": "2.33.0",
10+
"version": "2.33.2",
1111
"private": true,
1212
"license": "AGPL-3.0-or-later",
1313
"scripts": {
Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,8 @@
1-
import { EthereumBlockie, Image } from '@masknet/shared'
1+
import { EthereumBlockie } from '@masknet/shared'
22
import { makeStyles } from '@masknet/theme'
3-
import { RSS3 } from '@masknet/web3-providers'
4-
import { resolveIPFS_URL } from '@masknet/web3-shared-base'
5-
import { isValidAddress } from '@masknet/web3-shared-evm'
6-
import { useQuery } from '@tanstack/react-query'
73
import { memo, type HTMLProps } from 'react'
84

95
const useStyles = makeStyles<{ size: number }>()((theme, { size }) => ({
10-
container: {
11-
display: 'inline-block !important',
12-
width: size,
13-
height: size,
14-
borderRadius: '50%',
15-
overflow: 'hidden',
16-
},
17-
fallbackImage: {
18-
width: size,
19-
height: size,
20-
},
216
blockie: {
227
width: size,
238
height: size,
@@ -32,33 +17,5 @@ interface Props extends HTMLProps<HTMLImageElement> {
3217
}
3318
export const UserAvatar = memo(function UserAvatar({ identity, size = 20, ...rest }: Props) {
3419
const { classes } = useStyles({ size })
35-
const { data: profile } = useQuery({
36-
queryKey: ['rss3-profiles', identity],
37-
queryFn: async () => {
38-
if (!identity || isValidAddress(identity)) return null
39-
const profiles = await RSS3.getProfiles(identity)
40-
if (!profiles.length) return null
41-
return profiles.find((x) => x.handle === identity) || null
42-
},
43-
})
44-
const url = profile?.profile_uri?.[0]
45-
if (!url) {
46-
return (
47-
<EthereumBlockie
48-
address={identity || profile?.address || ''}
49-
classes={{ icon: classes.blockie }}
50-
style={rest.style}
51-
/>
52-
)
53-
}
54-
return (
55-
<Image
56-
classes={{ container: classes.container, fallbackImage: classes.fallbackImage }}
57-
src={resolveIPFS_URL(url)}
58-
width={size}
59-
height={size}
60-
{...rest}
61-
containerProps={{ style: rest.style }}
62-
/>
63-
)
20+
return <EthereumBlockie address={identity || ''} classes={{ icon: classes.blockie }} style={rest.style} />
6421
})

packages/vitest-setup/handlers/DSearch.ts

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -135,76 +135,4 @@ export const DSearchHandlers = [
135135
{ status: 200 },
136136
)
137137
}),
138-
139-
http.get(`${rss3BaseURL}/datasets/domains/profiles`, () => {
140-
return HttpResponse.json([
141-
{
142-
address: '0x934b510d4c9103e6a87aef13b816fb080286d649',
143-
network: 'crossbell',
144-
platform: 'Crossbell',
145-
source: 'Crossbell',
146-
name: 'Suji Yan',
147-
handle: 'suji.csb',
148-
bio: 'Founder Mask Network $Mask; maintain mstdn.jp mastodon.cloud ; Engineer; Journalist; 💪FOSS/Anti996; 中文/日本語 mask.io',
149-
url: 'https://crossbell.io/@suji',
150-
profile_uri: ['https://ipfs.io/ipfs/QmeYWaMUekPthkMnb5FMkiPLBTfu1PLkQFvZM3a7oftzNu/'],
151-
},
152-
{
153-
address: '0x934b510d4c9103e6a87aef13b816fb080286d649',
154-
network: 'farcaster',
155-
platform: 'Farcaster',
156-
source: 'Farcaster',
157-
name: 'Suji Yan',
158-
handle: 'suji',
159-
bio: 'Mask.io / suji_yan.twitter',
160-
url: 'https://www.discove.xyz/@suji',
161-
},
162-
{
163-
address: '0x934b510d4c9103e6a87aef13b816fb080286d649',
164-
network: 'ethereum',
165-
platform: 'ENS Registrar',
166-
source: 'ENS Registrar',
167-
name: 'sujiyan',
168-
handle: 'sujiyan.eth',
169-
bio: '',
170-
url: 'https://mask.io',
171-
expire_at: '2027-01-30T04:49:54Z',
172-
profile_uri: ['https://i.imgur.com/rkMlngS_d.webp?maxwidth=640&shape=thumb&fidelity=medium'],
173-
},
174-
{
175-
address: '0x934b510d4c9103e6a87aef13b816fb080286d649',
176-
network: 'crossbell',
177-
platform: 'Crossbell',
178-
source: 'Crossbell',
179-
name: '',
180-
handle: 'sujiyan.csb',
181-
bio: '',
182-
url: 'https://crossbell.io/@sujiyan',
183-
},
184-
{
185-
address: '0x934b510d4c9103e6a87aef13b816fb080286d649',
186-
network: 'binance_smart_chain',
187-
platform: 'Space ID',
188-
source: 'Space ID',
189-
name: 'sujiyan',
190-
handle: 'sujiyan.bnb',
191-
bio: '',
192-
expire_at: '2023-09-18T03:44:56Z',
193-
profile_uri: [
194-
'https://meta.image.space.id/image/mainnet/1724643242156410158978553366859696090187901297468846704390299624367871799562.svg',
195-
],
196-
},
197-
{
198-
address: '0x934b510d4c9103e6a87aef13b816fb080286d649',
199-
network: 'polygon',
200-
platform: 'Lens',
201-
source: 'Lens',
202-
name: 'Suji Yan',
203-
handle: 'sujiyan.lens',
204-
bio: 'Mask.io',
205-
url: 'https://lenster.xyz/u/sujiyan.lens',
206-
profile_uri: ['https://ipfs.io/ipfs/QmeYWaMUekPthkMnb5FMkiPLBTfu1PLkQFvZM3a7oftzNu'],
207-
},
208-
])
209-
}),
210138
]

packages/web3-providers/src/DSearch/index.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import { CoinGeckoSearchAPI } from '../CoinGecko/apis/DSearchAPI.js'
3838
import { CoinGeckoTrending } from '../CoinGecko/apis/TrendingAPI.js'
3939
import { ENS } from '../ENS/index.js'
4040
import { NFTScanCollectionSearchAPI, NFTScanSearchAPI } from '../NFTScan/apis/DSearchAPI.js'
41-
import { PlatformToChainIdMap } from '../RSS3/constants.js'
4241
import { RSS3 } from '../RSS3/index.js'
4342
import { SpaceID } from '../SpaceID/index.js'
4443
import { DSEARCH_BASE_URL } from './constants.js'
@@ -140,25 +139,6 @@ class DSearchAPI<ChainId = Web3Helper.ChainIdAll, SchemaType = Web3Helper.Schema
140139
]
141140
}
142141

143-
private async searchRSS3Handle(handle: string): Promise<Array<DomainResult<ChainId>>> {
144-
const profiles = await RSS3.getProfiles(handle)
145-
return profiles
146-
.filter((x) => x.handle === handle)
147-
.map((profile) => {
148-
const chainId = PlatformToChainIdMap[profile.network] as ChainId
149-
if (!chainId) console.error(`Not chain id configured for network ${profile.network}`)
150-
151-
return {
152-
type: SearchResultType.Domain,
153-
pluginID: NetworkPluginID.PLUGIN_EVM,
154-
chainId,
155-
keyword: handle,
156-
domain: profile.handle,
157-
address: profile.address,
158-
}
159-
})
160-
}
161-
162142
private async searchRSS3NameService(handle: string): Promise<Array<DomainResult<ChainId>>> {
163143
const result = await RSS3.getNameService(handle)
164144
if (!result) return []
@@ -454,14 +434,6 @@ class DSearchAPI<ChainId = Web3Helper.ChainIdAll, SchemaType = Web3Helper.Schema
454434
const { word, field } = this.parseKeyword(lowerKeyword)
455435
if (word && ['token', 'twitter'].includes(field ?? '')) return this.searchTokenByName(word) as Promise<T[]>
456436

457-
// vitalik.lens, vitalik.bit, etc. including ENS BNB
458-
// Can't get .bit domain via RSS3 profile API.
459-
if (isValidHandle(lowerKeyword) && !lowerKeyword.endsWith('.bit')) {
460-
if (lowerKeyword.endsWith('.eth')) Telemetry.captureEvent(EventType.Access, EventID.EntryTimelineDsearchEns)
461-
else Telemetry.captureEvent(EventType.Access, EventID.EntryTimelineDsearchName)
462-
const domains = (await this.searchRSS3Handle(lowerKeyword)) as T[]
463-
if (domains.length) return domains
464-
}
465437
if (lowerKeyword.endsWith('.bit')) {
466438
Telemetry.captureEvent(EventType.Access, EventID.EntryTimelineDsearchName)
467439
return this.searchRSS3NameService(lowerKeyword) as Promise<T[]>

packages/web3-providers/src/RSS3/apis/RSS3API.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createIndicator, createNextIndicator, createPageable } from '@masknet/shared-base'
22
import { queryClient } from '@masknet/shared-base-ui'
3-
import { isValidAddress, type ChainId } from '@masknet/web3-shared-evm'
3+
import { type ChainId } from '@masknet/web3-shared-evm'
44
import { Telemetry } from '@masknet/web3-telemetry'
55
import { ExceptionID, ExceptionType } from '@masknet/web3-telemetry/types'
66
import * as RSS3Next from /* webpackDefer: true */ 'rss3-next'
@@ -127,19 +127,6 @@ export class RSS3 {
127127
)
128128
}
129129

130-
static async getProfiles(account: string | undefined) {
131-
if (!account) return []
132-
if (!account.includes('.') && !isValidAddress(account)) return []
133-
const url = urlcat(RSS3_ENDPOINT, '/datasets/domains/profiles', {
134-
account,
135-
})
136-
137-
const response = await fetchFromRSS3<RSS3BaseAPI.ProfilesResponse | { error: string }>(url)
138-
if ('error' in response) return []
139-
140-
return response
141-
}
142-
143130
static async getNameService(handle: string) {
144131
const url = urlcat(RSS3_ENDPOINT, '/ns/:handle', {
145132
handle,

0 commit comments

Comments
 (0)