This repository has been archived by the owner on Jan 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from johngrantuk/issue31
Attempt at Issue #31.
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!'), | ||
), | ||
], | ||
) |