{"id":17808128,"url":"https://github.com/xelaj/tl","last_synced_at":"2025-03-17T14:31:46.215Z","repository":{"id":61568990,"uuid":"489792864","full_name":"xelaj/tl","owner":"xelaj","description":"⚡️ Native and ultrafast TL parser for your integrations!","archived":false,"fork":false,"pushed_at":"2024-03-11T20:16:56.000Z","size":355,"stargazers_count":11,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-10T15:52:45.636Z","etag":null,"topics":["awesome","awesome-golang","cryptocurrency","go","golang","mtproto","tdlib","telegram","telegram-bot","ton"],"latest_commit_sha":null,"homepage":"","language":"Go","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/xelaj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":null},"created_at":"2022-05-07T22:17:34.000Z","updated_at":"2024-12-20T15:21:48.000Z","dependencies_parsed_at":"2024-03-11T21:31:26.565Z","dependency_job_id":"35a189e7-34bb-4e58-86f8-33766512a67a","html_url":"https://github.com/xelaj/tl","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/xelaj%2Ftl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xelaj%2Ftl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xelaj%2Ftl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xelaj%2Ftl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xelaj","download_url":"https://codeload.github.com/xelaj/tl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244050338,"owners_count":20389679,"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":["awesome","awesome-golang","cryptocurrency","go","golang","mtproto","tdlib","telegram","telegram-bot","ton"],"created_at":"2024-10-27T15:06:39.968Z","updated_at":"2025-03-17T14:31:45.664Z","avatar_url":"https://github.com/xelaj.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cp align=\"center\"\u003eTypeLang\u003cp\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"./docs/assets/ton_green.svg\" width=\"200\"\u003e\n\u003cimg src=\"./docs/assets/filler.svg\" width=\"100\"\u003e\n\u003cimg src=\"./docs/assets/telegram_green.svg\" width=\"200\"\u003e\n\u003c/p\u003e\n\n\u003c!-- markdownlint-disable MD013 --\u003e\n\u003c!-- it's unable to past links as references, when you trying to center links--\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://pkg.go.dev/github.com/xelaj/tl\"\u003e\n\u003cimg src=\"https://gist.githubusercontent.com/quenbyako/9aae4a4ad4ff0f9bab9097f316ce475f/raw/go_reference.svg\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://goreportcard.com/report/github.com/xelaj/tl\"\u003e\n\u003cimg src=\"https://img.shields.io/static/v1?label=go+report\u0026message=A%2b\u0026color=success\u0026labelColor=27303B\u0026style=for-the-badge\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://codecov.io/gh/xelaj/tl\"\u003e\n\u003cimg src=\"https://img.shields.io/codecov/c/gh/xelaj/tl?labelColor=27303B\u0026label=cover\u0026logo=codecov\u0026style=for-the-badge\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://bit.ly/2xlsVsQ\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/chat-telegram-0088cc?labelColor=27303B\u0026logo=telegram\u0026style=for-the-badge\"\u003e\n\u003c/a\u003e\n\u003cbr/\u003e\n\u003ca href=\"https://github.com/xelaj/tl/releases\"\u003e\n\u003cimg src=\"https://img.shields.io/github/v/tag/xelaj/tl?labelColor=27303B\u0026label=version\u0026sort=semver\u0026style=for-the-badge\"\u003e\n\u003c/a\u003e\n\u003cimg src=\"https://img.shields.io/static/v1?label=stability\u0026message=stable\u0026labelColor=27303B\u0026color=success\u0026style=for-the-badge\"\u003e\n\u003ca href=\"https://github.com/xelaj/tl/blob/main/LICENSE.md\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/license-MIT%20(no%20🇷🇺)-green?labelColor=27303B\u0026style=for-the-badge\"\u003e\n\u003c/a\u003e\n\u003cimg src=\"https://img.shields.io/static/v1?label=%d1%81%d0%bb%d0%b0%d0%b2%d0%b0\u0026message=%d0%a3%d0%ba%d1%80%d0%b0%d1%97%d0%bd%d1%96\u0026color=ffd700\u0026labelColor=0057b7\u0026style=for-the-badge\"\u003e\n\u003c!--\ncode quality\ngolangci\ncontributors\ngo version\ngitlab pipelines\n--\u003e\n\u003c/p\u003e\n\u003c!-- markdownlint-enable MD013 --\u003e\n\n\u003cp align=\"center\"\u003e\nFull native implementation of TL serializing language. Simple and fast.\n\u003c/p\u003e\n\n**english** [русский][inex_ru]\n\n## 🤔 What is it?\n\nTL is a serialization format, created by Telegram and TON devs. This format\nslightly looks like Protobuf, but has a lot of exotic differences, which creates\nsome issues with working about this format. This package solve a lot of stuff\nand handle 90% of your routine, related to serialization (and trust me, this\nroutine could be a pain, that's why we created xelaj/tl).\n\n## ✨ Features\n\n* Probably the best golang package for parsing TL schemas\n* Auto code generation of implementation your spec\n* Supports TL-B for TON Blockchain\n* And many many more 😲\n\n## 👨‍💻 How to use\n\nHere are some usage cases, how you can do some stuff:\n\n### Basic usage\n\n``` go\npackage main\n\nimport \"github.com/xelaj/tl\"\n\ntype RepoUser struct {\n    _       struct{} `tl:\"someBitflag,bitflag\"`\n    Nick    string\n    Creator bool `tl:\",omitempty:someBitflag:0,implicit\"`\n    Editor  bool `tl:\",omitempty:someBitflag:7,implicit\"`\n}\n\nfunc (c *RepoUser) CRC() uint32 { return 0x12345678 }\n\nfunc main() {\n    tl.RegisterObjects((*RepoUser)(nil))\n\n    response := \u0026RepoUser{\n        Nick:    \"Hello user!\",\n        Creator: true,\n        Editor:  true,\n    }\n\n    println(tl.Marshal(response))\n    // And boom! 💥 You have decoded object!\n}\n```\n\n[![Run in playground][shield_go_play]](https://go.dev/play/p/Cw25cFM-WDx)\n\n### Run codegen\n\n```sh\n🔘 $ brew install tlgen\n\n     Processing... Done!\n\n🟢 $ cat schema.tl | tlgen generate \\\n        --package-name=\"github.com/username/tonlib\" \\\n        --output=\"./path/to/generate\" \\\n        --file-prefix=\"tl\" \\      # ➡ tl_stuff_gen.go or tl_gen.go\n        --split-files             # ➡ split by 4 files depend on object type\n\n🟢 $ ls ./path/to/generate\n\n     drwxr-xr-x+   4 username  staff   3.3K Oct 11 2049 .\n     drwxr-xr-x  104 username  staff   224B Oct 11 2049 ..\n     -rw-rw-r--    4 username  staff   4.1K Oct 11 2049 tl_enums_gen.go\n     -rw-rw-r--    4 username  staff   900B Oct 11 2049 tl_init_gen.go\n     -rw-rw-r--    4 username  staff   1.8K Oct 11 2049 tl_interfaces_gen.go\n     -rw-rw-r--    4 username  staff   3.2K Oct 11 2049 tl_methods_gen.go\n\n🟢 $ # Tadah! You have multiple files, but you can combine them into single one!\n\n```\n\n[![View demo][shield_view_demo]](https://go.dev/play/)\n\n### Parse messages without codegen\n\nTODO\n\n### Something else\n\n**Code examples are [here][gh_examples]**\n\n**Full docs are [here][godoc]**\n\n## ⌚️ Getting started\n\nTODO\n\n### Why TL serializing is **SO** ugly?\n\nWell... Read [this issue][ton_issue] about TON source code, when it was released\nfirst time. Remember: current TON developers are absolutely another guys. Use\ngoogle translate, this issue will answer to all your questions.\n\nTelegram devs are really strange\n\n## 🤔 Differences between TL and TL-B\n\nВы наверняка заметили, что логотип этого проекта это на самом деле два логотипа — telegram и ton. Однако, формат в ton обратно несовместим с тем же форматом в telegram. При этом, между ними очень много общего, поэтому вцелом довольно реально объеденить оба формата в одну библиотеку. При этом, в отличии от разработчиков telegram, разработчики ton более благосклонны к кооперации, так что вполне возможно, что поддержка ton будет даже более качественной\n\n\u003c!--\nhttps://github.com/ton-blockchain/wallet-android/blob/-/app/jni/ton/crypto/block/block-auto.cpp\n\nгенератор\n\nhttps://github.com/ton-blockchain/ton/blob/-/crypto/tl/tlbc-gen-cpp.cpp\n--\u003e\n\n## 🦊 Who use it\n\n* [MTProto][mtproto]\n* Mmmm...me?\n\n## 💎 Contributing\n\nPlease read [contributing guide][gh_contributing] if you want to help. And the\nhelp is very necessary!\n\n**Don't want code?** Read [this page][gh_support]! We love nocoders!\n\n## 🐛 Security bugs?\n\nPlease, **don't** create issue which describes security bug, this can be too\noffensive! Instead, please read [this notification][gh_security] and follow that\nsteps to notify us about problem.\n\n## 🏋️ TODO\n\n* [x] Full implementation of Tl serializing\n* [x] Tool to generate golang code\n* [ ] Write amazing docs\n* [ ] Create full toolset to support TL\n* [ ] make support of TL-B (incompatible version, used by TON)\n* [ ] Write RFC specification?\n* [ ] write good security policy\n* [ ] setup taskfile for markdown linter\n\n## 📒 Running project scripts\n\nThis project uses [go-task][taskfile], it's not important to understand, what's\ngoing on, (since you can just see into `Taskfile.yaml` and see all commands).\nFor better experience, you can download go-task and run tasks e.g. via\n`$ task \u003ctaskname\u003e`. All tasks can be shown via `$ task --list-all`\n\n## 👨‍👩‍👧‍👦 Authors\n\n* **Richard Cooper** \u003c[rcooper.xelaj@protonmail.com](mailto:rcooper.xelaj@protonmail.com)\u003e\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE][license_en]\nfile for details\n\nЕсли вы находитесь в россии, или как-либо связаны с российским правительством,\n(например, являетесь российским налогоплательщиком) на вас распостраняется\n[отдельная лицензия][license_ru].\n\n## One important thing\n\nEven that maintainers of this project are generally from russia, we still stand\nup with Ukraine, and from beginning of war, decided to stop paying any taxes, or\ncooperate in any case with government, and companies, connected with government.\nThis is absolutely nothing compared to how much pain putin brought to the\nfraternal country. And we are responsible for our inaction, and the only thing\nwe can do is to take at least any actions that harm putin’s regime, and help the\nvictims of regime using all resources available for us.\n\u003cimg src=\"./docs/assets/by_flag.svg\" height=\"16\"\u003e\n\u003cimg src=\"./docs/assets/ru_flag.svg\" height=\"16\"\u003e\n\u003cimg src=\"./docs/assets/ua_flag.svg\" height=\"16\"\u003e\n\n\u003c!--\nV2UndmUga25vd24gZWFjaCBvdGhlciBmb3Igc28gbG9uZwpZb3\nVyIGhlYXJ0J3MgYmVlbiBhY2hpbmcgYnV0IHlvdSdyZSB0b28g\nc2h5IHRvIHNheSBpdApJbnNpZGUgd2UgYm90aCBrbm93IHdoYX\nQncyBiZWVuIGdvaW5nIG9uCldlIGtub3cgdGhlIGdhbWUgYW5k\nIHdlJ3JlIGdvbm5hIHBsYXkgaXQKQW5kIGlmIHlvdSBhc2sgbW\nUgaG93IEknbSBmZWVsaW5nCkRvbid0IHRlbGwgbWUgeW91J3Jl\nIHRvbyBibGluZCB0byBzZWU=\n--\u003e\n\n--------------------------------------------------------------------------------\n\n\u003cp align=center\u003e\u003csub\u003e\u003csub\u003e\nCreated with love 💜 and magic 🦄 \u003c/br\u003e Xelaj Software, 2022-2024\n\u003c/sub\u003e\u003c/sub\u003e\u003c/p\u003e\n\n[mtproto]:       https://github.com/xelaj/mtproto\n[taskfile]:      https://taskfile.dev/\n[ton_issue]:     https://github.com/ton-blockchain/ton/issues/31\n[telegram_chat]: https://t.me/xelaj_developers\n\n\u003c!-- images --\u003e\n\n[goreport_card]: https://goreportcard.com/badge/github.com/xelaj/tl\n\n\u003c!-- localizations --\u003e\n[inex_ru]: https://github.com/xelaj/tl/blob/-/docs/ru_RU/README.md\n\n\u003c!-- project links --\u003e\n[godoc]:              https://pkg.go.dev/github.com/xelaj/tl\n[license_ru]:         https://github.com/xelaj/tl/blob/-/docs/ru_XZ/LICENSE.md\n[license_en]:         https://github.com/xelaj/tl/blob/-/LICENSE.md\n[gh_examples]:        https://github.com/xelaj/tl/blob/-/examples\n[gh_security]:        https://github.com/xelaj/tl/blob/-/.github/SECURITY.md\n[gh_support]:         https://github.com/xelaj/tl/blob/-/.github/SUPPORT.md\n[gh_contributing]:    https://github.com/xelaj/tl/blob/-/.github/CONTRIBUTING.md\n[gh_project]:         https://github.com/xelaj/tl/projects\n[gh_discussions]:     https://github.com/xelaj/tl/discussions\n[gh_discussions_faq]: https://github.com/xelaj/tl/discussions/categories/q-a\n[CoC]:                https://github.com/xelaj/tl/blob/-/.github/CODE_OF_CONDUCT.md\n\n[shield_go_play]:    https://gist.githubusercontent.com/quenbyako/9aae4a4ad4ff0f9bab9097f316ce475f/raw/go_playground.svg\n[shield_view_demo]:  https://gist.githubusercontent.com/quenbyako/9aae4a4ad4ff0f9bab9097f316ce475f/raw/view_demo.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxelaj%2Ftl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxelaj%2Ftl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxelaj%2Ftl/lists"}