"response": response.text[:-1]
}
+
def decode_raw_tx(raw_tx_str):
- tx_fee = 0
tx_input = {
"address": "",
"amount": 0,
"type": ""
}
tx = {
- "fee": tx_fee,
- "inputs": [
- tx_input
- ]
- "outputs": [
- tx_output
- ]
- "size": len(raw_tx_str) // 2,
+ "fee": 0,
+ "inputs": [],
+ "outputs": [],
+ "size": 0,
"time_range": 0,
- "tx_id":
+ "tx_id": "",
+ "version": 0
}
- size = len(raw_tx_str) // 2
-
\ No newline at end of file
+ version = int(raw_tx_str[2:4], 16)
+ time_range = int(raw_tx_str[4:6], 16)
+ tx_input_amount = int(raw_tx_str[6:8], 16)
+ tx_input_version = int(raw_tx_str[8:10], 16)
+ tx_input_length = int(raw_tx_str[10:12], 16)
+ tx_input_type = int(raw_tx_str[12:14], 16)
+ tx_input_data_spend_commit_length = int(raw_tx_str[14:16], 16)
+ tx_input_source_id = raw_tx_str[16:80]
+ tx_input_asset_id = raw_tx_str[80:144]
+
+
+ # for i in range(tx_input_amount):
+
+ return tx
+