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

Ruby SDK For TON #188

Closed
nerzh opened this issue Mar 30, 2023 · 26 comments
Closed

Ruby SDK For TON #188

nerzh opened this issue Mar 30, 2023 · 26 comments
Assignees
Labels
Approved This proposal is approved by the committee Developer Tool Related to tools or utilities used by developers Progress Blocked Task halted due to obstacles or issues

Comments

@nerzh
Copy link
Contributor

nerzh commented Mar 30, 2023

Summary

The Ruby language has a huge community of developers who are also interested in blockchain development. If we have Ruby programming language library to work with TON Blockchain, we can attract many new developers to the ecosystem. This is one of the most important reasons why I created this proposal.

Context

At the moment there are many popular libraries to work with the TON blockchain, but there is not yet a single current library that could cover the Ruby developer community. Here is a development plan that I would like to implement as part of this footstep:

  • Implement Cell, Slice, Builder and BOC (de)serialization
  • Implement an RPC client to work with the TON network
  • Implement support for popular structures from block.tlb
  • Implement support of TON base64 addresses
  • Implement support of HashmapE
  • Implement support of TON & BIP39 Mnemonics
  • Implement support of wallets (v3, v3r2, v4r2)
  • Ed25519 signing of transactions
  • Implement for workings with Jettons and NFTs

Goals

Develop the Ruby SDK to work with the TON blockchain

Deliverables

GitHub with rubyton library and examples

Definition of Done

GitHub repository with the source code

Reward

  • 5,000 USD in TON equivalent
  • Standard TON Footstep NFT
@nerzh nerzh added the footstep This is a TON Footstep issue label Mar 30, 2023
@Gusarich
Copy link
Collaborator

@Naltox what do you think?

@Naltox
Copy link

Naltox commented Mar 30, 2023

Looks nice!

@Gusarich Gusarich added the Approved This proposal is approved by the committee label Mar 31, 2023
@Gusarich
Copy link
Collaborator

@nerzh do you want to do this footstep?

@nerzh
Copy link
Contributor Author

nerzh commented Mar 31, 2023

@Gusarich hello, yes

@Gusarich
Copy link
Collaborator

@nerzh great! I've assigned you to this Footstep. You can begin the development :)

@p0v1n0m
Copy link

p0v1n0m commented May 16, 2023

This footstep abandoned?

@nerzh
Copy link
Contributor Author

nerzh commented May 16, 2023

This footstep abandoned?

Hello, of course not

@p0v1n0m
Copy link

p0v1n0m commented May 16, 2023

This footstep abandoned?

Hello, of course not

Sorry, then we look forward to it.

@delovoyhomie
Copy link
Collaborator

@nerzh, any updates?

@nerzh
Copy link
Contributor Author

nerzh commented Jun 10, 2023

@nerzh, any updates?

Hi! I'm a new developer in the TON blockchain, but I'm very serious to complete this task. In my free time, I study new material about TON and develop.

I’ e already partially implemented the BOC primitives, and I even conducted experiments with ADNL. Please leave this task assigned to me. Thank you!

@delovoyhomie
Copy link
Collaborator

@nerzh, how is it going?

@nerzh
Copy link
Contributor Author

nerzh commented Aug 20, 2023

@nerzh, how is it going?

Hello. I also wanted to write to you today 🙂

I've nearly completed the implementation of the library and plan to return this month with the first results. Thank you !

https://github.com/nerzh/ton-sdk-ruby

@delovoyhomie
Copy link
Collaborator

@nerzh, good!
When do you plan to finish this footstep completely with all the goals achieved?

@nerzh
Copy link
Contributor Author

nerzh commented Aug 20, 2023

@nerzh, good! When do you plan to finish this footstep completely with all the goals achieved?

In the first half of next month

@nerzh
Copy link
Contributor Author

nerzh commented Aug 25, 2023

@delovoyhomie @Gusarich
Hello everyone! I have completed and tested the implementation of an SDK for working with the TON Blockchain in Ruby. As a result, I have created two packages: https://github.com/nerzh/ton-sdk-ruby and https://github.com/nerzh/ton-sdk-ruby-smc. These packages implements all the functionality described in this footstep.

It was truly an engaging and exciting experience for me, and I appreciate the opportunity given. In the future, I plan to continue developing this package set, and I hope that they will be useful for TON developers. Thank you!

My TON address for the reward: EQAT-mDyyqoTIaiED7egj4VNm11U57cwWX5dQysGivwXVfGw

@nerzh
Copy link
Contributor Author

nerzh commented Sep 6, 2023

Hi, it's been a few weeks since I posted the release of the packages associated with this footstep. I'd like to clarify the status, and get some feedback. Any updates? @delovoyhomie @Gusarich @Naltox

@delovoyhomie
Copy link
Collaborator

@nerzh, your work is not overlooked, thank you for your contribution! Ruby SDK is now under the review code.

@nerzh
Copy link
Contributor Author

nerzh commented Sep 7, 2023

Ok, then I will wait for your verification, thank you.

@delovoyhomie delovoyhomie added Developer Tool Related to tools or utilities used by developers Progress Blocked Task halted due to obstacles or issues and removed footstep This is a TON Footstep issue labels Oct 12, 2023
@delovoyhomie
Copy link
Collaborator

I apologize for the extended wait for your code review. We are actively working on it and will soon conclude the process, after which we will happily congratulate you on its successful completion!

@delovoyhomie
Copy link
Collaborator

@nerzh, I kindly request that you carefully review the code feedback provided here and make the necessary improvements if required.

@nerzh
Copy link
Contributor Author

nerzh commented Oct 13, 2023

@delovoyhomie Hi! Thank you for the feedback, I really appreciate it. I'm in the process of exploring the review, and will come back later with some fixes.

@nerzh
Copy link
Contributor Author

nerzh commented Oct 14, 2023

@delovoyhomie I'm here, with good news. I've fixed the issues mentioned in the review and log is here too:

  1. The specific implementation of BitArray hasn't been used since the release stage. Now I removed it as it was never implemented to its final state and isn't needed in the context of the rest of the classes/methods.

  2. Same reason as in 1 point about BitArray

  3. Same reason as in 1 point about BitArray

  4. Fixed for store_var_uint and store_var_int

  5. In my library there are two classes Hashmap and HashmapE, they have an overloaded .serialize method that participates in the .cell method. So depending on whether Hashmap or HashmapE is passed to store_dict builder method, they will be written according to the TL-B scheme in correct way.

  6. FIxed. This method was originally ported from JS code, and now I'm pretty sure that the number 53 is a JS-specific limitation.

  7. This design allows you to use the Coins class not only to work with "native" TON coins, but also with various tokens (jettons) that may have non-standard decimals, for example it so useful for pretty printing

  8. Just fixed

  9. Just fixed

  10. Fixed. The problem was in the upper limit, which was 24 (the number of words in the mnemonic) instead of 2048 - the size of the bip39 dictionary.

  11. I've implemented the ability to call get methods in toncenter provider, I see no reason to make wallet classes dependent in initialization on the network provider. Users can initialize the provider and do it themselves, the methods to parse the storage are created for general purposes, not only for getting seqno.

  12. Just fixed

  13. Just fixed

  14. Fixed. For V4 the object type is incorrectly checked and there was no op in the message body. Also added an example in README

@krigga
Copy link

krigga commented Oct 20, 2023

Hey there
I have reviewed your fixes, and here's some more feedback:
4. The added check considers the size calculated from the value itself, instead of the size passed by the user, therefore rendering the check useless (it will always pass). This is true for both var_int and var_uint.
5. Got it, that works, but please consider shifting that class's design to look more like the JS version - IMO it's better to have one class for the dictionary and to be able to choose how to serialize it when you need to serialize it and not when you create it.
7. While this is acceptable, I'd urge you to still consider the design where you store @value as just an integer value (since it seems Ruby lets you store big integers without needing separate specific classes for them) and @decimals as another (small) integer which denotes the number of decimal places for pretty printing etc. This will make the code easily understandable, and Jettons store their values as big integers, too (onchain) - the decimal formatting only comes in the UI with use of decimals metadata field which (usually) only exists offchain!

Everything else looks good

@nerzh
Copy link
Contributor Author

nerzh commented Oct 23, 2023

@krigga All right! I'm in the process of researching what you've noted and I'll be back later with an update. Thanks!

@delovoyhomie
Copy link
Collaborator

Rewards sent!

Questbook proposal

@delovoyhomie
Copy link
Collaborator

delovoyhomie commented Oct 25, 2023

To accurately recognize your valuable contributions in our repository, we kindly request you to submit a Pull Request to the Hall of Fame file, providing the wallet address and a link to the bounty with the number.

Please follow these steps:

  1. Fork the repository (if you haven't already).
  2. Edit the Hall of Fame file, commit, and push your changes.
  3. Create a Pull Request from your fork to the main repository, providing the wallet address and a link to the bounty with the number (for example, Pull Request Article: Generation of block random seed #136).

For reference on what your entry should look like, please see the examples of past merged pull requests.

@nerzh, thank you for your contribution!

@nerzh nerzh mentioned this issue Oct 27, 2023
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 Developer Tool Related to tools or utilities used by developers Progress Blocked Task halted due to obstacles or issues
Projects
None yet
Development

No branches or pull requests

6 participants