|
|
|
@ -22,19 +22,22 @@ from tipbot.command_manager import *
|
|
|
|
|
|
|
|
|
|
last_wallet_update_time = None
|
|
|
|
|
|
|
|
|
|
def GetTipbotAddress():
|
|
|
|
|
def GetTipbotIntAddress():
|
|
|
|
|
try:
|
|
|
|
|
j = SendWalletJSONRPCCommand("getaddress",None)
|
|
|
|
|
j = SendWalletJSONRPCCommand("make_integrated_address",None)
|
|
|
|
|
if not "result" in j:
|
|
|
|
|
log_error('GetTipbotAddress: No result found in getaddress reply')
|
|
|
|
|
log_error('GetTipbotIntAddress: No result found in make_integrated_address reply')
|
|
|
|
|
return None
|
|
|
|
|
result = j["result"]
|
|
|
|
|
if not "address" in result:
|
|
|
|
|
log_error('GetTipbotAddress: No address found in getaddress reply')
|
|
|
|
|
if not "integrated_address" in result:
|
|
|
|
|
log_error('GetTipbotIntAddress: No integrated_address found in make_integrated_address reply')
|
|
|
|
|
return None
|
|
|
|
|
return result["address"]
|
|
|
|
|
if not "payment_id" in result:
|
|
|
|
|
log_error('GetTipbotIntAddress: No payment_id found in make_integrated_address reply')
|
|
|
|
|
return None
|
|
|
|
|
return result
|
|
|
|
|
except Exception,e:
|
|
|
|
|
log_error("GetTipbotAddress: Error retrieving %s's address: %s" % (config.tipbot_name, str(e)))
|
|
|
|
|
log_error("GetTipbotIntAddress: Error retrieving %s's int_address: %s" % (config.tipbot_name, str(e)))
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
def UpdateCoin(data):
|
|
|
|
@ -167,12 +170,12 @@ def RandomPaymentID(link,cmd):
|
|
|
|
|
def Help(link):
|
|
|
|
|
GetAccount(link.identity())
|
|
|
|
|
link.send_private("You can send %s to your account using this address AND payment ID:" % coinspecs.name);
|
|
|
|
|
address=GetTipbotAddress() or 'ERROR'
|
|
|
|
|
link.send_private(" Address: %s" % address)
|
|
|
|
|
result=GetTipbotIntAddress() or 'ERROR'
|
|
|
|
|
link.send_private(" Address: %s" % result["integrated_address"])
|
|
|
|
|
if config.openalias_address != None:
|
|
|
|
|
link.send_private(" (or %s when using OpenAlias)" % config.openalias_address)
|
|
|
|
|
link.send_private(" Use your primary payment ID: %s" % GetPaymentID(link))
|
|
|
|
|
link.send_private(" OR generate random payment ids at will with: !randompid")
|
|
|
|
|
SetPaymentID(link,result["payment_id"])
|
|
|
|
|
link.send_private(" Use your primary payment ID: %s" % result["payment_id"])
|
|
|
|
|
link.send_private("Incoming transactions are credited after %d confirmations" % config.payment_confirmations)
|
|
|
|
|
|
|
|
|
|
RegisterModule({
|
|
|
|
|