@hemergy/core-sdk
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -18,2 +18,3 @@ import { AxiosInstance } from 'axios'; | ||
projectsFactoryContract: ethers.Contract; | ||
usdcContract: ethers.Contract; | ||
}>; | ||
@@ -27,5 +28,5 @@ getSignerAddress(): Promise<string>; | ||
divestInProject(projectAddress: string, investorAccountAddress: string, amount: number): Promise<void>; | ||
mint(address: string): Promise<number>; | ||
mint(address: string): Promise<ethers.BigNumber>; | ||
isKYCed(accountAddress: string): Promise<boolean>; | ||
getBalance(address: string): Promise<ethers.BigNumber>; | ||
getBalance(address: string): Promise<any>; | ||
} |
@@ -42,6 +42,7 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { accountsFactoryAddress, accountsFactoryABI, projectsFactoryABI, projectsFactoryAddress } = yield this.getMeta(); | ||
const { accountsFactoryAddress, accountsFactoryABI, projectsFactoryABI, projectsFactoryAddress, usdcContractABI, usdcContractAddress, } = yield this.getMeta(); | ||
const accountsFactoryContract = new ethers_1.ethers.Contract(accountsFactoryAddress, accountsFactoryABI, this.signer); | ||
const projectsFactoryContract = new ethers_1.ethers.Contract(projectsFactoryAddress, projectsFactoryABI, this.signer); | ||
return { accountsFactoryContract, projectsFactoryContract }; | ||
const usdcContract = new ethers_1.ethers.Contract(usdcContractAddress, usdcContractABI, this.signer); | ||
return { accountsFactoryContract, projectsFactoryContract, usdcContract }; | ||
}); | ||
@@ -132,3 +133,3 @@ } | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { data } = yield this.axiosClient.post('bank/mint', { address }); | ||
const { data } = yield this.axiosClient.post('/bank/mint', { address }); | ||
return data; | ||
@@ -145,5 +146,9 @@ }); | ||
getBalance(address) { | ||
return this.signer.provider.getBalance(address); | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { usdcContract } = yield this.getContracts(); | ||
const balance = yield usdcContract.balanceOf(address); | ||
return balance; | ||
}); | ||
} | ||
} | ||
exports.default = Hemergy; |
@@ -10,2 +10,4 @@ export type Meta = { | ||
projectContractABI: Record<string, any>[]; | ||
usdcContractAddress: string; | ||
usdcContractABI: Record<string, any>[]; | ||
}; |
{ | ||
"name": "@hemergy/core-sdk", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "TypeScript NPM Module for Hemergy Core", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12965
216