Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ export function CollectionList({
.filter(Boolean) as Array<NonFungibleTokenCollection<Web3Helper.ChainIdAll>>
}, [allCollectibles.length])

const isFromAlchemy = collections?.findIndex((collection) => collection?.name?.length > 0) === -1

if (!allCollectibles.length && !done && !error && account) return <LoadingSkeleton />

if (!allCollectibles.length && error && account) return <RetryHint retry={nextPage} />
Expand Down Expand Up @@ -362,39 +364,43 @@ export function CollectionList({
{!done && <LoadingBase />}
</ElementAnchor>
</Box>
<Box>
<Box
display="flex"
alignItems="center"
justifyContent="center"
sx={{ marginTop: '8px', marginBottom: '12px', minWidth: 30, maxHeight: 24 }}>
<AllNetworkButton
className={classes.networkSelected}
onClick={() => setSelectedCollection('all')}>
ALL
</AllNetworkButton>
{!isFromAlchemy && (
<Box>
<Box
display="flex"
alignItems="center"
justifyContent="center"
sx={{ marginTop: '8px', marginBottom: '12px', minWidth: 30, maxHeight: 24 }}>
<AllNetworkButton
className={classes.networkSelected}
onClick={() => setSelectedCollection('all')}>
ALL
</AllNetworkButton>
</Box>
{collections.map((x, i) => {
return (
x?.name?.length > 0 && (
<Box
display="flex"
key={i}
alignItems="center"
justifyContent="center"
sx={{ marginTop: '8px', marginBottom: '12px', minWidth: 30, maxHeight: 24 }}>
<CollectionIcon
selectedCollection={
selectedCollection === 'all' ? undefined : selectedCollection?.address
}
collection={x}
onClick={() => {
setSelectedCollection(x)
}}
/>
</Box>
)
)
})}
</Box>
{collections.map((x, i) => {
return (
<Box
display="flex"
key={i}
alignItems="center"
justifyContent="center"
sx={{ marginTop: '8px', marginBottom: '12px', minWidth: 30, maxHeight: 24 }}>
<CollectionIcon
selectedCollection={
selectedCollection === 'all' ? undefined : selectedCollection?.address
}
collection={x}
onClick={() => {
setSelectedCollection(x)
}}
/>
</Box>
)
})}
</Box>
)}
</Stack>
</Box>
)
Expand Down
7 changes: 4 additions & 3 deletions packages/web3-providers/src/MagicEden/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ export class MagicEdenAPI implements NonFungibleTokenAPI.Provider<ChainId, Schem
chainId: ChainId.Mainnet,
type: TokenType.NonFungible,
schema: SchemaType.NonFungible,
tokenId: token.mintAddress,
tokenId: token?.title?.match(/#\d+/)?.[0]?.replace('#', '') ?? '',
address: token.mintAddress,
metadata: {
chainId: ChainId.Mainnet,
name: token.collectionName,
name: token?.title,
symbol: '',
description: '',
imageURL: toImage(token.img),
Expand All @@ -137,11 +137,12 @@ export class MagicEdenAPI implements NonFungibleTokenAPI.Provider<ChainId, Schem
},
collection: {
chainId: ChainId.Mainnet,
name: token.collectionName,
name: token.collectionName ?? token?.collectionTitle,
slug: '',
description: '',
iconURL: '',
verified: false,
address: token.mintAddress,
},
}
})
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-providers/src/MagicEden/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export interface MagicEdenNFT {
price: number
owner: string
collectionName: string
collectionTittle: string
collectionTitle: string
img: string
title: string
content: string
Expand Down
2 changes: 1 addition & 1 deletion packages/web3-providers/src/alchemy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function createNftToken_EVM(
collection: {
address: contractAddress,
chainId,
name: resolveCollectionName(asset),
name: '',
slug: '',
description: asset.description,
},
Expand Down
3 changes: 2 additions & 1 deletion packages/web3-providers/src/opensea/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ function createNFTToken(chainId: ChainId, asset: OpenSeaResponse): NonFungibleTo
owner: asset.owner.address,
},
collection: {
address: asset.token_address ?? asset.asset_contract.address,
chainId,
name: asset.collection.name,
slug: asset.collection.slug,
Expand All @@ -117,7 +118,7 @@ function createNFTAsset(chainId: ChainId, asset: OpenSeaResponse): NonFungibleAs
(x) => x.address.toLowerCase(),
)
const offerTokens = uniqBy(
asset.collection.payment_tokens.map((x) => createTokenDetailed(chainId, x)),
asset.collection?.payment_tokens?.map((x) => createTokenDetailed(chainId, x)),
(x) => x.address.toLowerCase(),
)
return {
Expand Down