diff --git a/explorer/package-lock.json b/explorer/package-lock.json index e2cb72e86b..d7f57b2a60 100644 --- a/explorer/package-lock.json +++ b/explorer/package-lock.json @@ -15465,9 +15465,9 @@ "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" }, "prettier": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", - "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.0.tgz", + "integrity": "sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==" }, "pretty-bytes": { "version": "5.6.0", diff --git a/explorer/package.json b/explorer/package.json index 19ccb72e23..88515e82d4 100644 --- a/explorer/package.json +++ b/explorer/package.json @@ -36,7 +36,7 @@ "cross-fetch": "^3.1.4", "humanize-duration-ts": "^2.1.1", "node-sass": "^5.0.0", - "prettier": "^2.2.1", + "prettier": "^2.3.0", "react": "^17.0.2", "react-chartjs-2": "^2.11.2", "react-countup": "^4.3.3", diff --git a/explorer/src/components/TpsCard.tsx b/explorer/src/components/TpsCard.tsx index 81a6cef318..617481ad01 100644 --- a/explorer/src/components/TpsCard.tsx +++ b/explorer/src/components/TpsCard.tsx @@ -147,9 +147,10 @@ function TpsBarChart({ performanceInfo }: TpsBarChartProps) { const averageTps = Math.round(avgTps).toLocaleString("en-US"); const transactionCount = ; const seriesData = perfHistory[series]; - const chartOptions = React.useMemo(() => CHART_OPTIONS(historyMaxTps), [ - historyMaxTps, - ]); + const chartOptions = React.useMemo( + () => CHART_OPTIONS(historyMaxTps), + [historyMaxTps] + ); const seriesLength = seriesData.length; const chartData: Chart.ChartData = { diff --git a/explorer/src/components/account/TokenLargestAccountsCard.tsx b/explorer/src/components/account/TokenLargestAccountsCard.tsx index f5a8fe4ccc..b363128292 100644 --- a/explorer/src/components/account/TokenLargestAccountsCard.tsx +++ b/explorer/src/components/account/TokenLargestAccountsCard.tsx @@ -19,10 +19,10 @@ export function TokenLargestAccountsCard({ pubkey }: { pubkey: PublicKey }) { const mintInfo = useMintAccountInfo(mintAddress); const largestAccounts = useTokenLargestTokens(mintAddress); const fetchLargestAccounts = useFetchTokenLargestAccounts(); - const refreshLargest = React.useCallback(() => fetchLargestAccounts(pubkey), [ - pubkey, - fetchLargestAccounts, - ]); + const refreshLargest = React.useCallback( + () => fetchLargestAccounts(pubkey), + [pubkey, fetchLargestAccounts] + ); const { tokenRegistry } = useTokenRegistry(); const unit = tokenRegistry.get(mintAddress)?.symbol; const unitLabel = unit ? `(${unit})` : ""; diff --git a/explorer/src/components/account/history/TokenInstructionsCard.tsx b/explorer/src/components/account/history/TokenInstructionsCard.tsx index 73cbf31251..25d02456fc 100644 --- a/explorer/src/components/account/history/TokenInstructionsCard.tsx +++ b/explorer/src/components/account/history/TokenInstructionsCard.tsx @@ -59,10 +59,8 @@ export function TokenInstructionsCard({ pubkey }: { pubkey: PublicKey }) { extractMintDetails(parsed, mintMap); - let instructions: ( - | ParsedInstruction - | PartiallyDecodedInstruction - )[] = []; + let instructions: (ParsedInstruction | PartiallyDecodedInstruction)[] = + []; InstructionContainer.create(parsed).instructions.forEach( ({ instruction, inner }, index) => { diff --git a/explorer/src/components/account/history/TokenTransfersCard.tsx b/explorer/src/components/account/history/TokenTransfersCard.tsx index 5846287394..80e80be2d2 100644 --- a/explorer/src/components/account/history/TokenTransfersCard.tsx +++ b/explorer/src/components/account/history/TokenTransfersCard.tsx @@ -47,10 +47,10 @@ export function TokenTransfersCard({ pubkey }: { pubkey: PublicKey }) { const { tokenRegistry } = useTokenRegistry(); - const mintDetails = React.useMemo(() => tokenRegistry.get(address), [ - address, - tokenRegistry, - ]); + const mintDetails = React.useMemo( + () => tokenRegistry.get(address), + [address, tokenRegistry] + ); const transactionRows = React.useMemo(() => { if (history?.data?.fetched) { diff --git a/explorer/src/index.tsx b/explorer/src/index.tsx index d4d7b8261f..ffb0658600 100644 --- a/explorer/src/index.tsx +++ b/explorer/src/index.tsx @@ -15,8 +15,7 @@ import { MintsProvider } from "providers/mints"; if (process.env.NODE_ENV === "production") { Sentry.init({ - dsn: - "https://5efdc15b4828434fbe949b5daed472be@o434108.ingest.sentry.io/5390542", + dsn: "https://5efdc15b4828434fbe949b5daed472be@o434108.ingest.sentry.io/5390542", }); } diff --git a/explorer/src/pages/ClusterStatsPage.tsx b/explorer/src/pages/ClusterStatsPage.tsx index fb823027b2..807fb6ecb5 100644 --- a/explorer/src/pages/ClusterStatsPage.tsx +++ b/explorer/src/pages/ClusterStatsPage.tsx @@ -218,12 +218,8 @@ function StatsCardBody() { return ; } - const { - avgSlotTime_1h, - avgSlotTime_1min, - epochInfo, - blockTime, - } = dashboardInfo; + const { avgSlotTime_1h, avgSlotTime_1min, epochInfo, blockTime } = + dashboardInfo; const hourlySlotTime = Math.round(1000 * avgSlotTime_1h); const averageSlotTime = Math.round(1000 * avgSlotTime_1min); const { slotIndex, slotsInEpoch } = epochInfo; diff --git a/explorer/src/pages/TransactionDetailsPage.tsx b/explorer/src/pages/TransactionDetailsPage.tsx index 7d27010436..96677aa3ac 100644 --- a/explorer/src/pages/TransactionDetailsPage.tsx +++ b/explorer/src/pages/TransactionDetailsPage.tsx @@ -60,9 +60,8 @@ export function TransactionDetailsPage({ signature: raw }: SignatureProps) { } catch (err) {} const status = useTransactionStatus(signature); - const [zeroConfirmationRetries, setZeroConfirmationRetries] = React.useState( - 0 - ); + const [zeroConfirmationRetries, setZeroConfirmationRetries] = + React.useState(0); let autoRefresh = AutoRefresh.Inactive; diff --git a/explorer/src/providers/accounts/rewards.tsx b/explorer/src/providers/accounts/rewards.tsx index 4b3517ad05..4d8684bb34 100644 --- a/explorer/src/providers/accounts/rewards.tsx +++ b/explorer/src/providers/accounts/rewards.tsx @@ -46,9 +46,8 @@ function reconcile( } export const StateContext = React.createContext(undefined); -export const DispatchContext = React.createContext( - undefined -); +export const DispatchContext = + React.createContext(undefined); type RewardsProviderProps = { children: React.ReactNode }; diff --git a/explorer/src/providers/cluster.tsx b/explorer/src/providers/cluster.tsx index 396fbba59d..affd21ce16 100644 --- a/explorer/src/providers/cluster.tsx +++ b/explorer/src/providers/cluster.tsx @@ -119,9 +119,8 @@ function parseQuery(query: URLSearchParams): Cluster { } type SetShowModal = React.Dispatch>; -const ModalContext = React.createContext<[boolean, SetShowModal] | undefined>( - undefined -); +const ModalContext = + React.createContext<[boolean, SetShowModal] | undefined>(undefined); const StateContext = React.createContext(undefined); const DispatchContext = React.createContext(undefined); diff --git a/explorer/src/providers/stats/solanaClusterStats.tsx b/explorer/src/providers/stats/solanaClusterStats.tsx index 8672d0f22f..ca49596672 100644 --- a/explorer/src/providers/stats/solanaClusterStats.tsx +++ b/explorer/src/providers/stats/solanaClusterStats.tsx @@ -53,25 +53,24 @@ const initialDashboardInfo: DashboardInfo = { }; type SetActive = React.Dispatch>; -const StatsProviderContext = React.createContext< - | { - setActive: SetActive; - setTimedOut: Function; - retry: Function; - active: boolean; - } - | undefined ->(undefined); +const StatsProviderContext = + React.createContext< + | { + setActive: SetActive; + setTimedOut: Function; + retry: Function; + active: boolean; + } + | undefined + >(undefined); type DashboardState = { info: DashboardInfo }; -const DashboardContext = React.createContext( - undefined -); +const DashboardContext = + React.createContext(undefined); type PerformanceState = { info: PerformanceInfo }; -const PerformanceContext = React.createContext( - undefined -); +const PerformanceContext = + React.createContext(undefined); type Props = { children: React.ReactNode }; export function SolanaClusterStatsProvider({ children }: Props) { diff --git a/explorer/src/providers/transactions/details.tsx b/explorer/src/providers/transactions/details.tsx index 134b3d35f0..93352feef6 100644 --- a/explorer/src/providers/transactions/details.tsx +++ b/explorer/src/providers/transactions/details.tsx @@ -19,9 +19,8 @@ type State = Cache.State
; type Dispatch = Cache.Dispatch
; export const StateContext = React.createContext(undefined); -export const DispatchContext = React.createContext( - undefined -); +export const DispatchContext = + React.createContext(undefined); type DetailsProviderProps = { children: React.ReactNode }; export function DetailsProvider({ children }: DetailsProviderProps) { diff --git a/explorer/src/utils/instruction.ts b/explorer/src/utils/instruction.ts index 5e9bd038b0..7618e1d7bf 100644 --- a/explorer/src/utils/instruction.ts +++ b/explorer/src/utils/instruction.ts @@ -168,10 +168,8 @@ export function getTokenInstructionType( signatureInfo: ConfirmedSignatureInfo, index: number ): InstructionType | undefined { - const innerInstructions: ( - | ParsedInstruction - | PartiallyDecodedInstruction - )[] = []; + const innerInstructions: (ParsedInstruction | PartiallyDecodedInstruction)[] = + []; if (transaction.meta?.innerInstructions) { transaction.meta.innerInstructions.forEach((ix) => { diff --git a/explorer/src/utils/tx.ts b/explorer/src/utils/tx.ts index 846c02550d..a4df63fb7b 100644 --- a/explorer/src/utils/tx.ts +++ b/explorer/src/utils/tx.ts @@ -20,7 +20,8 @@ import { Cluster } from "providers/cluster"; import { SerumMarketRegistry } from "serumMarketRegistry"; import { TokenInfoMap } from "@solana/spl-token-registry"; -export type ProgramName = typeof PROGRAM_NAME_BY_ID[keyof typeof PROGRAM_NAME_BY_ID]; +export type ProgramName = + typeof PROGRAM_NAME_BY_ID[keyof typeof PROGRAM_NAME_BY_ID]; export enum PROGRAM_NAMES { // native built-ins