How to get transaction detail with hash?
Could you clarify what you mean by transaction detail? And with hash of a transaction you mean the transaction ID (which for Segwit transactions is different from the hash)?
There is a function inside NetworkAPI called get_transaction_by_id which retrieves a transaction in raw hex format given its ID. But without further details I don't know if that suffices for your use case?
E.g.:
from bit.transaction import deserialize
from bit.network import NetworkAPI
# Get raw transaction by 'some_tx_id':
raw_hex = NetworkAPI.get_transaction_by_id('some_tx_id')
# Convert to transaction object:
tx_obj = deserialize(raw_hex)
@bjarnemagnussen How to convert tx_obj to object can be read
Pretty sure you can do tx_obj.__str__ or similar. Just look up what tx_obj has in the code, or you can run a Python console and do tx_obj.(tab).
Hello @teran-mckinney
I want see json/dict data.
I dont want see it
"TxObj(b'\x01\x00\x00\x00', [TxIn(b'H0E\x02!\x00\x93\xb6\x0c\x9c\xcejx;\x9e\xf9\x08\xe2Z$\xa6\xc2:yfc\x81\xc7[\x90\xc2\x82\xcf\x14\xfc\xc6\x17A\x02 .\xe5V\xeeu\xfd\xc8\x17\x90D\x99C\xb9\x07^8K\xa69\x15\xf7\xc4X\xea\x05\xa7:3\xd8\xed\x95\x01!\x02\x06\xa7R]\xfe\x04BY\x02\x10T\xe2\x92\xd9\x11\\\xcc.Q,\xab\x0c|\xf7\xb1.$4\x00\xc4\xe5\x89', b'k', b'D\xbe\n>\xad,T\xc5\xa60\tZo\xc8\xf2\xca\x06\xc8\xa9\xf0\xe5L\xa9P\xab6\xb1\x1c\xd1\x0e&6', b'\x00\x00\x00\x00', b'\xff\xff\xff\xff')], [TxOut(b'0W\x05\x00\x00\x00\x00\x00', b'v\xa9\x14\xb1i\xf2\xb0\xb8f\xdb\x05\x90\x0b\x93\xa5\xd7cE\xf1\x8d:\xfb$\x88\xac', b'\x19'), TxOut(b'\x0c\x06\x02\x00\x00\x00\x00\x00', b'v\xa9\x14l\x1bQ\x1ac0kb\x94\xe1\xd39\n\xc8\xcdH\x1fvp]\x88\xac', b'\x19'), TxOut(b'\xff\xdb\x03\x00\x00\x00\x00\x00', b'v\xa9\x14\x0c\x91~\xc5m\xed\x18R\xe4\xca\xaa7\xd7\xbf\x96Cw70\x88\xac', b'\x19'), TxOut(b'\x05I\x02\x00\x00\x00\x00\x00', b'v\xa9\x14%\xfc$\x8d\xc1&\xd0\xc8W\xae\xeftzF\x00U\xdf\x87\x12\xfd\x88\xac', b'\x19'), TxOut(b'^\x80\x00\x00\x00\x00\x00\x00', b'v\xa9\x14\xad^\xc8\n\xcd\xa4\x94\xb2.\x05\xa6\xda&Xo\xe5\x02!>\xc3\x88\xac', b'\x19')], b'\x00\x00\x00\x00')"
@henrytom1703: The TxObj object does not have a json/dict data representation.