Skip to content

hashToGatewayUrl

Converts IPFS hash to an accessible http url.

Usage

example.ts
import { mintclub } from 'mint.club-v2-sdk'
 
const httpUrl = mintclub.ipfs.hashToGatewayUrl('ipfs://somehashvalue') 
 
// const Image = () => <img src={httpUrl} alt="ipfs image" />

Return Value

Promise<'https://...'>

Returns a promise that resolves to a http url.

Parameters

hash

  • Type: IpfsHashUrl

A valid IPFS hash url.

const httpUrl = mintclub.ipfs.hashToGatewayUrl('ipfs://somehashvalue')  

gateway (optional)

  • Type: HttpUrl
  • Default: 'https://cf-ipfs.com/ipfs/'

A valid ipfs gateway url.

const httpUrl = mintclub.ipfs.hashToGatewayUrl(
	'ipfs://somehashvalue',
	'https://cf-ipfs.com/ipfs/'
)