{"id":13338213,"url":"https://github.com/broxus/ton-api","last_synced_at":"2025-09-20T21:28:51.760Z","repository":{"id":66355196,"uuid":"211145766","full_name":"broxus/ton-api","owner":"broxus","description":"Simple, highly experimental, http wallet api for TON","archived":false,"fork":false,"pushed_at":"2019-11-27T19:08:57.000Z","size":524,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-23T20:13:35.913Z","etag":null,"topics":["api","client","http","ton","wallet"],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/broxus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-26T17:32:19.000Z","updated_at":"2024-09-15T11:08:38.000Z","dependencies_parsed_at":"2023-06-08T06:45:59.538Z","dependency_job_id":null,"html_url":"https://github.com/broxus/ton-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broxus%2Fton-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broxus%2Fton-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broxus%2Fton-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broxus%2Fton-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/broxus","download_url":"https://codeload.github.com/broxus/ton-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227432007,"owners_count":17775893,"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":["api","client","http","ton","wallet"],"created_at":"2024-07-29T19:15:37.403Z","updated_at":"2025-09-20T21:28:51.633Z","avatar_url":"https://github.com/broxus.png","language":"Scala","readme":"# TON API\n\n## Overview\nThis is a simple wallet http api for telegram open network client. Base on original [native-lib.cpp](https://github.com/ton-blockchain/ton/blob/master/example/android/native-lib.cpp), [Play Framework](https://github.com/playframework/playframework) and [TON client java wrapper](https://github.com/broxus/ton-client).\n\n## Supported OS\n\n* \u003cb\u003eLinux\u003c/b\u003e - build on Ubuntu 18.04 LTS and Java 8.\n\n* \u003cb\u003eMacOS\u003c/b\u003e - build on Sierra and Java 8.\n\nSupported features\n-----\n\n* Keys, create, import and export as seed phrase.\n\n* Accounts, create wallet, send grams, get statuses.\n\n* Transactions, account transaction history, messages and binary data.\n\nDocker\n----\nYou can use all in one docker to run api in your environment. [Dockerfile](Dockerfile) contains multistage build (min docker version 17.05).\nBuilder container install sbt and compile api in stage mode. Then pre-build api copy to runtime container based on openjdk:8-jre-slim docker image.\n\n```bash\n# build ton-api docker image\ndocker build --tag ton-api -f Dockerfile .\n\n# run ton-api docker\ndocker run --rm -ti --name ton-api -p 9000:9000 --mount type=bind,source=\"$(pwd)/keystore\",target=/app/keystore ton-api -J-Xmx2G -J-Xms2G\n\n# run ton-api docker with configuration override\ndocker run --rm -ti --name ton-api -p 9000:9000 --mount type=bind,source=\"$(pwd)/keystore\",target=/app/keystore -v $(pwd)/conf/ton.conf:/app/conf/ton.conf ton-api -J-Xmx2G -J-Xms2G\n\n# stop ton-api docker\ndocker kill ton-api\n```\n\nConfiguration\n----\n\nExample configuration [ton.conf](conf/ton.conf)\n\n```hocon\n\nton {\n  \n  // https://test.ton.org/ton-lite-client-test1.config.json\n  lite-client = \"\"\"{\n      \"liteservers\": [\n        {\n          \"ip\": 1137658550,\n          \"port\": 4924,\n          \"id\": {\n            \"@type\": \"pub.ed25519\",\n            \"key\": \"peJTw/arlRfssgTuf9BMypJzqOi7SXEqSPSWiEw2U1M=\"\n          }\n        }\n      ],\n      \"validator\": {\n        \"@type\": \"validator.config.global\",\n        \"zero_state\": {\n          \"workchain\": -1,\n          \"shard\": -9223372036854775808,\n          \"seqno\": 0,\n          \"root_hash\": \"VCSXxDHhTALFxReyTZRd8E4Ya3ySOmpOWAS4rBX9XBY=\",\n          \"file_hash\": \"eh9yveSz1qMdJ7mOsO+I+H77jkLr9NpAuEkoJuseXBo=\"\n        }\n      }\n    }\"\"\"\n    \n  // keystore path\n  keystore = \"keystore\"\n  \n  use-network-callback = false\n  verbosity-level = 0\n}\n```\n\nSwagger\n----\nSource swagger schema example can be accessible [here](public/swagger_ton_api.yaml). For interactive example run application using docker or sbt and open [http://localhost:9000/](http://localhost:9000)\n\nExamples\n----\n\n\u003cb\u003eCreate new key\u003c/b\u003e\n\n```bash\ncurl -X POST -H \"Content-Type: application/json\" -d '{}' http://localhost:9000/ton/v1/createNewKey\n```\n\n```json\n{\n  \"publicKey\":\"PuZSaVYlFFB6Or92_EmNwgm2t4pem62k9s3WDuC9H3QeF1Ue\",\n  \"password\":\"o+rEXFnd9dDrEiYza5qVIhyX40W2I96KA1ojUZC6YJs=\",\n  \"seed\":[\"assist\",\"crunch\",\"parade\",\"entry\",\"cost\",\"random\",\"pizza\",\"organ\",\"maximum\",\"beauty\",\"wait\",\"tent\",\"buyer\",\"mom\",\"erosion\",\"media\",\"reward\",\"barely\",\"fitness\",\"skill\",\"pave\",\"zoo\",\"sight\",\"moral\"]\n}\n```\n\n\u003cbr\u003e\n\n\u003cb\u003eRequest account address\u003c/b\u003e (account types supported: wallet and testWallet)\n\n```bash\ncurl -X POST -H \"Content-Type: application/json\" -d '{\"publicKey\":\"PuZSaVYlFFB6Or92_EmNwgm2t4pem62k9s3WDuC9H3QeF1Ue\", \"accountType\": \"testWallet\"}' http://localhost:9000/ton/v1/accountAddress\n```\n\n```json\n{\n  \"address\":\"EQALQWtEElfqoIP2ftiiugUmQ5J4JDERedFLyvXhjHGJK2xl\",\n  \"unpacked\":{\n    \"address\":\"0B416B441257EAA083F67ED8A2BA052643927824311179D14BCAF5E18C71892B\",\n    \"workchainId\":0,\n    \"bounceable\":true,\n    \"testnet\":false\n  }\n}\n```\n\n\u003cbr\u003e\n\n\u003cb\u003eRequest account status\u003c/b\u003e (balance, last transaction, seqno and state)\n\n```bash\ncurl -X POST -H \"Content-Type: application/json\" -d '{\"address\": \"EQALQWtEElfqoIP2ftiiugUmQ5J4JDERedFLyvXhjHGJK2xl\"}' http://localhost:9000/ton/v1/accountStatus\n```\n\n```json\n{\n  \"balance\":-1,\n  \"timestamp\":1570035498,\n  \"accountType\":\"uninited\",\n  \"lastTransaction\":{\n    \"hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\n    \"lt\":0\n  }\n}\n```\n\n\u003cbr\u003e\n\n\u003cb\u003eInit account\u003c/b\u003e (create wallet, account types supported: wallet and testWallet)\n\n```bash\ncurl -X POST -H \"Content-Type: application/json\" -d '{\"accountKey\": {\"publicKey\":\"PuZSaVYlFFB6Or92_EmNwgm2t4pem62k9s3WDuC9H3QeF1Ue\",\"password\":\"o+rEXFnd9dDrEiYza5qVIhyX40W2I96KA1ojUZC6YJs=\"}, \"accountType\": \"testWallet\"}' http://localhost:9000/ton/v1/initAccount\n```\n\n```json\n{\"status\": \"OK\"}\n```\n\n\u003cbr\u003e\n\n\u003cb\u003eSend grams\u003c/b\u003e\n\n```bash\ncurl -X POST -H \"Content-Type: application/json\" -d '{ \"sourceKey\": {\"publicKey\":\"PuZSaVYlFFB6Or92_EmNwgm2t4pem62k9s3WDuC9H3QeF1Ue\",\"password\":\"o+rEXFnd9dDrEiYza5qVIhyX40W2I96KA1ojUZC6YJs=\"}, \"sourceAccountType\": \"testWallet\", \"sourceSequence\": 1, \"destinationAddress\": \"EQDVdEsJ6mgOaYToip2Q_xBdnCHDxj0Ypqt3oPCU-Hmv1kX4\", \"amount\": 1000000000 }' http://localhost:9000/ton/v1/sendGrams\n```\n\n```json\n{\"status\": \"OK\"}\n```\n\n\u003cbr\u003e\n\n\u003cb\u003eImport key\u003c/b\u003e\n\n```bash\ncurl -X POST -H \"Content-Type: application/json\" -d '{ \"seed\": \"seed\":[\"assist\",\"crunch\",\"parade\",\"entry\",\"cost\",\"random\",\"pizza\",\"organ\",\"maximum\",\"beauty\",\"wait\",\"tent\",\"buyer\",\"mom\",\"erosion\",\"media\",\"reward\",\"barely\",\"fitness\",\"skill\",\"pave\",\"zoo\",\"sight\",\"moral\"] }' http://localhost:9000/ton/v1/importKey\n```\n\n```json\n{\n  \"publicKey\":\"PuZSaVYlFFB6Or92_EmNwgm2t4pem62k9s3WDuC9H3QeF1Ue\",\n  \"password\":\"o+rEXFnd9dDrEiYza5qVIhyX40W2I96KA1ojUZC6YJs=\"\n}\n```\n\n\u003cbr\u003e\n\n\u003cb\u003eTransaction history\u003c/b\u003e\n\n```bash\ncurl -X POST -H \"Content-Type: application/json\" -d '{ \"address\": \"EQALQWtEElfqoIP2ftiiugUmQ5J4JDERedFLyvXhjHGJK2xl\", \"lastTransaction\":{\"hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\"lt\":0}, \"withData\": false }' http://localhost:9000/ton/v1/transactionHistory\n```\n\n```json\n{\n  \"previousTransaction\":{\n    \"hash\":\"0000000000000000000000000000000000000000000000000000000000000000\",\n    \"lt\":0\n  },\n  \"transactions\":[]\n}\n```\n\n## License\n\n```\nCopyright 2019 FINEX FUTURE LTD\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbroxus%2Fton-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbroxus%2Fton-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbroxus%2Fton-api/lists"}