1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

added getAccounts

This commit is contained in:
Sebastian Gerske 2018-09-20 10:18:02 +02:00
parent 55314f998a
commit 82f7b0001c

View File

@ -29,6 +29,20 @@ export default class Ocean {
}
}
async getAccounts() {
return Promise.all(this.helper.getAccounts().map(async (account) => {
// await ocean.market.requestTokens(account, 1000)
return {
name: account,
balance: {
ocn: await this.token.getTokenBalance(account),
eth: await this.token.getEthBalance(account)
}
}
}))
}
async getOrdersByConsumer(consumerAddress) {
let accessConsentEvent = this.auth.contract.AccessConsentRequested({ _consumer: consumerAddress }, {
fromBlock: 0,