From 2c3c8bb04e67855efeabe36676017be8edf083e2 Mon Sep 17 00:00:00 2001 From: alexcos20 Date: Thu, 1 Oct 2020 05:59:39 -0700 Subject: [PATCH] add amount in history --- src/ocean/Assets.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ocean/Assets.ts b/src/ocean/Assets.ts index 65494cf2..407d6bb9 100644 --- a/src/ocean/Assets.ts +++ b/src/ocean/Assets.ts @@ -35,6 +35,7 @@ export enum OrderProgressStep { export interface OrderHistory { dtAddress: string + amount: string timestamp: number transactionHash: string did?: string @@ -610,13 +611,15 @@ export class Assets extends Instantiable { const order: OrderHistory = { dtAddress: events[i].address, timestamp: parseInt(String(blockDetails.timestamp)), - transactionHash: events[i].transactionHash + transactionHash: events[i].transactionHash, + amount: null } const params = this.web3.eth.abi.decodeParameters( ['uint256', 'uint256', 'uint256', 'uint256'], events[i].data ) order.serviceId = parseInt(params[1]) + order.amount = this.web3.utils.fromWei(params[0]) order.did = didPrefixed(didNoZeroX(order.dtAddress)) const service = await this.getServiceByIndex(order.did, order.serviceId) order.serviceType = service.type