Eueno
  • EUENO – Decentralized Encrypting Blockchain Oracles for Web3
    • Litepaper
    • Use Cases
  • Get Started
    • Prerequisites
    • Buckets
      • Create a bucket
      • Delete a bucket
    • Files
      • Upload a file
      • View a file
      • Delete a file
      • Share a file
  • Pricing
  • Eueno libraries
    • @eueno/lib-browser
      • Installation
      • Setup
      • Create key (generate a key for encrypting the file(s))
      • login()
      • useEuenoContext()
      • getUserInfo()
      • updateUserInfo()
      • createProject()
      • getProjectInfo()
      • getProjects()
      • getFilesListByFolder()
      • deleteProject()
      • createFolder()
      • uploadFolder()
      • Get folder detail
      • deleteFolder()
      • uploadFile()
      • uploadFileWithSignedUrl()
      • getCid()
      • getFileById()
      • getFileListById()
      • Get file detail
        • getDetailFile()
        • getDetailUnencryptedFile()
        • getDetailEncryptedFile()
      • getDetailMultiEncryptedFiles()
      • deleteFile()
      • shareFile()
      • shareMultiFile()
      • deleteSharePermission()
      • getShareList()
      • getShareListToMe ()
    • @eueno/lib-node
      • Create eueno client
      • Create project key
      • Create project
      • Upload file
      • Upload folder
      • Get file
      • Get list file
      • Share file
      • Get shared files
      • Create folder
      • Create Account
      • Decrypt Get Key Aes
      • Decrypt File by Key Aes
  • Policies
    • Privacy Policy
    • Terms of Service
Powered by GitBook
On this page
  • Syntax
  • Parameters
  • Returns
  • Example
  1. Eueno libraries
  2. @eueno/lib-browser

createProject()

Syntax

createProject(data: NewProject, token: string)

This method is used when you want to create a new project.

Parameters

Name
Type
Required
Description

data

NewProject

Yes

Object contains project information.

token

string

Yes

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

The interface of NewProject looks as below

interface NewProject {
 name: string; //Project name
}

Returns

Promise returns a JSON - project info:

  • 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 Owallet account which created the project

  • updatedAt: The last date time update project

  • createdAt: The date-time create the project

Example

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

const onSubmit = async (data) => {
   const response = await createProject(data, token);
   if (response?.status == 200) {
     console.log(response);
     toast.success("Project created!");
   } else {
     toast.error(response || "An error occurred, please try again later");
   }
 };

Response of example:

    "data": {
        "totalFile": "0",
        "totalSize": "0",
        "id": 1,
        "name": "ProjectName",
        "ownerAddress": "0x…",
        "updatedAt": "2023-03-08T10:43:53.677Z",
        "createdAt": "2023-03-08T10:43:53.677Z"
    }
PreviousupdateUserInfo()NextgetProjectInfo()

Last updated 2 years ago