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:
parent
55314f998a
commit
82f7b0001c
14
src/ocean.js
14
src/ocean.js
@ -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) {
|
async getOrdersByConsumer(consumerAddress) {
|
||||||
let accessConsentEvent = this.auth.contract.AccessConsentRequested({ _consumer: consumerAddress }, {
|
let accessConsentEvent = this.auth.contract.AccessConsentRequested({ _consumer: consumerAddress }, {
|
||||||
fromBlock: 0,
|
fromBlock: 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user