# Path: jmbase/jmbase/support.py
# def get_log():
#     """
#     provides joinmarket logging instance
#     :return: log instance
#     """
#     return log
# 
# def bintohex(b):
#     """Convert bytes to a hex string"""
#     return binascii.hexlify(b).decode('utf8')
# 
# def hextobin(h):
#     """Convert a hex string to bytes"""
#     return binascii.unhexlify(h.encode('utf8'))
# 
# def utxo_to_utxostr(u):
#     if not isinstance(u, tuple):
#         return (False, "utxo is not a tuple.")
#     if not len(u) == 2:
#         return (False, "utxo should have two elements.")
#     if not isinstance(u[0], bytes):
#         return (False, "txid should be bytes.")
#     if not isinstance(u[1], int):
#         return (False, "index should be int.")
#     if u[1] < 0:
#         return (False, "index must be a positive integer.")
#     if not len(u[0]) == 32:
#         return (False, "txid must be 32 bytes.")
#     txid = binascii.hexlify(u[0]).decode("ascii")
#     return (True, txid + ":" + str(u[1]))


import os
import jmbitcoin as btc
from twisted.application.service import Service
from twisted.internet import task
from jmclient.configure import jm_single
from jmbase import (get_log, utxo_to_utxostr,
                    hextobin, bintohex)
#! /usr/bin/env python


jlog = get_log()

class SNICKERError(Exception):
    pass

class SNICKERReceiverService(Service):
    def __init__(self, receiver):
        assert isinstance(receiver, SNICKERReceiver)

# Path: jmbase/jmbase/support.py
# def get_log():
#     """
#     provides joinmarket logging instance
#     :return: log instance
#     """
#     return log
# 
# def bintohex(b):
#     """Convert bytes to a hex string"""
#     return binascii.hexlify(b).decode('utf8')
# 
# def hextobin(h):
#     """Convert a hex string to bytes"""
#     return binascii.unhexlify(h.encode('utf8'))
# 
# def utxo_to_utxostr(u):
#     if not isinstance(u, tuple):
#         return (False, "utxo is not a tuple.")
#     if not len(u) == 2:
#         return (False, "utxo should have two elements.")
#     if not isinstance(u[0], bytes):
#         return (False, "txid should be bytes.")
#     if not isinstance(u[1], int):
#         return (False, "index should be int.")
#     if u[1] < 0:
#         return (False, "index must be a positive integer.")
#     if not len(u[0]) == 32:
#         return (False, "txid must be 32 bytes.")
#     txid = binascii.hexlify(u[0]).decode("ascii")
#     return (True, txid + ":" + str(u[1]))


# Path: jmclient/jmclient/snicker_receiver.py
import os
import jmbitcoin as btc
from twisted.application.service import Service
from twisted.internet import task
from jmclient.configure import jm_single
from jmbase import (get_log, utxo_to_utxostr,
                    hextobin, bintohex)

#! /usr/bin/env python


jlog = get_log()

class SNICKERError(Exception):
    pass

class SNICKERReceiverService(Service):
    def __init__(self, receiver):
        assert isinstance(receiver, SNICKERReceiver)

        self.receiver = receiver