getCid()
Syntax
getCid(file: File, exportedKey?: string)
This method used to get cidFile
and cidTorrentFile
Parameters
Name
Type
Required
Description
file
File
Yes
File upload
exportedKey
string
No
Require if file encrypted
Example
import {getCid} from "@eueno/lib-browser";
const getData = async () => {
const file = files[0];
const exportedKey = "4R2Bw-kz9DnWA5FEcoopIsPhZZ5PswLBvtPwll6ejkU"
const response = await getCid(file, exportedKey);
console.log(response);
};
Response of example:
{
data: {
cidFile: "QmWYXyKrnpd94hVr4rh84q3MLfLfSMrk1MmuAW2Uj3Dv6X"
cidTorrentFile: "QmNxPpQkyK8x1ne3izWY7VRKw8LY7j4tVfaGfo5CMuuNpK"
},
status: 200
}
Last updated