def gettxout(self, txid, index, mempool=True): """ Returns details about an unspent transaction output (UTXO) Arguments: - *txid* -- Transactiond id for which the info should be returned. - *index* -- The output index. - *mempool* -- Add memory pool transactions. """ tx = self.proxy.gettxout(txid, index, mempool) if tx != None: return TransactionInfo(**tx) else: return TransactionInfo()
def gettransaction(self, txid): """ Get detailed information about transaction Arguments: - *txid* -- Transactiond id for which the info should be returned """ return TransactionInfo(**self.proxy.gettransaction(txid))
def getrawtransaction(self, txid, verbose=True): """ Get transaction raw info Arguments: - *txid* -- Transactiond id for which the info should be returned. - *verbose* -- If False, return only the "hex" of the transaction. """ if verbose: return TransactionInfo(**self.proxy.getrawtransaction(txid, 1)) return self.proxy.getrawtransaction(txid, 0)
def listunspent(self, minconf=1, maxconf=999999): """ Returns a list of unspent transaction inputs in the wallet. Arguments: - *minconf* -- Minimum number of confirmations required to be listed. - *maxconf* -- Maximal number of confirmations allowed to be listed. """ return [TransactionInfo(**tx) for tx in self.proxy.listunspent(minconf, maxconf)]
def listtransactions(self, account=None, count=10, from_=0, address=None): """ Returns a list of the last transactions for an account. Each transaction is represented with a :class:`~vergerpc.data.TransactionInfo` object. Arguments: - *account* -- Account to list transactions from. Return transactions from all accounts if None. - *count* -- Number of transactions to return. - *from_* -- Skip the first <from_> transactions. - *address* -- Receive address to consider """ accounts = [account] if account is not None else list(self.listaccounts(as_dict=True).keys()) return [TransactionInfo(**tx) for acc in accounts for tx in self.proxy.listtransactions(acc, count, from_) if address is None or tx["address"] == address]
def listsinceblock(self, block_hash): res = self.proxy.listsinceblock(block_hash) res['transactions'] = [ TransactionInfo(**x) for x in res['transactions'] ] return res