Skip to content

Commit

Permalink
update getOrderHistory to generate signature
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcos20 committed Oct 12, 2020
1 parent eb60a42 commit 007328d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/datatokens/Datatokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,4 +417,10 @@ export class DataTokens {
}
return null
}

public getStartOrderEventSignature(): string {
const abi = this.datatokensABI as AbiItem[]
const eventdata = abi.find((o) => (o.name = 'OrderStarted'))
return this.web3.eth.abi.encodeEventSignature(eventdata as any)
}
}
3 changes: 2 additions & 1 deletion src/ocean/Assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,11 @@ export class Assets extends Instantiable {
): Promise<Order[]> {
const results: Order[] = []
const address = account.getId().toLowerCase()
const { datatokens } = this.ocean
const events = await this.web3.eth.getPastLogs({
topics: [
[
'0xe1c4fa794edfa8f619b8257a077398950357b9c6398528f94480307352f9afcc',
datatokens.getStartOrderEventSignature(),
null,
'0x000000000000000000000000' + address.substring(address.length - 40)
]
Expand Down

0 comments on commit 007328d

Please sign in to comment.