Hi there! I'm developing a nodejs library that encapsulates interaction with different blockchains into strictly typed methods and wanted to ask a few questions regarding the interaction with project.
Right now, after a brief intro to the HTTP API I decided to reach out to the community of devs in order to get a better understanding
1. I've read a discussion in this chat about BIP39 not being supported completely. I would like to know if there is a way to generate a TON wallet from standart 12-15-18-21-24 word mnemonics consistently? Is there a derivation path?
2. Is there a way to identify a block with only an integer to make request to an API? Like in ETH BTC TRX etc
Dec 21, 2022, 10:58 AM
1. ton, by default uses 24 words. check https://github.com/toncenter/tonweb-mnemonic/tree/master/src
Dec 21, 2022, 11:33 AM
Thanks for the answer! I see that it is possible to generate 12 word mnemonic and function doesn't prevent it. Do you know if there is any derivationpath-like tools to generate multiple addresses from one mnemonic?
I've also tried to generate few mnemonics with openmask, my bip39 tool says that they are invalid
Dec 21, 2022, 11:45 AM
seed or words?
Dec 21, 2022, 11:50 AM
It tells just "Invalid mnemonic", I've tried to compare lists and found that words are correct
https://github.com/slavafomin/tonweb
Does anyone know the current state of TS version of tonweb?
Does anyone know the current state of TS version of tonweb?
Dec 21, 2022, 12:05 PM
Well, it's work in progress. I don't have much time to work on it, but I'm trying to keep it somewhat alive. It already has bug fixes, performance improvements and new features, like a dedicated Slice class with all the useful Cell parsing methods. It also has a pretty good test coverage. But it's not up to date, regarding the latest vanilla TonWeb version. I'm planning to update it soon.
But I'm using it in production :)
Dec 21, 2022, 12:10 PM
which project?
Dec 21, 2022, 12:10 PM
Thanks for the info! for now think I will use both bits of TS and JS code when I will be working with TON. It's very cool to see a TS library, TRON doesn't have one lol
Dec 21, 2022, 12:11 PM
tronweb?
Dec 21, 2022, 12:11 PM
Yeah
Dec 21, 2022, 12:11 PM
Can't say, sorry. It's under NDA.
Dec 21, 2022, 12:11 PM
Tronweb
Dec 21, 2022, 12:11 PM
ok
can you tell how to become master in ton smart contract?
Dec 21, 2022, 12:13 PM
The TS version is very good when it comes to source code study, I've tried to make it much more clear and readable. It even has comments :)
You need to find the TON Smart Contracts Guild and finish the quest-line there.
Dec 21, 2022, 12:14 PM
TON Smart Contracts Guild?
Dec 21, 2022, 12:15 PM
It was a TES-related joke. Disregard this.
Dec 21, 2022, 12:16 PM
)))
Do I really need a private key to estimate tx fee?
Dec 21, 2022, 12:28 PM
I guess so, because you still need to sign the message.
Dec 21, 2022, 12:30 PM
Thanks, will consider it
Are there any heuristic methods for approximating the fee?
I will give an example:
In ETH i can use the data from gas station and ABI data to estimate fee for transfers/contract executions without requesting the network
TRX has some batshit insane energy system that grants you access to constant fee values after sessions of deep dark exploration of the docs
BTC just has vbytes and satoshis
Are there any ways to do something like that in TON
I will give an example:
In ETH i can use the data from gas station and ABI data to estimate fee for transfers/contract executions without requesting the network
TRX has some batshit insane energy system that grants you access to constant fee values after sessions of deep dark exploration of the docs
BTC just has vbytes and satoshis
Are there any ways to do something like that in TON
Dec 21, 2022, 12:35 PM
The TonWeb will send your message to the TonCenter (HTTP API) that will call the tonlib (a C++ library that implements TON stuff). It will execute the contract using your message and will calculate the fees without actually delivering it to the validator. If you are not on the web, it could be all done locally. There are actually solutions to execute contracts locally from JS, maybe you can use that.
Dec 21, 2022, 12:38 PM
Can you please elaborate regarding the solutions?
Ideally I would like to know if there is way to approximate fee only knowing what I'm transferring (TON or some other currency if thers is) and sender of the transfer
Ideally I would like to know if there is way to approximate fee only knowing what I'm transferring (TON or some other currency if thers is) and sender of the transfer
Dec 21, 2022, 12:40 PM
I haven't tried that myself. Maybe someone here will be able to better answer this question.
Dec 21, 2022, 12:41 PM
Thanks a lot for your help! I was very happy to have a chat with dev!
Dec 21, 2022, 12:42 PM
Sure, feel free to ask 👍🏻
Dec 21, 2022, 12:43 PM
There are even two of them: https://github.com/ton-society/ton-footsteps/issues/79. Which will become official is unknown (well, and I'm an interested party 🙂)
UPD: link to proposal is https://github.com/ton-blockchain/TEPs/pull/101
UPD: link to proposal is https://github.com/ton-blockchain/TEPs/pull/101
Dec 21, 2022, 12:57 PM
Also, I've checked current implementation of mnemonic generation (https://github.com/toncenter/tonweb-mnemonic/blob/master/src/functions/generate-mnemonic.ts I hope this is corrent) and found that it's incompatable with BIP39, because words need particular structure, not just random word from a wordlist. The last word needs to contain a checksum in order to be compatable with BIP39
There is a good description of this at this BTT thread https://bitcointalk.org/index.php?topic=5300691.0
There is a good description of this at this BTT thread https://bitcointalk.org/index.php?topic=5300691.0
Dec 21, 2022, 1:27 PM
Yes, only a subset of ETH seed phrases are compatible with TON.
Dec 21, 2022, 1:39 PM
ETH seed phrases?
Dec 21, 2022, 1:40 PM
The BIP39 seed phrases to be precise.
Dec 21, 2022, 1:44 PM