getProjectInfo()

Syntax

getProjectInfo(projectId: string, token?: string)

Gets project information.

Parameters

NameTypeRequiredDescription

projectId

string

Yes

The project ID.

token

string

No

The authentication token response from Eueno API when login. After login, this token was saved in local storage with the name “eueno-token".

Returns

Promise return object with the structure looks as follows:

  • totalFile: The number of files/folders in the project

  • totalSize: The project size (bytes)

  • id: The project id

  • name: The project name

  • ownerAddress: The address of the account which created the project

  • updatedAt: The last date time update project

  • createdAt: The date-time create the project

Example

import {getProjectInfo} from "@eueno/lib-browser";

const getData = async () => {
   try {
     if (!token || !projectId) return;
     const response = await getBucketInfo(projectId);
     if (response?.status === 200) {
       console.log(response?.data?.data);
     } else toast.error("Error getting project information");
   } catch (error) {
     console.error(error);
   }
 };

Response of example:

{
    "msg": "success",
    "data": {
        "id": 1,
        "name": "ProjectName",
        "ownerAddress": "0x…",
        "totalFile": "0",
        "totalSize": "0"
        "updatedAt": "2023-03-08T15:02:45.881Z",
        "createdAt": "2023-03-08T10:43:53.677Z"
    }
}

Last updated