@aut-labs/sdk-storage
v0.0.1
Published
Nft.Storage wrapper
Downloads
8
Readme
Overview
It a nft.storage wrapper library to help with the issues coming from installing with webpack 5 polyfills in combination with @biconomy/mexa sdk
Installation
npm i @aut-labs-private/sdk-storage
or if you prefer using yarn
yarn @aut-labs-private/sdk-storage
Get started
class AutSDKStorage {
ipfsCIDToHttpUrl(url: string, isJson?: boolean): string;
storeImageAsBlob: (file: File) => Promise<string>;
storeAsBlob: (json: any) => Promise<string>;
storeAsJson: (json: any) => Promise<string>;
isValidUrl: (uri: string) => boolean;
}
Example usage
const client = new AutSDKStorage({
nftStorageApiKey: process.env.nftStorageApiKey
});
const respnse = await this.client.storeImageAsBlob(file);
// response ipfs://${cid}