This project shows builders how to develop Telegram Mini Apps on Asset Chain. It uses Next.js, wagmi for Asset Chain wallet connections, and various injected providers for ease of use.
-
Environment Variables:
- Rename
.env.example
to.env.local
and configure the following parameters:
- Rename
-
Clone the Repository:
cd <cloned-repo>
-
Install Dependencies:
Run the following command to install the necessary packages:npm install
-
Start the Development Server:
Run the server locally:npm run dev
To connect the app with different Ethereum wallet providers, you can modify the default connector in your src/hooks/useEvmWallet.tsx
file based on your needs.
-
Use Injected Provider:
This sets the default connector to detect and use any wallet injected into the browser, such as MetaMask or Coinbase Wallet.import { injected } from "@wagmi/core"; const defaultConnector = injected();
-
Use Coinbase Provider:
To connect with Coinbase Wallet, change the configuration:import { coinbaseConfig } from "../configs/wagmiConfig"; const defaultConnector = coinbaseConfig;
-
Use MetaMask Provider:
If you prefer MetaMask as your default wallet provider, configure it like so:import { metaMaskConfig } from "../configs/wagmiConfig"; const defaultConnector = metaMaskConfig;
-
Use WalletConnect Provider:
To integrate WalletConnect, which supports mobile wallets, adjust the default connector to:import { walletConnectConfig } from "../configs/wagmiConfig"; const defaultConnector = walletConnectConfig;
With this setup, you'll be able to connect your Telegram mini app to various Ethereum wallets, giving your users flexibility in interacting with blockchain-enabled features.
To start building a Telegram Mini App:
- Read the Docs: Visit the Telegram Mini Apps Guide for steps to set up and initialize your app.
See CONTRIBUTING.md for contribution and pull request protocol. We expect contributors to follow our guide when submitting code or comments.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
For questions or suggestions, just say Hi on Telegram.
We're always glad to help.