mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-25 13:54:05 -06:00
26 lines
1.2 KiB
TypeScript
26 lines
1.2 KiB
TypeScript
import { MetadataURIOrObject } from "../core/types";
|
|
import { IStorage } from "../interfaces/IStorage";
|
|
import FileOrBuffer from "../types/FileOrBuffer";
|
|
/**
|
|
*
|
|
* @param ipfsUrl - the ipfs:// uri
|
|
* @param gatewayUrl - the gateway url
|
|
* @returns the fully formed IPFS url
|
|
* @internal
|
|
*/
|
|
export declare function replaceIpfsWithGateway(ipfsUrl: string, gatewayUrl: string): string;
|
|
export declare function recursiveResolveGatewayUrl(json: any, storage: IStorage): any;
|
|
/**
|
|
* A helper function to upload arbitrary data to IPFS and return the resulting IPFS uri.
|
|
* @param data - stringified JSON || File
|
|
* @param contractAddress - (Optional) the contract address to associate the data with
|
|
* @param signerAddress - (Optional) the wallet address of the actor that is uploading the file
|
|
* @returns The `ipfs://<hash>` uri of the uploaded file
|
|
* @public
|
|
*/
|
|
export declare function uploadToIPFS(data: string | File | FileOrBuffer, contractAddress?: string, signerAddress?: string): Promise<string>;
|
|
/**
|
|
* @internal
|
|
*/
|
|
export declare function uploadMetadata(metadata: MetadataURIOrObject, contractAddress?: string, signerAddress?: string): Promise<string>;
|