πŸ’»Hemergy Core SDK

Hemergy Core SDK is the JavaScript library that allows developers to interact with the Hemergy core for creating and investing in renewable energy projects. With the Core SDK, you can easily access the platform's smart contracts, create accounts, projects, and check KYC status.

Installation

To install the Hemergy Core SDK, run the following command:

npm install @hemergy/core-sdk

Usage

First, import the necessary libraries and instantiate the Hemergy class with the required configuration.

import Hemergy from '@hemergy/core-sdk';
import { ethers } from 'ethers';

const signer = new ethers.providers.JsonRpcSigner();
const hemergy = new Hemergy({ baseURL: 'https://api.example.com', signer });

Get Meta

To retrieve the metadata of the Hemergy platform, use the getMeta() method.

const meta = await hemergy.getMeta();
console.log(meta);

Get Contracts

To access the Hemergy platform's contracts, use the getContracts() method.

Get Signer Address

To get the signer's Ethereum address, use the getSignerAddress() method.

Create Account

To create a new account on the Hemergy platform, use the createAccount() method.

Create Project

To create a new project on the Hemergy platform, use the createProject() method. You need to pass the account address and an optional list of beneficiaries.

Check KYC Status

To check the KYC status of an account, use the isKYCed() method. You need to pass the account address.

Last updated