psylopunk / pytonlib

Simple python client for The Open Network
https://pydocs.xton.me/
MIT License
93 stars 19 forks source link

Transfer function is freezes in version 0.14 without response #3

Closed lorrod closed 2 years ago

lorrod commented 2 years ago

Hello!

I would like to report about a problem with function wallet.transfer()

I am testing a new update of a library, have cloned repo from source. When I am trying to transfer coins to another address from which I have received funds, function is freezes with no response. I have tried to pass different timeouts with no luck

>>> wallet.get_balance()
109999978
>>> # I have tried to pass different timeouts here
>>> response = wallet.transfer(<TonKeeper address>, to_nano(0.01), comment="with", timeout=10)

Maybe the issue can be caused due to increased transaction fee?

Am I correctly understand that fee is hardcoded and equals to 1000000 nano? Is there a way to change a fee (calculate&set)?

psylopunk commented 2 years ago

The timeout occurs because liteserver is unavailable or an error occurred inside libtonlibjson. Read more here and here

psylopunk commented 2 years ago

Commission cannot be specified statically, it is determined by the validator during the execution of the task. We can only try to guess it by some methods.

Hardcode in the transfer function with addition of 0.01 TON has already been removed in favor of using send_mode=128, which indicates that the commission will be withdrawn separately from the amount being transferred.