-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathq3-2-1.py
22 lines (18 loc) · 1.12 KB
/
q3-2-1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from transaction import *
from constants import *
if __name__ == '__main__':
amount_to_send = 0.001
# txid_to_spend = ('addaa34f3a24cab6d29fee1020558acefb0aa366635927d3ebae0a9b72b5caf2') # TxHash of UTXO
# txid_to_spend = ('0941342a9c5df191ef367a7c480f6ca84a6bb4fa5b9b86ec2187118bcf37f0c3') # TxHash of UTXOs
# txid_to_spend = '2de7181c17575d122ac3b6f5580e941685db3e42dfc87c14f94b8a0287ba1bf8'
txid_to_spend = '6e56d76d039311600ad2a06994457949d6fe0f1f0da1dba21b48e0608216f38c'
utxo_index = 0
print(my_address) # Prints your address in base58
print(my_public_key.hex()) # Print your public key in hex
print(my_private_key.hex()) # Print your private key in hex
txout_scriptPubKey = P2PKH_multi_scriptPubKey(triple_addresses, 2, 3)
print(txout_scriptPubKey)
response = send_from_P2PKH_transaction(amount_to_send, txid_to_spend, utxo_index, txout_scriptPubKey,
my_address, my_public_key, my_private_key)
print(response.status_code, response.reason)
print(response.text) # Report the hash of transaction which is printed in this section result