예제 #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_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)