Table of contents

IPFS Functions

IPFS Functions

configureIpfs

configureIpfs(config): void

Configure the IPFS client with API base URL and authentication

Parameters

NameTypeDescription
configObjectConfiguration object
config.apiBaseUrl?stringBase URL for the IPFS API endpoints
config.apiKey?stringAPI key for authentication

Returns

void

uploadFileToIpfs

uploadFileToIpfs(file): Promise<string>

Uploads a file to IPFS and returns the IPFS URL

Parameters

NameTypeDescription
fileFileThe file to upload

Returns

Promise<string>

The IPFS URL of the uploaded file

uploadMetadataToIpfs

uploadMetadataToIpfs(metadata): Promise<string>

Uploads metadata to IPFS and returns the IPFS URL

Parameters

NameTypeDescription
metadataRecord<string, unknown>The metadata to upload

Returns

Promise<string>

The IPFS URL of the uploaded metadata