import { PublicKey } from '@solana/web3.js' ; export function getRealmUrl ( realm , programId ) { return getItemUrl ( 'realm' , realm , programId ) ; } export function getProposalUrl ( proposal , programId ) { return getItemUrl ( 'proposal' , proposal , programId ) ; } export function getGovernanceUrl ( governance , programId ) { return getItemUrl ( 'governance' , governance , programId ) ; } export function getHomeUrl ( programId ) { return `/?programId=${ programId . toBase58 ( ) }` ; } export function getItemUrl ( itemName , itemId , programId ) { return `/${ itemName }/${ itemId instanceof PublicKey ? itemId . toBase58 ( ) : itemId }?programId=${ programId instanceof PublicKey ? programId . toBase58 ( ) : programId }` ; }