PyBitmessage/src/class_namecoin.py
Daniel Kraft 19331b641a Start with namecoin connection module.
Create a still mostly empty module to encapsulate the
namecoin address query, and use it from the UI.
2013-07-05 17:29:49 +02:00

21 lines
731 B
Python

from jsonrpc import ServiceProxy, JSONRPCException
# This class handles the Namecoin identity integration.
class namecoinConnection(object):
def __init__(self):
user = "daniel"
password = "password"
host = "localhost"
port = "8336"
self.s = ServiceProxy ("http://" + user + ":" + password
+ "@" + host + ":" + port)
# Query for the bitmessage address corresponding to the given identity
# string. If it doesn't contain a slash, id/ is prepended. We return
# the result as (Error, Address) pair, where the Error is an error
# message to display or None in case of success.
def query(self,string):
return None, "BM-Foobar2"