Skip to content

upload

Upload a file to IPFS.

Usage

example.ts
import { mintclub } from 'mint.club-v2-sdk'
 
const imageOrVideo = URL.createObjectURL(...);
 
await mintclub.ipfs.upload({ 
	filebaseApiKey: 'YOUR API KEY', 
	media: imageOrVideo 
}) 

Return Value

Promise<'ipfs://{string}'>

Returns a promise that resolves to a string containing the IPFS hash of the uploaded file.

Parameters

filebaseApiKey

  • Type: string

Filebase API key.

example.ts
await mintclub.ipfs.upload({ 
	filebaseApiKey: 'YOUR API KEY', 
	media: file 
}) 

media

  • Type: Blob

A file to upload to the IPFS.

example.ts
await mintclub.ipfs.upload({ 
	filebaseApiKey: 'YOUR API KEY', 
	media: file 
})