-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
68 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...ages/en/build/create-aptos-dapp/templates/clicker-game-tg-mini-app-template.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
title: "Create Aptos Dapp Telegram Clicker Game Mini App Template" | ||
--- | ||
|
||
import { Callout, Steps } from 'nextra/components'; | ||
|
||
# Create Aptos Dapp Telegram Clicker Game Mini App Template | ||
|
||
This template provides a ready to use clicker game dapp that can be run as a Telegram mini app. You can use this template to build your own Telegram mini app dapp on the Aptos network. | ||
|
||
We provide 2 signing experience for the Telegram Mini App, you can choose when you create the dapp using the create-aptos-dapp cli: | ||
- explicit signing - the user needs to sign each transaction, this is powered by Aptos Wallet Adapter similar to other dapps | ||
- [demo](https://t.me/aptos_explict_siging_bot/) | ||
- seamless signing - the user doesn't need to sign each transaction because the approval is done in the background, this is powered by [Mizu Wallet SDK Core](https://docs.mizu.io/docs/api-connect/core) | ||
- [demo](https://t.me/seamless345_bot/) | ||
|
||
## Getting started | ||
|
||
<Steps> | ||
|
||
### Publish the contract | ||
|
||
Run the below command to publish the contract on-chain: | ||
```bash | ||
npm run move:publish | ||
``` | ||
This command will: | ||
1. Publish the contract to chain. | ||
2. Setting the `VITE_MODULE_ADDRESS` in the `.env` file to set the contract object address. | ||
|
||
### Create a Telegram bot | ||
|
||
Start a chat with [BotFather](https://t.me/BotFather), use the `/newbot` command to create a new bot. | ||
|
||
### (Optional) Obtain the app ID from Mizu wallet | ||
|
||
If you choose the seamless signing experience, you are using `@mizuwallet-sdk/core` instead of Aptos Wallet Adapte. You need to obtain a mizu app ID from the Mizu team by filling up their [form](https://ankaalabs.typeform.com/to/bAPqSxDu). Once you have the app ID, set it in the `.env` file as `VITE_MIZU_WALLET_APP_ID`. | ||
|
||
You can learn more about using it in the [Mizu doc](https://docs.mizu.io/docs/api-connect/core). | ||
|
||
### Host the frontend | ||
|
||
Host the frontend on Vercel or any other hosting service. | ||
|
||
### Create a Telegram mini app | ||
|
||
Use the `/newapp` commend to create a new mini app and link the mini app with the bot you just created. When BotFather asks for the mini app's URL, provide the URL of the frontend you deployed. | ||
|
||
### Set the menu button of the bot to open the mini app | ||
|
||
Use the `/mybots` command to find your bot, choose `bot settings` -> `menu button` -> `configure menu button`, provide the mini app's name and URL. Now you can access the mini app from your bot's menu. | ||
|
||
</Steps> | ||
|
||
## Ready for Mainnet | ||
|
||
If you started your dapp on testnet, and you are happy with your testing, you will want to get the dapp on mainnet. | ||
|
||
To publish the smart contract on mainnet, we need to change some configuration. | ||
|
||
1. Change the `VITE_APP_NETWORK` value to `mainnet` in the `.env` file | ||
2. Run `npm run move:init` to initialize an account to work against Mainnet | ||
3. If you already have an account you would like to use to publish the contract under, you can pass its private key when the prompt asks for that. | ||
4. If you are generating a new account, you need to transfer this account some APT on Aptos Mainnet since the tool can’t fund the account when it is against Mainnet. | ||
5. Check: open `.aptos/config.yaml` file and see that you have a profile under the `{PROJECT_NAME}-mainnet` name (where `PROJECT_NAME` is specified in your `.env` file). In addition, open the `.env` file and check the `VITE_MODULE_ADDRESS` value is the same as the new profile's account account address. | ||
7. Finally, run `npm run move:publish` to publish your move module on Aptos mainnet. |
31 changes: 0 additions & 31 deletions
31
apps/nextra/pages/en/build/create-aptos-dapp/templates/tg-mini-app-boilerplate.mdx
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
.../build/create-aptos-dapp/templates/tg-mini-app-seamless-signing-boilerplate.mdx
This file was deleted.
Oops, something went wrong.