|
|
@ -53,6 +53,7 @@ export function AddressPage() { |
|
|
|
IUserERC721Assets[] |
|
|
|
IUserERC721Assets[] |
|
|
|
>([]); |
|
|
|
>([]); |
|
|
|
const [activeIndex, setActiveIndex] = useState(activeTab); |
|
|
|
const [activeIndex, setActiveIndex] = useState(activeTab); |
|
|
|
|
|
|
|
const [holdersCount, setHoldersCount] = useState<number | undefined>() |
|
|
|
const erc20Map = useERC20Pool(); |
|
|
|
const erc20Map = useERC20Pool(); |
|
|
|
const erc721Map = useERC721Pool(); |
|
|
|
const erc721Map = useERC721Pool(); |
|
|
|
const erc1155Map = useERC1155Pool(); |
|
|
|
const erc1155Map = useERC1155Pool(); |
|
|
@ -171,7 +172,25 @@ export function AddressPage() { |
|
|
|
item.type = type; |
|
|
|
item.type = type; |
|
|
|
return item; |
|
|
|
return item; |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(type === 'erc1155') { |
|
|
|
|
|
|
|
items = items.filter((item) => item && item.ownerAddress && item.ownerAddress.startsWith('0x')) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
setInventory(items); |
|
|
|
setInventory(items); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO remove after fix on backend, workaround
|
|
|
|
|
|
|
|
if(type === "erc1155") { |
|
|
|
|
|
|
|
const holdersMap = items |
|
|
|
|
|
|
|
.reduce((acc, nextItem) => { |
|
|
|
|
|
|
|
const { ownerAddress } = nextItem |
|
|
|
|
|
|
|
if(ownerAddress && !acc[ownerAddress.toLowerCase()]) { |
|
|
|
|
|
|
|
acc[ownerAddress.toLowerCase()] = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return acc |
|
|
|
|
|
|
|
}, {} as Record<string, boolean>) |
|
|
|
|
|
|
|
setHoldersCount(Object.keys(holdersMap).length) |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
setInventory([]); |
|
|
|
setInventory([]); |
|
|
|
} |
|
|
|
} |
|
|
@ -289,6 +308,7 @@ export function AddressPage() { |
|
|
|
tokens={tokens} |
|
|
|
tokens={tokens} |
|
|
|
balance={balance} |
|
|
|
balance={balance} |
|
|
|
delegations={delegations} |
|
|
|
delegations={delegations} |
|
|
|
|
|
|
|
holdersCount={holdersCount} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</BasePage> |
|
|
|
</BasePage> |
|
|
|
<BasePage margin={{ top: "15px" }}> |
|
|
|
<BasePage margin={{ top: "15px" }}> |
|
|
@ -329,6 +349,7 @@ export function AddressPage() { |
|
|
|
id={id} |
|
|
|
id={id} |
|
|
|
type={type} |
|
|
|
type={type} |
|
|
|
inventory={inventory} |
|
|
|
inventory={inventory} |
|
|
|
|
|
|
|
holdersCount={holdersCount} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</Tab> |
|
|
|
</Tab> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|