getDetailMultiEncryptedFiles()

This method is used to get detail for a list of encrypted files.

Syntax

getDetailMultiEncryptedFiles(
  ids: Array<string> | Array<number>,
  token: string,
  isShare: boolean,
  account: string,
  onProcess?: (torrent: any, remaining: any) => void
)

Params

NameTypeRequiredDescription

ids

Array<string> | Array<number>

Yes

List of file id.

token

string

Yes

The authentication token.

isShare

boolean

Yes

If you get file detail of files that are shared, isShare will be true, else isShare will be false.

account

string

Yes

User Owallet address

onProcess

function

No

This function is used to handle the process get a file.

The first param torrent is an object that includes some torrent information (see more).

The second param remaining is the time remaining to get file.

Example

import { getDetailMultiEncryptedFiles } from "@eueno/lib-browser";import { useDispatch, useSelector } from "react-redux";

const getFileListDetail = async () => {
    const ids = ["20086"];
    const account = "0x6c00ba5420f8f86d...821c260f1a093"

    try {
      const encryptDetail = await getDetailMultiEncryptedFiles(
        ids,
        token,
        false,
        account,
        (torrent, remaining) => {
          console.log(torrent, remaining)
        }
      );

      console.log(encryptDetail);
    } catch (error) {
      console.log(error);
    }
};

Response

"data": [
      {
            "id": "20086",
            "name": "loading-icon (1).png",
            "nameNo": 1,
            "bufferData": [137, 80, 78, 71, 12, 10, 26,...],
            "virtualPath": "0xa4ea6...bf0e65c8a32/new/loading-icon (1).png",
            "virtualCloudPath": "0xa4ea61c9...89531-f882d37lllmz.loading-icon (1).png",
            "path": "0xa4ea61c99...82d37lllmz.loading-icon (1).png",
            "url": "https://node1-gateway-ipfs.eueno.io/ipfs/Qm...34ASACrTRDbyLiWi3",
            "backupUrl": "https://node1-gateway-ipfs.eueno.io/ipfs/QmVY...CrTRDbyLiWi3",
            "size": "26529",
            "mimeType": "image/png",
            "method": "ENCRYPT",
            "torrentSize": 4,
            "torrentUrl": "https://node1-gateway-ipfs.eueno.io/ipfs/QmSU...Z2FNvgzkJ7",
            "backupTorrentUrl": "https://node1-gateway-ipfs.eueno.io/ipfs/QmSUzA6...Z2FNvgzkJ7",
            "encryptKey": "af071851a69...b1a2a8ae52da43a76",
            "createdAt": "2023-05-30T04:26:30.629Z",
            "updatedAt": "2023-05-30T04:26:33.912Z"
        },
  ]

Last updated