def create_tx(addrs): '''Selects txouts and create spend given amount in BTC to construct a transaction tx''' tx = Transaction('btc') for addr in addrs: tx.add_inputs(address=addr) return tx
def sweep(crypto, private_key, to_address, fee=None, password=None, **modes): """ Move all funds by private key to another address. """ from moneywagon.tx import Transaction tx = Transaction(crypto, verbose=modes.get('verbose', False)) tx.add_inputs(private_key=private_key, password=password, **modes) tx.change_address = to_address tx.fee(fee) return tx.push()
def make_payment(self): tx = Transaction(crypto=self.withdraw_currency.code) tx.add_inputs( self.exchange.withdraw_currency.pop_utxos(self.withdraw_amount)) tx.add_output(self.withdraw_amount, to_address) return tx.push_tx()
def make_payment(self): tx = Transaction(crypto=self.withdraw_currency.code) tx.add_inputs(self.exchange.withdraw_currency.pop_utxos( self.withdraw_amount)) tx.add_output(self.withdraw_amount, to_address) return tx.push_tx()