forked from axiom-team/jaklis
listWallets: Show balance in G1, not cents
This commit is contained in:
parent
db39e5c77d
commit
efed7354df
|
@ -21,7 +21,7 @@ class ListWallets:
|
||||||
|
|
||||||
def sendDoc(self):
|
def sendDoc(self):
|
||||||
# Build wallets generation document
|
# Build wallets generation document
|
||||||
|
|
||||||
queryBuild = gql(
|
queryBuild = gql(
|
||||||
"""
|
"""
|
||||||
{
|
{
|
||||||
|
@ -55,14 +55,14 @@ class ListWallets:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
jsonBrut = queryResult['wallets']['edges']
|
jsonBrut = queryResult['wallets']['edges']
|
||||||
|
|
||||||
walletList = []
|
walletList = []
|
||||||
for i, trans in enumerate(jsonBrut):
|
for i, trans in enumerate(jsonBrut):
|
||||||
dataWork = trans['node']
|
dataWork = trans['node']
|
||||||
if (self.mbr and (dataWork['idty'] == None or dataWork['idty']['isMember'] == False)): continue
|
if (self.mbr and (dataWork['idty'] == None or dataWork['idty']['isMember'] == False)): continue
|
||||||
if (self.nonMbr and (dataWork['idty'] == None or dataWork['idty']['isMember'] == True)): continue
|
if (self.nonMbr and (dataWork['idty'] == None or dataWork['idty']['isMember'] == True)): continue
|
||||||
if (self.larf and (dataWork['idty'] != None)): continue
|
if (self.larf and (dataWork['idty'] != None)): continue
|
||||||
walletList.append({'pubkey': dataWork['script'],'balance': dataWork['balance']['amount'],'id': dataWork['idty']})
|
walletList.append({'pubkey': dataWork['script'],'balance': dataWork['balance']['amount']/100,'id': dataWork['idty']})
|
||||||
|
|
||||||
if (self.brut):
|
if (self.brut):
|
||||||
names = []
|
names = []
|
||||||
|
@ -71,7 +71,7 @@ class ListWallets:
|
||||||
names.append(dataWork['pubkey'] + ' ' + dataWork['id']['username'])
|
names.append(dataWork['pubkey'] + ' ' + dataWork['id']['username'])
|
||||||
else:
|
else:
|
||||||
names.append(dataWork['pubkey'])
|
names.append(dataWork['pubkey'])
|
||||||
|
|
||||||
return "\n".join(names)
|
return "\n".join(names)
|
||||||
else:
|
else:
|
||||||
return json.dumps(walletList, indent=2)
|
return json.dumps(walletList, indent=2)
|
||||||
|
|
Loading…
Reference in New Issue