{"id":27215577,"url":"https://github.com/shiny-lua/capsule-miniapp","last_synced_at":"2025-06-11T18:06:15.643Z","repository":{"id":263016208,"uuid":"888574720","full_name":"shiny-lua/capsule-miniapp","owner":"shiny-lua","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-14T16:27:52.000Z","size":309,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T04:34:21.958Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/shiny-lua.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":"2024-11-14T16:25:15.000Z","updated_at":"2024-11-19T13:20:09.000Z","dependencies_parsed_at":"2024-11-15T16:42:53.389Z","dependency_job_id":null,"html_url":"https://github.com/shiny-lua/capsule-miniapp","commit_stats":null,"previous_names":["shiny-lua/capsule-miniapp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shiny-lua/capsule-miniapp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiny-lua%2Fcapsule-miniapp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiny-lua%2Fcapsule-miniapp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiny-lua%2Fcapsule-miniapp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiny-lua%2Fcapsule-miniapp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shiny-lua","download_url":"https://codeload.github.com/shiny-lua/capsule-miniapp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shiny-lua%2Fcapsule-miniapp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259312575,"owners_count":22838961,"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":[],"created_at":"2025-04-10T04:26:01.365Z","updated_at":"2025-06-11T18:06:15.608Z","avatar_url":"https://github.com/shiny-lua.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Capsule Telegram Mini-App\n\n\u003cimg width=\"445\" alt=\"image\" src=\"https://github.com/user-attachments/assets/eeaf9104-2c5a-423c-9a37-92e1ffea5d24\"\u003e\n\nThis template provides a minimal setup to get Capsule Pre-generated wallets working in a Mini-App\n\n## Key Steps\n\n1. **Initialize the App**\n\n   - When the mini-app starts, it calls `initializeApp()` which checks for an existing wallet.\n\n2. **Generate Wallet**\n\n   - If no wallet exists, `generateWallet()` is called to create a pre-generated wallet using\n     `capsuleClient.createWalletPreGen()`.\n\n3. **Store Wallet Data**\n\n   - After wallet creation, the user share and wallet ID need to be stored.\n   - Due to storage limitations, data is chunked using `storeWithChunking()`.\n   - This process runs asynchronously to avoid blocking the app.\n\n4. **Retrieve Wallet Data**\n\n   - When the app starts, it attempts to retrieve stored data using `retrieveChunkedData()`.\n   - This function reassembles the chunked data.\n\n5. **Sign Messages**\n\n   - Once the wallet is set up, users can sign messages using `signMessage()`.\n\n6. **Clear Storage**\n   - Users can clear all stored data using `clearChunkedStorage()`.\n\nNote: The app can start signing transactions as soon as the wallet is created. However, ensure the user doesn't close\nthe app until the storage of the user share is completed.\n\n## Usage\n\nFirst, deploy your app to a link (This repo is hosted [here](https://capsule-org.github.io/capsule-telegram-miniapp/))\n\nThen, make a telegram bot [(See Telegram's Guide Here)](https://core.telegram.org/bots/tutorial) and point it to open\nthis link\n\n## Try it out\n\n\u003cimg width=\"422\" alt=\"image\" src=\"https://github.com/user-attachments/assets/7f34d3fa-b395-41e8-8828-53d467fa8a2e\"\u003e\n\nA Telegram mini-app linked to this app is [here](https://t.me/capsule_miniapp_bot)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiny-lua%2Fcapsule-miniapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshiny-lua%2Fcapsule-miniapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshiny-lua%2Fcapsule-miniapp/lists"}