This repository was archived by the owner on Jan 13, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ # coding=utf-8
2+ """
3+ Simple example using the RoutingWrapper to route API requests to different nodes.
4+ See: https://github.com/iotaledger/documentation/blob/iota.lib.py/1.2.x/source/includes/_adapters.md#routingwrapper
5+ """
6+ from iota import *
7+ from iota .adapter .wrappers import RoutingWrapper
8+
9+ api = \
10+ Iota (
11+ # Send PoW requests to local node.
12+ # All other requests go to light wallet node.
13+ RoutingWrapper ('http://service.iotasupport.com:14265' )
14+ .add_route ('attachToTangle' , 'http://localhost:14265' ),
15+
16+ # Seed used for cryptographic functions.
17+ seed = b'SEED9GOES9HERE'
18+ )
19+
20+ # Example of sending a transfer using the adapter.
21+ bundle = api .send_transfer (
22+ depth = 100 ,
23+ transfers = [
24+ ProposedTransaction (
25+ # Recipient of the transfer.
26+ address =
27+ Address (
28+ #b'TESTVALUE9DONTUSEINPRODUCTION99999FBFFTG'
29+ #b'QFWEHEL9KCAFXBJBXGE9HID9XCOHFIDABHDG9AHDR'
30+ ),
31+
32+ # Amount of IOTA to transfer.
33+ # This value may be zero.
34+ value = 1 ,
35+
36+ # Optional tag to attach to the transfer.
37+ tag = Tag (b'ADAPT' ),
38+
39+ # Optional message to include with the transfer.
40+ message = TryteString .from_string ('Hello!' ),
41+ ),
42+ ],
43+ )
You can’t perform that action at this time.
0 commit comments