forked from iota-community/python-iota-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathe06_send_tokens.py
More file actions
19 lines (16 loc) · 957 Bytes
/
e06_send_tokens.py
File metadata and controls
19 lines (16 loc) · 957 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# This example creates a transaction with a custom index/data.
# The amount of iota specified in the "amount" variable will be transferred to the given address.
import iota_client
# *** Replace with your testing seed (In case you decided to generate one, otherwise keep this one) ***
SENDER_SEED = 'a201599ad3bc079378e1e3cba43ee976828c146ec95f296c7d3a4ddc7dee24f37edba7b2bf8055503babd992964e0cb3649af6f184626636741cd9d6813b8c57'
RECIPIENT_ADDRESS = 'atoi1qz8wn7fj23g3qz8rpk9dk38zffs6u7wmdalvu7eak8a5r7me72pw2vspcl0'
INDEX = "Chrysalis Python Workshop"
DATA = "Here are your IOTAs!".encode()
# Chrysalis testnet node
client = iota_client.Client(node='https://api.lb-0.testnet.chrysalis2.com')
output = {
'address': RECIPIENT_ADDRESS,
'amount': 2000000 # 2 MIOTA
}
message_id = client.message(seed=SENDER_SEED, index=INDEX, data=DATA, outputs=[output])
print(f"IOTAs sent!\nhttps://explorer.iota.org/chrysalis/message/{message_id['message_id']}")