Skip to content

Commit

Permalink
Remove token distribution page (#270)
Browse files Browse the repository at this point in the history
The token distribution page (address/[address]/largest) was the only use
of `LargestAccountsProvider`. It was nested under `MintsProvider` with
`TokenRegistryProvider`.

So this PR also removes `LargestAccountsProvider` and `MintsProvider`,
and moves `TokenRegistryProvider` to be its own top-level provider. Most
changes are just reflecting that change in the imports.

Closes #210
  • Loading branch information
mcintyre94 authored Jul 14, 2023
1 parent 97cd3db commit 080f1d8
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 312 deletions.
20 changes: 0 additions & 20 deletions app/address/[address]/largest/page.tsx

This file was deleted.

8 changes: 1 addition & 7 deletions app/address/[address]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import isMetaplexNFT from '@providers/accounts/utils/isMetaplexNFT';
import { useAnchorProgram } from '@providers/anchor';
import { CacheEntry, FetchStatus } from '@providers/cache';
import { useCluster } from '@providers/cluster';
import { useTokenRegistry } from '@providers/mints/token-registry';
import { useTokenRegistry } from '@providers/token-registry';
import { PROGRAM_ID as ACCOUNT_COMPRESSION_ID } from '@solana/spl-account-compression';
import { PublicKey } from '@solana/web3.js';
import { ClusterStatus } from '@utils/cluster';
Expand Down Expand Up @@ -84,11 +84,6 @@ const TABS_LOOKUP: { [id: string]: Tab[] } = {
slug: 'instructions',
title: 'Instructions',
},
{
path: 'largest',
slug: 'largest',
title: 'Distribution',
},
],
'spl-token:mint:metaplexNFT': [
{
Expand Down Expand Up @@ -370,7 +365,6 @@ export type MoreTabs =
| 'history'
| 'tokens'
| 'nftoken-collection-nfts'
| 'largest'
| 'vote-history'
| 'slot-hashes'
| 'stake-history'
Expand Down
2 changes: 1 addition & 1 deletion app/components/SearchBar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { useCluster } from '@providers/cluster';
import { useTokenRegistry } from '@providers/mints/token-registry';
import { useTokenRegistry } from '@providers/token-registry';
import { TokenInfoMap } from '@solana/spl-token-registry';
import { Connection } from '@solana/web3.js';
import { Cluster } from '@utils/cluster';
Expand Down
2 changes: 1 addition & 1 deletion app/components/account/OwnedTokensCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Identicon } from '@components/common/Identicon';
import { LoadingCard } from '@components/common/LoadingCard';
import { TokenInfoWithPubkey, useAccountOwnedTokens, useFetchAccountOwnedTokens } from '@providers/accounts/tokens';
import { FetchStatus } from '@providers/cache';
import { useTokenRegistry } from '@providers/mints/token-registry';
import { useTokenRegistry } from '@providers/token-registry';
import { PublicKey } from '@solana/web3.js';
import { BigNumber } from 'bignumber.js';
import Image from 'next/image';
Expand Down
2 changes: 1 addition & 1 deletion app/components/account/TokenAccountSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { TableCardBody } from '@components/common/TableCardBody';
import { Account, NFTData, TokenProgramData, useFetchAccountInfo } from '@providers/accounts';
import isMetaplexNFT from '@providers/accounts/utils/isMetaplexNFT';
import { useCluster } from '@providers/cluster';
import { useTokenRegistry } from '@providers/mints/token-registry';
import { useTokenRegistry } from '@providers/token-registry';
import { PublicKey } from '@solana/web3.js';
import { Cluster } from '@utils/cluster';
import { CoingeckoStatus, useCoinGecko } from '@utils/coingecko';
Expand Down
2 changes: 1 addition & 1 deletion app/components/account/TokenHistoryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useAccountHistories, useFetchAccountHistory } from '@providers/accounts
import { TOKEN_PROGRAM_ID, TokenInfoWithPubkey, useAccountOwnedTokens } from '@providers/accounts/tokens';
import { CacheEntry, FetchStatus } from '@providers/cache';
import { useCluster } from '@providers/cluster';
import { useTokenRegistry } from '@providers/mints/token-registry';
import { useTokenRegistry } from '@providers/token-registry';
import { Details, useFetchTransactionDetails, useTransactionDetailsCache } from '@providers/transactions/parsed';
import { TokenInfoMap } from '@solana/spl-token-registry';
import { ConfirmedSignatureInfo, ParsedInstruction, PartiallyDecodedInstruction, PublicKey } from '@solana/web3.js';
Expand Down
132 changes: 0 additions & 132 deletions app/components/account/TokenLargestAccountsCard.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion app/components/account/UnknownAccountCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SolBalance } from '@components/common/SolBalance';
import { TableCardBody } from '@components/common/TableCardBody';
import { Account } from '@providers/accounts';
import { useCluster } from '@providers/cluster';
import { useTokenRegistry } from '@providers/mints/token-registry';
import { useTokenRegistry } from '@providers/token-registry';
import { addressLabel } from '@utils/tx';
import React from 'react';

Expand Down
2 changes: 1 addition & 1 deletion app/components/account/history/TokenTransfersCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useAccountHistory } from '@providers/accounts';
import { useFetchAccountHistory } from '@providers/accounts/history';
import { FetchStatus } from '@providers/cache';
import { useCluster } from '@providers/cluster';
import { useTokenRegistry } from '@providers/mints/token-registry';
import { useTokenRegistry } from '@providers/token-registry';
import { ParsedInstruction, ParsedTransactionWithMeta, PartiallyDecodedInstruction, PublicKey } from '@solana/web3.js';
import { Cluster } from '@utils/cluster';
import { normalizeTokenAmount } from '@utils/index';
Expand Down
2 changes: 1 addition & 1 deletion app/components/common/Address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { Connection, programs } from '@metaplex/js';
import { useCluster } from '@providers/cluster';
import { useTokenRegistry } from '@providers/mints/token-registry';
import { useTokenRegistry } from '@providers/token-registry';
import { PublicKey } from '@solana/web3.js';
import { displayAddress } from '@utils/tx';
import { useClusterPath } from '@utils/url';
Expand Down
2 changes: 1 addition & 1 deletion app/components/instruction/token/TokenDetailsCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Address } from '@components/common/Address';
import { useFetchAccountInfo, useMintAccountInfo, useTokenAccountInfo } from '@providers/accounts';
import { useTokenRegistry } from '@providers/mints/token-registry';
import { useTokenRegistry } from '@providers/token-registry';
import { ParsedInstruction, ParsedTransaction, PublicKey, SignatureResult } from '@solana/web3.js';
import { normalizeTokenAmount } from '@utils/index';
import { ParsedInfo } from '@validators/index';
Expand Down
2 changes: 1 addition & 1 deletion app/components/transaction/TokenBalancesCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Address } from '@components/common/Address';
import { BalanceDelta } from '@components/common/BalanceDelta';
import { useTokenRegistry } from '@providers/mints/token-registry';
import { useTokenRegistry } from '@providers/token-registry';
import { useTransactionDetails } from '@providers/transactions';
import { ParsedMessageAccount, PublicKey, TokenAmount, TokenBalance } from '@solana/web3.js';
import { SignatureProps } from '@utils/index';
Expand Down
7 changes: 4 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import { MessageBanner } from '@components/MessageBanner';
import { Navbar } from '@components/Navbar';
import { SearchBar } from '@components/SearchBar';
import { ClusterProvider } from '@providers/cluster';
import { MintsProvider } from '@providers/mints';
import { ScrollAnchorProvider } from '@providers/scroll-anchor';
import { Rubik } from 'next/font/google';
import { Metadata } from 'next/types';

import { TokenRegistryProvider } from './providers/token-registry';

export const metadata: Metadata = {
description: 'Inspect transactions, accounts, blocks, and more on the Solana blockchain',
manifest: '/manifest.json',
Expand Down Expand Up @@ -41,7 +42,7 @@ export default function RootLayout({
<body>
<ScrollAnchorProvider>
<ClusterProvider>
<MintsProvider>
<TokenRegistryProvider>
<ClusterModal />
<div className="main-content pb-4">
<Navbar />
Expand All @@ -50,7 +51,7 @@ export default function RootLayout({
<SearchBar />
{children}
</div>
</MintsProvider>
</TokenRegistryProvider>
</ClusterProvider>
</ScrollAnchorProvider>
{analytics}
Expand Down
13 changes: 0 additions & 13 deletions app/providers/mints/index.tsx

This file was deleted.

Loading

1 comment on commit 080f1d8

@vercel
Copy link

@vercel vercel bot commented on 080f1d8 Jul 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

explorer – ./

explorer-solana-labs.vercel.app
explorer.solana.com
explorer-git-master-solana-labs.vercel.app

Please sign in to comment.