Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!



 1319

TON Seed Phrase Checker and Permanent Auto Withdrawal from Wallets

by sehays - 01 November, 2024 - 10:39 PM
This post is by a banned member (sehays) - Unhide
sehays  
Supreme
1.484
Posts
1.293
Threads
1 Year of service
#1
Preface

Since I started learning how to work with the TON blockchain, I decided to develop several tools that might be useful for forum participants. This article will present two programs: the first is a checker that checks seed phrases for validity and balance, and the second is a program for constant monitoring of wallet balances. If a non-zero balance is detected on the wallet, the program will automatically withdraw funds. Both tools are designed to work with TON wallets.

How the seed phrase checker will work:

First, the seed phrases will be taken from the txt.
Then a wallet will be created based on the seed phrase.
After that, the wallet balance will be determined.
When checking the balance, there will be several checks, for example, in case the balance is zero or the seed phrase is invalid.
After checking the wallets, the results of the check will be output to the console and written to a new txt.

How will the software for automatic withdrawal work?

Seed phrases from a TXT file will be taken.
Then wallets will be created based on them.
After that, the balance will be checked to ensure that it is not zero.
Then a transaction will be created for 90% of the amount in the wallet.
PS All this software will work in an infinite loop, so the program will endlessly check the balance and display a message if it is replenished on the wallets.

PSS All software will be tested only in the test network due to the lack of TON. The main library for implementing the idea will be tonutils, and the API will be used from tonconsole (TonapiClient) - https://tonconsole.com/ .
You can get TON in the test network in this telegram bot - @testgiver_ton_bot.
To correctly withdraw and replenish wallets, you will need to activate them by sending TON to each other (if new regs are used for the test).
To find out if the wallet is active, you can follow this link: https://testnet.tonapi.io/v2/accounts/wallet_address . On the page that opens, find the "status" key.

Seed Phrase Checker
The first thing that will be implemented is the software for checking validity and balance, and immediately you need to specify several variables, including not forgetting to specify the API from tonconsole (TonapiClient).

Hidden Content
You must register or login to view this content.


Next comes the main logic; it must be inside an asynchronous function, because the methods called from the tonutils library are asynchronous, and it will not be possible to call them outside an asynchronous function.

Hidden Content
You must register or login to view this content.


As you can see from the code, the TonAPI client is initialized first. Then come variables with zero values; these variables are needed to create statistics at the end of the seed-phrase check. The -> None construct is not necessary here, it is only needed to indicate that the function does not return anything; in this case, it simply improves the readability of the code.

Next, you need to open the text file with the seeds and write all the seeds to a variable.

Hidden Content
You must register or login to view this content.


Then comes the main logic, which is to create a wallet from the seed phrase, check the balance and write the results to TXT.

Hidden Content
You must register or login to view this content.


At the very beginning, two text files are opened: one contains the general results with valid wallets and amounts on them, and the second contains only the seed phrases that have successfully passed the check, without any unnecessary information. This is done so that in the future, in the second software, TXT can be used only with working wallets without other garbage.

With the software for checking validity and balance, that's it. This is what the result looks like:
[Image: Capture-d-cran-2024-11-01-212517.png]
[Image: Capture-d-cran-2024-11-01-212723.png]
[Image: Capture-d-cran-2024-11-01-212935.png]

P.S. Displaying the balance without displaying the seed phrase is due to the wallet status being inactive. You can check the status at this link: https://testnet.tonapi.io/v2/accounts/wallet . On the page that opens, find the "status" key.

Auto withdrawal
Now we can start writing the second program. The first thing we will do is create some necessary variables.


Hidden Content
You must register or login to view this content.


There will be two functions in this project. The first function will initialize the client, read the seed phrases from a text file and run the second function.

Hidden Content
You must register or login to view this content.


As you can see from the code, the check_and_transfer function is called with the seed phrase passed to it. Now we need to write the logic of this called function.

Hidden Content
You must register or login to view this content.


I would like to note that a repeated attempt to verify the wallet is necessary because the API used has a limit of 1 request per second, and the API rejects requests quite often. I have not found another solution to this problem, except to create several API keys from different accounts and alternate them. I

also wanted to explain how transaction creation works. The transfer method from the tonutils library is called, to which such parameters as the sending address, amount and comment are passed. The transaction hash comes in response from this method. The thing is that even if the transaction is canceled, the method will send a message about the successful sending of the transaction, so you need to add a check that the transaction was actually successful. To do this, you need to get information about transactions on the wallet where the money is sent, and check the most recent transaction for the "success" key; this flag must be true. To get information about transactions, you need to use this API address: testnet.tonapi.io/v2/blockchain/accounts/wallet_address/transactions.

So the first thing that will be done is a new function to check transactions.

Hidden Content
You must register or login to view this content.


I want to note a couple of things. Receiving a response from the API is inside the for loop, because if you take it outside the loop, then if the transaction is not confirmed, the same response from the API will be taken again, as a result, the data will be outdated. Also, retries were added so that the transaction has time to be confirmed.

Now this function must be called after sending the transaction inside the check_and_transfer function.

Hidden Content
You must register or login to view this content.


The 5-second pause was set so that the transaction would appear in the list in principle, since according to my observations, it appears on average after 3–5 seconds.

Here are the results of this software:
[Image: Capture-d-cran-2024-11-01-213420.png]
[Image: Capture-d-cran-2024-11-01-213518.png]
[Image: Capture-d-cran-2024-11-01-213615.png]
As you can see, after each payment the amount really changed, this can only mean that the auto-withdrawal works and the balance was really transferred.

This completes the software for checking the balance by seed phrase and the software for auto-withdrawal.

Generate seed phrases and search for wallets with balance

I also just want to show a script that generates seed phrases, then wallets from them and checks their balance. A kind of casino with almost zero chance of winning (this software reminds me of Jingleminer, with the same minimal chance, but still not zero).

Hidden Content
You must register or login to view this content.


When generating random wallets from seed phrases and checking the balance, a 404 error may occur. This is due to the fact that empty wallets without transfers and with an inactive status are not displayed in this API (tonconsole). If the wallet is active, there will be no such error. Also, even if a 404 error occurs, the generated wallet is still written to a text file along with its seed phrase.

Conclusion

I think this is where the article comes to an end. It turned out to be quite simple, but I think it is not useless. I tried to create software that can be useful to users of this forum. Of course, the software is not that fast, but due to the use of an API with a limit of 1 request per second, it will not be possible to make it faster. If you have ideas on how to improve the performance of this software, I will be happy to read about it in the comments.

Link to the article in the form of a document - https://docs.google.com/document/d/1Hdpr...sp=sharing

Also, if you want to test these softwares in a test network or in practice, then I provide you with a link to the GitHub repository - https://github.com/overlordgamedev/Check...phrase-TON


leaving a like is much appreciated and help me to keep publishing threads.
This post is by a banned member (dindindind) - Unhide
32
Posts
0
Threads
#2
tytyt bump
This post is by a banned member (fym_rolex) - Unhide
fym_rolex  
Registered
2
Posts
0
Threads
#3
hope works hioe works hope works
This post is by a banned member (tigwi25) - Unhide
tigwi25  
Registered
2
Posts
0
Threads
#4
good job bro smart tool
This post is by a banned member (r3born67) - Unhide
r3born67  
Registered
9
Posts
1
Threads
#5
(01 November, 2024 - 10:39 PM)sehays Wrote: Show More
Preface

Since I started learning how to work with the TON blockchain, I decided to develop several tools that might be useful for forum participants. This article will present two programs: the first is a checker that checks seed phrases for validity and balance, and the second is a program for constant monitoring of wallet balances. If a non-zero balance is detected on the wallet, the program will automatically withdraw funds. Both tools are designed to work with TON wallets.

How the seed phrase checker will work:

First, the seed phrases will be taken from the txt.
Then a wallet will be created based on the seed phrase.
After that, the wallet balance will be determined.
When checking the balance, there will be several checks, for example, in case the balance is zero or the seed phrase is invalid.
After checking the wallets, the results of the check will be output to the console and written to a new txt.

How will the software for automatic withdrawal work?

Seed phrases from a TXT file will be taken.
Then wallets will be created based on them.
After that, the balance will be checked to ensure that it is not zero.
Then a transaction will be created for 90% of the amount in the wallet.
PS All this software will work in an infinite loop, so the program will endlessly check the balance and display a message if it is replenished on the wallets.

PSS All software will be tested only in the test network due to the lack of TON. The main library for implementing the idea will be tonutils, and the API will be used from tonconsole (TonapiClient) - https://tonconsole.com/ .
You can get TON in the test network in this telegram bot - @testgiver_ton_bot.
To correctly withdraw and replenish wallets, you will need to activate them by sending TON to each other (if new regs are used for the test).
To find out if the wallet is active, you can follow this link: https://testnet.tonapi.io/v2/accounts/wallet_address . On the page that opens, find the "status" key.

Seed Phrase Checker
The first thing that will be implemented is the software for checking validity and balance, and immediately you need to specify several variables, including not forgetting to specify the API from tonconsole (TonapiClient).

When generating random wallets from seed phrases and checking the balance, a 404 error may occur. This is due to the fact that empty wallets without transfers and with an inactive status are not displayed in this API (tonconsole). If the wallet is active, there will be no such error. Also, even if a 404 error occurs, the generated wallet is still written to a text file along with its seed phrase.

Conclusion

I think this is where the article comes to an end. It turned out to be quite simple, but I think it is not useless. I tried to create software that can be useful to users of this forum. Of course, the software is not that fast, but due to the use of an API with a limit of 1 request per second, it will not be possible to make it faster. If you have ideas on how to improve the performance of this software, I will be happy to read about it in the comments.

Link to the article in the form of a document - https://docs.google.com/document/d/1Hdpr...sp=sharing

Also, if you want to test these softwares in a test network or in practice, then I provide you with a link to the GitHub repository - https://github.com/overlordgamedev/Check...phrase-TON


leaving a like is much appreciated and help me to keep publishing threads.

Thank you so much!
This post is by a banned member (leaf50) - Unhide
leaf50  
Premium Member
149
Posts
0
Threads
#6
thx
This post is by a banned member (undercoverha) - Unhide
222
Posts
2
Threads
#7
tyy bump
This post is by a banned member (austroo) - Unhide
austroo  
Registered
38
Posts
0
Threads
#8
(This post was last modified: 12 November, 2024 - 04:51 PM by austroo.)
nhhas

gagaga

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 1 Guest(s)