explorer: Don't show token holdings for accounts with too many tokens (#27604)
This commit is contained in:
parent
12d2147efa
commit
db0bff0668
|
@ -66,6 +66,12 @@ export function OwnedTokensCard({ pubkey }: { pubkey: PublicKey }) {
|
|||
);
|
||||
}
|
||||
|
||||
if (tokens.length > 100) {
|
||||
return (
|
||||
<ErrorCard text="Token holdings is not available for accounts with over 100 token accounts" />
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{showDropdown && (
|
||||
|
|
|
@ -66,7 +66,7 @@ async function fetchAccountTokens(
|
|||
"processed"
|
||||
).getParsedTokenAccountsByOwner(pubkey, { programId: TOKEN_PROGRAM_ID });
|
||||
data = {
|
||||
tokens: value.map((accountInfo) => {
|
||||
tokens: value.slice(0, 101).map((accountInfo) => {
|
||||
const parsedInfo = accountInfo.account.data.parsed.info;
|
||||
const info = create(parsedInfo, TokenAccountInfo);
|
||||
return { info, pubkey: accountInfo.pubkey };
|
||||
|
|
Loading…
Reference in New Issue