tfchain/TFChainWallet.py
def _fund_txn(self, txn, source, refund):
        """
        common fund/refund/inputs/fees logic for all 3Bot Transactions
        """
        # get the fees, and fund the transaction
        miner_fee = self._minium_miner_fee
        bot_fee = txn.required_bot_fees
        balance = self._wallet.balance
        inputs, remainder, suggested_refund = balance.fund(miner_fee+bot_fee, source=source)

        # add the coin inputs
        txn.coin_inputs = inputs

        # add refund coin output if needed
        if remainder > 0:
            # define the refund condition
            if refund is None: # automatically choose a refund condition if none is given
                if suggested_refund is None:
                    refund = ConditionTypes.unlockhash_new(unlockhash=self._wallet.address)
                else:
                    refund = suggested_refund
            else:
                # use the given refund condition (defined as a recipient)
                refund = ConditionTypes.from_recipient(refund)
            txn.refund_coin_output_set(value=remainder, condition=refund)
        # add the miner fee
        txn.transaction_fee = miner_fee

        # return balance object
        return balance

        common fund/refund/inputs/fees logic for all 3Bot Transactions
        
common fund/refund/inputs/fees logic for all 3Bot Transactions
common fund / refund / inputs / fees logic for all 3Bot Transactions
def _fund_txn(self, txn, source, refund):
        miner_fee = self._minium_miner_fee
        bot_fee = txn.required_bot_fees
        balance = self._wallet.balance
        inputs, remainder, suggested_refund = balance.fund(miner_fee+bot_fee, source=source)
        txn.coin_inputs = inputs
        if remainder > 0:
            if refund is None: 
                if suggested_refund is None:
                    refund = ConditionTypes.unlockhash_new(unlockhash=self._wallet.address)
                else:
                    refund = suggested_refund
            else:
                refund = ConditionTypes.from_recipient(refund)
            txn.refund_coin_output_set(value=remainder, condition=refund)
        txn.transaction_fee = miner_fee
        return balance
def _fund_txn ( self , txn , source , refund ) : miner_fee = self . _minium_miner_fee bot_fee = txn . required_bot_fees balance = self . _wallet . balance inputs , remainder , suggested_refund = balance . fund ( miner_fee + bot_fee , source = source ) txn . coin_inputs = inputs if remainder > 0 : if refund is None : if suggested_refund is None : refund = ConditionTypes . unlockhash_new ( unlockhash = self . _wallet . address ) else : refund = suggested_refund else : refund = ConditionTypes . from_recipient ( refund ) txn . refund_coin_output_set ( value = remainder , condition = refund ) txn . transaction_fee = miner_fee return balance
common fund/refund/inputs/fees logic for all 3Bot Transactions
common fund / refund / inputs / fees logic for all 3Bot Transactions
"""
        common fund/refund/inputs/fees logic for all 3Bot Transactions
        """ # get the fees, and fund the transaction # add the coin inputs # add refund coin output if needed # define the refund condition # automatically choose a refund condition if none is given # use the given refund condition (defined as a recipient) # add the miner fee # return balance object
self
txn
source
refund