import { parsedSearchParam , getUrlHostname } from "./urls" ; const truncateString = ( str ) => str ? `${ str . slice ( 0 , 4 ) }…${ str . slice ( - 4 ) }` : "" ; export const truncatedPublicKey = ( publicKey ) => truncateString ( publicKey ) ; export const truncatedPoolId = ( poolId ) => truncateString ( poolId ) ; export const getTransactionInfo = ( search ) => { const transactionInfo = parsedSearchParam ( search ) ; const { url , transaction , isDomainListedAllowed , flaggedKeys , } = transactionInfo ; const hostname = getUrlHostname ( url ) ; const { _operations = [ ] } = transaction ; const operationTypes = _operations . map ( ( operation ) => operation . type ) ; return { transaction , domain : hostname , operations : _operations , operationTypes , isDomainListedAllowed , flaggedKeys , } ; } ; export const stroopToXlm = ( stroop ) => stroop / 10000000 ;