@hemergy/core-sdk
Advanced tools
Comparing version 0.0.17 to 0.0.18
@@ -25,6 +25,7 @@ import { AxiosInstance } from 'axios'; | ||
createAccount(): Promise<string>; | ||
createProject(accountAddress: string, beneficiaries: string[] | undefined, totalSupply: number, tokenPrice: number, projectURI: string, midcap: number): Promise<string>; | ||
investInProject(projectAddress: string, investorAccountAddress: string, amount: number): Promise<boolean>; | ||
kickstartProject(projectAddress: string): Promise<boolean>; | ||
divestInProject(projectAddress: string, investorAccountAddress: string, amount: number): Promise<boolean>; | ||
createProject(accountAddress: string, beneficiaries: string[] | undefined, amounts: number[] | undefined, totalSupply: number, tokenPrice: number, projectURI: string, midcap: number): Promise<string>; | ||
investInProject(projectAddress: string, investorAccountAddress: string, amount: number): Promise<any>; | ||
kickstartProject(projectAddress: string): Promise<any>; | ||
closeFundraise(projectAddress: string): Promise<any>; | ||
divestInProject(projectAddress: string, investorAccountAddress: string, amount: number): Promise<any>; | ||
withdrawTokens(investorWalletAddress: string, projectAddress: string): Promise<void>; | ||
@@ -31,0 +32,0 @@ mint(address: string): Promise<ethers.BigNumber>; |
@@ -95,3 +95,3 @@ "use strict"; | ||
} | ||
createProject(accountAddress, beneficiaries = [], totalSupply, tokenPrice, projectURI, midcap) { | ||
createProject(accountAddress, beneficiaries = [], amounts = [], totalSupply, tokenPrice, projectURI, midcap) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -106,2 +106,3 @@ const [{ projectsFactoryContract }, signerAddress] = yield Promise.all([ | ||
beneficiaries, | ||
amounts, | ||
totalSupply, | ||
@@ -120,3 +121,3 @@ tokenPrice, | ||
const signerAddress = yield this.getSignerAddress(); | ||
yield this.signAndBroadcast(`/projects/${projectAddress}/invest`, { | ||
const res = yield this.signAndBroadcast(`/projects/${projectAddress}/invest`, { | ||
endUserAddress: signerAddress, | ||
@@ -127,3 +128,3 @@ projectAddress, | ||
}); | ||
return true; | ||
return res; | ||
}); | ||
@@ -134,13 +135,23 @@ } | ||
const signerAddress = yield this.getSignerAddress(); | ||
yield this.signAndBroadcast(`/projects/${projectAddress}/kickstart`, { | ||
const res = yield this.signAndBroadcast(`/projects/${projectAddress}/kickstart`, { | ||
endUserAddress: signerAddress, | ||
projectAddress, | ||
}); | ||
return true; | ||
return res; | ||
}); | ||
} | ||
closeFundraise(projectAddress) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const signerAddress = yield this.getSignerAddress(); | ||
const res = yield this.signAndBroadcast(`/projects/${projectAddress}/closeFundraise`, { | ||
endUserAddress: signerAddress, | ||
projectAddress, | ||
}); | ||
return res; | ||
}); | ||
} | ||
divestInProject(projectAddress, investorAccountAddress, amount) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const signerAddress = yield this.getSignerAddress(); | ||
yield this.signAndBroadcast(`/projects/${projectAddress}/divest`, { | ||
const res = yield this.signAndBroadcast(`/projects/${projectAddress}/divest`, { | ||
endUserAddress: signerAddress, | ||
@@ -151,3 +162,3 @@ projectAddress, | ||
}); | ||
return true; | ||
return res; | ||
}); | ||
@@ -154,0 +165,0 @@ } |
{ | ||
"name": "@hemergy/core-sdk", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"description": "TypeScript NPM Module for Hemergy Core", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
16212
274