From d17112523dd3fdd7b21ea17e41e2d3e3d57bf447 Mon Sep 17 00:00:00 2001 From: Vivek Teega Date: Sat, 22 Apr 2023 17:44:29 +0000 Subject: [PATCH] Added accepting_token, selling_token info for token swap as part of smart contract info --- ranchimallflo_api.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ranchimallflo_api.py b/ranchimallflo_api.py index 969ebbe..58d6289 100644 --- a/ranchimallflo_api.py +++ b/ranchimallflo_api.py @@ -18,6 +18,7 @@ import atexit import pyflo from operator import itemgetter import pdb +import ast app = Quart(__name__) @@ -107,9 +108,11 @@ def smartcontract_morph_helper(smart_contracts): contractDict['contractAddress'] = contract[2] contractDict['status'] = contract[3] contractDict['contractType'] = contract[5] - if contractDict['contractType'] == 'continuous-event': + if contractDict['contractType'] in ['continuous-event', 'continuos-event']: contractDict['contractSubType'] = 'tokenswap' - accepting_selling_tokens = contract[4] + accepting_selling_tokens = ast.literal_eval(contract[4]) + contractDict['acceptingToken'] = accepting_selling_tokens[0] + contractDict['sellingToken'] = accepting_selling_tokens[1] elif contractDict['contractType'] == 'one-time-event': contractDict['tokenIdentification'] = contract[4] # pull the contract structure