-
me in tg: @yungwine
High-level OOP Python library to interact with TON Blockchain
License: MIT License
me in tg: @yungwine
How can I get the transaction hash after sending it in the TON blockchain? It is a big issue that the transfer_ton function only provides the response status and not the transaction hash.
<TonTools.Contracts.Wallet.Wallet object at 0x7fe02fed1580>
Tonlib #2 crashed: Traceback (most recent call last):
File "/root/myflaskapp2/venv/lib/python3.8/site-packages/ton/tonlibjson.py", line 222, in read_results
result = await asyncio.wait_for(self.loop.run_in_executor(None, receive_func), timeout=timeout)
File "/usr/lib/python3.8/asyncio/tasks.py", line 481, in wait_for
await waiter
asyncio.exceptions.CancelledError
Hi
how can pass comment(meme) attribute in transfer_jetton_by_jetton_wallet?
and return mnemonics & address :D
Provide more examples for NFTs in separate files: How to parse collections, items, sales/auctions contracts and so on.
Split this into several files and provide more examples for actions with jettons
Traceback (most recent call last):
File "<rootDir>/gdfgsdg.py", line 25, in <module>
asyncio.run(main())
File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "<rootDir>/gdfgsdg.py", line 19, in main
print(await wallet.run_get_method('get_wallet_data', []))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/quisegosum/Project/bets/toncoin/.venv/lib/python3.11/site-packages/TonTools/Contracts/Contract.py", line 151, in run_get_method
return await self.provider.run_get_method(method=method, address=self.address, stack=stack)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/quisegosum/Project/bets/toncoin/.venv/lib/python3.11/site-packages/TonTools/Providers/TonCenterClient.py", line 98, in run_get_method
response = await process_response(response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/quisegosum/Project/bets/toncoin/.venv/lib/python3.11/site-packages/TonTools/Providers/TonCenterClient.py", line 34, in process_response
raise TonCenterClientError(f'TonCenter failed with error: {response_dict["error"]}')
~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'error'
Response from API:
{'ok': False, 'result': 'Ratelimit exceed', 'code': 429}
This is my code:
client = TonCenterClient(key=api_key, base_url='https://toncenter.com/api/v2/jsonRPC')
your_wallet = Wallet(provider=client, mnemonics=mnemonics, version='v4r2')
await your_wallet.transfer_jetton(
destination_address=to_address, #Receiving address
jetton_master_address=RAFF, #RAFF Contract Address
jettons_amount=1
)
print('done')
Look forward to your reply.
import asyncio
from TonTools.Contracts.Jetton import Jetton
from TonTools.Providers.LsClient import LsClient
usd_master = 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs'
async def main():
client = LsClient(ls_index=0, default_timeout=30)
await client.init_tonlib()
jetton = Jetton(usd_master, provider=client)
await jetton.update()
print(jetton)
if __name__ == '__main__':
asyncio.run(main())
Traceback (most recent call last):
File "<rootDir>/toontools_test/bugs/get_jetton_data.py", line 18, in <module>
asyncio.run(main())
File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "<rootDir>/toontools_test/bugs/get_jetton_data.py", line 13, in main
await jetton.update()
File "<rootDir>/.venv/lib/python3.11/site-packages/TonTools/Contracts/Jetton.py", line 34, in update
jetton = await self.provider.get_jetton_data(self.address)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<rootDir>/.venv/lib/python3.11/site-packages/TonTools/Providers/LsClient.py", line 250, in get_jetton_data
result = process_jetton_data(data[3].cell.bytes) if isinstance(process_jetton_data(data[3].cell.bytes), dict) else await get(process_jetton_data(data[3].cell.bytes))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<rootDir>/.venv/lib/python3.11/site-packages/TonTools/Providers/utils.py", line 29, in process_jetton_data
symbol = Cell.one_from_boc(b64decode(data)).refs[0].refs[1].refs[0].refs[1].refs[0].bits.get_top_upped_array().decode().split('\x00')[-1]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.