Skip to main content

Universal TON wallet

Project description

WARNING: some commands may be upgraded or changed

Functionality and examples

Easy installation with a single command for non developers

sh -c "$(curl -sSfL https://tonfactory.org/wton/install)"

Installation with pip3

$ pip3 install wton
$ wton init

WARNING: for better user experience use virtual environment (python3 -m venv venv & source venv/bin/activate)

wton encrypts all your wallets info in a keystore file using your password. Create an encrypted keystore and select it as a current keystore.

$ wton keystore new myKeystore
Password []:

$ wton config wton.keystore_name myKeystore

Create any type of a TON wallet

$ wton wallet create \
	PocketMoney \
	--workchain 0 \
	--version v4r2 \
	--comment “My main wallet” \
	--save-to-whitelist myPocketMoney

Add your contacts to a whitelist

$ wton whitelist add myBestFriend EQBP5aEPlmFNr4eS3DJw2ydC4X_hOumwZoqCcJgHVSQHjZWW

Transfer money from the wallet to a whitelist contact

$ wton transfer PockeyMoney myBestFriend 10 --message “Happy birthday!”

Features

Switch between mainnet and testnet

$ wton config --network mainnet

Keystore, wallet, whitelist commands support CRUD (create, read, update, delete. Some examples

$ wton wallet get oldWallet
Raw address: 0:4fe5a10f96614daf8792dc3270db2742e17fe13ae9b0668a827098075524078d
Nonbounceable address: UQBP5aEPlmFNr4eS3DJw2ydC4X_hOumwZoqCcJgHVSQHjchT
Bounceable address: EQBP5aEPlmFNr4eS3DJw2ydC4X_hOumwZoqCcJgHVSQHjZWW
Version: v4r2
Workchain: 0
Comment: None

$ wton wallet delete oldWallet
Are you sure you want to delete oldWallet wallet? [y/N]: y

$ wton whitelist edit myBestFriend --name myFriend

Backup and restore your keystores

$ wton keystore backup ./myKeystore.backup
Password []: 
Backup stores keys in UNENCRYPTED FORM. Are you sure want to export unencrypted keys to disk? [y/N]:
$ wton keystore restore myRestoredKeystore ./myKeystore.backup
Password []:

Export your wallet mnemonic words and import them in any official TON wallet

$ wton wallet reveal PocketMoney
Password []: 
cliff spin hawk artefact language volume subway surround nuclear lawn weird arrest mule cube impact crash abandon slender turn basic sentence actor you fix

Import wallet from mnemonic phrase

$ wton wallet import-from-mnemonics restoredWallet v4r2 0 “cliff spin hawk artefact language volume subway surround nuclear lawn weird arrest mule cube impact crash abandon slender turn basic sentence actor you fix”

Export your wallet to .addr and .pk files

$ wton wallet to-addr-pk PocketMoney ./destinationDir/
Password []:

List all wallets and whitelist contacts with verbose information. Also, you can redirect output into a .md file to see a nice table.

$ wton wallet list --verbose
|   Name   | Version | WC |                     Address                      |       Comment        |  State   |    Balance    |
|:--------:|:-------:|:--:|:------------------------------------------------:|:--------------------:|:--------:|:-------------:|
|  PockeyMoney  |   v4r2  | 0  | EQBP5aEPlmFNr4eS3DJw2ydC4X_hOumwZoqCcJgHVSQHjZWW | None |  Active  | 1.095236369 |
|  Another wallet  |   v3r2  | 0  | EQCS9ZmXTu-VlDLIsjcQMpMjF0PSdA_aTD6MqCHlaLUoTARS |         None         |  Active  |  1.095236369  |

$ wton whitelist list -v  > myContacts.md

For daily usage you may prefer our wton-interactive version

$ wton-interactive
[✓] Pick command: Keystores
[✓] Pick command: Open keystore
[✓] Choose keystore to use: good.keystore
[?] Pick command: List wallets
 > List wallets
   Transfer
   Create wallet
   Init wallet
   Get wallet
   Edit wallet
   Delete wallet
   Reveal wallet mnemonics
   Import from mnemonics
   Wallet to .addr and .pk
   Backup keystore
   Back

Integrations

Example of automatic salary payment, you may use cron to run pay_salary.sh

$ cat employee.info
employee1 EQDvtizebIVTGYASXgjYX5sHfkGLW8aFTa7wfYCyARIpARB0 10
employee2 EQA-Ri7Oftdjq--NJmuJrFJ1YqxYk6t2K3xIFKw3syhIUgUe 20
employee3 EQCNLRRZkvoqAW6zwYyy_BVwOBcMnwqvyrSpm8WnACdzXuu3 15.5

$ cat pay_salary.sh
cd ~/team_workspace/ton/
source venv/bin/activate
wton config --local wton.keystore_name yandex

input="./employees.info"
while IFS= read -r line
do
    stringarray=($line)
    name=${stringarray[0]}
    addr=${stringarray[1]}
    salary=${stringarray[2]}

    wton wallet transfer SalaryWallet $name $salary --wait
done < "$input"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wton-0.0.14.tar.gz (56.4 kB view details)

Uploaded Source

Built Distribution

wton-0.0.14-py3-none-any.whl (73.7 kB view details)

Uploaded Python 3

File details

Details for the file wton-0.0.14.tar.gz.

File metadata

  • Download URL: wton-0.0.14.tar.gz
  • Upload date:
  • Size: 56.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.11

File hashes

Hashes for wton-0.0.14.tar.gz
Algorithm Hash digest
SHA256 eb25a6e90ac89ae3a9fd8ab8b7a6ce28f6317e2f9a13307d4eeb44a23d97e6aa
MD5 b383acf0daa27e0f0bbfe105f6a184b9
BLAKE2b-256 107c2b8613de3e92ac3b38f498401aff5bd118b66a6ff97d533155c809150741

See more details on using hashes here.

File details

Details for the file wton-0.0.14-py3-none-any.whl.

File metadata

  • Download URL: wton-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 73.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.11

File hashes

Hashes for wton-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 4762e53693d602be50887f6b09a4476f539056b9c391ef30f99baaa4990312d8
MD5 80df24fe0058fd98811eddc8884f79cc
BLAKE2b-256 09dd17ad313ed4f685ad4fff3c20b573778f1f5aee1f33492d51d0699c637f3a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page