From 2f4db790e867c850978a98bd6db4bc80618a8d62 Mon Sep 17 00:00:00 2001 From: Vivek Teega Date: Sun, 1 Sep 2019 13:34:35 +0530 Subject: [PATCH] show total number of transactions in token details --- ranchimallflo_api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ranchimallflo_api.py b/ranchimallflo_api.py index 0101802..5a1dcdd 100644 --- a/ranchimallflo_api.py +++ b/ranchimallflo_api.py @@ -48,10 +48,12 @@ async def getTokenInfo(): incorporationRow = c.fetchall()[0] c.execute('SELECT COUNT (DISTINCT address) FROM activeTable') numberOf_distinctAddresses = c.fetchall()[0][0] + c.execute('select max(id) from transactionHistory') + numberOf_transactions = c.fetchall()[0][0] conn.close() return jsonify(result='ok', token=token, incorporationAddress=incorporationRow[1], tokenSupply=incorporationRow[3], transactionHash=incorporationRow[6], blockchainReference=incorporationRow[7], - activeAddress_no=numberOf_distinctAddresses) + activeAddress_no=numberOf_distinctAddresses, totalTransactions = numberOf_transactions) @app.route('/api/v1.0/getTokenTransactions', methods=['GET'])