From 73e4e2029490abfe2c0b3f6de7bd91c30f5311fd Mon Sep 17 00:00:00 2001 From: Steven Luscher Date: Fri, 15 Sep 2023 12:44:02 -0700 Subject: [PATCH] chore: format code (#291) chore: format code --- Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/solana-labs/explorer/pull/291). * #292 * __->__ #291 --- app/@analytics/default.js | 2 +- app/components/LiveTransactionStatsCard.tsx | 11 +- app/components/SearchBar.tsx | 18 +- app/providers/cluster.tsx | 4 +- app/providers/supply.tsx | 10 +- app/supply/layout.tsx | 12 +- app/tx/layout.tsx | 12 +- app/utils/domain-info.ts | 10 +- app/utils/epoch-schedule.ts | 42 +- app/utils/local-storage.ts | 22 +- app/utils/math.ts | 2 +- app/utils/name-service.tsx | 6 +- app/utils/programs.ts | 818 ++++++++++---------- app/utils/token-info.ts | 79 +- app/utils/token-search.ts | 57 +- app/utils/tx.ts | 4 +- jest.config.js | 8 +- jest.setup.js | 2 +- 18 files changed, 555 insertions(+), 564 deletions(-) diff --git a/app/@analytics/default.js b/app/@analytics/default.js index 62bc4f06..e00ea496 100644 --- a/app/@analytics/default.js +++ b/app/@analytics/default.js @@ -23,4 +23,4 @@ export default function Analytics() { ); -} \ No newline at end of file +} diff --git a/app/components/LiveTransactionStatsCard.tsx b/app/components/LiveTransactionStatsCard.tsx index f2440465..07aa9ed4 100644 --- a/app/components/LiveTransactionStatsCard.tsx +++ b/app/components/LiveTransactionStatsCard.tsx @@ -443,13 +443,14 @@ function PingBarChart({
${val.mean} ms

${val.confirmed} of ${val.submitted} confirmed

- ${val.loss + ${ + val.loss ? `

${val.loss.toLocaleString(undefined, { - minimumFractionDigits: 2, - style: 'percent', - })} loss

` + minimumFractionDigits: 2, + style: 'percent', + })} loss

` : '' - } + } ${SERIES_INFO[series].label(seriesLength - i)}min ago
`; diff --git a/app/components/SearchBar.tsx b/app/components/SearchBar.tsx index 62ca92b8..9ef7fe46 100644 --- a/app/components/SearchBar.tsx +++ b/app/components/SearchBar.tsx @@ -50,8 +50,8 @@ export function SearchBar() { const localOptions = buildOptions(search, cluster, clusterInfo?.epochInfo.epoch); const tokenOptions = await buildTokenOptions(search, cluster); const tokenOptionsAppendable = tokenOptions ? [tokenOptions] : []; - const domainOptions = hasDomainSyntax(search) && cluster === Cluster.MainnetBeta ? - await buildDomainOptions(search) ?? [] : []; + const domainOptions = + hasDomainSyntax(search) && cluster === Cluster.MainnetBeta ? (await buildDomainOptions(search)) ?? [] : []; return [...localOptions, ...tokenOptionsAppendable, ...domainOptions]; } @@ -85,7 +85,9 @@ export function SearchBar() { components={{ DropdownIndicator }} classNamePrefix="search-bar" /* workaround for https://github.com/JedWatson/react-select/issues/5714 */ - onFocus={() => { selectRef.current?.handleInputChange(search, { action: 'set-value' }) }} + onFocus={() => { + selectRef.current?.handleInputChange(search, { action: 'set-value' }); + }} /> @@ -173,17 +175,16 @@ async function buildTokenOptions(search: string, cluster: Cluster): Promise 0) { return { label: 'Tokens', - options: matchedTokens + options: matchedTokens, }; } } async function buildDomainOptions(search: string) { const domainInfoResponse = await fetch(`/api/domain-info/${search}`); - const domainInfo = await domainInfoResponse.json() as FetchedDomainInfo; + const domainInfo = (await domainInfoResponse.json()) as FetchedDomainInfo; if (domainInfo && domainInfo.owner && domainInfo.address) { - return [ { label: 'Domain Owner', @@ -204,7 +205,8 @@ async function buildDomainOptions(search: string) { value: [search], }, ], - }]; + }, + ]; } } @@ -248,7 +250,7 @@ function buildOptions(rawSearch: string, cluster: Cluster, currentEpoch?: bigint }); // Parse as BigInt but not if it starts eg 0x or 0b - if (currentEpoch !== undefined && !(/^0\w/.test(search)) && BigInt(search) <= currentEpoch + 1n) { + if (currentEpoch !== undefined && !/^0\w/.test(search) && BigInt(search) <= currentEpoch + 1n) { options.push({ label: 'Epoch', options: [ diff --git a/app/providers/cluster.tsx b/app/providers/cluster.tsx index 3b496772..d58a853c 100644 --- a/app/providers/cluster.tsx +++ b/app/providers/cluster.tsx @@ -126,8 +126,8 @@ async function updateCluster(dispatch: Dispatch, cluster: Cluster, customUrl: st new URL(customUrl); const transportUrl = clusterUrl(cluster, customUrl); - const transport = createDefaultRpcTransport({ url: transportUrl }) - const rpc = createSolanaRpc({ transport }) + const transport = createDefaultRpcTransport({ url: transportUrl }); + const rpc = createSolanaRpc({ transport }); const [firstAvailableBlock, epochSchedule, epochInfo] = await Promise.all([ rpc.getFirstAvailableBlock().send(), diff --git a/app/providers/supply.tsx b/app/providers/supply.tsx index 150dd358..34084f1c 100644 --- a/app/providers/supply.tsx +++ b/app/providers/supply.tsx @@ -15,9 +15,9 @@ export enum Status { type Lamports = bigint; type Supply = Readonly<{ - circulating: Lamports, - nonCirculating: Lamports, - total: Lamports, + circulating: Lamports; + nonCirculating: Lamports; + total: Lamports; }>; type State = Supply | Status | string; @@ -52,7 +52,9 @@ async function fetch(dispatch: Dispatch, cluster: Cluster, url: string) { const transport = createDefaultRpcTransport({ url }); const rpc = createSolanaRpc({ transport }); - const supplyResponse = await rpc.getSupply({ commitment: 'finalized', excludeNonCirculatingAccountsList: true }).send(); + const supplyResponse = await rpc + .getSupply({ commitment: 'finalized', excludeNonCirculatingAccountsList: true }) + .send(); const supply: Supply = { circulating: supplyResponse.value.circulating, nonCirculating: supplyResponse.value.nonCirculating, diff --git a/app/supply/layout.tsx b/app/supply/layout.tsx index 5da00913..0432420d 100644 --- a/app/supply/layout.tsx +++ b/app/supply/layout.tsx @@ -3,11 +3,9 @@ import { SupplyProvider } from '@providers/supply'; import { PropsWithChildren } from 'react'; export default function SupplyLayout({ children }: PropsWithChildren>) { - return ( - - - {children} - - - ); + return ( + + {children} + + ); } diff --git a/app/tx/layout.tsx b/app/tx/layout.tsx index 36362f7d..6a0c8176 100644 --- a/app/tx/layout.tsx +++ b/app/tx/layout.tsx @@ -4,11 +4,9 @@ import { PropsWithChildren } from 'react'; import { AccountsProvider } from '../providers/accounts'; export default function TxLayout({ children }: PropsWithChildren>) { - return ( - - - {children} - - - ); + return ( + + {children} + + ); } diff --git a/app/utils/domain-info.ts b/app/utils/domain-info.ts index 8b4394d9..117627d9 100644 --- a/app/utils/domain-info.ts +++ b/app/utils/domain-info.ts @@ -1,5 +1,5 @@ -import { getHashedName, getNameAccountKey, getNameOwner } from "@bonfida/spl-name-service"; -import { Connection, PublicKey } from "@solana/web3.js"; +import { getHashedName, getNameAccountKey, getNameOwner } from '@bonfida/spl-name-service'; +import { Connection, PublicKey } from '@solana/web3.js'; // Address of the SOL TLD export const SOL_TLD_AUTHORITY = new PublicKey('58PwtjSDuFHuUkYjH9BYnnQKHfwo9reZhC2zMJv9JPkx'); @@ -30,9 +30,9 @@ export async function getDomainInfo(domain: string, connection: Connection) { const registry = await getNameOwner(connection, domainKey); return registry && registry.registry.owner ? { - address: domainKey.toString(), - owner: registry.registry.owner.toString(), - } + address: domainKey.toString(), + owner: registry.registry.owner.toString(), + } : null; } catch { return null; diff --git a/app/utils/epoch-schedule.ts b/app/utils/epoch-schedule.ts index 9cea623b..6d7d0eb8 100644 --- a/app/utils/epoch-schedule.ts +++ b/app/utils/epoch-schedule.ts @@ -2,11 +2,11 @@ const MINIMUM_SLOT_PER_EPOCH = BigInt(32); export interface EpochSchedule { /** The maximum number of slots in each epoch */ - slotsPerEpoch: bigint, + slotsPerEpoch: bigint; /** The first epoch with `slotsPerEpoch` slots */ - firstNormalEpoch: bigint, + firstNormalEpoch: bigint; /** The first slot of `firstNormalEpoch` */ - firstNormalSlot: bigint + firstNormalSlot: bigint; } // Returns the number of trailing zeros in the binary representation of n @@ -23,13 +23,13 @@ function trailingZeros(n: bigint): number { function nextPowerOfTwo(n: bigint): bigint { if (n === 0n) return 1n; n--; - n |= n >> 1n - n |= n >> 2n - n |= n >> 4n - n |= n >> 8n - n |= n >> 16n - n |= n >> 32n - return n + 1n + n |= n >> 1n; + n |= n >> 2n; + n |= n >> 4n; + n |= n >> 8n; + n |= n >> 16n; + n |= n >> 32n; + return n + 1n; } /** @@ -38,10 +38,7 @@ function nextPowerOfTwo(n: bigint): bigint { * @param slot The slot to get the epoch number for * @returns The epoch number that contains or will contain the given slot */ -export function getEpochForSlot( - epochSchedule: EpochSchedule, - slot: bigint, -): bigint { +export function getEpochForSlot(epochSchedule: EpochSchedule, slot: bigint): bigint { if (slot < epochSchedule.firstNormalSlot) { const epoch = trailingZeros(nextPowerOfTwo(slot + MINIMUM_SLOT_PER_EPOCH + BigInt(1))) - @@ -63,17 +60,11 @@ export function getEpochForSlot( * @param epoch Epoch to get the first slot for * @returns First slot in the epoch */ -export function getFirstSlotInEpoch( - epochSchedule: EpochSchedule, - epoch: bigint -): bigint { +export function getFirstSlotInEpoch(epochSchedule: EpochSchedule, epoch: bigint): bigint { if (epoch <= epochSchedule.firstNormalEpoch) { - return ((2n ** epoch) - 1n) * MINIMUM_SLOT_PER_EPOCH; + return (2n ** epoch - 1n) * MINIMUM_SLOT_PER_EPOCH; } else { - return ( - (epoch - epochSchedule.firstNormalEpoch) * epochSchedule.slotsPerEpoch + - epochSchedule.firstNormalSlot - ); + return (epoch - epochSchedule.firstNormalEpoch) * epochSchedule.slotsPerEpoch + epochSchedule.firstNormalSlot; } } @@ -83,9 +74,6 @@ export function getFirstSlotInEpoch( * @param epoch Epoch to get the last slot for * @returns Last slot in the epoch */ -export function getLastSlotInEpoch( - epochSchedule: EpochSchedule, - epoch: bigint -): bigint { +export function getLastSlotInEpoch(epochSchedule: EpochSchedule, epoch: bigint): bigint { return getFirstSlotInEpoch(epochSchedule, epoch + 1n) - 1n; } diff --git a/app/utils/local-storage.ts b/app/utils/local-storage.ts index 2cb0195e..2fb25e77 100644 --- a/app/utils/local-storage.ts +++ b/app/utils/local-storage.ts @@ -1,14 +1,14 @@ let localStorageIsAvailableDecision: boolean | undefined; export function localStorageIsAvailable() { - if (localStorageIsAvailableDecision === undefined) { - const test = 'test'; - try { - localStorage.setItem(test, test); - localStorage.removeItem(test); - localStorageIsAvailableDecision = true; - } catch (e) { - localStorageIsAvailableDecision = false; + if (localStorageIsAvailableDecision === undefined) { + const test = 'test'; + try { + localStorage.setItem(test, test); + localStorage.removeItem(test); + localStorageIsAvailableDecision = true; + } catch (e) { + localStorageIsAvailableDecision = false; + } } - } - return localStorageIsAvailableDecision; -} \ No newline at end of file + return localStorageIsAvailableDecision; +} diff --git a/app/utils/math.ts b/app/utils/math.ts index 8b578b14..0d8f00db 100644 --- a/app/utils/math.ts +++ b/app/utils/math.ts @@ -6,5 +6,5 @@ export function percentage(numerator: bigint, denominator: bigint, decimals: num // since bigint is integer, we need to multiply first to get decimals // see https://stackoverflow.com/a/63095380/1375972 const pow = 10 ** decimals; - return Number(numerator * BigInt(100 * pow) / denominator) / pow; + return Number((numerator * BigInt(100 * pow)) / denominator) / pow; } diff --git a/app/utils/name-service.tsx b/app/utils/name-service.tsx index 40fa3e1d..804cfa2f 100644 --- a/app/utils/name-service.tsx +++ b/app/utils/name-service.tsx @@ -1,10 +1,6 @@ 'use client'; -import { - getFilteredProgramAccounts, - NAME_PROGRAM_ID, - performReverseLookup, -} from '@bonfida/spl-name-service'; +import { getFilteredProgramAccounts, NAME_PROGRAM_ID, performReverseLookup } from '@bonfida/spl-name-service'; import { useCluster } from '@providers/cluster'; import { Connection, PublicKey } from '@solana/web3.js'; import { Cluster } from '@utils/cluster'; diff --git a/app/utils/programs.ts b/app/utils/programs.ts index a6c026ef..f1dac94b 100644 --- a/app/utils/programs.ts +++ b/app/utils/programs.ts @@ -1,87 +1,87 @@ -import { Cluster } from "./cluster"; +import { Cluster } from './cluster'; export enum PROGRAM_NAMES { - // native built-ins - ADDRESS_LOOKUP_TABLE = 'Address Lookup Table Program', - COMPUTE_BUDGET = 'Compute Budget Program', - CONFIG = 'Config Program', - STAKE = 'Stake Program', - SYSTEM = 'System Program', - VOTE = 'Vote Program', + // native built-ins + ADDRESS_LOOKUP_TABLE = 'Address Lookup Table Program', + COMPUTE_BUDGET = 'Compute Budget Program', + CONFIG = 'Config Program', + STAKE = 'Stake Program', + SYSTEM = 'System Program', + VOTE = 'Vote Program', - // native precompiles - SECP256K1 = 'Secp256k1 SigVerify Precompile', - ED25519 = 'Ed25519 SigVerify Precompile', + // native precompiles + SECP256K1 = 'Secp256k1 SigVerify Precompile', + ED25519 = 'Ed25519 SigVerify Precompile', - // spl - ASSOCIATED_TOKEN = 'Associated Token Program', - ACCOUNT_COMPRESSION = 'State Compression Program', - FEATURE_PROPOSAL = 'Feature Proposal Program', - LENDING = 'Lending Program', - MEMO = 'Memo Program', - MEMO_2 = 'Memo Program v2', - NAME = 'Name Service Program', - STAKE_POOL = 'Stake Pool Program', - SWAP = 'Swap Program', - TOKEN = 'Token Program', - TOKEN_METADATA = 'Token Metadata Program', - TOKEN_VAULT = 'Token Vault Program', + // spl + ASSOCIATED_TOKEN = 'Associated Token Program', + ACCOUNT_COMPRESSION = 'State Compression Program', + FEATURE_PROPOSAL = 'Feature Proposal Program', + LENDING = 'Lending Program', + MEMO = 'Memo Program', + MEMO_2 = 'Memo Program v2', + NAME = 'Name Service Program', + STAKE_POOL = 'Stake Pool Program', + SWAP = 'Swap Program', + TOKEN = 'Token Program', + TOKEN_METADATA = 'Token Metadata Program', + TOKEN_VAULT = 'Token Vault Program', - // other - ACUMEN = 'Acumen Program', - BREAK_SOLANA = 'Break Solana Program', - CHAINLINK_ORACLE = 'Chainlink OCR2 Oracle Program', - CHAINLINK_STORE = 'Chainlink Store Program', - CLOCKWORK_1 = 'Clockwork Thread Program v1', - CLOCKWORK_2 = 'Clockwork Thread Program v2', - MANGO_GOVERNANCE = 'Mango Governance Program', - MANGO_ICO = 'Mango ICO Program', - MANGO_1 = 'Mango Program v1', - MANGO_2 = 'Mango Program v2', - MANGO_3 = 'Mango Program v3', - MARINADE = 'Marinade Staking Program', - MERCURIAL = 'Mercurial Stable Swap Program', - METAPLEX = 'Metaplex Program', - NFT_AUCTION = 'NFT Auction Program', - NFT_CANDY_MACHINE = 'NFT Candy Machine Program', - NFT_CANDY_MACHINE_V2 = 'NFT Candy Machine Program V2', - ORCA_SWAP_1 = 'Orca Swap Program v1', - ORCA_SWAP_2 = 'Orca Swap Program v2', - ORCA_AQUAFARM = 'Orca Aquafarm Program', - PORT = 'Port Finance Program', - PYTH_DEVNET = 'Pyth Oracle Program', - PYTH_TESTNET = 'Pyth Oracle Program', - PYTH_MAINNET = 'Pyth Oracle Program', - QUARRY_MERGE_MINE = 'Quarry Merge Mine', - QUARRY_MINE = 'Quarry Mine', - QUARRY_MINT_WRAPPER = 'Quarry Mint Wrapper', - QUARRY_REDEEMER = 'Quarry Redeemer', - QUARRY_REGISTRY = 'Quarry Registry', - RAYDIUM_AMM = 'Raydium AMM Program', - RAYDIUM_IDO = 'Raydium IDO Program', - RAYDIUM_LP_1 = 'Raydium Liquidity Pool Program v1', - RAYDIUM_LP_2 = 'Raydium Liquidity Pool Program v2', - RAYDIUM_STAKING = 'Raydium Staking Program', - SABER_ROUTER = 'Saber Router Program', - SABER_SWAP = 'Saber Stable Swap Program', - SERUM_1 = 'Serum Dex Program v1', - SERUM_2 = 'Serum Dex Program v2', - SERUM_3 = 'Serum Dex Program v3', - SERUM_SWAP = 'Serum Swap Program', - SERUM_POOL = 'Serum Pool', - SOLEND = 'Solend Program', - SOLIDO = 'Lido for Solana Program', - STEP_SWAP = 'Step Finance Swap Program', - SWIM_SWAP = 'Swim Swap Program', - SWITCHBOARD = 'Switchboard Oracle Program', - WORMHOLE = 'Wormhole', - WORMHOLE_CORE = 'Wormhole Core Bridge', - WORMHOLE_TOKEN = 'Wormhole Token Bridge', - WORMHOLE_NFT = 'Wormhole NFT Bridge', - SOLANART = 'Solanart', - SOLANART_GO = 'Solanart - Global offers', - STEPN_DEX = 'STEPN Dex', - OPENBOOK_DEX = 'OpenBook Dex', + // other + ACUMEN = 'Acumen Program', + BREAK_SOLANA = 'Break Solana Program', + CHAINLINK_ORACLE = 'Chainlink OCR2 Oracle Program', + CHAINLINK_STORE = 'Chainlink Store Program', + CLOCKWORK_1 = 'Clockwork Thread Program v1', + CLOCKWORK_2 = 'Clockwork Thread Program v2', + MANGO_GOVERNANCE = 'Mango Governance Program', + MANGO_ICO = 'Mango ICO Program', + MANGO_1 = 'Mango Program v1', + MANGO_2 = 'Mango Program v2', + MANGO_3 = 'Mango Program v3', + MARINADE = 'Marinade Staking Program', + MERCURIAL = 'Mercurial Stable Swap Program', + METAPLEX = 'Metaplex Program', + NFT_AUCTION = 'NFT Auction Program', + NFT_CANDY_MACHINE = 'NFT Candy Machine Program', + NFT_CANDY_MACHINE_V2 = 'NFT Candy Machine Program V2', + ORCA_SWAP_1 = 'Orca Swap Program v1', + ORCA_SWAP_2 = 'Orca Swap Program v2', + ORCA_AQUAFARM = 'Orca Aquafarm Program', + PORT = 'Port Finance Program', + PYTH_DEVNET = 'Pyth Oracle Program', + PYTH_TESTNET = 'Pyth Oracle Program', + PYTH_MAINNET = 'Pyth Oracle Program', + QUARRY_MERGE_MINE = 'Quarry Merge Mine', + QUARRY_MINE = 'Quarry Mine', + QUARRY_MINT_WRAPPER = 'Quarry Mint Wrapper', + QUARRY_REDEEMER = 'Quarry Redeemer', + QUARRY_REGISTRY = 'Quarry Registry', + RAYDIUM_AMM = 'Raydium AMM Program', + RAYDIUM_IDO = 'Raydium IDO Program', + RAYDIUM_LP_1 = 'Raydium Liquidity Pool Program v1', + RAYDIUM_LP_2 = 'Raydium Liquidity Pool Program v2', + RAYDIUM_STAKING = 'Raydium Staking Program', + SABER_ROUTER = 'Saber Router Program', + SABER_SWAP = 'Saber Stable Swap Program', + SERUM_1 = 'Serum Dex Program v1', + SERUM_2 = 'Serum Dex Program v2', + SERUM_3 = 'Serum Dex Program v3', + SERUM_SWAP = 'Serum Swap Program', + SERUM_POOL = 'Serum Pool', + SOLEND = 'Solend Program', + SOLIDO = 'Lido for Solana Program', + STEP_SWAP = 'Step Finance Swap Program', + SWIM_SWAP = 'Swim Swap Program', + SWITCHBOARD = 'Switchboard Oracle Program', + WORMHOLE = 'Wormhole', + WORMHOLE_CORE = 'Wormhole Core Bridge', + WORMHOLE_TOKEN = 'Wormhole Token Bridge', + WORMHOLE_NFT = 'Wormhole NFT Bridge', + SOLANART = 'Solanart', + SOLANART_GO = 'Solanart - Global offers', + STEPN_DEX = 'STEPN Dex', + OPENBOOK_DEX = 'OpenBook Dex', } const ALL_CLUSTERS = [Cluster.Custom, Cluster.Devnet, Cluster.Testnet, Cluster.MainnetBeta]; @@ -89,348 +89,348 @@ const ALL_CLUSTERS = [Cluster.Custom, Cluster.Devnet, Cluster.Testnet, Cluster.M const LIVE_CLUSTERS = [Cluster.Devnet, Cluster.Testnet, Cluster.MainnetBeta]; export const LOADER_IDS: { [key: string]: string } = { - BPFLoader1111111111111111111111111111111111: 'BPF Loader', - BPFLoader2111111111111111111111111111111111: 'BPF Loader 2', - BPFLoaderUpgradeab1e11111111111111111111111: 'BPF Upgradeable Loader', - MoveLdr111111111111111111111111111111111111: 'Move Loader', - NativeLoader1111111111111111111111111111111: 'Native Loader', + BPFLoader1111111111111111111111111111111111: 'BPF Loader', + BPFLoader2111111111111111111111111111111111: 'BPF Loader 2', + BPFLoaderUpgradeab1e11111111111111111111111: 'BPF Upgradeable Loader', + MoveLdr111111111111111111111111111111111111: 'Move Loader', + NativeLoader1111111111111111111111111111111: 'Native Loader', } as const; export type LoaderName = (typeof LOADER_IDS)[keyof typeof LOADER_IDS]; export type ProgramInfo = { - name: string; - deployments: Cluster[]; + name: string; + deployments: Cluster[]; }; export const PROGRAM_INFO_BY_ID: { [address: string]: ProgramInfo } = { - '11111111111111111111111111111111': { - deployments: ALL_CLUSTERS, - name: PROGRAM_NAMES.SYSTEM, - }, - '22Y43yTVxuUkoRKdm9thyRhQ3SdgQS7c7kB6UNCiaczD': { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.SERUM_SWAP, - }, - '27haf8L6oxUeXrHrgEgsexjSY5hbVUWEmvv9Nyxg8vQv': { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.RAYDIUM_LP_2, - }, - '2rHhojZ7hpu1zA91nvZmT8TqWWvMcKmmNBCr2mKTtMq4': { - deployments: [Cluster.Devnet], - name: PROGRAM_NAMES.WORMHOLE_NFT, - }, - '3XXuUFfweXBwFgFfYaejLvZE4cGZiHgKiGfMtdxNzYmv': { - deployments: [Cluster.MainnetBeta, Cluster.Devnet], - name: PROGRAM_NAMES.CLOCKWORK_1, - }, - '3u8hJUVTA4jH1wYAyUur7FFZVQ8H635K3tSHHF4ssjQ5': { - deployments: [Cluster.Devnet], - name: PROGRAM_NAMES.WORMHOLE_CORE, - }, - '5ZfZAwP2m93waazg8DkrrVmsupeiPEvaEHowiUP7UAbJ': { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.SOLANART_GO, - }, - '5fNfvyp5czQVX77yoACa3JJVEhdRaWjPuazuWgjhTqEH': { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.MANGO_2, - }, - '675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8': { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.RAYDIUM_AMM, - }, - '7sPptkymzvayoSbLXzBsXEF8TSf3typNnAWkrKrDizNb': { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.MANGO_ICO, - }, - '82yxjeMsvaURa4MbZZ7WZZHfobirZYkH1zF8fmeGtyaQ': { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.ORCA_AQUAFARM, - }, - '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz': { - deployments: [Cluster.Testnet], - name: PROGRAM_NAMES.PYTH_TESTNET, - }, - '9HzJyW1qZsEiSfMUf6L2jo3CcTKAyBmSyKdwQeYisHrC': { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.RAYDIUM_IDO, - }, - '9W959DqEETiGZocYWCQPaJ6sBmUzgfxXfqGeTEdp3aQP': { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.ORCA_SWAP_2, - }, - '9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin': { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.SERUM_3, - }, - // spl - ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL: { - deployments: ALL_CLUSTERS, - name: PROGRAM_NAMES.ASSOCIATED_TOKEN, - }, - // native built-ins - AddressLookupTab1e1111111111111111111111111: { - deployments: ALL_CLUSTERS, - name: PROGRAM_NAMES.ADDRESS_LOOKUP_TABLE, - }, - BJ3jrUzddfuSrZHXSCxMUUQsjKEyLmuuyZebkcaFp2fg: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.SERUM_1, - }, - BrEAK7zGZ6dM71zUDACDqJnekihmwF15noTddWTsknjC: { - deployments: LIVE_CLUSTERS, - name: PROGRAM_NAMES.BREAK_SOLANA, - }, - // other - C64kTdg1Hzv5KoQmZrQRcm2Qz7PkxtFBgw7EpFhvYn8W: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.ACUMEN, - }, - CJsLwbP1iu5DuUikHEJnLfANgKy6stB2uFgvBBHoyxwz: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.SOLANART, - }, - CLoCKyJ6DXBJqqu2VWx9RLbgnwwR6BMHHuyasVmfMzBh: { - deployments: [Cluster.MainnetBeta, Cluster.Devnet], - name: PROGRAM_NAMES.CLOCKWORK_2, - }, - ComputeBudget111111111111111111111111111111: { - deployments: ALL_CLUSTERS, - name: PROGRAM_NAMES.COMPUTE_BUDGET, - }, - Config1111111111111111111111111111111111111: { - deployments: ALL_CLUSTERS, - name: PROGRAM_NAMES.CONFIG, - }, - CrX7kMhLC3cSsXJdT7JDgqrRVWGnUpX3gfEfxxU2NVLi: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.SOLIDO, - }, - Crt7UoUR6QgrFrN7j8rmSQpUTNWNSitSwWvsWGf1qZ5t: { - deployments: [Cluster.Devnet, Cluster.MainnetBeta], - name: PROGRAM_NAMES.SABER_ROUTER, - }, - DZnkkTmCiFWfYTfT41X3Rd1kDgozqzxWaHqsw6W4x2oe: { - deployments: [Cluster.Devnet], - name: PROGRAM_NAMES.WORMHOLE_TOKEN, - }, - DjVE6JNiYqPL2QXyCUUh8rNjHrbz9hXHNYt99MQ59qw1: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.ORCA_SWAP_1, - }, - Dooar9JkhdZ7J3LHN3A7YCuoGRUggXhQaG4kijfLGU2j: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.STEPN_DEX, - }, - DtmE9D2CSB4L5D6A15mraeEjrGMm6auWVzgaD8hK2tZM: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.SWITCHBOARD, - }, - EUqojwWA2rd19FZrzeBncJsm38Jm1hEhE3zsmX3bRc2o: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.SERUM_2, - }, - Ed25519SigVerify111111111111111111111111111: { - deployments: ALL_CLUSTERS, - name: PROGRAM_NAMES.ED25519, - }, - EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.RAYDIUM_STAKING, - }, - Feat1YXHhH6t1juaWF74WLcfv4XoNocjXA6sPWHNgAse: { - deployments: ALL_CLUSTERS, - name: PROGRAM_NAMES.FEATURE_PROPOSAL, - }, - FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.PYTH_MAINNET, - }, - GqTPL6qRf5aUuqscLh8Rg2HTxPUXfhhAXDptTLhp1t2J: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.MANGO_GOVERNANCE, - }, - HEvSKofvBgfaexv23kMabbYqxasxU3mQ4ibBMEmJWHny: { - deployments: [Cluster.Devnet, Cluster.MainnetBeta], - name: PROGRAM_NAMES.CHAINLINK_STORE, - }, - JD3bq9hGdy38PuWQ4h2YJpELmHVGPPfFSuFkpzAd9zfu: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.MANGO_1, - }, - KeccakSecp256k11111111111111111111111111111: { - deployments: ALL_CLUSTERS, - name: PROGRAM_NAMES.SECP256K1, - }, - LendZqTs7gn5CTSJU1jWKhKuVpjJGom45nnwPb2AMTi: { - deployments: LIVE_CLUSTERS, - name: PROGRAM_NAMES.LENDING, - }, - MERLuDFBMmsHnsBPZw2sDQZHvXFMwp8EdjudcU2HKky: { - deployments: [Cluster.Devnet, Cluster.MainnetBeta], - name: PROGRAM_NAMES.MERCURIAL, - }, - MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.MARINADE, - }, - Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo: { - deployments: ALL_CLUSTERS, - name: PROGRAM_NAMES.MEMO, - }, - MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr: { - deployments: ALL_CLUSTERS, - name: PROGRAM_NAMES.MEMO_2, - }, - Port7uDYB3wk6GJAw4KT1WpTeMtSu9bTcChBHkX2LfR: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.PORT, - }, - QMMD16kjauP5knBwxNUJRZ1Z5o3deBuFrqVjBVmmqto: { - deployments: LIVE_CLUSTERS, - name: PROGRAM_NAMES.QUARRY_MERGE_MINE, - }, - QMNeHCGYnLVDn1icRAfQZpjPLBNkfGbSKRB83G5d8KB: { - deployments: LIVE_CLUSTERS, - name: PROGRAM_NAMES.QUARRY_MINE, - }, - QMWoBmAyJLAsA1Lh9ugMTw2gciTihncciphzdNzdZYV: { - deployments: LIVE_CLUSTERS, - name: PROGRAM_NAMES.QUARRY_MINT_WRAPPER, - }, - QRDxhMw1P2NEfiw5mYXG79bwfgHTdasY2xNP76XSea9: { - deployments: LIVE_CLUSTERS, - name: PROGRAM_NAMES.QUARRY_REDEEMER, - }, - QREGBnEj9Sa5uR91AV8u3FxThgP5ZCvdZUW2bHAkfNc: { - deployments: LIVE_CLUSTERS, - name: PROGRAM_NAMES.QUARRY_REGISTRY, - }, - RVKd61ztZW9GUwhRbbLoYVRE5Xf1B2tVscKqwZqXgEr: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.RAYDIUM_LP_1, - }, - SPoo1Ku8WFXoNDMHPsrGSTSG1Y47rzgn41SLUNakuHy: { - deployments: LIVE_CLUSTERS, - name: PROGRAM_NAMES.STAKE_POOL, - }, - SSwpMgqNDsyV7mAgN9ady4bDVu5ySjmmXejXvy2vLt1: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.STEP_SWAP, - }, - SSwpkEEcbUqx4vtoEByFjSkhKdCT862DNVb52nZg1UZ: { - deployments: [Cluster.Devnet, Cluster.MainnetBeta], - name: PROGRAM_NAMES.SABER_SWAP, - }, - SWiMDJYFUGj6cPrQ6QYYYWZtvXQdRChSVAygDZDsCHC: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.SWIM_SWAP, - }, - So1endDq2YkqhipRh3WViPa8hdiSpxWy6z3Z6tMCpAo: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.SOLEND, - }, - Stake11111111111111111111111111111111111111: { - deployments: ALL_CLUSTERS, - name: PROGRAM_NAMES.STAKE, - }, - SwaPpA9LAaLfeLi3a68M4DjnLqgtticKg6CnyNwgAC8: { - deployments: LIVE_CLUSTERS, - name: PROGRAM_NAMES.SWAP, - }, - TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA: { - deployments: ALL_CLUSTERS, - name: PROGRAM_NAMES.TOKEN, - }, - Vote111111111111111111111111111111111111111: { - deployments: ALL_CLUSTERS, - name: PROGRAM_NAMES.VOTE, - }, - WnFt12ZrnzZrFZkt2xsNsaNWoQribnuQ5B5FrDbwDhD: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.WORMHOLE_NFT, - }, - WormT3McKhFJ2RkiGpdw9GKvNCrB2aB54gb2uV9MfQC: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.WORMHOLE, - }, - WvmTNLpGMVbwJVYztYL4Hnsy82cJhQorxjnnXcRm3b6: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.SERUM_POOL, - }, - auctxRXPeJoc4817jDhf4HbjnhEcr1cCXenosMhK5R8: { - deployments: LIVE_CLUSTERS, - name: PROGRAM_NAMES.NFT_AUCTION, - }, - cjg3oHmg9uuPsP8D6g29NWvhySJkdYdAo9D25PRbKXJ: { - deployments: [Cluster.Devnet, Cluster.MainnetBeta], - name: PROGRAM_NAMES.CHAINLINK_ORACLE, - }, - cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK: { - deployments: [Cluster.Devnet, Cluster.MainnetBeta], - name: PROGRAM_NAMES.ACCOUNT_COMPRESSION, - }, - cndy3Z4yapfJBmL3ShUp5exZKqR3z33thTzeNMm2gRZ: { - deployments: LIVE_CLUSTERS, - name: PROGRAM_NAMES.NFT_CANDY_MACHINE_V2, - }, - cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ: { - deployments: LIVE_CLUSTERS, - name: PROGRAM_NAMES.NFT_CANDY_MACHINE, - }, - gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s: { - deployments: [Cluster.Devnet], - name: PROGRAM_NAMES.PYTH_DEVNET, - }, - metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s: { - deployments: LIVE_CLUSTERS, - name: PROGRAM_NAMES.TOKEN_METADATA, - }, - mv3ekLzLbnVPNxjSKvqBpU3ZeZXPQdEC3bp5MDEBG68: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.MANGO_3, - }, - namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX: { - deployments: LIVE_CLUSTERS, - name: PROGRAM_NAMES.NAME, - }, - p1exdMJcjVao65QdewkaZRUnU6VPSXhus9n2GzWfh98: { - deployments: LIVE_CLUSTERS, - name: PROGRAM_NAMES.METAPLEX, - }, - srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.OPENBOOK_DEX, - }, - vau1zxA2LbssAUEF7Gpw91zMM1LvXrvpzJtmZ58rPsn: { - deployments: LIVE_CLUSTERS, - name: PROGRAM_NAMES.TOKEN_VAULT, - }, - worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.WORMHOLE_CORE, - }, - wormDTUJ6AWPNvk59vGQbDvGJmqbDTdgWgAqcLBCgUb: { - deployments: [Cluster.MainnetBeta], - name: PROGRAM_NAMES.WORMHOLE_TOKEN, - }, + '11111111111111111111111111111111': { + deployments: ALL_CLUSTERS, + name: PROGRAM_NAMES.SYSTEM, + }, + '22Y43yTVxuUkoRKdm9thyRhQ3SdgQS7c7kB6UNCiaczD': { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.SERUM_SWAP, + }, + '27haf8L6oxUeXrHrgEgsexjSY5hbVUWEmvv9Nyxg8vQv': { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.RAYDIUM_LP_2, + }, + '2rHhojZ7hpu1zA91nvZmT8TqWWvMcKmmNBCr2mKTtMq4': { + deployments: [Cluster.Devnet], + name: PROGRAM_NAMES.WORMHOLE_NFT, + }, + '3XXuUFfweXBwFgFfYaejLvZE4cGZiHgKiGfMtdxNzYmv': { + deployments: [Cluster.MainnetBeta, Cluster.Devnet], + name: PROGRAM_NAMES.CLOCKWORK_1, + }, + '3u8hJUVTA4jH1wYAyUur7FFZVQ8H635K3tSHHF4ssjQ5': { + deployments: [Cluster.Devnet], + name: PROGRAM_NAMES.WORMHOLE_CORE, + }, + '5ZfZAwP2m93waazg8DkrrVmsupeiPEvaEHowiUP7UAbJ': { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.SOLANART_GO, + }, + '5fNfvyp5czQVX77yoACa3JJVEhdRaWjPuazuWgjhTqEH': { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.MANGO_2, + }, + '675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8': { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.RAYDIUM_AMM, + }, + '7sPptkymzvayoSbLXzBsXEF8TSf3typNnAWkrKrDizNb': { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.MANGO_ICO, + }, + '82yxjeMsvaURa4MbZZ7WZZHfobirZYkH1zF8fmeGtyaQ': { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.ORCA_AQUAFARM, + }, + '8tfDNiaEyrV6Q1U4DEXrEigs9DoDtkugzFbybENEbCDz': { + deployments: [Cluster.Testnet], + name: PROGRAM_NAMES.PYTH_TESTNET, + }, + '9HzJyW1qZsEiSfMUf6L2jo3CcTKAyBmSyKdwQeYisHrC': { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.RAYDIUM_IDO, + }, + '9W959DqEETiGZocYWCQPaJ6sBmUzgfxXfqGeTEdp3aQP': { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.ORCA_SWAP_2, + }, + '9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin': { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.SERUM_3, + }, + // spl + ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL: { + deployments: ALL_CLUSTERS, + name: PROGRAM_NAMES.ASSOCIATED_TOKEN, + }, + // native built-ins + AddressLookupTab1e1111111111111111111111111: { + deployments: ALL_CLUSTERS, + name: PROGRAM_NAMES.ADDRESS_LOOKUP_TABLE, + }, + BJ3jrUzddfuSrZHXSCxMUUQsjKEyLmuuyZebkcaFp2fg: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.SERUM_1, + }, + BrEAK7zGZ6dM71zUDACDqJnekihmwF15noTddWTsknjC: { + deployments: LIVE_CLUSTERS, + name: PROGRAM_NAMES.BREAK_SOLANA, + }, + // other + C64kTdg1Hzv5KoQmZrQRcm2Qz7PkxtFBgw7EpFhvYn8W: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.ACUMEN, + }, + CJsLwbP1iu5DuUikHEJnLfANgKy6stB2uFgvBBHoyxwz: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.SOLANART, + }, + CLoCKyJ6DXBJqqu2VWx9RLbgnwwR6BMHHuyasVmfMzBh: { + deployments: [Cluster.MainnetBeta, Cluster.Devnet], + name: PROGRAM_NAMES.CLOCKWORK_2, + }, + ComputeBudget111111111111111111111111111111: { + deployments: ALL_CLUSTERS, + name: PROGRAM_NAMES.COMPUTE_BUDGET, + }, + Config1111111111111111111111111111111111111: { + deployments: ALL_CLUSTERS, + name: PROGRAM_NAMES.CONFIG, + }, + CrX7kMhLC3cSsXJdT7JDgqrRVWGnUpX3gfEfxxU2NVLi: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.SOLIDO, + }, + Crt7UoUR6QgrFrN7j8rmSQpUTNWNSitSwWvsWGf1qZ5t: { + deployments: [Cluster.Devnet, Cluster.MainnetBeta], + name: PROGRAM_NAMES.SABER_ROUTER, + }, + DZnkkTmCiFWfYTfT41X3Rd1kDgozqzxWaHqsw6W4x2oe: { + deployments: [Cluster.Devnet], + name: PROGRAM_NAMES.WORMHOLE_TOKEN, + }, + DjVE6JNiYqPL2QXyCUUh8rNjHrbz9hXHNYt99MQ59qw1: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.ORCA_SWAP_1, + }, + Dooar9JkhdZ7J3LHN3A7YCuoGRUggXhQaG4kijfLGU2j: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.STEPN_DEX, + }, + DtmE9D2CSB4L5D6A15mraeEjrGMm6auWVzgaD8hK2tZM: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.SWITCHBOARD, + }, + EUqojwWA2rd19FZrzeBncJsm38Jm1hEhE3zsmX3bRc2o: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.SERUM_2, + }, + Ed25519SigVerify111111111111111111111111111: { + deployments: ALL_CLUSTERS, + name: PROGRAM_NAMES.ED25519, + }, + EhhTKczWMGQt46ynNeRX1WfeagwwJd7ufHvCDjRxjo5Q: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.RAYDIUM_STAKING, + }, + Feat1YXHhH6t1juaWF74WLcfv4XoNocjXA6sPWHNgAse: { + deployments: ALL_CLUSTERS, + name: PROGRAM_NAMES.FEATURE_PROPOSAL, + }, + FsJ3A3u2vn5cTVofAjvy6y5kwABJAqYWpe4975bi2epH: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.PYTH_MAINNET, + }, + GqTPL6qRf5aUuqscLh8Rg2HTxPUXfhhAXDptTLhp1t2J: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.MANGO_GOVERNANCE, + }, + HEvSKofvBgfaexv23kMabbYqxasxU3mQ4ibBMEmJWHny: { + deployments: [Cluster.Devnet, Cluster.MainnetBeta], + name: PROGRAM_NAMES.CHAINLINK_STORE, + }, + JD3bq9hGdy38PuWQ4h2YJpELmHVGPPfFSuFkpzAd9zfu: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.MANGO_1, + }, + KeccakSecp256k11111111111111111111111111111: { + deployments: ALL_CLUSTERS, + name: PROGRAM_NAMES.SECP256K1, + }, + LendZqTs7gn5CTSJU1jWKhKuVpjJGom45nnwPb2AMTi: { + deployments: LIVE_CLUSTERS, + name: PROGRAM_NAMES.LENDING, + }, + MERLuDFBMmsHnsBPZw2sDQZHvXFMwp8EdjudcU2HKky: { + deployments: [Cluster.Devnet, Cluster.MainnetBeta], + name: PROGRAM_NAMES.MERCURIAL, + }, + MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.MARINADE, + }, + Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo: { + deployments: ALL_CLUSTERS, + name: PROGRAM_NAMES.MEMO, + }, + MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr: { + deployments: ALL_CLUSTERS, + name: PROGRAM_NAMES.MEMO_2, + }, + Port7uDYB3wk6GJAw4KT1WpTeMtSu9bTcChBHkX2LfR: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.PORT, + }, + QMMD16kjauP5knBwxNUJRZ1Z5o3deBuFrqVjBVmmqto: { + deployments: LIVE_CLUSTERS, + name: PROGRAM_NAMES.QUARRY_MERGE_MINE, + }, + QMNeHCGYnLVDn1icRAfQZpjPLBNkfGbSKRB83G5d8KB: { + deployments: LIVE_CLUSTERS, + name: PROGRAM_NAMES.QUARRY_MINE, + }, + QMWoBmAyJLAsA1Lh9ugMTw2gciTihncciphzdNzdZYV: { + deployments: LIVE_CLUSTERS, + name: PROGRAM_NAMES.QUARRY_MINT_WRAPPER, + }, + QRDxhMw1P2NEfiw5mYXG79bwfgHTdasY2xNP76XSea9: { + deployments: LIVE_CLUSTERS, + name: PROGRAM_NAMES.QUARRY_REDEEMER, + }, + QREGBnEj9Sa5uR91AV8u3FxThgP5ZCvdZUW2bHAkfNc: { + deployments: LIVE_CLUSTERS, + name: PROGRAM_NAMES.QUARRY_REGISTRY, + }, + RVKd61ztZW9GUwhRbbLoYVRE5Xf1B2tVscKqwZqXgEr: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.RAYDIUM_LP_1, + }, + SPoo1Ku8WFXoNDMHPsrGSTSG1Y47rzgn41SLUNakuHy: { + deployments: LIVE_CLUSTERS, + name: PROGRAM_NAMES.STAKE_POOL, + }, + SSwpMgqNDsyV7mAgN9ady4bDVu5ySjmmXejXvy2vLt1: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.STEP_SWAP, + }, + SSwpkEEcbUqx4vtoEByFjSkhKdCT862DNVb52nZg1UZ: { + deployments: [Cluster.Devnet, Cluster.MainnetBeta], + name: PROGRAM_NAMES.SABER_SWAP, + }, + SWiMDJYFUGj6cPrQ6QYYYWZtvXQdRChSVAygDZDsCHC: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.SWIM_SWAP, + }, + So1endDq2YkqhipRh3WViPa8hdiSpxWy6z3Z6tMCpAo: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.SOLEND, + }, + Stake11111111111111111111111111111111111111: { + deployments: ALL_CLUSTERS, + name: PROGRAM_NAMES.STAKE, + }, + SwaPpA9LAaLfeLi3a68M4DjnLqgtticKg6CnyNwgAC8: { + deployments: LIVE_CLUSTERS, + name: PROGRAM_NAMES.SWAP, + }, + TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA: { + deployments: ALL_CLUSTERS, + name: PROGRAM_NAMES.TOKEN, + }, + Vote111111111111111111111111111111111111111: { + deployments: ALL_CLUSTERS, + name: PROGRAM_NAMES.VOTE, + }, + WnFt12ZrnzZrFZkt2xsNsaNWoQribnuQ5B5FrDbwDhD: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.WORMHOLE_NFT, + }, + WormT3McKhFJ2RkiGpdw9GKvNCrB2aB54gb2uV9MfQC: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.WORMHOLE, + }, + WvmTNLpGMVbwJVYztYL4Hnsy82cJhQorxjnnXcRm3b6: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.SERUM_POOL, + }, + auctxRXPeJoc4817jDhf4HbjnhEcr1cCXenosMhK5R8: { + deployments: LIVE_CLUSTERS, + name: PROGRAM_NAMES.NFT_AUCTION, + }, + cjg3oHmg9uuPsP8D6g29NWvhySJkdYdAo9D25PRbKXJ: { + deployments: [Cluster.Devnet, Cluster.MainnetBeta], + name: PROGRAM_NAMES.CHAINLINK_ORACLE, + }, + cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK: { + deployments: [Cluster.Devnet, Cluster.MainnetBeta], + name: PROGRAM_NAMES.ACCOUNT_COMPRESSION, + }, + cndy3Z4yapfJBmL3ShUp5exZKqR3z33thTzeNMm2gRZ: { + deployments: LIVE_CLUSTERS, + name: PROGRAM_NAMES.NFT_CANDY_MACHINE_V2, + }, + cndyAnrLdpjq1Ssp1z8xxDsB8dxe7u4HL5Nxi2K5WXZ: { + deployments: LIVE_CLUSTERS, + name: PROGRAM_NAMES.NFT_CANDY_MACHINE, + }, + gSbePebfvPy7tRqimPoVecS2UsBvYv46ynrzWocc92s: { + deployments: [Cluster.Devnet], + name: PROGRAM_NAMES.PYTH_DEVNET, + }, + metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s: { + deployments: LIVE_CLUSTERS, + name: PROGRAM_NAMES.TOKEN_METADATA, + }, + mv3ekLzLbnVPNxjSKvqBpU3ZeZXPQdEC3bp5MDEBG68: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.MANGO_3, + }, + namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX: { + deployments: LIVE_CLUSTERS, + name: PROGRAM_NAMES.NAME, + }, + p1exdMJcjVao65QdewkaZRUnU6VPSXhus9n2GzWfh98: { + deployments: LIVE_CLUSTERS, + name: PROGRAM_NAMES.METAPLEX, + }, + srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.OPENBOOK_DEX, + }, + vau1zxA2LbssAUEF7Gpw91zMM1LvXrvpzJtmZ58rPsn: { + deployments: LIVE_CLUSTERS, + name: PROGRAM_NAMES.TOKEN_VAULT, + }, + worm2ZoG2kUd4vFXhvjh93UUH596ayRfgQ2MgjNMTth: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.WORMHOLE_CORE, + }, + wormDTUJ6AWPNvk59vGQbDvGJmqbDTdgWgAqcLBCgUb: { + deployments: [Cluster.MainnetBeta], + name: PROGRAM_NAMES.WORMHOLE_TOKEN, + }, }; export const SPECIAL_IDS: { [key: string]: string } = { - '1nc1nerator11111111111111111111111111111111': 'Incinerator', - Sysvar1111111111111111111111111111111111111: 'SYSVAR', + '1nc1nerator11111111111111111111111111111111': 'Incinerator', + Sysvar1111111111111111111111111111111111111: 'SYSVAR', }; export const SYSVAR_IDS: { [key: string]: string } = { - Sysvar1nstructions1111111111111111111111111: 'Sysvar: Instructions', - SysvarC1ock11111111111111111111111111111111: 'Sysvar: Clock', - SysvarEpochSchedu1e111111111111111111111111: 'Sysvar: Epoch Schedule', - SysvarFees111111111111111111111111111111111: 'Sysvar: Fees', - SysvarRecentB1ockHashes11111111111111111111: 'Sysvar: Recent Blockhashes', - SysvarRent111111111111111111111111111111111: 'Sysvar: Rent', - SysvarRewards111111111111111111111111111111: 'Sysvar: Rewards', - SysvarS1otHashes111111111111111111111111111: 'Sysvar: Slot Hashes', - SysvarS1otHistory11111111111111111111111111: 'Sysvar: Slot History', - SysvarStakeHistory1111111111111111111111111: 'Sysvar: Stake History', + Sysvar1nstructions1111111111111111111111111: 'Sysvar: Instructions', + SysvarC1ock11111111111111111111111111111111: 'Sysvar: Clock', + SysvarEpochSchedu1e111111111111111111111111: 'Sysvar: Epoch Schedule', + SysvarFees111111111111111111111111111111111: 'Sysvar: Fees', + SysvarRecentB1ockHashes11111111111111111111: 'Sysvar: Recent Blockhashes', + SysvarRent111111111111111111111111111111111: 'Sysvar: Rent', + SysvarRewards111111111111111111111111111111: 'Sysvar: Rewards', + SysvarS1otHashes111111111111111111111111111: 'Sysvar: Slot Hashes', + SysvarS1otHistory11111111111111111111111111: 'Sysvar: Slot History', + SysvarStakeHistory1111111111111111111111111: 'Sysvar: Stake History', }; diff --git a/app/utils/token-info.ts b/app/utils/token-info.ts index e2628687..f03fa137 100644 --- a/app/utils/token-info.ts +++ b/app/utils/token-info.ts @@ -1,43 +1,43 @@ -import { Connection, PublicKey } from "@solana/web3.js"; -import { ChainId, Client, Token, UtlConfig } from "@solflare-wallet/utl-sdk"; +import { Connection, PublicKey } from '@solana/web3.js'; +import { ChainId, Client, Token, UtlConfig } from '@solflare-wallet/utl-sdk'; -import { Cluster } from "./cluster"; +import { Cluster } from './cluster'; type TokenExtensions = { - readonly website?: string, - readonly bridgeContract?: string, - readonly assetContract?: string, - readonly address?: string, - readonly explorer?: string, - readonly twitter?: string, - readonly github?: string, - readonly medium?: string, - readonly tgann?: string, - readonly tggroup?: string, - readonly discord?: string, - readonly serumV3Usdt?: string, - readonly serumV3Usdc?: string, - readonly coingeckoId?: string, - readonly imageUrl?: string, - readonly description?: string, -} + readonly website?: string; + readonly bridgeContract?: string; + readonly assetContract?: string; + readonly address?: string; + readonly explorer?: string; + readonly twitter?: string; + readonly github?: string; + readonly medium?: string; + readonly tgann?: string; + readonly tggroup?: string; + readonly discord?: string; + readonly serumV3Usdt?: string; + readonly serumV3Usdc?: string; + readonly coingeckoId?: string; + readonly imageUrl?: string; + readonly description?: string; +}; export type FullLegacyTokenInfo = { - readonly chainId: number, - readonly address: string, - readonly name: string, - readonly decimals: number, - readonly symbol: string, - readonly logoURI?: string, - readonly tags?: string[], - readonly extensions?: TokenExtensions, -} + readonly chainId: number; + readonly address: string; + readonly name: string; + readonly decimals: number; + readonly symbol: string; + readonly logoURI?: string; + readonly tags?: string[]; + readonly extensions?: TokenExtensions; +}; export type FullTokenInfo = FullLegacyTokenInfo & { readonly verified: boolean; }; type FullLegacyTokenInfoList = { - tokens: FullLegacyTokenInfo[] -} + tokens: FullLegacyTokenInfo[]; +}; function getChainId(cluster: Cluster): ChainId | undefined { if (cluster === Cluster.MainnetBeta) return ChainId.MAINNET; @@ -46,17 +46,14 @@ function getChainId(cluster: Cluster): ChainId | undefined { else return undefined; } -function makeUtlClient( - cluster: Cluster, - connectionString: string -): Client | undefined { +function makeUtlClient(cluster: Cluster, connectionString: string): Client | undefined { const chainId = getChainId(cluster); if (!chainId) return undefined; const config: UtlConfig = new UtlConfig({ chainId, connection: new Connection(connectionString), - }) + }); return new Client(config); } @@ -80,13 +77,15 @@ async function getFullLegacyTokenInfoUsingCdn( address: PublicKey, chainId: ChainId ): Promise { - const tokenListResponse = await fetch('https://cdn.jsdelivr.net/gh/solana-labs/token-list@latest/src/tokens/solana.tokenlist.json'); + const tokenListResponse = await fetch( + 'https://cdn.jsdelivr.net/gh/solana-labs/token-list@latest/src/tokens/solana.tokenlist.json' + ); if (tokenListResponse.status >= 400) { reportError(new Error('Error fetching token list from CDN')); return undefined; } - const { tokens } = await tokenListResponse.json() as FullLegacyTokenInfoList; - const tokenInfo = tokens.find(t => t.address === address.toString() && t.chainId === chainId) + const { tokens } = (await tokenListResponse.json()) as FullLegacyTokenInfoList; + const tokenInfo = tokens.find(t => t.address === address.toString() && t.chainId === chainId); return tokenInfo; } @@ -106,7 +105,7 @@ export async function getFullTokenInfo( const [legacyCdnTokenInfo, sdkTokenInfo] = await Promise.all([ getFullLegacyTokenInfoUsingCdn(address, chainId), - getTokenInfo(address, cluster, connectionString) + getTokenInfo(address, cluster, connectionString), ]); if (!sdkTokenInfo) { diff --git a/app/utils/token-search.ts b/app/utils/token-search.ts index 6eac7a34..23b3c874 100644 --- a/app/utils/token-search.ts +++ b/app/utils/token-search.ts @@ -6,37 +6,34 @@ * So to avoid pulling in extra dependencies we just use the public API directly for search */ -import { Base58EncodedAddress } from "web3js-experimental" +import { Base58EncodedAddress } from 'web3js-experimental'; -import { Cluster } from "./cluster"; -import { reportError } from "./sentry"; +import { Cluster } from './cluster'; +import { reportError } from './sentry'; type TokenSearchApiResponseToken = { - address: Base58EncodedAddress, - chainId: number, - name: string, - symbol: string, - verified: boolean, - decimals: number, - holders: number, - logoUri: string, - tags: string[], + address: Base58EncodedAddress; + chainId: number; + name: string; + symbol: string; + verified: boolean; + decimals: number; + holders: number; + logoUri: string; + tags: string[]; }; type TokenSearchApiResponse = { - content: TokenSearchApiResponseToken[], -} + content: TokenSearchApiResponseToken[]; +}; type SearchElement = { label: string; value: string[]; pathname: string; -} +}; -export async function searchTokens( - search: string, - cluster: Cluster -): Promise { +export async function searchTokens(search: string, cluster: Cluster): Promise { if (process.env.NEXT_PUBLIC_DISABLE_TOKEN_SEARCH || !search) { return []; } @@ -46,24 +43,34 @@ export async function searchTokens( if (cluster === Cluster.MainnetBeta) chainId = 101; else if (cluster === Cluster.Testnet) chainId = 102; else if (cluster === Cluster.Devnet) chainId = 103; - else { return []; } + else { + return []; + } - const apiResponse = await fetch(`https://token-list-api.solana.cloud/v1/search?query=${encodeURIComponent(search)}&chainId=${chainId}&start=0&limit=20`); + const apiResponse = await fetch( + `https://token-list-api.solana.cloud/v1/search?query=${encodeURIComponent( + search + )}&chainId=${chainId}&start=0&limit=20` + ); if (apiResponse.status >= 400) { try { const errorJsonBody = await apiResponse.json(); - reportError(new Error('Error calling token search API'), { chainId: chainId.toString(), errorJsonBody, search }); + reportError(new Error('Error calling token search API'), { + chainId: chainId.toString(), + errorJsonBody, + search, + }); } catch { // no JSON body for error reportError(new Error('Error calling token search API'), { chainId: chainId.toString(), search }); } } - const { content } = await apiResponse.json() as TokenSearchApiResponse; + const { content } = (await apiResponse.json()) as TokenSearchApiResponse; return content.map(token => ({ label: token.name, pathname: '/address/' + token.address, - value: [token.name, token.symbol, token.address] - })) + value: [token.name, token.symbol, token.address], + })); } diff --git a/app/utils/tx.ts b/app/utils/tx.ts index 9a8ec587..1bad9c47 100644 --- a/app/utils/tx.ts +++ b/app/utils/tx.ts @@ -12,8 +12,8 @@ import bs58 from 'bs58'; import { LOADER_IDS, PROGRAM_INFO_BY_ID, SPECIAL_IDS, SYSVAR_IDS } from './programs'; export type TokenLabelInfo = { - name?: string, - symbol?: string, + name?: string; + symbol?: string; }; export function getProgramName(address: string, cluster: Cluster): string { diff --git a/jest.config.js b/jest.config.js index 12555758..4ecce9e3 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,15 +1,15 @@ -const nextJest = require('next/jest') +const nextJest = require('next/jest'); const createJestConfig = nextJest({ // Provide the path to your Next.js app to load next.config.js and .env files in your test environment dir: './', -}) +}); // Add any custom config to be passed to Jest const customJestConfig = { setupFilesAfterEnv: ['/jest.setup.js'], testEnvironment: 'jest-environment-jsdom', -} +}; // createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async -module.exports = createJestConfig(customJestConfig) +module.exports = createJestConfig(customJestConfig); diff --git a/jest.setup.js b/jest.setup.js index 996e74a2..306452c5 100644 --- a/jest.setup.js +++ b/jest.setup.js @@ -3,4 +3,4 @@ // Used for __tests__/testing-library.js // Learn more: https://github.com/testing-library/jest-dom -import '@testing-library/jest-dom/extend-expect' +import '@testing-library/jest-dom/extend-expect';