1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

update getOrderHistory to generate signature

This commit is contained in:
alexcos20 2020-10-12 08:15:08 -07:00
parent eb60a4217f
commit 007328d74e
2 changed files with 8 additions and 1 deletions

View File

@ -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)
}
}

View File

@ -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)
]