Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions examples/send_transfer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# coding=utf-8
"""
Example script that shows how to use PyOTA to send a transfer to an address.
"""
from iota import *


# Create the API instance.
api =\
Iota(
# URI of a locally running node.
'http://localhost:14265/',

# Seed used for cryptographic functions.
seed = b'SEED9GOES9HERE'
)

# For more information, see :py:meth:`Iota.send_transfer`.
api.send_transfer(
depth = 100,

# One or more :py:class:`ProposedTransaction` objects to add to the
# bundle.
transfers = [
ProposedTransaction(
# Recipient of the transfer.
address =
Address(
b'TESTVALUE9DONTUSEINPRODUCTION99999FBFFTG'
b'QFWEHEL9KCAFXBJBXGE9HID9XCOHFIDABHDG9AHDR'
),

# Amount of IOTA to transfer.
# This value may be zero.
value = 1,

# Optional tag to attach to the transfer.
tag = Tag(b'EXAMPLE'),

# Optional message to include with the transfer.
message = TryteString.from_string('Hello!'),
),
],
)