예제 #1
0
파일: api.py 프로젝트: hfeeki/btctxstore
    def add_inputs(self,
                   rawtx,
                   wifs,
                   change_address=None,
                   fee=10000,
                   dont_sign=False):
        """Add sufficient inputs from given <wifs> to cover <rawtx> outputs
        and <fee>. If no <change_address> is given, change will be sent to
        first wif.
        """
        tx = deserialize.tx(rawtx)
        keys = deserialize.keys(self.testnet, wifs)
        fee = deserialize.positive_integer(fee)
        if change_address is not None:
            change_address = deserialize.address(self.testnet, change_address)
        tx = control.add_inputs(self.service,
                                self.testnet,
                                tx,
                                keys,
                                change_address=change_address,
                                fee=fee)

        if not dont_sign:
            tx = control.sign_tx(self.service, self.testnet, tx, keys)

        return serialize.tx(tx)
예제 #2
0
파일: api.py 프로젝트: hfeeki/btctxstore
 def sign_tx(self, rawtx, wifs):
     """Sign <rawtx> with  given <wifs> as json data.
     <wifs>: '["privatekey_in_wif_format", ...]'
     """
     tx = deserialize.tx(rawtx)
     keys = deserialize.keys(self.testnet, wifs)
     tx = control.sign_tx(self.service, self.testnet, tx, keys)
     return serialize.tx(tx)
예제 #3
0
파일: api.py 프로젝트: StorjOld/btctxstore
 def sign_tx(self, rawtx, wifs):
     """Sign <rawtx> with  given <wifs> as json data.
     <wifs>: '["privatekey_in_wif_format", ...]'
     """
     tx = deserialize.tx(rawtx)
     keys = deserialize.keys(self.testnet, wifs)
     tx = control.sign_tx(self.service, self.testnet, tx, keys)
     return serialize.tx(tx)
예제 #4
0
파일: api.py 프로젝트: StorjOld/btctxstore
 def add_broadcast_message(self, rawtx, message, sender_wif,
                           dust_limit=common.DUST_LIMIT):
     """TODO add docstring"""
     tx = deserialize.tx(rawtx)
     message = deserialize.unicode_str(message)
     sender_key = deserialize.key(self.testnet, sender_wif)
     tx = control.add_broadcast_message(self.testnet, tx, message,
                                        sender_key, dust_limit=dust_limit)
     return serialize.tx(tx)
예제 #5
0
파일: api.py 프로젝트: xgess/btctxstore
 def add_broadcast_message(self, rawtx, message, sender_wif,
                           dust_limit=common.DUST_LIMIT):
     """TODO add docstring"""
     tx = deserialize.tx(rawtx)
     message = deserialize.unicode_str(message)
     sender_key = deserialize.key(self.testnet, sender_wif)
     tx = control.add_broadcast_message(self.testnet, tx, message,
                                        sender_key, dust_limit=dust_limit)
     return serialize.tx(tx)
예제 #6
0
파일: api.py 프로젝트: StorjOld/btctxstore
    def add_inputs(self, rawtx, wifs, change_address=None, fee=10000,
                   dont_sign=False):
        """Add sufficient inputs from given <wifs> to cover <rawtx> outputs
        and <fee>. If no <change_address> is given, change will be sent to
        first wif.
        """
        tx = deserialize.tx(rawtx)
        keys = deserialize.keys(self.testnet, wifs)
        fee = deserialize.positive_integer(fee)
        if change_address is not None:
            change_address = deserialize.address(self.testnet, change_address)
        tx = control.add_inputs(self.service, self.testnet, tx, keys,
                                change_address=change_address, fee=fee)

        if not dont_sign:
            tx = control.sign_tx(self.service, self.testnet, tx, keys)

        return serialize.tx(tx)
예제 #7
0
파일: api.py 프로젝트: hfeeki/btctxstore
 def get_broadcast_message(self, rawtx):
     """TODO add docstring"""
     tx = deserialize.tx(rawtx)
     result = control.get_broadcast_message(self.testnet, tx)
     result["signature"] = serialize.signature(result["signature"])
     return result
예제 #8
0
파일: api.py 프로젝트: hfeeki/btctxstore
 def add_data_blob(self, rawtx, hexdata, dust_limit=common.DUST_LIMIT):
     """TODO add docstring"""
     tx = deserialize.tx(rawtx)
     data = deserialize.binary(hexdata)
     tx = control.add_data_blob(tx, data, dust_limit=dust_limit)
     return serialize.tx(tx)
예제 #9
0
파일: api.py 프로젝트: hfeeki/btctxstore
 def get_data_blob(self, rawtx):
     """TODO add docstring"""
     tx = deserialize.tx(rawtx)
     data = control.get_data_blob(tx)
     return serialize.data(data)
예제 #10
0
파일: api.py 프로젝트: hfeeki/btctxstore
 def get_nulldata(self, rawtx):
     """Returns nulldata from <rawtx> as hexdata."""
     tx = deserialize.tx(rawtx)
     index, data = control.get_nulldata(tx)
     return serialize.data(data)
예제 #11
0
파일: api.py 프로젝트: StorjOld/btctxstore
 def get_broadcast_message(self, rawtx):
     """TODO add docstring"""
     tx = deserialize.tx(rawtx)
     result = control.get_broadcast_message(self.testnet, tx)
     result["signature"] = serialize.signature(result["signature"])
     return result
예제 #12
0
파일: api.py 프로젝트: StorjOld/btctxstore
 def add_data_blob(self, rawtx, hexdata, dust_limit=common.DUST_LIMIT):
     """TODO add docstring"""
     tx = deserialize.tx(rawtx)
     data = deserialize.binary(hexdata)
     tx = control.add_data_blob(tx, data, dust_limit=dust_limit)
     return serialize.tx(tx)
예제 #13
0
파일: api.py 프로젝트: StorjOld/btctxstore
 def get_data_blob(self, rawtx):
     """TODO add docstring"""
     tx = deserialize.tx(rawtx)
     data = control.get_data_blob(tx)
     return serialize.data(data)
예제 #14
0
파일: api.py 프로젝트: StorjOld/btctxstore
 def get_nulldata(self, rawtx):
     """Returns nulldata from <rawtx> as hexdata."""
     tx = deserialize.tx(rawtx)
     index, data = control.get_nulldata(tx)
     return serialize.data(data)