{"id":23470873,"url":"https://github.com/xanders/tron-wallet","last_synced_at":"2025-04-13T00:57:16.270Z","repository":{"id":190865520,"uuid":"683483890","full_name":"Xanders/tron-wallet","owner":"Xanders","description":"Simple Tron CLI wallet","archived":false,"fork":false,"pushed_at":"2023-08-30T18:37:47.000Z","size":2003,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T00:57:13.182Z","etag":null,"topics":["crypto","tron","wallet"],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Xanders.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-26T18:06:49.000Z","updated_at":"2023-08-27T07:43:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"7bb206fd-b8ad-47d6-a662-9ce56f089738","html_url":"https://github.com/Xanders/tron-wallet","commit_stats":null,"previous_names":["xanders/tron-wallet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xanders%2Ftron-wallet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xanders%2Ftron-wallet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xanders%2Ftron-wallet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xanders%2Ftron-wallet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xanders","download_url":"https://codeload.github.com/Xanders/tron-wallet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650436,"owners_count":21139672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crypto","tron","wallet"],"created_at":"2024-12-24T16:17:05.194Z","updated_at":"2025-04-13T00:57:16.249Z","avatar_url":"https://github.com/Xanders.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tron Wallet\n\nSimple [Tron](https://tron.network/) CLI wallet without backdoors\n\n(trust me, I am very honest)\n\n## IMPORTANT\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,\nunder [MIT license](LICENSE.txt).\n*This means you can lose all your real money and we will not care about it.\nSorry.*\n\nThis wallet is maintained by enthusiasts in their free time.\nIt can be not up to date with the current Tron API.\nYour private key may not work.\nYour operations may stuck in the middle.\nYou can see an incorrect balance in your wallet.\nA lot of functions are not implemented.\nAnd there are a lot of errors in the existing ones.\n\n**Use it AT YOUR OWN RISK.**\n\n...still, it is a perfect tool for testing Tron payments\nin your projects via testnet.\n\n## Usage\n\nWith this wallet, you can connect to any Tron node in mainnet or testnet.\n\nUsing various commands you can create or import any number\nof key-address pairs (**accounts**). Each account has its own password,\nused to encrypt your private key in the local SQLite.\nSo even with your SQLite file, `wallet.db`, a marvelous actor cannot access your money.\n\n**It's recommended to backup your `wallet.db` on the external drive\nand your passwords in a physical paper notebook. Do it every time you add\na new account to the wallet. If you lose any of those two components,\nyou will not be able to access your money!**\n\nYou can manage TRC20 smart contracts to be able to deal with USDT, USDC, etc.\nArbitrary (non-currency) contracts are not supported.\n\nStaking and voting are supported, but in case of unstake, you will not able\nto see your money in this wallet for two weeks at the moment of writing.\n\nThere is a simple address book under the `book` command for your convenience.\n\n### Run with Docker\n\nThe simplest way to use the wallet is [Docker](https://www.docker.com/products/docker-desktop/):\n\n```bash\ndocker run --rm -it -v ~:/home xanders/tron-wallet\n```\n\n[The image](https://hub.docker.com/repository/docker/xanders/tron-wallet) is extra tiny, **20.9MB**, statically built from scratch.\n\nThe `-v ~:/home` part means you will mount your host home directory\ninto the container, so the wallet database will be stored here.\nOn Windows `~` does not work, use `%homedrive%%homepath%` instead.\n\n⚠️ **WARNING:** ⚠️ do NOT use Docker volumes to store the wallet database,\nbecause it's too easy to delete the volume occasionally.\nAnd never run the image without `-v` at all. Both cases will lead to\n**irreversible loss of your money**.\n\nSo:\n\n```bash\ndocker run --rm -it xanders/tron-wallet # ❌ BAD ❌\ndocker run --rm -it -v very-secure-volume:/home xanders/tron-wallet # ❌ BAD ❌\ndocker run --rm -it -v ~:/home xanders/tron-wallet # ✔️ GOOD ✔️\ndocker run --rm -it -v /my/own/secure/path:/home xanders/tron-wallet # 🔐 BEST 🔐\n```\n\nBy default, Tron Wallet will create a hidden `.local` folder\nin the given path and a `tron-wallet` folder inside to store the `wallet.db`.\nYou can change this behavior with the environment variables described below.\n\nThe only good option to use volumes is while using the testnet.\n\n### Run without Docker\n\n* Install [Crystal Language](https://crystal-lang.org/) `\u003e= 1.8.0`\n* Install `libreadline-dev`, `libsqlite3-dev`\n* Clone [this repo](https://github.com/Xanders/tron-wallet)\n* Run `make shards release install`\n* From any directory run `tron-wallet`\n\n### Inside\n\nPrint `help` to list available commands:\n\n![Tron Wallet screenshot](screenshot.png)\n\n### Configuration\n\nYou can use the following environment variables:\n\n* `TRON_WALLET_DB_DIR`: path to the directory where Tron Wallet will store its database, default: `$HOME/.local/tron-wallet` (`$HOME` is `/home` in the Docker image)\n* `TRON_WALLET_DEFAULT_NODE_URL`: Tron node URL to connect to, default: ask on first start ([list of mainnet nodes](https://tronprotocol.github.io/documentation-en/developers/official-public-nodes/), remember to add `:8090` after IP)\n* `TRON_WALLET_DEFAULT_MAX_FEE`: maximum allowed fee for transaction in TRX, default: ask on first start\n* `TRON_WALLET_PREDEFINED_CONTRACTS`: contracts that should be added to the database at initial startup in the form of `NAME1:address1,NAME2:address2,\u003c...\u003e`, default: none (see [USDT](https://tron.network/usdt), [USDC](https://tron.network/usdc))\n* `TRON_WALLET_ONE_INSECURE_PASSWORD`: when set, will be used for all password prompts, **NEVER USE IT ON MAINNET**, default: use own password for every address\n* `TRON_WALLET_CHECK_IS_NODE_OUT_OF_SYNC`: by default, Tron Wallet checks the difference between the given Tron node's current block and the current block on TronScan. The check performing at wallet startup. This is useful in case you have your own node and want to be sure it isn't stuck. However, there is no TronScan API for testnet, so in this case or case of a private Tron network you should set this variable to `false` (lowercased).\n\n*Note:* node URL and maximum commission can be adjusted in runtime\nand saved into the database via the `settings` command.\n\n### When developing Tron-related applications\n\nIt is a common case to use the wallet connected to testnet\nwhen developing Tron-related applications. For this case,\nyou can add this Tron Wallet to your `docker-compose.yml`:\n\n```yaml\nname: my-cool-project\n\nservices:\n  tron-wallet:\n    image: xanders/tron-wallet\n    tty: true # To be able to attach\n    stdin_open: true # To be able to attach\n    volumes:\n      tron-wallet:/home # Use the volumes only for testnet!\n    environment:\n      TRON_WALLET_DEFAULT_NODE_URL: \"https://api.shasta.trongrid.io\" # See https://www.trongrid.io/shasta\n      TRON_WALLET_DEFAULT_MAX_FEE: \"100\"\n      TRON_WALLET_PREDEFINED_CONTRACTS: \"USDT:TG3XXyExBkPp9nzdajDZsozEu4BkaSJozs\" # This is Shasta testnet USDT address, NOT mainnet\n      TRON_WALLET_ONE_INSECURE_PASSWORD: \"absolutely-insecure\" # Please change to another insecure phrase\n      TRON_WALLET_CHECK_IS_NODE_OUT_OF_SYNC: \"false\" # Always `false` for testnet or private network\n\nvolumes:\n  tron-wallet:\n```\n\nAnd now you can run your wallet in the background and connect at any moment:\n\n```bash\ndocker compose up tron-wallet -d\ndocker attach my-cool-project-tron-wallet-1\n```\n\n*(hit `enter` after attach to see the output)*\n\nWhile you *can* mount a folder in your project to store the `wallet.db`,\nplease *do not do that*. It's too simple for a random developer\nto switch to mainnet, add some accounts, and then push to the repo.\nThis is the case where using volumes is better. Or you can add\nthe mounted folder to the `.gitignore`, it is safe too.\n\nIf you need to have some pre-defined accounts or address book records,\nplease open an issue, and we can add such functionality.\n\n*Note:* Tron Wallet was **not** designed as Crystal Shard. It does not\nhave a stable API and relies on user interaction in a lot of places.\nIf you creating a Tron-related project in Crystal, then — wow — please\nopen an issue to discuss how we can design an API together.\n\n## Contribute\n\nWell, you know. 🍴 Fork and create the Pull Request.\nOr create an issue for a feature request or bug report.\nAny help is welcome!\n\nRun `make` to list all the commands available.\nConsider using the `debug` wallet command to see API requests and responses.\n\n## TODO\n\n- [ ] Refactor source, add with_decrypt block\n- [x] Show energy and bandwidth in balance\n- [x] Add stacking TRX\n- [ ] Add inline swap coins through exchange\n- [ ] Add autocomplete commands by TAB\n- [x] Edit wallet names\n- [ ] Edit contracts, book records\n- [x] Add link to transactions on TronScan","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxanders%2Ftron-wallet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxanders%2Ftron-wallet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxanders%2Ftron-wallet/lists"}