Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #58 from johngrantuk/issue31
Browse files Browse the repository at this point in the history
Attempt at Issue #31.
  • Loading branch information
todofixthis authored Aug 1, 2017
2 parents 46d6725 + e1cc21d commit 5b16f2b
Showing 1 changed file with 44 additions and 0 deletions.
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!'),
),
],
)

0 comments on commit 5b16f2b

Please sign in to comment.