import NeucronSDK from "./src/neucron-sdk.js";
const neucron = new NeucronSDK();
await neucron.authentication.login({ email: "your-email@example.com", password: "your-password" });
Upload File
You can easily upload a file to Neucron using the uploadFile function, supporting options such as specifying the file path, data, and wallet ID. In a browser environment, you need to create an input element to handle file selection.
data: Contains the specific data returned by the API call.
txid: Transaction ID associated with the operation.
status_code: Indicates the HTTP status code of the response. A status code of 200 signifies a successful request.
Ensure proper handling of the response in your application based on the information provided in the data field, and check the status_code to confirm the success of the operation.
Note: The Neucron SDK is compatible with both Node.js and browser-based environments. Choose the appropriate import statement based on your environment.
This version includes instructions on how to handle file inputs in both browser and Node.js environments. Feel free to adjust as needed.