forked from OmniLayer/omniEngine
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmscutils.py
61 lines (58 loc) · 1.98 KB
/
mscutils.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
def getDivisible(rawtx):
try:
divisible=rawtx['result']['divisible']
except KeyError:
if rawtx['result']['propertytype'] == 'indivisible':
divisible=False
else:
divisible=True
return divisible
def getEcosystem(propertyid):
if propertyid == 2 or ( propertyid >= 2147483651 and propertyid <= 4294967295 ) or propertyid == "test":
return "Test"
elif propertyid == 1 or ( propertyid >= 3 and propertyid <= 2147483650) or propertyid == "main":
return "Production"
else:
return None
def getTxState(valid):
if valid:
return "valid"
else:
return "not valid"
#there is also pending, but omniEngine won't write that
def get_TxType(text_type):
try:
convert={"Simple Send": 0 ,
"Restricted Send": 2,
"Send To Owners": 3,
"Send All": 4,
"Savings": -1,
"Savings COMPROMISED": -1,
"Rate-Limiting": -1,
"Automatic Dispensary":-1,
"DEx Sell Offer": 20,
"MetaDEx: Offer/Accept one Master Protocol Coins for another": 21,
"MetaDEx: Offer/Accept one Master Protocol Tokens for another": 21,
"MetaDEx token trade": 21,
"DEx Accept Offer": 22,
"DEx Purchase": -22,
"MetaDEx trade": 25,
"MetaDEx cancel-price": 26,
"MetaDEx cancel-pair": 27,
"MetaDEx cancel-ecosystem": 28,
"Create Property - Fixed": 50,
"Create Property - Variable": 51,
"Crowdsale Purchase": -51,
"Promote Property": 52,
"Close Crowdsale": 53,
"Create Property - Manual": 54,
"Grant Property Tokens": 55,
"Revoke Property Tokens": 56,
"Change Issuer Address": 70,
"Notification": -1,
"Feature Activation": 65534,
"ALERT": 65535
}
return convert[text_type]
except KeyError:
return -1