def onClick_btnCreateNewAddress(): support.printD('wallet01_support.onClick_btnCreateNewAddress') newAddress = GeneChainCoin.getnewaddress() support.printD(newAddress) GeneChainCoin.grant(newAddress, "receive,send") w.lstSendGeneChainCoinAddress.insert(END, newAddress) w.lstSendGeneChainCoinAddress.selection_clear(0, END) sys.stdout.flush()
def onBtn1Rls_lstSendGeneChainCoinAddress(p1): support.printD('wallet01_support.onBtn1Rls_lstSendGeneChainCoinAddress') i = w.lstSendGeneChainCoinAddress.curselection() #print(i) curaddress = w.lstSendGeneChainCoinAddress.get(i) support.printD(curaddress) balances = GeneChainCoin.getmultibalances("*", "GCC") try: print(balances[curaddress][0]['qty']) dataBalance.set(balances[curaddress][0]['qty']) except: dataBalance.set('- No Wallet -') sys.stdout.flush()
def onClick_btnCreateWallet(): support.printD('wallet01_support.onClick_btnCreateWallet') i = w.lstSendGeneChainCoinAddress.curselection() #print(i) curaddress = w.lstSendGeneChainCoinAddress.get(i) support.printD(curaddress) support.printD(GeneChainCoin.grant(curaddress, "receive,send")) support.printD(GeneChainCoin.sendasset(curaddress, "GCC", 0)) sys.stdout.flush()
def getGccMiners(): support.printD("wallet01_support.getGccMiner") # load Data from the GeneChain global GeneChainCoin print(GeneChainCoin.listaddresses()) print(GeneChainCoin.listpermissions('issue')) addressesAll = GeneChainCoin.listaddresses() addressesIssue = GeneChainCoin.listpermissions('issue') gccMiners = [] for a in addressesIssue: if any(d['address'] == a["address"] for d in addressesAll): gccMiners.append(a["address"]) print(a) print(gccMiners) if len(gccMiners) != 1: support.printD("Attenzione ! l'elenco dei miners non è pari ad 1.") return gccMiners
def onClick_btnUpdateBalance(): print('wallet01_support.onClick_btnUpdateBalance') #GeneChainCoin = support.getApiCoin("pippo") #GeneChainCoin.subscribe("GCC") support.printD(GeneChainCoin.listwallettransactions(1)) support.printD(GeneChainCoin.listassettransactions("GCC")) support.printD("---------------") for t in GeneChainCoin.listassettransactions("GCC"): support.printD(t) lstSendGeneChainCoinAddress_load(curAddress) sys.stdout.flush()
def lstSendGeneChainCoinAddress_load(curAddress): support.printD("wallet01_support.lstSendGeneChainCoinAddress_load") # load Data from the GeneChain global GeneChainCoin addressesAll = GeneChainCoin.listaddresses() print(addressesAll) w.lstSendGeneChainCoinAddress.delete(0, END) for a in addressesAll: if curAddress == a["address"]: w.lstSendGeneChainCoinAddress.insert( END, a["address"] + "* Your Current Address") else: w.lstSendGeneChainCoinAddress.insert(END, a["address"]) w.lstSendGeneChainCoinAddress.selection_clear(0, END) print(GeneChainCoin.listpermissions("GCC.*")) print(GeneChainCoin.getmultibalances("*", "GCC")) balances = GeneChainCoin.getmultibalances("*", "GCC") print(balances['total'][0]['qty']) dataBalance.set(balances['total'][0]['qty']) gccMiner = getGccMiners()[0] print(gccMiner)
def onClick_btnChargeWallet(): support.printD('wallet01_support.onClick_ChargeWallet') i = w.lstSendGeneChainCoinAddress.curselection() support.printD(i) try: curaddress = w.lstSendGeneChainCoinAddress.get(i) support.printD(curaddress) qty = float(dataChargeWallet.get()) gccMiner = getGccMiners()[0] support.printD("gccminer") support.printD(gccMiner) result = tkMessageBox.askokcancel( "Your Sure ?", "You, really want to charge '" + dataChargeWallet.get() + "' GCC on address " + curaddress + " wallet ?") if result: support.printD(GeneChainCoin.grant(curaddress, "receive,send")) support.printD(GeneChainCoin.sendasset(curaddress, "GCC", qty)) lstSendGeneChainCoinAddress_load(curAddress) except: support.printD("Any row currently selected") sys.stdout.flush()
def onClick_btnSendGeneChainCoin(): support.printD('wallet01_support.onClick_btnSendGeneChainCoin') i = w.lstSendGeneChainCoinAddress.curselection() support.printD(i) curaddress = w.lstSendGeneChainCoinAddress.get(i) support.printD(curaddress) qty = float(dataSendGeneChainCoin.get()) gccMiner = getGccMiners()[0] support.printD("gccminer") support.printD(gccMiner) result = tkMessageBox.askokcancel( "Your Sure ?", "You, " + gccMiner + " Address really want to transfer '" + dataSendGeneChainCoin.get() + "' GCC on address " + curaddress + " ?") if result: support.printD(GeneChainCoin.sendasset(curaddress, "GCC", qty)) lstSendGeneChainCoinAddress_load(curAddress) sys.stdout.flush()