export function getIpfsIoUrl ( cid ) { return `https://ipfs.io/ipfs/${ cid }` ; } export function getPinataUrlFromCid ( cid ) { return `https://gateway.pinata.cloud/ipfs/${ cid }` ; } export function getPinataFxhashGateway ( cid ) { return `https://gateway.fxhash.xyz/ipfs/${ cid }` ; } export function getPinataFxhashGatewaySafe ( cid ) { return `https://gateway.fxhash2.xyz/ipfs/${ cid }` ; } export function getIpfsSlash ( cid ) { return `ipfs://${ cid }` ; } /**
 * given an URL of the form `ipfs://frghrtjtyjtyj`
 * outputs the CID in the rightmost section
 */ export function ipfsUrlToCid ( url ) { return url ? url . substring ( 7 ) : "" ; } /**
 * Generic method to get a display url based on a CID and a hash.
 * This function also accepts a transform method so that the base URL can be formed in any way using the cid
 */ export function ipfsUrlWithHash ( cid , hash , transform = getIpfsIoUrl ) { return `${ transform ( cid ) }?fxhash=${ hash }` ; }