Files
import { NotVault, Files, FileEntry } from '@notcentralised/notvault-sdk';const vault = new NotVault(); const files = new Files(vault);const newFilesList : FileEntry[] = await files.add( '... File Name ...', '... Super secret text, usually in Base64 format when dealing with binary data ...', (event: any) => { const percent = Math.floor((event.loaded / event.total) * 100); console.log(`Progress ${percent}%`); } );const retrievedFile : FileEntry = await files.get(`... File CID in IPFS ...`);const allFiles : FileEntry[] = await files.list();const newFilesAfterRemoval : FileEntry[] = await files.remove(`... File CID in IPFS ...`);
Last updated