Adding API to get transaction details along with FLO data parsing
This commit is contained in:
parent
27414f4c45
commit
e7638aef51
@ -12,6 +12,7 @@ from typing import Optional
|
|||||||
|
|
||||||
from pybtc import verify_signature
|
from pybtc import verify_signature
|
||||||
from config import *
|
from config import *
|
||||||
|
import parsing
|
||||||
|
|
||||||
|
|
||||||
app = Quart(__name__)
|
app = Quart(__name__)
|
||||||
@ -499,6 +500,20 @@ async def getblockdetails(blockno):
|
|||||||
return jsonify(blockdetails)
|
return jsonify(blockdetails)
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/api/v1.0/getTransactionDetails/<transactionHash>', methods=['GET'])
|
||||||
|
async def gettransactiondetails(transactionHash):
|
||||||
|
transactionDetails = requests.get('https://flosight.duckdns.org/api/tx/{}'.format(transactionHash))
|
||||||
|
transactionDetails = json.loads(transactionDetails.content)
|
||||||
|
|
||||||
|
flodata = transactionDetails['floData']
|
||||||
|
|
||||||
|
blockdetails = requests.get('https://flosight.duckdns.org/api/block/{}'.format(transactionDetails['blockhash']))
|
||||||
|
blockdetails = json.loads(blockdetails.content)
|
||||||
|
|
||||||
|
parseResult = parsing.parse_flodata(flodata, blockdetails)
|
||||||
|
return jsonify(parsingDetails=parseResult, transactionDetails=transactionDetails)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/test')
|
@app.route('/test')
|
||||||
async def test():
|
async def test():
|
||||||
return render_template('test.html')
|
return render_template('test.html')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user