mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
add amount in history
This commit is contained in:
parent
eadaa7abb5
commit
2c3c8bb04e
@ -35,6 +35,7 @@ export enum OrderProgressStep {
|
|||||||
|
|
||||||
export interface OrderHistory {
|
export interface OrderHistory {
|
||||||
dtAddress: string
|
dtAddress: string
|
||||||
|
amount: string
|
||||||
timestamp: number
|
timestamp: number
|
||||||
transactionHash: string
|
transactionHash: string
|
||||||
did?: string
|
did?: string
|
||||||
@ -610,13 +611,15 @@ export class Assets extends Instantiable {
|
|||||||
const order: OrderHistory = {
|
const order: OrderHistory = {
|
||||||
dtAddress: events[i].address,
|
dtAddress: events[i].address,
|
||||||
timestamp: parseInt(String(blockDetails.timestamp)),
|
timestamp: parseInt(String(blockDetails.timestamp)),
|
||||||
transactionHash: events[i].transactionHash
|
transactionHash: events[i].transactionHash,
|
||||||
|
amount: null
|
||||||
}
|
}
|
||||||
const params = this.web3.eth.abi.decodeParameters(
|
const params = this.web3.eth.abi.decodeParameters(
|
||||||
['uint256', 'uint256', 'uint256', 'uint256'],
|
['uint256', 'uint256', 'uint256', 'uint256'],
|
||||||
events[i].data
|
events[i].data
|
||||||
)
|
)
|
||||||
order.serviceId = parseInt(params[1])
|
order.serviceId = parseInt(params[1])
|
||||||
|
order.amount = this.web3.utils.fromWei(params[0])
|
||||||
order.did = didPrefixed(didNoZeroX(order.dtAddress))
|
order.did = didPrefixed(didNoZeroX(order.dtAddress))
|
||||||
const service = await this.getServiceByIndex(order.did, order.serviceId)
|
const service = await this.getServiceByIndex(order.did, order.serviceId)
|
||||||
order.serviceType = service.type
|
order.serviceType = service.type
|
||||||
|
Loading…
x
Reference in New Issue
Block a user