Added response codes to v2
This commit is contained in:
parent
188b64f347
commit
e4dd64f7a1
@ -150,6 +150,17 @@ def fetchContractStructure(contractName, contractAddress):
|
|||||||
contractStructure['exitconditions'] = conditionDict
|
contractStructure['exitconditions'] = conditionDict
|
||||||
del counter, conditionDict, c
|
del counter, conditionDict, c
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
|
if 'contractAmount' in contractStructure:
|
||||||
|
contractStructure['contractAmount'] = float(contractStructure['contractAmount'])
|
||||||
|
if 'payeeAddress' in contractStructure:
|
||||||
|
contractStructure['payeeAddress'] = json.loads(contractStructure['payeeAddress'])
|
||||||
|
if 'maximumsubscriptionamount' in contractStructure:
|
||||||
|
contractStructure['maximumsubscriptionamount'] = float(contractStructure['maximumsubscriptionamount'])
|
||||||
|
if 'minimumsubscriptionamount' in contractStructure:
|
||||||
|
contractStructure['minimumsubscriptionamount'] = float(contractStructure['minimumsubscriptionamount'])
|
||||||
|
if 'price' in contractStructure:
|
||||||
|
contractStructure['price'] = float(contractStructure['price'])
|
||||||
return contractStructure
|
return contractStructure
|
||||||
else:
|
else:
|
||||||
return 0
|
return 0
|
||||||
@ -207,22 +218,20 @@ async def info():
|
|||||||
validatedTransactionCount = c.execute('select count(distinct transactionHash) from latestTransactions').fetchall()[0][0]
|
validatedTransactionCount = c.execute('select count(distinct transactionHash) from latestTransactions').fetchall()[0][0]
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
return jsonify(systemAddressCount=tokenAddressCount, systemBlockCount=validatedBlockCount, systemTransactionCount=validatedTransactionCount, systemSmartContractCount=contractCount, systemTokenCount=tokenCount, lastscannedblock=lastscannedblock, result='ok')
|
return jsonify(systemAddressCount=tokenAddressCount, systemBlockCount=validatedBlockCount, systemTransactionCount=validatedTransactionCount, systemSmartContractCount=contractCount, systemTokenCount=tokenCount, lastscannedblock=lastscannedblock), 200
|
||||||
|
|
||||||
|
|
||||||
# FLO TOKEN APIs
|
|
||||||
@app.route('/api/v1.0/broadcastTx/<raw_transaction_hash>')
|
@app.route('/api/v1.0/broadcastTx/<raw_transaction_hash>')
|
||||||
async def broadcastTx(raw_transaction_hash):
|
async def broadcastTx(raw_transaction_hash):
|
||||||
p1 = subprocess.run(['flo-cli',f"-datadir={FLO_DATA_DIR}",'sendrawtransaction',raw_transaction_hash], capture_output=True)
|
p1 = subprocess.run(['flo-cli',f"-datadir={FLO_DATA_DIR}",'sendrawtransaction',raw_transaction_hash], capture_output=True)
|
||||||
return jsonify(args=p1.args,returncode=p1.returncode,stdout=p1.stdout.decode(),stderr=p1.stderr.decode())
|
return jsonify(args=p1.args,returncode=p1.returncode,stdout=p1.stdout.decode(),stderr=p1.stderr.decode())
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v2/broadcastTx/<raw_transaction_hash>')
|
@app.route('/api/v2/broadcastTx/<raw_transaction_hash>')
|
||||||
async def broadcastTx_v2(raw_transaction_hash):
|
async def broadcastTx_v2(raw_transaction_hash):
|
||||||
p1 = subprocess.run(['flo-cli',f"-datadir={FLO_DATA_DIR}",'sendrawtransaction',raw_transaction_hash], capture_output=True)
|
p1 = subprocess.run(['flo-cli',f"-datadir={FLO_DATA_DIR}",'sendrawtransaction',raw_transaction_hash], capture_output=True)
|
||||||
return jsonify(args=p1.args,returncode=p1.returncode,stdout=p1.stdout.decode(),stderr=p1.stderr.decode())
|
return jsonify(args=p1.args,returncode=p1.returncode,stdout=p1.stdout.decode(),stderr=p1.stderr.decode()), 200
|
||||||
|
|
||||||
|
|
||||||
|
# FLO TOKEN APIs
|
||||||
@app.route('/api/v1.0/getTokenList', methods=['GET'])
|
@app.route('/api/v1.0/getTokenList', methods=['GET'])
|
||||||
async def getTokenList():
|
async def getTokenList():
|
||||||
filelist = []
|
filelist = []
|
||||||
@ -240,7 +249,7 @@ async def tokenList():
|
|||||||
if os.path.isfile(os.path.join(dbfolder, 'tokens', item)):
|
if os.path.isfile(os.path.join(dbfolder, 'tokens', item)):
|
||||||
filelist.append(item[:-3])
|
filelist.append(item[:-3])
|
||||||
|
|
||||||
return jsonify(tokens=filelist, result='ok')
|
return jsonify(tokens=filelist), 200
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v1.0/getTokenInfo', methods=['GET'])
|
@app.route('/api/v1.0/getTokenInfo', methods=['GET'])
|
||||||
@ -282,19 +291,17 @@ async def getTokenInfo():
|
|||||||
activeAddress_no=numberOf_distinctAddresses, totalTransactions=numberOf_transactions, associatedSmartContracts=associatedContractList)
|
activeAddress_no=numberOf_distinctAddresses, totalTransactions=numberOf_transactions, associatedSmartContracts=associatedContractList)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v2/tokenInfo', methods=['GET'])
|
@app.route('/api/v2/tokenInfo/<token>', methods=['GET'])
|
||||||
async def tokenInfo():
|
async def tokenInfo(token):
|
||||||
token = request.args.get('token')
|
|
||||||
|
|
||||||
if token is None:
|
if token is None:
|
||||||
return jsonify(result='error', description='token name hasnt been passed')
|
return jsonify(description='token name hasnt been passed'), 400
|
||||||
|
|
||||||
dblocation = dbfolder + '/tokens/' + str(token) + '.db'
|
dblocation = dbfolder + '/tokens/' + str(token) + '.db'
|
||||||
if os.path.exists(dblocation):
|
if os.path.exists(dblocation):
|
||||||
conn = sqlite3.connect(dblocation)
|
conn = sqlite3.connect(dblocation)
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
else:
|
else:
|
||||||
return jsonify(result='error', description='token doesn\'t exist')
|
return jsonify(description='token doesn\'t exist'), 404
|
||||||
c.execute('SELECT * FROM transactionHistory WHERE id=1')
|
c.execute('SELECT * FROM transactionHistory WHERE id=1')
|
||||||
incorporationRow = c.fetchall()[0]
|
incorporationRow = c.fetchall()[0]
|
||||||
c.execute('SELECT COUNT (DISTINCT address) FROM activeTable')
|
c.execute('SELECT COUNT (DISTINCT address) FROM activeTable')
|
||||||
@ -316,9 +323,7 @@ async def tokenInfo():
|
|||||||
tempdict['transactionHash'] = item[4]
|
tempdict['transactionHash'] = item[4]
|
||||||
associatedContractList.append(tempdict)
|
associatedContractList.append(tempdict)
|
||||||
|
|
||||||
return jsonify(result='ok', token=token, incorporationAddress=incorporationRow[1], tokenSupply=incorporationRow[3],
|
return jsonify(token=token, incorporationAddress=incorporationRow[1], tokenSupply=incorporationRow[3], time=incorporationRow[6], blockchainReference=incorporationRow[7], activeAddress_no=numberOf_distinctAddresses, totalTransactions=numberOf_transactions, associatedSmartContracts=associatedContractList), 200
|
||||||
time=incorporationRow[6], blockchainReference=incorporationRow[7],
|
|
||||||
activeAddress_no=numberOf_distinctAddresses, totalTransactions=numberOf_transactions, associatedSmartContracts=associatedContractList)
|
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v1.0/getTokenTransactions', methods=['GET'])
|
@app.route('/api/v1.0/getTokenTransactions', methods=['GET'])
|
||||||
@ -373,23 +378,22 @@ async def getTokenTransactions():
|
|||||||
return jsonify(result='ok', token=token, transactions=rowarray_list)
|
return jsonify(result='ok', token=token, transactions=rowarray_list)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v2/tokenTransactions', methods=['GET'])
|
@app.route('/api/v2/tokenTransactions/<token>', methods=['GET'])
|
||||||
async def tokenTransactions():
|
async def tokenTransactions(token):
|
||||||
token = request.args.get('token')
|
if token is None:
|
||||||
|
return jsonify(description='token name hasnt been passed'), 400
|
||||||
|
|
||||||
senderFloAddress = request.args.get('senderFloAddress')
|
senderFloAddress = request.args.get('senderFloAddress')
|
||||||
destFloAddress = request.args.get('destFloAddress')
|
destFloAddress = request.args.get('destFloAddress')
|
||||||
limit = request.args.get('limit')
|
limit = request.args.get('limit')
|
||||||
|
|
||||||
if token is None:
|
|
||||||
return jsonify(result='error', description='token name hasnt been passed')
|
|
||||||
|
|
||||||
dblocation = dbfolder + '/tokens/' + str(token) + '.db'
|
dblocation = dbfolder + '/tokens/' + str(token) + '.db'
|
||||||
if os.path.exists(dblocation):
|
if os.path.exists(dblocation):
|
||||||
conn = sqlite3.connect(dblocation)
|
conn = sqlite3.connect(dblocation)
|
||||||
conn.row_factory = sqlite3.Row
|
conn.row_factory = sqlite3.Row
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
else:
|
else:
|
||||||
return jsonify(result='error', description='token doesn\'t exist')
|
return jsonify(description='token doesn\'t exist'), 404
|
||||||
|
|
||||||
if senderFloAddress and not destFloAddress:
|
if senderFloAddress and not destFloAddress:
|
||||||
if limit is None:
|
if limit is None:
|
||||||
@ -409,11 +413,9 @@ async def tokenTransactions():
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
if limit is None:
|
if limit is None:
|
||||||
c.execute(
|
c.execute('SELECT jsonData, parsedFloData FROM transactionHistory ORDER BY id DESC LIMIT 100')
|
||||||
'SELECT jsonData, parsedFloData FROM transactionHistory ORDER BY id DESC LIMIT 100')
|
|
||||||
else:
|
else:
|
||||||
c.execute(
|
c.execute('SELECT jsonData, parsedFloData FROM transactionHistory ORDER BY id DESC LIMIT {}'.format(limit))
|
||||||
'SELECT jsonData, parsedFloData FROM transactionHistory ORDER BY id DESC LIMIT {}'.format(limit))
|
|
||||||
transactionJsonData = c.fetchall()
|
transactionJsonData = c.fetchall()
|
||||||
conn.close()
|
conn.close()
|
||||||
rowarray_list = {}
|
rowarray_list = {}
|
||||||
@ -422,7 +424,7 @@ async def tokenTransactions():
|
|||||||
temp['transactionDetails'] = json.loads(row[0])
|
temp['transactionDetails'] = json.loads(row[0])
|
||||||
temp['parsedFloData'] = json.loads(row[1])
|
temp['parsedFloData'] = json.loads(row[1])
|
||||||
rowarray_list[temp['transactionDetails']['txid']] = temp
|
rowarray_list[temp['transactionDetails']['txid']] = temp
|
||||||
return jsonify(result='ok', token=token, transactions=rowarray_list)
|
return jsonify(token=token, transactions=rowarray_list), 200
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v1.0/getTokenBalances', methods=['GET'])
|
@app.route('/api/v1.0/getTokenBalances', methods=['GET'])
|
||||||
@ -449,37 +451,33 @@ async def getTokenBalances():
|
|||||||
return jsonify(result='ok', token=token, balances=returnList)
|
return jsonify(result='ok', token=token, balances=returnList)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v2/tokenBalances', methods=['GET'])
|
@app.route('/api/v2/tokenBalances/<token>', methods=['GET'])
|
||||||
async def tokenBalances():
|
async def tokenBalances(token):
|
||||||
token = request.args.get('token')
|
|
||||||
if token is None:
|
if token is None:
|
||||||
return jsonify(result='error', description='token name hasnt been passed')
|
return jsonify(description='token name hasnt been passed'), 400
|
||||||
|
|
||||||
dblocation = dbfolder + '/tokens/' + str(token) + '.db'
|
dblocation = dbfolder + '/tokens/' + str(token) + '.db'
|
||||||
if os.path.exists(dblocation):
|
if os.path.exists(dblocation):
|
||||||
conn = sqlite3.connect(dblocation)
|
conn = sqlite3.connect(dblocation)
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
else:
|
else:
|
||||||
return jsonify(result='error', description='token doesn\'t exist')
|
return jsonify(description='token doesn\'t exist'), 404
|
||||||
c.execute(
|
c.execute('SELECT address,SUM(transferBalance) FROM activeTable GROUP BY address')
|
||||||
'SELECT address,SUM(transferBalance) FROM activeTable GROUP BY address')
|
|
||||||
addressBalances = c.fetchall()
|
addressBalances = c.fetchall()
|
||||||
|
|
||||||
returnList = {}
|
returnList = {}
|
||||||
|
|
||||||
for address in addressBalances:
|
for address in addressBalances:
|
||||||
returnList[address[0]] = address[1]
|
returnList[address[0]] = address[1]
|
||||||
|
|
||||||
return jsonify(result='ok', token=token, balances=returnList)
|
return jsonify(token=token, balances=returnList), 200
|
||||||
|
|
||||||
|
|
||||||
# FLO address APIs
|
# FLO Address APIs
|
||||||
@app.route('/api/v1.0/getFloAddressInfo', methods=['GET'])
|
@app.route('/api/v1.0/getFloAddressInfo', methods=['GET'])
|
||||||
async def getFloAddressInfo():
|
async def getFloAddressInfo():
|
||||||
floAddress = request.args.get('floAddress')
|
floAddress = request.args.get('floAddress')
|
||||||
|
|
||||||
if floAddress is None:
|
if floAddress is None:
|
||||||
return jsonify(result='error', description='floAddress hasn\'t been passed')
|
return jsonify(description='floAddress hasn\'t been passed'), 400
|
||||||
|
|
||||||
dblocation = dbfolder + '/system.db'
|
dblocation = dbfolder + '/system.db'
|
||||||
if os.path.exists(dblocation):
|
if os.path.exists(dblocation):
|
||||||
@ -534,28 +532,22 @@ async def getFloAddressInfo():
|
|||||||
incorporatedSmartContracts=None)
|
incorporatedSmartContracts=None)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v2/floAddressInfo', methods=['GET'])
|
@app.route('/api/v2/floAddressInfo/<floAddress>', methods=['GET'])
|
||||||
async def floAddressInfo():
|
async def floAddressInfo(floAddress):
|
||||||
floAddress = request.args.get('floAddress')
|
|
||||||
|
|
||||||
if floAddress is None:
|
if floAddress is None:
|
||||||
return jsonify(result='error', description='floAddress hasn\'t been passed')
|
return jsonify(description='floAddress hasn\'t been passed'), 400
|
||||||
|
|
||||||
dblocation = dbfolder + '/system.db'
|
dblocation = dbfolder + '/system.db'
|
||||||
if os.path.exists(dblocation):
|
if os.path.exists(dblocation):
|
||||||
conn = sqlite3.connect(dblocation)
|
conn = sqlite3.connect(dblocation)
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
c.execute(
|
c.execute(f'SELECT token FROM tokenAddressMapping WHERE tokenAddress="{floAddress}"')
|
||||||
'select token from tokenAddressMapping where tokenAddress="{}"'.format(floAddress))
|
|
||||||
tokenNames = c.fetchall()
|
tokenNames = c.fetchall()
|
||||||
|
c.execute(f"SELECT contractName, status, tokenIdentification, contractType, transactionHash, blockNumber, blockHash FROM activecontracts WHERE contractAddress='{floAddress}'")
|
||||||
c.execute(
|
|
||||||
f"select contractName, status, tokenIdentification, contractType, transactionHash, blockNumber, blockHash from activecontracts where contractAddress='{floAddress}'")
|
|
||||||
incorporatedContracts = c.fetchall()
|
incorporatedContracts = c.fetchall()
|
||||||
|
|
||||||
if len(tokenNames) != 0:
|
if len(tokenNames) != 0:
|
||||||
detailList = {}
|
detailList = {}
|
||||||
|
|
||||||
for token in tokenNames:
|
for token in tokenNames:
|
||||||
token = token[0]
|
token = token[0]
|
||||||
dblocation = dbfolder + '/tokens/' + str(token) + '.db'
|
dblocation = dbfolder + '/tokens/' + str(token) + '.db'
|
||||||
@ -563,16 +555,14 @@ async def floAddressInfo():
|
|||||||
tempdict = {}
|
tempdict = {}
|
||||||
conn = sqlite3.connect(dblocation)
|
conn = sqlite3.connect(dblocation)
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
c.execute(
|
c.execute(f'SELECT SUM(transferBalance) FROM activeTable WHERE address="{floAddress}"')
|
||||||
'SELECT SUM(transferBalance) FROM activeTable WHERE address="{}"'.format(floAddress))
|
|
||||||
balance = c.fetchall()[0][0]
|
balance = c.fetchall()[0][0]
|
||||||
tempdict['balance'] = balance
|
tempdict['balance'] = balance
|
||||||
tempdict['token'] = token
|
tempdict['token'] = token
|
||||||
detailList[token] = tempdict
|
detailList[token] = tempdict
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Address is not associated with any token
|
# Address is not associated with any token
|
||||||
return jsonify(result='error', description='FLO address is not associated with any tokens')
|
return jsonify(description='FLO address is not associated with any tokens'), 404
|
||||||
|
|
||||||
if len(incorporatedContracts) != 0:
|
if len(incorporatedContracts) != 0:
|
||||||
incorporatedSmartContracts = []
|
incorporatedSmartContracts = []
|
||||||
@ -587,11 +577,9 @@ async def floAddressInfo():
|
|||||||
tempdict['blockNumber'] = contract[5]
|
tempdict['blockNumber'] = contract[5]
|
||||||
tempdict['blockHash'] = contract[6]
|
tempdict['blockHash'] = contract[6]
|
||||||
incorporatedSmartContracts.append(tempdict)
|
incorporatedSmartContracts.append(tempdict)
|
||||||
|
|
||||||
return jsonify(result='ok', floAddress=floAddress, floAddressBalances=detailList, incorporatedSmartContracts=incorporatedContracts)
|
|
||||||
else:
|
else:
|
||||||
return jsonify(result='ok', floAddress=floAddress, floAddressBalances=detailList,
|
incorporatedContracts=None
|
||||||
incorporatedSmartContracts=None)
|
return jsonify(floAddress=floAddress, floAddressBalances=detailList, incorporatedSmartContracts=None), 200
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v1.0/getFloAddressBalance', methods=['GET'])
|
@app.route('/api/v1.0/getFloAddressBalance', methods=['GET'])
|
||||||
@ -647,26 +635,22 @@ async def getAddressBalance():
|
|||||||
return jsonify(result='ok', token=token, floAddress=floAddress, balance=balance)
|
return jsonify(result='ok', token=token, floAddress=floAddress, balance=balance)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v2/floAddressBalance', methods=['GET'])
|
@app.route('/api/v2/floAddressBalance/<floAddress>', methods=['GET'])
|
||||||
async def floAddressBalance():
|
async def floAddressBalance(floAddress):
|
||||||
floAddress = request.args.get('floAddress')
|
|
||||||
token = request.args.get('token')
|
|
||||||
|
|
||||||
if floAddress is None:
|
if floAddress is None:
|
||||||
return jsonify(result='error', description='floAddress hasn\'t been passed')
|
return jsonify(description='floAddress hasn\'t been passed'), 400
|
||||||
|
|
||||||
|
token = request.args.get('token')
|
||||||
if token is None:
|
if token is None:
|
||||||
dblocation = dbfolder + '/system.db'
|
dblocation = dbfolder + '/system.db'
|
||||||
if os.path.exists(dblocation):
|
if os.path.exists(dblocation):
|
||||||
conn = sqlite3.connect(dblocation)
|
conn = sqlite3.connect(dblocation)
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
c.execute(
|
c.execute(f'SELECT token FROM tokenAddressMapping WHERE tokenAddress="{floAddress}"')
|
||||||
'select token from tokenAddressMapping where tokenAddress="{}"'.format(floAddress))
|
|
||||||
tokenNames = c.fetchall()
|
tokenNames = c.fetchall()
|
||||||
|
|
||||||
if len(tokenNames) != 0:
|
if len(tokenNames) != 0:
|
||||||
detailList = {}
|
detailList = {}
|
||||||
|
|
||||||
for token in tokenNames:
|
for token in tokenNames:
|
||||||
token = token[0]
|
token = token[0]
|
||||||
dblocation = dbfolder + '/tokens/' + str(token) + '.db'
|
dblocation = dbfolder + '/tokens/' + str(token) + '.db'
|
||||||
@ -674,30 +658,26 @@ async def floAddressBalance():
|
|||||||
tempdict = {}
|
tempdict = {}
|
||||||
conn = sqlite3.connect(dblocation)
|
conn = sqlite3.connect(dblocation)
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
c.execute(
|
c.execute(f'SELECT SUM(transferBalance) FROM activeTable WHERE address="{floAddress}"')
|
||||||
'SELECT SUM(transferBalance) FROM activeTable WHERE address="{}"'.format(floAddress))
|
|
||||||
balance = c.fetchall()[0][0]
|
balance = c.fetchall()[0][0]
|
||||||
tempdict['balance'] = balance
|
tempdict['balance'] = balance
|
||||||
tempdict['token'] = token
|
tempdict['token'] = token
|
||||||
detailList[token] = tempdict
|
detailList[token] = tempdict
|
||||||
|
return jsonify(floAddress=floAddress, floAddressBalances=detailList), 200
|
||||||
return jsonify(result='ok', floAddress=floAddress, floAddressBalances=detailList)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Address is not associated with any token
|
# Address is not associated with any token
|
||||||
return jsonify(result='error', description='FLO address is not associated with any tokens')
|
return jsonify(floAddress=floAddress, floAddressBalances={}), 200
|
||||||
else:
|
else:
|
||||||
dblocation = dbfolder + '/tokens/' + str(token) + '.db'
|
dblocation = dbfolder + '/tokens/' + str(token) + '.db'
|
||||||
if os.path.exists(dblocation):
|
if os.path.exists(dblocation):
|
||||||
conn = sqlite3.connect(dblocation)
|
conn = sqlite3.connect(dblocation)
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
else:
|
else:
|
||||||
return jsonify(result='error', description='token doesn\'t exist')
|
return jsonify(description="token doesn't exist"), 404
|
||||||
c.execute(
|
c.execute(f'SELECT SUM(transferBalance) FROM activeTable WHERE address="{floAddress}"')
|
||||||
'SELECT SUM(transferBalance) FROM activeTable WHERE address="{}"'.format(floAddress))
|
|
||||||
balance = c.fetchall()[0][0]
|
balance = c.fetchall()[0][0]
|
||||||
conn.close()
|
conn.close()
|
||||||
return jsonify(result='ok', token=token, floAddress=floAddress, balance=balance)
|
return jsonify(token=token, floAddress=floAddress, balance=balance), 200
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v1.0/getFloAddressTransactions', methods=['GET'])
|
@app.route('/api/v1.0/getFloAddressTransactions', methods=['GET'])
|
||||||
@ -757,15 +737,13 @@ async def getFloAddressTransactions():
|
|||||||
return jsonify(result='error', description='No token transactions present present on this address')
|
return jsonify(result='error', description='No token transactions present present on this address')
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v2/floAddressTransactions', methods=['GET'])
|
@app.route('/api/v2/floAddressTransactions/<floAddress>', methods=['GET'])
|
||||||
async def floAddressTransactions():
|
async def floAddressTransactions(floAddress):
|
||||||
floAddress = request.args.get('floAddress')
|
if floAddress is None:
|
||||||
|
return jsonify(description='floAddress has not been passed'), 400
|
||||||
|
|
||||||
token = request.args.get('token')
|
token = request.args.get('token')
|
||||||
limit = request.args.get('limit')
|
limit = request.args.get('limit')
|
||||||
|
|
||||||
if floAddress is None:
|
|
||||||
return jsonify(result='error', description='floAddress has not been passed')
|
|
||||||
|
|
||||||
if token is None:
|
if token is None:
|
||||||
dblocation = dbfolder + '/system.db'
|
dblocation = dbfolder + '/system.db'
|
||||||
if os.path.exists(dblocation):
|
if os.path.exists(dblocation):
|
||||||
@ -778,7 +756,7 @@ async def floAddressTransactions():
|
|||||||
if os.path.exists(dblocation):
|
if os.path.exists(dblocation):
|
||||||
tokenNames = [[str(token), ]]
|
tokenNames = [[str(token), ]]
|
||||||
else:
|
else:
|
||||||
return jsonify(result='error', description='token doesn\'t exist')
|
return jsonify(description='token doesn\'t exist'), 404
|
||||||
|
|
||||||
if len(tokenNames) != 0:
|
if len(tokenNames) != 0:
|
||||||
allTransactionList = {}
|
allTransactionList = {}
|
||||||
@ -791,11 +769,9 @@ async def floAddressTransactions():
|
|||||||
conn = sqlite3.connect(dblocation)
|
conn = sqlite3.connect(dblocation)
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
if limit is None:
|
if limit is None:
|
||||||
c.execute('SELECT jsonData, parsedFloData FROM transactionHistory WHERE sourceFloAddress="{}" OR destFloAddress="{}" ORDER BY id DESC LIMIT 100'.format(
|
c.execute(f'SELECT jsonData, parsedFloData FROM transactionHistory WHERE sourceFloAddress="{floAddress}" OR destFloAddress="{floAddress}" ORDER BY id DESC LIMIT 100')
|
||||||
floAddress, floAddress))
|
|
||||||
else:
|
else:
|
||||||
c.execute('SELECT jsonData, parsedFloData FROM transactionHistory WHERE sourceFloAddress="{}" OR destFloAddress="{}" ORDER BY id DESC LIMIT {}'.format(
|
c.execute(f'SELECT jsonData, parsedFloData FROM transactionHistory WHERE sourceFloAddress="{floAddress}" OR destFloAddress="{floAddress}" ORDER BY id DESC LIMIT {limit}')
|
||||||
floAddress, floAddress, limit))
|
|
||||||
transactionJsonData = c.fetchall()
|
transactionJsonData = c.fetchall()
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
@ -803,15 +779,14 @@ async def floAddressTransactions():
|
|||||||
temp = {}
|
temp = {}
|
||||||
temp['transactionDetails'] = json.loads(row[0])
|
temp['transactionDetails'] = json.loads(row[0])
|
||||||
temp['parsedFloData'] = json.loads(row[1])
|
temp['parsedFloData'] = json.loads(row[1])
|
||||||
allTransactionList[temp['transactionDetails']
|
allTransactionList[temp['transactionDetails']['txid']] = temp
|
||||||
['txid']] = temp
|
|
||||||
|
|
||||||
if token is None:
|
if token is None:
|
||||||
return jsonify(result='ok', floAddress=floAddress, transactions=allTransactionList)
|
return jsonify(floAddress=floAddress, transactions=allTransactionList), 200
|
||||||
else:
|
else:
|
||||||
return jsonify(result='ok', floAddress=floAddress, transactions=allTransactionList, token=token)
|
return jsonify(floAddress=floAddress, transactions=allTransactionList, token=token), 200
|
||||||
else:
|
else:
|
||||||
return jsonify(result='error', description='No token transactions present present on this address')
|
return jsonify(floAddress=floAddress, transactions={}, token=token), 200
|
||||||
|
|
||||||
|
|
||||||
# SMART CONTRACT APIs
|
# SMART CONTRACT APIs
|
||||||
@ -1040,9 +1015,9 @@ async def getContractInfo_v2():
|
|||||||
contractName = request.args.get('contractName')
|
contractName = request.args.get('contractName')
|
||||||
contractAddress = request.args.get('contractAddress')
|
contractAddress = request.args.get('contractAddress')
|
||||||
if contractName is None:
|
if contractName is None:
|
||||||
return jsonify(result='error', description='Smart Contract\'s name hasn\'t been passed')
|
return jsonify(description='Smart Contract\'s name hasn\'t been passed'), 400
|
||||||
if contractAddress is None:
|
if contractAddress is None:
|
||||||
return jsonify(result='error', description='Smart Contract\'s address hasn\'t been passed')
|
return jsonify(description='Smart Contract\'s address hasn\'t been passed'), 400
|
||||||
|
|
||||||
contractName = contractName.strip()
|
contractName = contractName.strip()
|
||||||
contractAddress = contractAddress.strip()
|
contractAddress = contractAddress.strip()
|
||||||
@ -1079,9 +1054,9 @@ async def getContractInfo_v2():
|
|||||||
elif contractStructure['contractType'] == 'one-time-event' and 'payeeAddress' in contractStructure.keys():
|
elif contractStructure['contractType'] == 'one-time-event' and 'payeeAddress' in contractStructure.keys():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return jsonify(result='ok', contractName=contractName, contractAddress=contractAddress, contractInfo=returnval)
|
return jsonify(contractName=contractName, contractAddress=contractAddress, contractInfo=returnval), 200
|
||||||
else:
|
else:
|
||||||
return jsonify(result='error', details='Smart Contract with the given name doesn\'t exist')
|
return jsonify(details='Smart Contract with the given name doesn\'t exist'), 404
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v1.0/getSmartContractParticipants', methods=['GET'])
|
@app.route('/api/v1.0/getSmartContractParticipants', methods=['GET'])
|
||||||
@ -1171,9 +1146,9 @@ async def getcontractparticipants_v2():
|
|||||||
contractAddress = request.args.get('contractAddress')
|
contractAddress = request.args.get('contractAddress')
|
||||||
|
|
||||||
if contractName is None:
|
if contractName is None:
|
||||||
return jsonify(result='error', description='Smart Contract\'s name hasn\'t been passed')
|
return jsonify(description='Smart Contract\'s name hasn\'t been passed'), 400
|
||||||
if contractAddress is None:
|
if contractAddress is None:
|
||||||
return jsonify(result='error', description='Smart Contract\'s address hasn\'t been passed')
|
return jsonify(description='Smart Contract\'s address hasn\'t been passed'), 400
|
||||||
|
|
||||||
contractName = contractName.strip()
|
contractName = contractName.strip()
|
||||||
contractAddress = contractAddress.strip()
|
contractAddress = contractAddress.strip()
|
||||||
@ -1228,9 +1203,9 @@ async def getcontractparticipants_v2():
|
|||||||
}
|
}
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
return jsonify(result='ok', contractName=contractName, contractAddress=contractAddress, participantInfo=returnval)
|
return jsonify(contractName=contractName, contractAddress=contractAddress, participantInfo=returnval), 200
|
||||||
else:
|
else:
|
||||||
return jsonify(result='error', description='Smart Contract with the given name doesn\'t exist')
|
return jsonify(description='Smart Contract with the given name doesn\'t exist'), 404
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v1.0/getParticipantDetails', methods=['GET'])
|
@app.route('/api/v1.0/getParticipantDetails', methods=['GET'])
|
||||||
@ -1434,18 +1409,17 @@ async def getParticipantDetails():
|
|||||||
return jsonify(result='error', description='System error. System db is missing')
|
return jsonify(result='error', description='System error. System db is missing')
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v2/participantDetails', methods=['GET'])
|
@app.route('/api/v2/participantDetails/<floAddress>', methods=['GET'])
|
||||||
async def participantDetails():
|
async def participantDetails():
|
||||||
floAddress = request.args.get('floAddress')
|
if floAddress is None:
|
||||||
|
return jsonify(description='FLO address hasn\'t been passed'), 400
|
||||||
contractName = request.args.get('contractName')
|
contractName = request.args.get('contractName')
|
||||||
contractAddress = request.args.get('contractAddress')
|
contractAddress = request.args.get('contractAddress')
|
||||||
|
|
||||||
if floAddress is None:
|
|
||||||
return jsonify(result='error', description='FLO address hasn\'t been passed')
|
|
||||||
dblocation = os.path.join(dbfolder, 'system.db')
|
dblocation = os.path.join(dbfolder, 'system.db')
|
||||||
|
|
||||||
if (contractName and contractAddress is None) or (contractName is None and contractAddress):
|
if (contractName and contractAddress is None) or (contractName is None and contractAddress):
|
||||||
return jsonify(result='error', description='pass both, contractName and contractAddress as url parameters')
|
return jsonify(description='pass both, contractName and contractAddress as url parameters'), 400
|
||||||
|
|
||||||
#if os.path.isfile(dblocation) and os.path.isfile(contract_db):
|
#if os.path.isfile(dblocation) and os.path.isfile(contract_db):
|
||||||
if os.path.isfile(dblocation):
|
if os.path.isfile(dblocation):
|
||||||
@ -1627,12 +1601,11 @@ async def participantDetails():
|
|||||||
|
|
||||||
participationDetailsList.append(detailsDict)
|
participationDetailsList.append(detailsDict)
|
||||||
|
|
||||||
return jsonify(result='ok', floAddress=floAddress, type='participant', participatedContracts=participationDetailsList)
|
return jsonify(floAddress=floAddress, type='participant', participatedContracts=participationDetailsList), 200
|
||||||
|
|
||||||
else:
|
else:
|
||||||
return jsonify(result='error', description='Address hasn\'t participated in any other contract')
|
return jsonify(description="Address hasn't participated in any other contract"), 404
|
||||||
else:
|
else:
|
||||||
return jsonify(result='error', description='System error. System db is missing')
|
return jsonify(description='System error. System db is missing'), 404
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v1.0/getSmartContractTransactions', methods=['GET'])
|
@app.route('/api/v1.0/getSmartContractTransactions', methods=['GET'])
|
||||||
@ -1674,12 +1647,10 @@ async def getsmartcontracttransactions():
|
|||||||
async def smartcontracttransactions():
|
async def smartcontracttransactions():
|
||||||
contractName = request.args.get('contractName')
|
contractName = request.args.get('contractName')
|
||||||
contractAddress = request.args.get('contractAddress')
|
contractAddress = request.args.get('contractAddress')
|
||||||
|
|
||||||
if contractName is None:
|
if contractName is None:
|
||||||
return jsonify(result='error', description='Smart Contract\'s name hasn\'t been passed')
|
return jsonify(description='Smart Contract\'s name hasn\'t been passed'), 400
|
||||||
|
|
||||||
if contractAddress is None:
|
if contractAddress is None:
|
||||||
return jsonify(result='error', description='Smart Contract\'s address hasn\'t been passed')
|
return jsonify(description='Smart Contract\'s address hasn\'t been passed'), 400
|
||||||
|
|
||||||
contractDbName = '{}-{}.db'.format(contractName.strip(), contractAddress.strip())
|
contractDbName = '{}-{}.db'.format(contractName.strip(), contractAddress.strip())
|
||||||
filelocation = os.path.join(dbfolder, 'smartContracts', contractDbName)
|
filelocation = os.path.join(dbfolder, 'smartContracts', contractDbName)
|
||||||
@ -1699,9 +1670,9 @@ async def smartcontracttransactions():
|
|||||||
temp['parsedFloData'] = json.loads(item[1])
|
temp['parsedFloData'] = json.loads(item[1])
|
||||||
returnval[temp['transactionDetails']['txid']] = temp
|
returnval[temp['transactionDetails']['txid']] = temp
|
||||||
|
|
||||||
return jsonify(result='ok')
|
return jsonify(contractName=contractName, contractAddress=contractAddress, contractTransactions=returnval), 200
|
||||||
else:
|
else:
|
||||||
return jsonify(result='error', description='Smart Contract with the given name doesn\'t exist')
|
return jsonify(description='Smart Contract with the given name doesn\'t exist'), 404
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v1.0/getBlockDetails/<blockdetail>', methods=['GET'])
|
@app.route('/api/v1.0/getBlockDetails/<blockdetail>', methods=['GET'])
|
||||||
@ -1719,9 +1690,9 @@ async def blockdetails(blockdetail):
|
|||||||
blockJson = blockdetailhelper(blockdetail)
|
blockJson = blockdetailhelper(blockdetail)
|
||||||
if len(blockJson) != 0:
|
if len(blockJson) != 0:
|
||||||
blockJson = json.loads(blockJson[0][0])
|
blockJson = json.loads(blockJson[0][0])
|
||||||
return jsonify(result='ok', blockDetails=blockJson)
|
return jsonify(blockDetails=blockJson), 200
|
||||||
else:
|
else:
|
||||||
return jsonify(result='error', description='Block doesn\'t exist in database')
|
return jsonify(description='Block doesn\'t exist in database'), 404
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v1.0/getTransactionDetails/<transactionHash>', methods=['GET'])
|
@app.route('/api/v1.0/getTransactionDetails/<transactionHash>', methods=['GET'])
|
||||||
@ -1811,9 +1782,9 @@ async def transactiondetails1(transactionHash):
|
|||||||
if winningAmount[0][0] is not None:
|
if winningAmount[0][0] is not None:
|
||||||
operationDetails['winningAmount'] = winningAmount[0][0]
|
operationDetails['winningAmount'] = winningAmount[0][0]
|
||||||
|
|
||||||
return jsonify(parsedFloData=parseResult, transactionDetails=transactionJson, transactionHash=transactionHash, operation=operation, operationDetails=operationDetails, result='ok')
|
return jsonify(parsedFloData=parseResult, transactionDetails=transactionJson, transactionHash=transactionHash, operation=operation, operationDetails=operationDetails), 200
|
||||||
else:
|
else:
|
||||||
return jsonify(result='error', description='Transaction doesn\'t exist in database')
|
return jsonify(description='Transaction doesn\'t exist in database'), 404
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v1.0/getLatestTransactionDetails', methods=['GET'])
|
@app.route('/api/v1.0/getLatestTransactionDetails', methods=['GET'])
|
||||||
@ -1858,7 +1829,6 @@ async def getLatestTransactionDetails():
|
|||||||
|
|
||||||
@app.route('/api/v2/latestTransactionDetails', methods=['GET'])
|
@app.route('/api/v2/latestTransactionDetails', methods=['GET'])
|
||||||
async def latestTransactionDetails():
|
async def latestTransactionDetails():
|
||||||
|
|
||||||
numberOfLatestBlocks = request.args.get('numberOfLatestBlocks')
|
numberOfLatestBlocks = request.args.get('numberOfLatestBlocks')
|
||||||
|
|
||||||
dblocation = dbfolder + '/latestCache.db'
|
dblocation = dbfolder + '/latestCache.db'
|
||||||
@ -1866,7 +1836,7 @@ async def latestTransactionDetails():
|
|||||||
conn = sqlite3.connect(dblocation)
|
conn = sqlite3.connect(dblocation)
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
else:
|
else:
|
||||||
return 'Latest transactions db doesn\'t exist. This is unusual, please report on https://github.com/ranchimall/ranchimallflo-api'
|
return jsonify(description='Latest transactions db doesn\'t exist. This is unusual, please report on https://github.com/ranchimall/ranchimallflo-api'), 500
|
||||||
|
|
||||||
if numberOfLatestBlocks is not None:
|
if numberOfLatestBlocks is not None:
|
||||||
c.execute('SELECT * FROM latestTransactions WHERE blockNumber IN (SELECT DISTINCT blockNumber FROM latestTransactions ORDER BY blockNumber DESC LIMIT {}) ORDER BY id ASC;'.format(int(numberOfLatestBlocks)))
|
c.execute('SELECT * FROM latestTransactions WHERE blockNumber IN (SELECT DISTINCT blockNumber FROM latestTransactions ORDER BY blockNumber DESC LIMIT {}) ORDER BY id ASC;'.format(int(numberOfLatestBlocks)))
|
||||||
@ -1894,7 +1864,7 @@ async def latestTransactionDetails():
|
|||||||
tx_parsed_details['parsedFloData']['transactionType'] = item[4]
|
tx_parsed_details['parsedFloData']['transactionType'] = item[4]
|
||||||
tx_parsed_details['transactionDetails']['blockheight'] = int(item[2])
|
tx_parsed_details['transactionDetails']['blockheight'] = int(item[2])
|
||||||
tempdict[json.loads(item[3])['txid']] = tx_parsed_details
|
tempdict[json.loads(item[3])['txid']] = tx_parsed_details
|
||||||
return jsonify(result='ok', latestTransactions=tempdict)
|
return jsonify(latestTransactions=tempdict), 200
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v1.0/getLatestBlockDetails', methods=['GET'])
|
@app.route('/api/v1.0/getLatestBlockDetails', methods=['GET'])
|
||||||
@ -1929,13 +1899,12 @@ async def latestBlockDetails():
|
|||||||
conn = sqlite3.connect(dblocation)
|
conn = sqlite3.connect(dblocation)
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
else:
|
else:
|
||||||
return 'Latest transactions db doesn\'t exist. This is unusual, please report on https://github.com/ranchimall/ranchimallflo-api'
|
return jsonify(description='Latest transactions db doesn\'t exist. This is unusual, please report on https://github.com/ranchimall/ranchimallflo-api'), 404
|
||||||
|
|
||||||
if limit is None:
|
if limit is None:
|
||||||
c.execute('''SELECT * FROM ( SELECT * FROM latestBlocks ORDER BY blockNumber DESC LIMIT 4) ORDER BY id ASC;''')
|
c.execute('''SELECT * FROM ( SELECT * FROM latestBlocks ORDER BY blockNumber DESC LIMIT 4) ORDER BY id ASC;''')
|
||||||
else:
|
else:
|
||||||
int(limit)
|
c.execute(f'SELECT * FROM ( SELECT * FROM latestBlocks ORDER BY blockNumber DESC LIMIT {limit}) ORDER BY id ASC;')
|
||||||
c.execute('SELECT * FROM ( SELECT * FROM latestBlocks ORDER BY blockNumber DESC LIMIT {}) ORDER BY id ASC;'.format(limit))
|
|
||||||
latestBlocks = c.fetchall()
|
latestBlocks = c.fetchall()
|
||||||
c.close()
|
c.close()
|
||||||
tempdict = {}
|
tempdict = {}
|
||||||
@ -1979,9 +1948,9 @@ async def blocktransactions(blockdetail):
|
|||||||
"parsedFloData" : parseResult,
|
"parsedFloData" : parseResult,
|
||||||
"transactionDetails" : transactionJson
|
"transactionDetails" : transactionJson
|
||||||
}
|
}
|
||||||
return jsonify(result='ok', transactions=blocktxs, blockKeyword=blockdetail)
|
return jsonify(transactions=blocktxs, blockKeyword=blockdetail), 200
|
||||||
else:
|
else:
|
||||||
return jsonify(result='error', description='Block doesn\'t exist in database')
|
return jsonify(description='Block doesn\'t exist in database'), 404
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v1.0/categoriseString/<urlstring>')
|
@app.route('/api/v1.0/categoriseString/<urlstring>')
|
||||||
@ -2021,11 +1990,11 @@ async def categoriseString_v2(urlstring):
|
|||||||
# check if the hash is of a transaction
|
# check if the hash is of a transaction
|
||||||
response = requests.get('{}tx/{}'.format(apiUrl, urlstring))
|
response = requests.get('{}tx/{}'.format(apiUrl, urlstring))
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
return jsonify(type='transaction')
|
return jsonify(type='transaction'), 200
|
||||||
else:
|
else:
|
||||||
response = requests.get('{}block/{}'.format(apiUrl, urlstring))
|
response = requests.get('{}block/{}'.format(apiUrl, urlstring))
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
return jsonify(type='block')
|
return jsonify(type='block'), 200
|
||||||
else:
|
else:
|
||||||
# check urlstring is a token name
|
# check urlstring is a token name
|
||||||
tokenfolder = os.path.join(dbfolder, 'tokens')
|
tokenfolder = os.path.join(dbfolder, 'tokens')
|
||||||
@ -2033,19 +2002,18 @@ async def categoriseString_v2(urlstring):
|
|||||||
for f in os.listdir(tokenfolder) if os.path.isfile(os.path.join(tokenfolder, f))]
|
for f in os.listdir(tokenfolder) if os.path.isfile(os.path.join(tokenfolder, f))]
|
||||||
|
|
||||||
if urlstring.lower() in onlyfiles:
|
if urlstring.lower() in onlyfiles:
|
||||||
return jsonify(type='token')
|
return jsonify(type='token'), 200
|
||||||
else:
|
else:
|
||||||
contractfolder = os.path.join(dbfolder, 'system.db')
|
contractfolder = os.path.join(dbfolder, 'system.db')
|
||||||
conn = sqlite3.connect(contractfolder)
|
conn = sqlite3.connect(contractfolder)
|
||||||
conn.row_factory = lambda cursor, row: row[0]
|
conn.row_factory = lambda cursor, row: row[0]
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
contractList = c.execute(
|
contractList = c.execute('select contractname from activeContracts').fetchall()
|
||||||
'select contractname from activeContracts').fetchall()
|
|
||||||
|
|
||||||
if urlstring.lower() in contractList:
|
if urlstring.lower() in contractList:
|
||||||
return jsonify(type='smartContract')
|
return jsonify(type='smartContract'), 200
|
||||||
else:
|
else:
|
||||||
return jsonify(type='noise')
|
return jsonify(type='noise'), 200
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/v1.0/getTokenSmartContractList', methods=['GET'])
|
@app.route('/api/v1.0/getTokenSmartContractList', methods=['GET'])
|
||||||
@ -2119,7 +2087,7 @@ async def tokenSmartContractList():
|
|||||||
|
|
||||||
contractList.append(contractDict)
|
contractList.append(contractDict)
|
||||||
|
|
||||||
return jsonify(tokens=filelist, smartContracts=contractList, result='ok')
|
return jsonify(tokens=filelist, smartContracts=contractList), 200
|
||||||
|
|
||||||
|
|
||||||
class ServerSentEvent:
|
class ServerSentEvent:
|
||||||
@ -2236,12 +2204,7 @@ async def priceData():
|
|||||||
ratepair = list(ratepair)
|
ratepair = list(ratepair)
|
||||||
prices[ratepair[0]] = ratepair[1]
|
prices[ratepair[0]] = ratepair[1]
|
||||||
|
|
||||||
return jsonify(prices=prices, result='ok')
|
return jsonify(prices=prices), 200
|
||||||
|
|
||||||
|
|
||||||
@app.route('/api/test')
|
|
||||||
async def test_msg():
|
|
||||||
return jsonify('Welcome to Ranchi Mall API')
|
|
||||||
|
|
||||||
|
|
||||||
# if system.db isn't present, initialize it
|
# if system.db isn't present, initialize it
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user