Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Back to post

Revisions 2

one year ago
Jeremy
384 × 5 Administrator
How do you send TON transactions in Python?
How do you send TON transactions in Python?
There is one community led solution called [pytonlib](https://github.com/psylopunk/pytonlib) that I have found to send a transaction in Python. Please note that I have not tried it myself so I cannot in good faith recommend it, but the community members who work on it are quite active. Install with: ```bash pip install ton ``` Here is an example of how it is used to send a transaction. ```python from .init import client from .wallet import wallet # Viewing transactions txs = await wallet.get_transactions() in_msg = txs[0].in_msg in_msg.source.account_address # Sender in_msg.destination.account_address # Recipient int(in_msg.amount) # Amount in nanoTONs client.from_nano(int(in_msg.value)) # Amount in TONs # Sending transaction with 1 TON await wallet.transfer('EQCl1Ug9ZT9ZfGyFH9l4q-bqaUy6kyOzVPmrk7bivmVKJRRZ', client.to_nano(1), comment='test') # Send transaction with multiple outputs await wallet.transfer( ('EQCl1Ug9ZT9ZfGyFH9l4q-bqaUy6kyOzVPmrk7bivmVKJRRZ', client.to_nano(1), 'test comment'), ('EQCl1Ug9ZT9ZfGyFH9l4q-bqaUy6kyOzVPmrk7bivmVKJRRZ', client.to_nano(0.5), 'test comment 2'), ('EQCl1Ug9ZT9ZfGyFH9l4q-bqaUy6kyOzVPmrk7bivmVKJRRZ', client.to_nano(1)) ) # Sending transaction with raw BOC data from tvm_valuetypes import Cell await wallet.transfer('EQCl1Ug9ZT9ZfGyFH9l4q-bqaUy6kyOzVPmrk7bivmVKJRRZ', client.to_nano(1), data=Cell().serialize_boc()) ```
There is one community led solution called [pytonlib](https://github.com/psylopunk/pytonlib) that I have found to send a transaction in Python. Please note that I have not tried it myself so I cannot in good faith recommend it, but the community members who work on it are quite active. Install with: ```bash pip install ton ``` Here is an example of how it is used to send a transaction. ```python from .init import client from .wallet import wallet # Viewing transactions txs = await wallet.get_transactions() in_msg = txs[0].in_msg in_msg.source.account_address # Sender in_msg.destination.account_address # Recipient int(in_msg.amount) # Amount in nanoTONs client.from_nano(int(in_msg.value)) # Amount in TONs # Sending transaction with 1 TON await wallet.transfer('EQCl1Ug9ZT9ZfGyFH9l4q-bqaUy6kyOzVPmrk7bivmVKJRRZ', client.to_nano(1), comment='test') # Send transaction with multiple outputs await wallet.transfer( ('EQCl1Ug9ZT9ZfGyFH9l4q-bqaUy6kyOzVPmrk7bivmVKJRRZ', client.to_nano(1), 'test comment'), ('EQCl1Ug9ZT9ZfGyFH9l4q-bqaUy6kyOzVPmrk7bivmVKJRRZ', client.to_nano(0.5), 'test comment 2'), ('EQCl1Ug9ZT9ZfGyFH9l4q-bqaUy6kyOzVPmrk7bivmVKJRRZ', client.to_nano(1)) ) # Sending transaction with raw BOC data from tvm_valuetypes import Cell await wallet.transfer('EQCl1Ug9ZT9ZfGyFH9l4q-bqaUy6kyOzVPmrk7bivmVKJRRZ', client.to_nano(1), data=Cell().serialize_boc()) ```
one year ago
Original
Jeremy
384 × 5 Administrator
How do you send TON transactions in Python?

There is one community led solution called [pytonlib](https://github.com/psylopunk/pytonlib) that I have found to send a transaction in Python. Please note that I have not tried it myself so I cannot in good faith recommend it, but the community members who work on it are quite active. Install with: ```bash pip install ton ``` Here is an example of how it is used to send a transaction. ```python from .init import client from .wallet import wallet # Viewing transactions txs = await wallet.get_transactions() in_msg = txs[0].in_msg in_msg.source.account_address # Sender in_msg.destination.account_address # Recipient int(in_msg.amount) # Amount in nanoTONs client.from_nano(int(in_msg.value)) # Amount in TONs # Sending transaction with 1 TON await wallet.transfer('EQCl1Ug9ZT9ZfGyFH9l4q-bqaUy6kyOzVPmrk7bivmVKJRRZ', client.to_nano(1), comment='test') # Send transaction with multiple outputs await wallet.transfer( ('EQCl1Ug9ZT9ZfGyFH9l4q-bqaUy6kyOzVPmrk7bivmVKJRRZ', client.to_nano(1), 'test comment'), ('EQCl1Ug9ZT9ZfGyFH9l4q-bqaUy6kyOzVPmrk7bivmVKJRRZ', client.to_nano(0.5), 'test comment 2'), ('EQCl1Ug9ZT9ZfGyFH9l4q-bqaUy6kyOzVPmrk7bivmVKJRRZ', client.to_nano(1)) ) # Sending transaction with raw BOC data from tvm_valuetypes import Cell await wallet.transfer('EQCl1Ug9ZT9ZfGyFH9l4q-bqaUy6kyOzVPmrk7bivmVKJRRZ', client.to_nano(1), data=Cell().serialize_boc()) ```