Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python library for TON Connect 2.0 #199

Closed
3 tasks done
XaBbl4 opened this issue Apr 4, 2023 · 28 comments
Closed
3 tasks done

Python library for TON Connect 2.0 #199

XaBbl4 opened this issue Apr 4, 2023 · 28 comments
Assignees
Labels
Approved This proposal is approved by the committee footstep This is a TON Footstep issue

Comments

@XaBbl4
Copy link

XaBbl4 commented Apr 4, 2023

Summary

At this step, it is proposed to create a library for working with the TON Connect protocol in Python.

Context

At the moment, there is only one library for working with the TON Connect protocol - written in JS. Need libraries in other languages to reach as many developers and improve the quality of dApps.
For the first version, need to add support http-bridge-compatible wallets.

Goals

  • Develop a library for working with the TON Connect in Python.
  • Help Python developers integrate TON Connect into dApps written in Python.

Deliverables

  • GitHub repository with the implementation TON Connect protocol in Python

Definition of Done

  • GitHub repository with the source code - link
  • Publish library to pypi.org - link
  • Create a PR to ton-connect repository with a link to the Python library - link

Reward

  • Standard TON Footstep NFT
  • 1000 USD in TON equivalent

Total: $1000

@XaBbl4 XaBbl4 added the footstep This is a TON Footstep issue label Apr 4, 2023
@XaBbl4
Copy link
Author

XaBbl4 commented Apr 4, 2023

I have almost finished development the TON Connect protocol inside my telegram bot, but it takes several weeks (maybe less) to make it a separate library.

@XaBbl4
Copy link
Author

XaBbl4 commented Apr 14, 2023

Closed because not assigned and a new issue has been created. Sad for the wasted time.

@XaBbl4 XaBbl4 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 14, 2023
@delovoyhomie
Copy link
Collaborator

Closed because not assigned and a new issue has been created. Sad for the wasted time.

@XaBbl4, we apologize. I’ll give an answer soon. Maybe we’ll reopen it.

@Naltox
Copy link

Naltox commented Apr 17, 2023

LGTM!

@delovoyhomie delovoyhomie reopened this Apr 17, 2023
@delovoyhomie delovoyhomie added the Approved This proposal is approved by the committee label Apr 17, 2023
@delovoyhomie
Copy link
Collaborator

@XaBbl4, you can continue to perform this footstep.
Sorry for the delay.
Please report about progress here!

@Gusarich
Copy link
Contributor

We also need to decide the reward.

@delovoyhomie
Copy link
Collaborator

@krigga, what do you think about the amount of reward?

@krigga
Copy link

krigga commented Apr 17, 2023

I believe a reward of about $1000 would be fair.

@delovoyhomie
Copy link
Collaborator

@XaBbl4, do you agree with the $1000 reward? Ready to do it?

@XaBbl4
Copy link
Author

XaBbl4 commented Apr 18, 2023

@delovoyhomie, yes, that's ok.

Current status:

  • The first version of the library is available on GitHub and PyPI (links in description of footstep)
  • Connection to the wallet works.
  • Requests for sending transactions are working.
  • Syntax is the same as TonConnectSDK for JS, except function naming is in lower_case_with_underscores.

Needs do:

  • Parsing execution result when transactions are sent
  • Checking ton_proof

@XaBbl4
Copy link
Author

XaBbl4 commented Apr 25, 2023

Added parsing of the result of send transaction and connect event requests. Also added ton_proof check (and example for it).
Please review the code on github.
There are still places that can be improved, but now can use it.
After the review, I will create a PR to ton-connect.

There is also a telegram bot with a demo, but not yet completed.

@delovoyhomie
Copy link
Collaborator

@krigga or @Naltox, can you make sure that the work is done correctly by reviewing the code on github?

@krigga
Copy link

krigga commented Apr 25, 2023

Sure, I'll review it

@krigga
Copy link

krigga commented Apr 26, 2023

@XaBbl4 I couldn't properly verify that the library works due to this issue XaBbl4/pytonconnect#1

@XaBbl4
Copy link
Author

XaBbl4 commented Apr 26, 2023

@krigga Thanks. Fixed it. Didn't check this import option, always used from pytonconnect import TonConnect

@krigga
Copy link

krigga commented Apr 26, 2023

Didn't check this import option, always used from pytonconnect import TonConnect

That one didn't work, too. I'll check the fix soon.

@delovoyhomie
Copy link
Collaborator

@XaBbl4 I couldn't properly verify that the library works due to this issue XaBbl4/pytonconnect#1

@krigga, is the issue fixed? What steps are left to complete the footstep?

@delovoyhomie
Copy link
Collaborator

@XaBbl4, complete the third milestone. Submit PR to ton-connect repository with a link to the Python library.

@krigga
Copy link

krigga commented May 10, 2023

Yes, the library works, I believe the footstep is complete (barring the third milestone).
I would like to ask the author to implement two features for ease of use: provide an implementation of IStorage that uses the filesystem to cache the connection data, and add a method like connector.wait_for_connection() so as not to rely on asyncio.sleep or similar to wait for the connection. However, I believe this does not block the footstep.

XaBbl4 pushed a commit to XaBbl4/ton-connect that referenced this issue May 10, 2023
XaBbl4 added a commit to XaBbl4/ton-connect that referenced this issue May 10, 2023
XaBbl4 added a commit to XaBbl4/ton-connect that referenced this issue May 10, 2023
@XaBbl4
Copy link
Author

XaBbl4 commented May 10, 2023

@delovoyhomie, Add PR to ton-connect (not without problems, making a couple of unnecessary commits, that don’t know how to remove)

I would like to ask the author to implement two features for ease of use: provide an implementation of IStorage that uses the filesystem to cache the connection data, and add a method like connector.wait_for_connection() so as not to rely on asyncio.sleep or similar to wait for the connection.

@krigga, I'll try to add it soon. There are a functions that I wanted to complete, also add an example of using the library with a telegram bot, but have not yet found the time to finish it.

@delovoyhomie
Copy link
Collaborator

@XaBbl4, I would be very grateful if you could implement a telegram bot to connect the wallet, as it was done in #176.

Let's do the same with the bot and documentation in a new footstep once we are done with this.

As far as I know, it is possible to revert changes to previous ones (about couple of unnecessary commits) Please try to sort out this problem.

@XaBbl4
Copy link
Author

XaBbl4 commented May 10, 2023

As far as I know, it is possible to revert changes to previous ones (about couple of unnecessary commits) Please try to sort out this problem.

One commit got into the PR, just a few were added to the Issue history of footstep. I did't work with github so often, more with gitlab.

@delovoyhomie
Copy link
Collaborator

@XaBbl4, could you please let me know here when the PR to ton-connect-list has been merged?

@XaBbl4
Copy link
Author

XaBbl4 commented May 19, 2023

I would like to ask the author to implement two features for ease of use: provide an implementation of IStorage that uses the filesystem to cache the connection data, and add a method like connector.wait_for_connection() so as not to rely on asyncio.sleep or similar to wait for the connection.

@krigga, publish v0.2.0: added method wait_for_connection() and class FileStorage, also added example to github-repository how to use it.

could you please let me know here when the PR to ton-connect-list has been merged?

@delovoyhomie, something I doubt that the PR will be accepted quickly, there is another PR dated March 30 which remained without discussion.

@krigga
Copy link

krigga commented May 19, 2023

@XaBbl4 the new features work, thank you. Could you please remove these specifiers https://github.com/XaBbl4/pytonconnect/blob/5e860b52359a43919605f25239f96467724f07f8/setup.cfg#L15-L16 in the manifest? Python 3.8 cannot handle the type hints like list[dict] and throws an Exception when trying to import pytonconnect. After that, I have no more requests.

@delovoyhomie
Copy link
Collaborator

@XaBbl4, please send me your wallet address to receive the reward.

@XaBbl4
Copy link
Author

XaBbl4 commented May 19, 2023

@krigga, thx. To keep compatibility with Python 3.7 and 3.8, the type hint changed to List[dict], because support of Python 3.8 will end in 2024.10

@delovoyhomie, my wallet EQAZ3Z3iWsk1eBFkE_iWEAYc8o9S2vFYE3O9hnH3q939ZMmq

@delovoyhomie
Copy link
Collaborator

Rewards sent! Thank you for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved This proposal is approved by the committee footstep This is a TON Footstep issue
Projects
None yet
Development

No branches or pull requests

6 participants
@XaBbl4 @Naltox @krigga @Gusarich @delovoyhomie and others