def unconfirmed(self): """ Total unconfirmed coins, available for spending. """ if self.chain_time > 0 and self.chain_height > 0: return Currency.sum(*[ co.value for co in jsobj.dict_values(self._outputs_unconfirmed) if not co.condition.lock.locked_check(time=self.chain_time, height=self.chain_height) ]) or Currency() else: return Currency.sum(*[ co.value for co in jsobj.dict_values(self._outputs_unconfirmed) ])
def unconfirmed_locked(self): """ Total unconfirmed coins that are locked, and thus not available for spending. """ if self.chain_time > 0 and self.chain_height > 0: return Currency.sum(*[ co.value for co in jsobj.dict_values(self._outputs_unconfirmed) if co.condition.lock.locked_check(time=self.chain_time, height=self.chain_height) ]) or Currency() else: return Currency( ) # impossible to know for sure without a complete context
def coin_outputs(self): """ Coin outputs of this Transaction, funded by the Transaction's coin inputs. """ outputs = [] if self.fee_payout_address != None and len(self.miner_fees) > 0: amount = Currency.sum(*self.miner_fees) condition = ConditionTypes.from_recipient(self.fee_payout_address) outputs.append( CoinOutput(value=amount, condition=condition, id=self._fee_payout_id, is_fee=True)) return jsarr.concat(outputs, self._custom_coin_outputs_getter())
def available(self): """ Total available coins. """ return Currency.sum(*[co.value for co in self.outputs_available])